- Reorder the keys used to cache transitions
[tatoo.git] / src / tree / common.ml
1 (***********************************************************************)
2 (*                                                                     *)
3 (*                               TAToo                                 *)
4 (*                                                                     *)
5 (*                     Kim Nguyen, LRI UMR8623                         *)
6 (*                   Université Paris-Sud & CNRS                       *)
7 (*                                                                     *)
8 (*  Copyright 2010-2012 Université Paris-Sud and Centre National de la *)
9 (*  Recherche Scientifique. All rights reserved.  This file is         *)
10 (*  distributed under the terms of the GNU Lesser General Public       *)
11 (*  License, with the special exception on linking described in file   *)
12 (*  ../LICENSE.                                                        *)
13 (*                                                                     *)
14 (***********************************************************************)
15
16 (*
17   Time-stamp: <Last modified on 2013-03-16 07:01:10 CET by Kim Nguyen>
18 *)
19
20 module NodeKind =
21   struct
22     type t =
23         Document | Element | Text |  Attribute | Comment | ProcessingInstruction
24       | Node
25
26     let to_string =
27       function
28     Document -> "document"
29     | Element -> "element"
30     | Attribute -> "attribute"
31     | Text -> "text"
32     | Comment -> "comment"
33     | ProcessingInstruction -> "processing-instruction"
34     | Node -> "node"
35     let print ppf k = Format.fprintf ppf "%s" (to_string k)
36
37
38     let is_a k1 k2 =
39       k1 == Node || k2 == Node || k1 == k2
40 end