module Grammar: sig end
This module implements the Camlp4 extensible grammars system.
Grammars entries can be extended using the EXTEND statement,
added by loading the Camlp4 pa_extend.cmo file.
type g
val gcreate : Token.t Token.glexer -> gval tokens : g -> string -> (string * int) listExamples:
EXTEND
statement rule), the call Grammar.token g "" returns the keywords
list.Grammar.token g "IDENT" returns the list of all usages
of the pattern "IDENT" in the EXTEND statements.val glexer : g -> Token.t Token.glexermodule Entry: sig endval of_entry : 'a Entry.e -> g
Clearing grammars and entries
|
module Unsafe: sig end
Functorial interface
|
module type GLexerType = sig endGrammar.GMake: te is the
type of the tokens.
module type S = sig endGrammar.GMake.
module GMake: functor (L : GLexerType) -> sig end
Miscellaneous
|
val error_verbose : bool refFalseval warning_verbose : bool refTrueval strict_parsing : bool refFalseval print_entry : Format.formatter -> 'a Gramext.g_entry -> unitval iter_entry : ('a Gramext.g_entry -> unit) -> 'a Gramext.g_entry -> unitGrammar.iter_entry f e applies f to the entry e and
transitively all entries called by e. The order in which
the entries are passed to f is the order they appear in
each entry. Each entry is passed only once.val fold_entry : ('a Gramext.g_entry -> 'b -> 'b) -> 'a Gramext.g_entry -> 'b -> 'bGrammar.fold_entry f e init computes (f eN .. (f e2 (f e1 init))),
where e1 .. eN are e and transitively all entries called by e.
The order in which the entries are passed to f is the order they
appear in each entry. Each entry is passed only once.