Change incorrect english in error message.
[SXSI/xpathcomp.git] / src / grammar2.mli
1 type t
2
3 type node = [ `Start ] Node.t
4
5 type n_type = [ `NonTerminal ]
6 type t_type = [ `Terminal ]
7 type r_type = [ `Rule ]
8 type any_type = [ n_type | t_type ]
9 type rhs = [ r_type ] Node.t
10
11 type n_symbol = n_type Node.t
12 type t_symbol = t_type Node.t
13 type tn_symbol = [ any_type ] Node.t
14
15 type 'a partial =
16   | Cache of 'a
17   | Leaf of int*int * StateSet.t array * node
18   | Node0 of tn_symbol (* No parameters *)
19   | Node1 of tn_symbol * 'a partial
20   | Node2 of tn_symbol * 'a partial * 'a partial
21
22 type conf = C0 | C1 | C2 | C3 | C4 | C5 | C6
23
24 val parse : string -> t
25 val save : t -> string -> unit
26 val load : string -> t
27 val tag_operations : t -> Tag.operations
28
29 val start_tag : t -> node -> tn_symbol
30 val is_terminal : t -> [< any_type ] Node.t -> bool
31 val is_non_terminal : t -> [< any_type ] Node.t -> bool
32 external terminal : [< any_type ] Node.t -> t_symbol = "%identity"
33 external non_terminal : [< any_type ] Node.t -> n_symbol = "%identity"
34 val nil_symbol : t_symbol
35 val tag : t_symbol -> Tag.t
36 val start_first_child : t -> node -> node
37 val start_next_sibling : t -> node -> node
38 val get_rule : t -> n_symbol -> rhs
39 val get_conf : rhs ->  conf
40 val get_rank : rhs -> int
41 val get_id1_rank : rhs -> int
42 val get_id2_rank : rhs -> int
43 val get_id2_pos : rhs -> int
44 val get_id1 : rhs -> tn_symbol
45 val get_id2 : rhs -> tn_symbol
46
47 val is_attribute : t -> Tag.t -> bool
48 (*
49 val start_skip : t -> node -> int -> int
50 val rule_skip : t -> n_symbol -> 'a partial -> 'a partial -> int -> int
51 *)
52 val dummy_param : 'a partial
53 (*
54 val dispatch_param0 : conf -> tn_symbol -> 'a partial -> 'a partial -> 'a partial
55 val dispatch_param1 : conf -> tn_symbol -> 'a partial -> 'a partial -> 'a partial
56 *)