Debian Codegraph @

coqpp/coqpp_ast.mli

raw symbols SCIP
1 (************************************************************************)
2 (* * The Rocq Prover / The Rocq Development Team *)
3 (* v * Copyright INRIA, CNRS and contributors *)
4 (* <O___,, * (see version control and CREDITS file for authors & dates) *)
5 (* \VV/ **************************************************************)
6 (* // * This file is distributed under the terms of the *)
7 (* * GNU Lesser General Public License Version 2.1 *)
8 (* * (see LICENSE file for the text of the license) *)
9 (************************************************************************)
10
11 type loc = {
12 loc_start : Lexing.position;
13 loc_end : Lexing.position;
14 }
15
16 type code = { code : string; loc : loc option; }
17
18 type user_symbol =
19 | Ulist1 of user_symbol
20 | Ulist1sep of user_symbol * string
21 | Ulist0 of user_symbol
22 | Ulist0sep of user_symbol * string
23 | Uopt of user_symbol
24 | Uentry of string
25 | Uentryl of string * int
26
27 type token_data =
28 | TokNone
29 | TokName of string
30
31 type ext_token =
32 | ExtTerminal of string
33 | ExtNonTerminal of user_symbol * token_data
34
35 type tactic_rule = {
36 tac_toks : ext_token list;
37 tac_body : code;
38 }
39
40 type level = string
41
42 type position =
43 | First
44 | Last
45 | Before of level
46 | After of level
47
48 type assoc =
49 | LeftA
50 | RightA
51 | NonA
52 | BothA
53
54 type gram_symbol =
55 | GSymbString of string
56 | GSymbQualid of string * level option
57 | GSymbParen of gram_symbol list
58 | GSymbProd of gram_prod list
59
60 and gram_prod = {
61 gprod_symbs : (string option * gram_symbol list) list;
62 gprod_body : code;
63 }
64
65 type symb =
66 | SymbToken of string * string option
67 | SymbEntry of string * string option
68 | SymbSelf
69 | SymbNext
70 | SymbList0 of symb * symb option
71 | SymbList1 of symb * symb option
72 | SymbOpt of symb
73 | SymbRules of ((string option * symb) list * code) list
74 | SymbQuote of string (** Not used by GRAMMAR EXTEND *)
75
76 type gram_rule = {
77 grule_label : string option;
78 grule_assoc : assoc option;
79 grule_prods : gram_prod list;
80 }
81
82 type grammar_rules =
83 | GDataFresh of position option * gram_rule list
84 | GDataReuse of string option * gram_prod list
85
86 type grammar_entry = {
87 gentry_name : string;
88 gentry_rules : grammar_rules;
89 }
90
91 type grammar_ext = {
92 gramext_name : string;
93 gramext_globals : string list;
94 gramext_entries : grammar_entry list;
95 }
96
97 type tactic_ext = {
98 tacext_name : string;
99 tacext_level : int option;
100 tacext_deprecated : code option;
101 tacext_rules : tactic_rule list;
102 }
103
104 type classification =
105 | ClassifDefault
106 | ClassifCode of code
107 | ClassifName of string
108
109 type vernac_rule = {
110 vernac_atts : (string * code) list option;
111 vernac_state : string option;
112 vernac_toks : ext_token list;
113 vernac_class : code option;
114 vernac_depr : bool;
115 vernac_body : code;
116 vernac_synterp : (string * code) option;
117 }
118
119 type vernac_ext = {
120 vernacext_name : string;
121 vernacext_entry : code option;
122 vernacext_class : classification;
123 vernacext_state : string option;
124 vernacext_rules : vernac_rule list;
125 }
126
127 type vernac_argument_ext = {
128 vernacargext_name : string;
129 vernacargext_printer : code option;
130 vernacargext_rules : tactic_rule list;
131 }
132
133 type argument_type =
134 | ListArgType of argument_type
135 | OptArgType of argument_type
136 | PairArgType of argument_type * argument_type
137 | ExtraArgType of string
138
139 type argument_ext = {
140 argext_name : string;
141 argext_rules : tactic_rule list;
142 argext_type : argument_type option;
143 argext_interp : (string option * code) option;
144 argext_glob : code option;
145 argext_subst : code option;
146 argext_rprinter : code option;
147 argext_gprinter : code option;
148 argext_tprinter : code option;
149 }
150
151 type node =
152 | Code of code
153 | Comment of string
154 | DeclarePlugin of string option
155 | GramExt of grammar_ext
156 | VernacExt of vernac_ext
157 | VernacArgumentExt of vernac_argument_ext
158 | TacticExt of tactic_ext
159 | ArgumentExt of argument_ext
160 | IgnoreKeywords
161
162 type t = node list