4794739d05782d0ab4062ca8607dc7fb9283623c
[bpt/coccinelle.git] / parsing_cocci / ast_cocci.mli
1 (*
2 * Copyright 2010, INRIA, University of Copenhagen
3 * Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix
4 * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
5 * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
6 * This file is part of Coccinelle.
7 *
8 * Coccinelle is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, according to version 2 of the License.
11 *
12 * Coccinelle is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with Coccinelle. If not, see <http://www.gnu.org/licenses/>.
19 *
20 * The authors reserve the right to distribute this or future versions of
21 * Coccinelle under other licenses.
22 *)
23
24
25 (* --------------------------------------------------------------------- *)
26 (* Modified code *)
27
28 type added_string = Noindent of string | Indent of string
29
30 type info = { line : int; column : int;
31 strbef : (added_string * int (* line *) * int (* col *)) list;
32 straft : (added_string * int (* line *) * int (* col *)) list }
33 type line = int
34 type meta_name = string * string
35 type 'a wrap =
36 {node : 'a;
37 node_line : line;
38 free_vars : meta_name list; (*free vars*)
39 minus_free_vars : meta_name list; (*minus free vars*)
40 fresh_vars : (meta_name * seed) list; (*fresh vars*)
41 inherited : meta_name list; (*inherited vars*)
42 saved_witness : meta_name list; (*witness vars*)
43 bef_aft : dots_bef_aft;
44 pos_info : meta_name mcode option; (* pos info, try not to duplicate *)
45 true_if_test_exp : bool;(* true if "test_exp from iso", only for exprs *)
46 (* the following is only for declarations *)
47 safe_for_multi_decls : bool;
48 (* isos relevant to the term; ultimately only used for rule_elems *)
49 iso_info : (string*anything) list }
50
51 and 'a befaft =
52 BEFORE of 'a list list * count
53 | AFTER of 'a list list * count
54 | BEFOREAFTER of 'a list list * 'a list list * count
55 | NOTHING
56
57 and 'a mcode = 'a * info * mcodekind * meta_pos (* pos variable *)
58 (* pos is an offset indicating where in the C code the mcodekind has an
59 effect *)
60 and mcodekind =
61 MINUS of pos * int list * int * anything list list
62 | CONTEXT of pos * anything befaft
63 | PLUS of count
64 and count = ONE (* + *) | MANY (* ++ *)
65 and fixpos =
66 Real of int (* charpos *) | Virt of int * int (* charpos + offset *)
67 and pos = NoPos | DontCarePos | FixPos of (fixpos * fixpos)
68
69 and dots_bef_aft =
70 NoDots
71 | AddingBetweenDots of statement * int (*index of let var*)
72 | DroppingBetweenDots of statement * int (*index of let var*)
73
74 and inherited = Type_cocci.inherited
75 and keep_binding = Type_cocci.keep_binding
76 and multi = bool (*true if a nest is one or more, false if it is zero or more*)
77
78 and end_info =
79 meta_name list (*free vars*) * (meta_name * seed) list (*fresh*) *
80 meta_name list (*inherited vars*) * mcodekind
81
82 (* --------------------------------------------------------------------- *)
83 (* Metavariables *)
84
85 and arity = UNIQUE | OPT | MULTI | NONE
86
87 and metavar =
88 MetaIdDecl of arity * meta_name (* name *)
89 | MetaFreshIdDecl of meta_name (* name *) * seed (* seed *)
90 | MetaTypeDecl of arity * meta_name (* name *)
91 | MetaInitDecl of arity * meta_name (* name *)
92 | MetaListlenDecl of meta_name (* name *)
93 | MetaParamDecl of arity * meta_name (* name *)
94 | MetaParamListDecl of arity * meta_name (*name*) * list_len (*len*)
95 | MetaConstDecl of
96 arity * meta_name (* name *) * Type_cocci.typeC list option
97 | MetaErrDecl of arity * meta_name (* name *)
98 | MetaExpDecl of
99 arity * meta_name (* name *) * Type_cocci.typeC list option
100 | MetaIdExpDecl of
101 arity * meta_name (* name *) * Type_cocci.typeC list option
102 | MetaLocalIdExpDecl of
103 arity * meta_name (* name *) * Type_cocci.typeC list option
104 | MetaExpListDecl of arity * meta_name (*name*) * list_len (*len*)
105 | MetaDeclDecl of arity * meta_name (* name *)
106 | MetaFieldDecl of arity * meta_name (* name *)
107 | MetaStmDecl of arity * meta_name (* name *)
108 | MetaStmListDecl of arity * meta_name (* name *)
109 | MetaFuncDecl of arity * meta_name (* name *)
110 | MetaLocalFuncDecl of arity * meta_name (* name *)
111 | MetaPosDecl of arity * meta_name (* name *)
112 | MetaDeclarerDecl of arity * meta_name (* name *)
113 | MetaIteratorDecl of arity * meta_name (* name *)
114
115 and list_len = AnyLen | MetaLen of meta_name | CstLen of int
116
117 and seed = NoVal | StringSeed of string | ListSeed of seed_elem list
118 and seed_elem = SeedString of string | SeedId of meta_name
119
120 (* --------------------------------------------------------------------- *)
121 (* --------------------------------------------------------------------- *)
122 (* Dots *)
123
124 and 'a base_dots =
125 DOTS of 'a list
126 | CIRCLES of 'a list
127 | STARS of 'a list
128
129 and 'a dots = 'a base_dots wrap
130
131 (* --------------------------------------------------------------------- *)
132 (* Identifier *)
133
134 and base_ident =
135 Id of string mcode
136 | MetaId of meta_name mcode * idconstraint * keep_binding * inherited
137 | MetaFunc of meta_name mcode * idconstraint * keep_binding * inherited
138 | MetaLocalFunc of meta_name mcode * idconstraint * keep_binding * inherited
139
140 | OptIdent of ident
141 | UniqueIdent of ident
142
143 and ident = base_ident wrap
144
145 (* --------------------------------------------------------------------- *)
146 (* Expression *)
147
148 and base_expression =
149 Ident of ident
150 | Constant of constant mcode
151 | FunCall of expression * string mcode (* ( *) *
152 expression dots * string mcode (* ) *)
153 | Assignment of expression * assignOp mcode * expression * bool
154 | CondExpr of expression * string mcode (* ? *) * expression option *
155 string mcode (* : *) * expression
156 | Postfix of expression * fixOp mcode
157 | Infix of expression * fixOp mcode
158 | Unary of expression * unaryOp mcode
159 | Binary of expression * binaryOp mcode * expression
160 | Nested of expression * binaryOp mcode * expression
161 | ArrayAccess of expression * string mcode (* [ *) * expression *
162 string mcode (* ] *)
163 | RecordAccess of expression * string mcode (* . *) * ident
164 | RecordPtAccess of expression * string mcode (* -> *) * ident
165 | Cast of string mcode (* ( *) * fullType * string mcode (* ) *) *
166 expression
167
168 | SizeOfExpr of string mcode (* sizeof *) * expression
169 | SizeOfType of string mcode (* sizeof *) * string mcode (* ( *) *
170 fullType * string mcode (* ) *)
171 | TypeExp of fullType
172
173 | Paren of string mcode (* ( *) * expression *
174 string mcode (* ) *)
175
176 | MetaErr of meta_name mcode * constraints * keep_binding *
177 inherited
178 | MetaExpr of meta_name mcode * constraints * keep_binding *
179 Type_cocci.typeC list option * form * inherited
180 | MetaExprList of meta_name mcode * listlen *
181 keep_binding * inherited (* only in arg lists *)
182
183 | EComma of string mcode (* only in arg lists *)
184
185 | DisjExpr of expression list
186 | NestExpr of string mcode (* <.../<+... *) *
187 expression dots *
188 string mcode (* ...>/...+> *) *
189 expression option * multi
190
191 (* can appear in arg lists, and also inside Nest, as in:
192 if(< ... X ... Y ...>)
193 In the following, the expression option is the WHEN *)
194 | Edots of string mcode (* ... *) * expression option
195 | Ecircles of string mcode (* ooo *) * expression option
196 | Estars of string mcode (* *** *) * expression option
197
198 | OptExp of expression
199 | UniqueExp of expression
200
201 and constraints =
202 NoConstraint
203 | NotIdCstrt of reconstraint
204 | NotExpCstrt of expression list
205 | SubExpCstrt of meta_name list
206
207 (* Constraints on Meta-* Identifiers, Functions *)
208 and idconstraint =
209 IdNoConstraint
210 | IdNegIdSet of string list * meta_name list
211 | IdRegExpConstraint of reconstraint
212
213 and reconstraint =
214 | IdRegExp of string * Str.regexp
215 | IdNotRegExp of string * Str.regexp
216
217 and form = ANY | ID | LocalID | CONST (* form for MetaExp *)
218
219 and expression = base_expression wrap
220
221 and listlen =
222 MetaListLen of meta_name mcode * keep_binding * inherited
223 | CstListLen of int
224 | AnyListLen
225
226 and unaryOp = GetRef | DeRef | UnPlus | UnMinus | Tilde | Not
227 and assignOp = SimpleAssign | OpAssign of arithOp
228 and fixOp = Dec | Inc
229
230 and binaryOp = Arith of arithOp | Logical of logicalOp
231 and arithOp =
232 Plus | Minus | Mul | Div | Mod | DecLeft | DecRight | And | Or | Xor
233 and logicalOp = Inf | Sup | InfEq | SupEq | Eq | NotEq | AndLog | OrLog
234
235 and constant =
236 String of string
237 | Char of string
238 | Int of string
239 | Float of string
240
241 (* --------------------------------------------------------------------- *)
242 (* Types *)
243
244 and base_fullType =
245 Type of const_vol mcode option * typeC
246 | DisjType of fullType list (* only after iso *)
247 | OptType of fullType
248 | UniqueType of fullType
249
250 and base_typeC =
251 BaseType of baseType * string mcode list (* Yoann style *)
252 | SignedT of sign mcode * typeC option
253 | Pointer of fullType * string mcode (* * *)
254 | FunctionPointer of fullType *
255 string mcode(* ( *)*string mcode(* * *)*string mcode(* ) *)*
256 string mcode (* ( *)*parameter_list*string mcode(* ) *)
257 | FunctionType of bool (* true if all minus for dropping return type *) *
258 fullType option *
259 string mcode (* ( *) * parameter_list *
260 string mcode (* ) *)
261 | Array of fullType * string mcode (* [ *) *
262 expression option * string mcode (* ] *)
263 | EnumName of string mcode (*enum*) * ident option (* name *)
264 | EnumDef of fullType (* either EnumName or metavar *) *
265 string mcode (* { *) * expression dots * string mcode (* } *)
266 | StructUnionName of structUnion mcode * ident option (* name *)
267 | StructUnionDef of fullType (* either StructUnionName or metavar *) *
268 string mcode (* { *) * declaration dots * string mcode (* } *)
269 | TypeName of string mcode
270
271 | MetaType of meta_name mcode * keep_binding * inherited
272
273 and fullType = base_fullType wrap
274 and typeC = base_typeC wrap
275
276 and baseType = VoidType | CharType | ShortType | IntType | DoubleType
277 | FloatType | LongType | LongLongType | SizeType | SSizeType | PtrDiffType
278
279 and structUnion = Struct | Union
280
281 and sign = Signed | Unsigned
282
283 and const_vol = Const | Volatile
284
285 (* --------------------------------------------------------------------- *)
286 (* Variable declaration *)
287 (* Even if the Cocci program specifies a list of declarations, they are
288 split out into multiple declarations of a single variable each. *)
289
290 and base_declaration =
291 Init of storage mcode option * fullType * ident * string mcode (*=*) *
292 initialiser * string mcode (*;*)
293 | UnInit of storage mcode option * fullType * ident * string mcode (* ; *)
294 | TyDecl of fullType * string mcode (* ; *)
295 | MacroDecl of ident (* name *) * string mcode (* ( *) *
296 expression dots * string mcode (* ) *) * string mcode (* ; *)
297 | Typedef of string mcode (*typedef*) * fullType * typeC * string mcode (*;*)
298 | DisjDecl of declaration list
299 | Ddots of string mcode (* ... *) * declaration option (* whencode *)
300
301 | MetaDecl of meta_name mcode * keep_binding * inherited
302 | MetaField of meta_name mcode * keep_binding * inherited
303
304 | OptDecl of declaration
305 | UniqueDecl of declaration
306
307 and declaration = base_declaration wrap
308
309 (* --------------------------------------------------------------------- *)
310 (* Initializers *)
311
312 and base_initialiser =
313 MetaInit of meta_name mcode * keep_binding * inherited
314 | InitExpr of expression
315 | ArInitList of string mcode (*{*) * initialiser dots * string mcode (*}*)
316 | StrInitList of bool (* true if all are - *) *
317 string mcode (*{*) * initialiser list * string mcode (*}*) *
318 initialiser list (* whencode: elements that shouldn't appear in init *)
319 | InitGccExt of
320 designator list (* name *) * string mcode (*=*) *
321 initialiser (* gccext: *)
322 | InitGccName of ident (* name *) * string mcode (*:*) *
323 initialiser
324 | IComma of string mcode (* , *)
325 | Idots of string mcode (* ... *) * initialiser option (* whencode *)
326 | OptIni of initialiser
327 | UniqueIni of initialiser
328
329 and designator =
330 DesignatorField of string mcode (* . *) * ident
331 | DesignatorIndex of string mcode (* [ *) * expression * string mcode (* ] *)
332 | DesignatorRange of
333 string mcode (* [ *) * expression * string mcode (* ... *) *
334 expression * string mcode (* ] *)
335
336 and initialiser = base_initialiser wrap
337
338 (* --------------------------------------------------------------------- *)
339 (* Parameter *)
340
341 and base_parameterTypeDef =
342 VoidParam of fullType
343 | Param of fullType * ident option
344
345 | MetaParam of meta_name mcode * keep_binding * inherited
346 | MetaParamList of meta_name mcode * listlen * keep_binding * inherited
347
348 | PComma of string mcode
349
350 | Pdots of string mcode (* ... *)
351 | Pcircles of string mcode (* ooo *)
352
353 | OptParam of parameterTypeDef
354 | UniqueParam of parameterTypeDef
355
356 and parameterTypeDef = base_parameterTypeDef wrap
357
358 and parameter_list = parameterTypeDef dots
359
360 (* --------------------------------------------------------------------- *)
361 (* #define Parameters *)
362
363 and base_define_param =
364 DParam of ident
365 | DPComma of string mcode
366 | DPdots of string mcode (* ... *)
367 | DPcircles of string mcode (* ooo *)
368 | OptDParam of define_param
369 | UniqueDParam of define_param
370
371 and define_param = base_define_param wrap
372
373 and base_define_parameters =
374 NoParams
375 | DParams of string mcode(*( *) * define_param dots * string mcode(* )*)
376
377 and define_parameters = base_define_parameters wrap
378
379 (* --------------------------------------------------------------------- *)
380 (* positions *)
381
382 (* PER = keep bindings separate, ANY = collect them *)
383 and meta_collect = PER | ALL
384
385 and meta_pos =
386 MetaPos of meta_name mcode * meta_name list *
387 meta_collect * keep_binding * inherited
388 | NoMetaPos
389
390 (* --------------------------------------------------------------------- *)
391 (* Function declaration *)
392
393 and storage = Static | Auto | Register | Extern
394
395 (* --------------------------------------------------------------------- *)
396 (* Top-level code *)
397
398 and base_rule_elem =
399 FunHeader of mcodekind (* before the function header *) *
400 bool (* true if all minus, for dropping static, etc *) *
401 fninfo list * ident (* name *) *
402 string mcode (* ( *) * parameter_list *
403 string mcode (* ) *)
404 | Decl of mcodekind (* before the decl *) *
405 bool (* true if all minus *) * declaration
406
407 | SeqStart of string mcode (* { *)
408 | SeqEnd of string mcode (* } *)
409
410 | ExprStatement of expression * string mcode (*;*)
411 | IfHeader of string mcode (* if *) * string mcode (* ( *) *
412 expression * string mcode (* ) *)
413 | Else of string mcode (* else *)
414 | WhileHeader of string mcode (* while *) * string mcode (* ( *) *
415 expression * string mcode (* ) *)
416 | DoHeader of string mcode (* do *)
417 | WhileTail of string mcode (* while *) * string mcode (* ( *) *
418 expression * string mcode (* ) *) *
419 string mcode (* ; *)
420 | ForHeader of string mcode (* for *) * string mcode (* ( *) *
421 expression option * string mcode (*;*) *
422 expression option * string mcode (*;*) *
423 expression option * string mcode (* ) *)
424 | IteratorHeader of ident (* name *) * string mcode (* ( *) *
425 expression dots * string mcode (* ) *)
426 | SwitchHeader of string mcode (* switch *) * string mcode (* ( *) *
427 expression * string mcode (* ) *)
428 | Break of string mcode (* break *) * string mcode (* ; *)
429 | Continue of string mcode (* continue *) * string mcode (* ; *)
430 | Label of ident * string mcode (* : *)
431 | Goto of string mcode (* goto *) * ident * string mcode (* ; *)
432 | Return of string mcode (* return *) * string mcode (* ; *)
433 | ReturnExpr of string mcode (* return *) * expression *
434 string mcode (* ; *)
435
436 | MetaRuleElem of meta_name mcode * keep_binding * inherited
437 | MetaStmt of meta_name mcode * keep_binding * metaStmtInfo *
438 inherited
439 | MetaStmtList of meta_name mcode * keep_binding * inherited
440
441 | Exp of expression
442 | TopExp of expression (* for macros body *)
443 | Ty of fullType (* only at top level *)
444 | TopInit of initialiser (* only at top level *)
445 | Include of string mcode (*#include*) * inc_file mcode (*file *)
446 | DefineHeader of string mcode (* #define *) * ident (* name *) *
447 define_parameters (*params*)
448 | Case of string mcode (* case *) * expression * string mcode (*:*)
449 | Default of string mcode (* default *) * string mcode (*:*)
450 | DisjRuleElem of rule_elem list
451
452 and fninfo =
453 FStorage of storage mcode
454 | FType of fullType
455 | FInline of string mcode
456 | FAttr of string mcode
457
458 and metaStmtInfo =
459 NotSequencible | SequencibleAfterDots of dots_whencode list | Sequencible
460
461 and rule_elem = base_rule_elem wrap
462
463 and base_statement =
464 Seq of rule_elem (* { *) *
465 statement dots * rule_elem (* } *)
466 | IfThen of rule_elem (* header *) * statement * end_info
467 | IfThenElse of rule_elem (* header *) * statement *
468 rule_elem (* else *) * statement * end_info
469 | While of rule_elem (* header *) * statement * end_info
470 | Do of rule_elem (* do *) * statement * rule_elem (* tail *)
471 | For of rule_elem (* header *) * statement * end_info
472 | Iterator of rule_elem (* header *) * statement * end_info (*enditer*)
473 | Switch of rule_elem (* header *) * rule_elem (* { *) *
474 statement (*decl*) dots * case_line list * rule_elem(*}*)
475 | Atomic of rule_elem
476 | Disj of statement dots list
477 | Nest of string mcode (* <.../<+... *) * statement dots *
478 string mcode (* ...>/...+> *) *
479 (statement dots,statement) whencode list * multi *
480 dots_whencode list * dots_whencode list
481 | FunDecl of rule_elem (* header *) * rule_elem (* { *) *
482 statement dots * rule_elem (* } *)
483 | Define of rule_elem (* header *) * statement dots
484 | Dots of string mcode (* ... *) *
485 (statement dots,statement) whencode list *
486 dots_whencode list * dots_whencode list
487 | Circles of string mcode (* ooo *) *
488 (statement dots,statement) whencode list *
489 dots_whencode list * dots_whencode list
490 | Stars of string mcode (* *** *) *
491 (statement dots,statement) whencode list *
492 dots_whencode list * dots_whencode list
493 | OptStm of statement
494 | UniqueStm of statement
495
496 and ('a,'b) whencode =
497 WhenNot of 'a
498 | WhenAlways of 'b
499 | WhenModifier of when_modifier
500 | WhenNotTrue of rule_elem
501 | WhenNotFalse of rule_elem
502
503 and when_modifier =
504 WhenAny
505 | WhenStrict
506 | WhenForall
507 | WhenExists
508
509 and dots_whencode =
510 WParen of rule_elem * meta_name (*pren_var*)
511 | Other of statement
512 | Other_dots of statement dots
513
514 and statement = base_statement wrap
515
516 and base_case_line =
517 CaseLine of rule_elem (* case/default header *) * statement dots
518 | OptCase of case_line
519
520 and case_line = base_case_line wrap
521
522 and inc_file =
523 Local of inc_elem list
524 | NonLocal of inc_elem list
525
526 and inc_elem =
527 IncPath of string
528 | IncDots
529
530 and base_top_level =
531 DECL of statement
532 | CODE of statement dots
533 | FILEINFO of string mcode (* old file *) * string mcode (* new file *)
534 | ERRORWORDS of expression list
535
536 and top_level = base_top_level wrap
537
538 and rulename =
539 CocciRulename of string option * dependency * string list * string list *
540 exists * bool
541 (* true if the whole thing is an expression *)
542 | GeneratedRulename of string option * dependency *
543 string list * string list * exists * bool
544 (* true if the whole thing is an expression *)
545 | ScriptRulename of string option (* name *) * string (* language *) *
546 dependency
547 | InitialScriptRulename of string option (* name *) * string (* language *) *
548 dependency
549 | FinalScriptRulename of string option (* name *) * string (* language *) *
550 dependency
551
552 and ruletype = Normal | Generated
553
554 and rule =
555 CocciRule of string (* name *) *
556 (dependency * string list (* dropped isos *) * exists) *
557 top_level list * bool list (* true if generates an exp *) * ruletype
558 | ScriptRule of string (* name *) *
559 string * dependency *
560 (script_meta_name * meta_name * metavar) list *
561 meta_name list (*script vars*) * string
562 | InitialScriptRule of string (* name *) *
563 string * dependency * string
564 | FinalScriptRule of string (* name *) *
565 string * dependency * string
566
567 and script_meta_name = string option (*string*) * string option (*ast*)
568
569 and dependency =
570 Dep of string (* rule applies for the current binding *)
571 | AntiDep of string (* rule doesn't apply for the current binding *)
572 | EverDep of string (* rule applies for some binding *)
573 | NeverDep of string (* rule never applies for any binding *)
574 | AndDep of dependency * dependency
575 | OrDep of dependency * dependency
576 | NoDep | FailDep
577
578 and rule_with_metavars = metavar list * rule
579
580 and anything =
581 FullTypeTag of fullType
582 | BaseTypeTag of baseType
583 | StructUnionTag of structUnion
584 | SignTag of sign
585 | IdentTag of ident
586 | ExpressionTag of expression
587 | ConstantTag of constant
588 | UnaryOpTag of unaryOp
589 | AssignOpTag of assignOp
590 | FixOpTag of fixOp
591 | BinaryOpTag of binaryOp
592 | ArithOpTag of arithOp
593 | LogicalOpTag of logicalOp
594 | DeclarationTag of declaration
595 | InitTag of initialiser
596 | StorageTag of storage
597 | IncFileTag of inc_file
598 | Rule_elemTag of rule_elem
599 | StatementTag of statement
600 | CaseLineTag of case_line
601 | ConstVolTag of const_vol
602 | Token of string * info option
603 | Pragma of added_string list
604 | Code of top_level
605 | ExprDotsTag of expression dots
606 | ParamDotsTag of parameterTypeDef dots
607 | StmtDotsTag of statement dots
608 | DeclDotsTag of declaration dots
609 | TypeCTag of typeC
610 | ParamTag of parameterTypeDef
611 | SgrepStartTag of string
612 | SgrepEndTag of string
613
614 (* --------------------------------------------------------------------- *)
615
616 and exists = Exists | Forall | Undetermined
617
618 (* --------------------------------------------------------------------- *)
619
620 val mkToken : string -> anything
621
622 val undots : 'a dots -> 'a list
623
624 val lub_count : count -> count -> count
625
626 (* --------------------------------------------------------------------- *)
627
628 val rewrap : 'a wrap -> 'b -> 'b wrap
629 val rewrap_mcode : 'a mcode -> 'a -> 'a mcode
630 val unwrap : 'a wrap -> 'a
631 val unwrap_mcode : 'a mcode -> 'a
632 val get_mcodekind : 'a mcode -> mcodekind
633 val get_line : 'a wrap -> line
634 val get_mcode_line : 'a mcode -> line
635 val get_mcode_col : 'a mcode -> int
636 val get_fvs : 'a wrap -> meta_name list
637 val get_wcfvs : ('a wrap,'b wrap) whencode list -> meta_name list
638 val set_fvs : meta_name list -> 'a wrap -> 'a wrap
639 val get_mfvs : 'a wrap -> meta_name list
640 val set_mfvs : meta_name list -> 'a wrap -> 'a wrap
641 val get_fresh : 'a wrap -> (meta_name * seed) list
642 val get_inherited : 'a wrap -> meta_name list
643 val get_saved : 'a wrap -> meta_name list
644 val get_dots_bef_aft : statement -> dots_bef_aft
645 val set_dots_bef_aft : dots_bef_aft -> statement -> statement
646 val get_pos : 'a wrap -> meta_name mcode option
647 val set_pos : 'a wrap -> meta_name mcode option -> 'a wrap
648 val get_test_exp : 'a wrap -> bool
649 val set_test_exp : expression -> expression
650 val get_safe_decl : 'a wrap -> bool
651 val get_isos : 'a wrap -> (string*anything) list
652 val set_isos : 'a wrap -> (string*anything) list -> 'a wrap
653 val get_pos_var : 'a mcode -> meta_pos
654 val set_pos_var : meta_pos -> 'a mcode -> 'a mcode
655 val drop_pos : 'a mcode -> 'a mcode
656
657 val get_meta_name : metavar -> meta_name
658
659 val tag2c : anything -> string
660
661 val no_info : info
662
663 val make_meta_rule_elem :
664 string -> mcodekind ->
665 (meta_name list * (meta_name * seed) list * meta_name list) ->
666 rule_elem
667
668 val make_meta_decl :
669 string -> mcodekind ->
670 (meta_name list * (meta_name * seed) list * meta_name list) ->
671 declaration
672
673 val make_term : 'a -> 'a wrap
674 val make_mcode : 'a -> 'a mcode
675
676 val equal_pos : fixpos -> fixpos -> bool