From 6b649aba925b6f7462da07599fe67ebb12a3460e Mon Sep 17 00:00:00 2001 From: Samuel Mimram Date: Wed, 28 Jul 2004 21:54:47 +0000 Subject: Imported Upstream version 8.0pl1 --- parsing/extend.mli | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 parsing/extend.mli (limited to 'parsing/extend.mli') diff --git a/parsing/extend.mli b/parsing/extend.mli new file mode 100644 index 00000000..761d0e04 --- /dev/null +++ b/parsing/extend.mli @@ -0,0 +1,153 @@ +(************************************************************************) +(* v * The Coq Proof Assistant / The Coq Development Team *) +(* constr_expr -> constr_expr) -> unit + +type syntax_modifier = + | SetItemLevel of string list * production_level + | SetLevel of int + | SetAssoc of Gramext.g_assoc + | SetEntryType of string * simple_constr_production_entry + | SetOnlyParsing + | SetFormat of string located + +type nonterm = + | NtShort of string + | NtQual of string * string +type grammar_production = + | VTerm of string + | VNonTerm of loc * nonterm * Names.identifier option +type raw_grammar_rule = string * grammar_production list * grammar_action +type raw_grammar_entry = string * grammar_associativity * raw_grammar_rule list + +val terminal : string -> string * string + +val rename_command_entry : string -> string + +val explicitize_entry : string -> string -> constr_entry + +val subst_grammar_command : + Names.substitution -> grammar_command -> grammar_command + +(* unparsing objects *) + +type 'pat unparsing_hunk = + | PH of 'pat * string option * parenRelation + | RO of string + | UNP_BOX of ppbox * 'pat unparsing_hunk list + | UNP_BRK of int * int + | UNP_TBRK of int * int + | UNP_TAB + | UNP_FNL + | UNP_SYMBOLIC of string option * string * 'pat unparsing_hunk + +(*val subst_unparsing_hunk : + Names.substitution -> (Names.substitution -> 'pat -> 'pat) -> + 'pat unparsing_hunk -> 'pat unparsing_hunk +*) + +(* Checks if the precedence of the parent printer (None means the + highest precedence), and the child's one, follow the given + relation. *) + +val tolerable_prec : tolerability option -> precedence -> bool + +type 'pat syntax_entry = { + syn_id : string; + syn_prec: precedence; + syn_astpat : 'pat; + syn_hunks : 'pat unparsing_hunk list } + +val subst_syntax_entry : + (Names.substitution -> 'pat -> 'pat) -> + Names.substitution -> 'pat syntax_entry -> 'pat syntax_entry + + +type 'pat syntax_command = { + sc_univ : string; + sc_entries : 'pat syntax_entry list } + +val subst_syntax_command : + (Names.substitution -> 'pat -> 'pat) -> + Names.substitution -> 'pat syntax_command -> 'pat syntax_command + +type syntax_rule = string * Coqast.t * Coqast.t unparsing_hunk list +type raw_syntax_entry = precedence * syntax_rule list + +val interp_grammar_command : + string -> (string * string -> unit) -> + raw_grammar_entry list -> grammar_command + +val interp_syntax_entry : + string -> raw_syntax_entry list -> Ast.astpat syntax_command -- cgit v1.2.3