X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Ftree%2Fcommon.ml;fp=src%2Ftree%2Fcommon.ml;h=099d751cde9a104dd100b147b4971c7fd46c9277;hb=3f530996e51732a419f226bd0ed94f9ca94cd1a7;hp=0000000000000000000000000000000000000000;hpb=3ec88447d6f39b141a1174086bc0845f5c86b15b;p=tatoo.git diff --git a/src/tree/common.ml b/src/tree/common.ml new file mode 100644 index 0000000..099d751 --- /dev/null +++ b/src/tree/common.ml @@ -0,0 +1,40 @@ +(***********************************************************************) +(* *) +(* TAToo *) +(* *) +(* Kim Nguyen, LRI UMR8623 *) +(* Université Paris-Sud & CNRS *) +(* *) +(* Copyright 2010-2012 Université Paris-Sud and Centre National de la *) +(* Recherche Scientifique. All rights reserved. This file is *) +(* distributed under the terms of the GNU Lesser General Public *) +(* License, with the special exception on linking described in file *) +(* ../LICENSE. *) +(* *) +(***********************************************************************) + +(* + Time-stamp: +*) + +module NodeKind = + struct + type t = + Document | Element | Text | Comment | Attribute | ProcessingInstruction + | Node + + let to_string = + function + Document -> "document" + | Element -> "element" + | Attribute -> "attribute" + | Text -> "text" + | Comment -> "comment" + | ProcessingInstruction -> "processing-instruction" + | Node -> "node" + let print ppf k = Format.fprintf ppf "%s" (to_string k) + + + let is_a k1 k2 = + k1 == Node || k2 == Node || k1 == k2 +end