Coccinelle release-1.0.0-rc11
[bpt/coccinelle.git] / parsing_cocci / ast_cocci.mli
index 4749c04..0bf2fcd 100644 (file)
@@ -1,5 +1,7 @@
 (*
- * Copyright 2010, INRIA, University of Copenhagen
+ * Copyright 2012, INRIA
+ * Julia Lawall, Gilles Muller
+ * Copyright 2010-2011, INRIA, University of Copenhagen
  * Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix
  * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
  * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
@@ -158,6 +160,7 @@ and base_expression =
   | FunCall        of expression * string mcode (* ( *) *
                       expression dots * string mcode (* ) *)
   | Assignment     of expression * assignOp mcode * expression * bool
+  | Sequence       of expression * string mcode (* , *) * expression
   | CondExpr       of expression * string mcode (* ? *) * expression option *
                      string mcode (* : *) * expression
   | Postfix        of expression * fixOp mcode
@@ -188,6 +191,7 @@ and base_expression =
                      Type_cocci.typeC list option * form * inherited
   | MetaExprList   of meta_name mcode * listlen *
                      keep_binding * inherited (* only in arg lists *)
+  | AsExpr         of expression * expression (* as expr, always metavar *)
 
   | EComma         of string mcode (* only in arg lists *)
 
@@ -251,7 +255,9 @@ and constant =
 (* Types *)
 
 and base_fullType =
-    Type            of const_vol mcode option * typeC
+    Type            of bool (* true if all minus *) *
+                       const_vol mcode option * typeC
+  | AsType          of fullType * fullType (* as type, always metavar *)
   | DisjType        of fullType list (* only after iso *)
   | OptType         of fullType
   | UniqueType      of fullType
@@ -305,6 +311,9 @@ and base_declaration =
   | TyDecl of fullType * string mcode (* ; *)
   | MacroDecl of ident (* name *) * string mcode (* ( *) *
         expression dots * string mcode (* ) *) * string mcode (* ; *)
+  | MacroDeclInit of ident (* name *) * string mcode (* ( *) *
+        expression dots * string mcode (* ) *) * string mcode (*=*) *
+        initialiser * string mcode (* ; *)
   | Typedef of string mcode (*typedef*) * fullType * typeC * string mcode (*;*)
   | DisjDecl   of declaration list
   | Ddots    of string mcode (* ... *) * declaration option (* whencode *)
@@ -312,6 +321,7 @@ and base_declaration =
   | MetaDecl of meta_name mcode * keep_binding * inherited
   | MetaField of meta_name mcode * keep_binding * inherited
   | MetaFieldList of meta_name mcode * listlen * keep_binding * inherited
+  | AsDecl        of declaration * declaration
 
   | OptDecl    of declaration
   | UniqueDecl of declaration
@@ -324,6 +334,7 @@ and declaration = base_declaration wrap
 and base_initialiser =
     MetaInit of meta_name mcode * keep_binding * inherited
   | MetaInitList of meta_name mcode * listlen * keep_binding * inherited
+  | AsInit of initialiser * initialiser (* as init, always metavar *)
   | InitExpr of expression
   | ArInitList of string mcode (*{*) * initialiser dots * string mcode (*}*)
   | StrInitList of bool (* true if all are - *) *
@@ -494,6 +505,7 @@ and base_statement =
   | FunDecl       of rule_elem (* header *) * rule_elem (* { *) *
                     statement dots * rule_elem (* } *)
   | Define        of rule_elem (* header *) * statement dots
+  | AsStmt        of statement * statement (* as statement, always metavar *)
   | Dots          of string mcode (* ... *) *
                     (statement dots,statement) whencode list *
                     dots_whencode list * dots_whencode list
@@ -684,6 +696,7 @@ val make_meta_decl :
       declaration
 
 val make_term : 'a -> 'a wrap
+val make_inherited_term : 'a -> meta_name list (* inherited vars *) -> 'a wrap
 val make_mcode : 'a -> 'a mcode
 
 val equal_pos : fixpos -> fixpos -> bool