sig
type 'a parser_t = 'a Stream.t -> Obj.t
type 'a bparser_t = ('a, Obj.t) Fstream.bp
type parse_algorithm = Predictive | Backtracking | DefaultAlgorithm
type 'a grammar = {
gtokens : (Plexing.pattern, int Pervasives.ref) Hashtbl.t;
mutable glexer : 'a Plexing.lexer;
mutable galgo : Gramext.parse_algorithm;
}
type 'a g_entry = {
egram : 'a Gramext.grammar;
ename : string;
elocal : bool;
mutable estart : int -> 'a Gramext.parser_t;
mutable econtinue : int -> int -> Obj.t -> 'a Gramext.parser_t;
mutable bstart : int -> 'a Gramext.bparser_t;
mutable bcontinue : int -> int -> Obj.t -> 'a Gramext.bparser_t;
mutable edesc : 'a Gramext.g_desc;
}
and 'a g_desc =
Dlevels of 'a Gramext.g_level list
| Dparser of 'a Gramext.parser_t
and 'a g_level = {
assoc : Gramext.g_assoc;
lname : string option;
lsuffix : 'a Gramext.g_tree;
lprefix : 'a Gramext.g_tree;
}
and g_assoc = NonA | RightA | LeftA
and 'a g_symbol =
Sfacto of 'a Gramext.g_symbol
| Smeta of string * 'a Gramext.g_symbol list * Obj.t
| Snterm of 'a Gramext.g_entry
| Snterml of 'a Gramext.g_entry * string
| Slist0 of 'a Gramext.g_symbol
| Slist0sep of 'a Gramext.g_symbol * 'a Gramext.g_symbol
| Slist1 of 'a Gramext.g_symbol
| Slist1sep of 'a Gramext.g_symbol * 'a Gramext.g_symbol
| Sopt of 'a Gramext.g_symbol
| Sflag of 'a Gramext.g_symbol
| Sself
| Snext
| Stoken of Plexing.pattern
| Stree of 'a Gramext.g_tree
| Svala of string list * 'a Gramext.g_symbol
and g_action = Obj.t
and 'a g_tree =
Node of 'a Gramext.g_node
| LocAct of Gramext.g_action * Gramext.g_action list
| DeadEnd
and 'a g_node = {
node : 'a Gramext.g_symbol;
son : 'a Gramext.g_tree;
brother : 'a Gramext.g_tree;
}
type position =
First
| Last
| Before of string
| After of string
| Like of string
| Level of string
val levels_of_rules :
'a Gramext.g_entry ->
Gramext.position option ->
(string option * Gramext.g_assoc option *
('a Gramext.g_symbol list * Gramext.g_action) list)
list -> 'a Gramext.g_level list
val srules :
('a Gramext.g_symbol list * Gramext.g_action) list -> 'a Gramext.g_symbol
external action : 'a -> Gramext.g_action = "%identity"
val eq_symbol : 'a Gramext.g_symbol -> 'a Gramext.g_symbol -> bool
val delete_rule_in_level_list :
'a Gramext.g_entry ->
'a Gramext.g_symbol list ->
'a Gramext.g_level list -> 'a Gramext.g_level list
val warning_verbose : bool Pervasives.ref
end