Module Pcoq
include Gramlib.Grammar.S with type keyword_state := CLexer.keyword_state and type te := Tok.t and type 'a pattern := 'a Tok.p and type 'a with_gstate := 'a and type 'a with_kwstate := 'a and type 'a with_estate := 'a and type 'a mod_estate := 'a
type keyword_statetype tetype 'c patterntype ty_pattern=|TPattern : 'a pattern -> ty_pattern
module Parsable : sig ... endmodule Entry : sig ... endmodule rec Symbol : sig ... endand Rule : sig ... endand Rules : sig ... endmodule Production : sig ... endtype 'a single_extend_statement= string option * Gramlib.Gramext.g_assoc option * 'a Production.t listtype 'a extend_statement=|Reuse of string option * 'a Production.t listExtend an existing level by its optional given name. If None, picks the topmost level.
|Fresh of Gramlib.Gramext.position * 'a single_extend_statement listCreate a level at the given position.
val generalize_symbol : ('a, 'tr, 'c) Symbol.t -> ('a, Gramlib.Grammar.norec, 'c) Symbol.t optionval level_of_nonterm : ('a, Gramlib.Grammar.norec, 'c) Symbol.t -> string option
module Lookahead : sig ... endval terminal : string -> string Tok.pWhen string is not an ident, returns a keyword.
val parse_string : 'a Entry.t -> ?loc:Loc.t -> string -> 'aval eoi_entry : 'a Entry.t -> 'a Entry.tval create_generic_entry2 : string -> ('a, Genarg.rlevel) Genarg.abstract_argument_type -> 'a Entry.tval register_grammar : ('raw, 'glb, 'top) Genarg.genarg_type -> 'raw Entry.t -> unitval genarg_grammar : ('raw, 'glb, 'top) Genarg.genarg_type -> 'raw Entry.t
module Prim : sig ... endmodule Constr : sig ... endmodule Module : sig ... endType-safe grammar extension
val epsilon_value : ('a -> 'self) -> ('self, _, 'a) Symbol.t -> 'self option
Extending the parser without synchronization
val grammar_extend : 'a Entry.t -> 'a extend_statement -> unitExtend the grammar of Coq, without synchronizing it with the backtracking mechanism. This means that grammar extensions defined this way will survive an undo.
Extending the parser with summary-synchronized commands
Extension with parsing rules
type gram_reinit= Gramlib.Gramext.g_assoc * Gramlib.Gramext.positionType of reinitialization data
type extend_rule=|ExtendRule : 'a Entry.t * 'a extend_statement -> extend_rule|ExtendRuleReinit : 'a Entry.t * gram_reinit * 'a extend_statement -> extend_ruletype 'a grammar_extension={gext_fun : 'a -> GramState.t -> extend_rule list * GramState.t;gext_eq : 'a -> 'a -> bool;}Grammar extension entry point. Given some
'aand a current grammar state, such a function must produce the list of grammar extensions that will be applied in the same order and kept synchronized w.r.t. the summary, together with a new state. It should be pure.
val create_grammar_command : string -> 'a grammar_extension -> 'a grammar_commandCreate a new grammar-modifying command with the given name. The extension function is called to generate the rules for a given data.
val extend_grammar_command : 'a grammar_command -> 'a -> unitExtend the grammar of Coq with the given data.
Extension with parsing entries
type ('a, 'b) entry_extension={eext_fun : 'a -> GramState.t -> string list * GramState.t;eext_eq : 'a -> 'a -> bool;}Entry extension entry point. Given some
'aand a current grammar state, such a function must produce the list of entry extensions that will be created and kept synchronized w.r.t. the summary, together with a new state. It should be pure.
val create_entry_command : string -> ('a, 'b) entry_extension -> ('a, 'b) entry_commandCreate a new entry-creating command with the given name. The extension function is called to generate the new entries for a given data.
val extend_entry_command : ('a, 'b) entry_command -> 'a -> 'b Entry.t listCreate new synchronized entries using the provided data.
val find_custom_entry : ('a, 'b) entry_command -> string -> 'b Entry.tFind an entry generated by the synchronized system in the current state.
- raises Not_found
if non-existent.
Protection w.r.t. backtrack
val parser_summary_tag : frozen_t Summary.Dyn.tag
val register_grammars_by_name : string -> Entry.any_t list -> unitval find_grammars_by_name : string -> Entry.any_t listval freeze : unit -> frozen_tParsing state handling
val unfreeze : frozen_t -> unitval get_keyword_state : unit -> CLexer.keyword_stateval set_keyword_state : CLexer.keyword_state -> unit