Module Gramext


module Gramext: sig .. end

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 : parse_algorithm;
}
type 'a g_entry = {
   egram : 'a grammar;
   ename : string;
   elocal : bool;
   mutable estart : int -> 'a parser_t;
   mutable econtinue : int -> int -> Obj.t -> 'a parser_t;
   mutable bstart : int -> 'a bparser_t;
   mutable bcontinue : int -> int -> Obj.t -> 'a bparser_t;
   mutable edesc : 'a g_desc;
}
type 'a g_desc =
| Dlevels of 'a g_level list
| Dparser of 'a parser_t

type 'a g_level = {
   assoc : g_assoc;
   lname : string option;
   lsuffix : 'a g_tree;
   lprefix : 'a g_tree;
}
type g_assoc =
| NonA
| RightA
| LeftA

type 'a g_symbol =
| Sfacto of 'a g_symbol
| Smeta of string * 'a g_symbol list * Obj.t
| Snterm of 'a g_entry
| Snterml of 'a g_entry * string
| Slist0 of 'a g_symbol
| Slist0sep of 'a g_symbol * 'a g_symbol
| Slist1 of 'a g_symbol
| Slist1sep of 'a g_symbol * 'a g_symbol
| Sopt of 'a g_symbol
| Sflag of 'a g_symbol
| Sself
| Snext
| Stoken of Plexing.pattern
| Stree of 'a g_tree
| Svala of string list * 'a g_symbol
type g_action = Obj.t 

type 'a g_tree =
| Node of 'a g_node
| LocAct of g_action * g_action list
| DeadEnd

type 'a g_node = {
   node : 'a g_symbol;
   son : 'a g_tree;
   brother : 'a g_tree;
}
type position =
| First
| Last
| Before of string
| After of string
| Like of string
| Level of string
val levels_of_rules : 'a g_entry ->
position option ->
(string option * g_assoc option *
('a g_symbol list * g_action) list)
list -> 'a g_level list
val srules : ('a g_symbol list * g_action) list -> 'a g_symbol
val action : 'a -> g_action
val eq_symbol : 'a g_symbol -> 'a g_symbol -> bool
val delete_rule_in_level_list : 'a g_entry ->
'a g_symbol list ->
'a g_level list -> 'a g_level list
val warning_verbose : bool Pervasives.ref