Release of coccinelle 1.0.0-rc9
[bpt/coccinelle.git] / parsing_cocci / ast_cocci.mli
index 2bcda92..4749c04 100644 (file)
@@ -54,11 +54,14 @@ and 'a befaft =
   | BEFOREAFTER of 'a list list * 'a list list * count
   | NOTHING
 
+and 'a replacement = REPLACEMENT of 'a list list * count | NOREPLACEMENT
+
 and 'a mcode = 'a * info * mcodekind * meta_pos list (* pos variables *)
  (* pos is an offset indicating where in the C code the mcodekind has an
  effect *)
+and adjacency = ALLMINUS | ADJ of int
  and mcodekind =
-    MINUS       of pos * int list * int * anything list list
+    MINUS       of pos * int list * adjacency * anything replacement
   | CONTEXT     of pos * anything befaft
   | PLUS        of count
  and count = ONE (* + *) | MANY (* ++ *)
@@ -177,6 +180,8 @@ and base_expression =
   | Paren          of string mcode (* ( *) * expression *
                       string mcode (* ) *)
 
+  | Constructor    of string mcode (* ( *) * fullType * string mcode (* ) *) *
+                     initialiser
   | MetaErr        of meta_name mcode * constraints * keep_binding *
                      inherited
   | MetaExpr       of meta_name mcode * constraints * keep_binding *
@@ -189,7 +194,7 @@ and base_expression =
   | DisjExpr       of expression list
   | NestExpr       of string mcode (* <.../<+... *) *
                      expression dots *
-                     string mcode (* ...>/...+> *) * 
+                     string mcode (* ...>/...+> *) *
                       expression option * multi
 
   (* can appear in arg lists, and also inside Nest, as in:
@@ -215,8 +220,8 @@ and idconstraint =
   | IdRegExpConstraint of reconstraint
 
 and reconstraint =
-  | IdRegExp        of string * Str.regexp
-  | IdNotRegExp     of string * Str.regexp
+  | IdRegExp        of string * Regexp.regexp
+  | IdNotRegExp     of string * Regexp.regexp
 
 and form = ANY | ID | LocalID | CONST (* form for MetaExp *)
 
@@ -227,7 +232,7 @@ and listlen =
   | CstListLen of int
   | AnyListLen
 
-and  unaryOp = GetRef | DeRef | UnPlus |  UnMinus | Tilde | Not
+and  unaryOp = GetRef | GetRefLabel | DeRef | UnPlus |  UnMinus | Tilde | Not
 and  assignOp = SimpleAssign | OpAssign of arithOp
 and  fixOp = Dec | Inc
 
@@ -277,8 +282,10 @@ and base_typeC =
 and fullType = base_fullType wrap
 and typeC = base_typeC wrap
 
-and baseType = VoidType | CharType | ShortType | IntType | DoubleType
-  | FloatType | LongType | LongLongType | SizeType | SSizeType | PtrDiffType
+and baseType = VoidType | CharType | ShortType | ShortIntType | IntType
+| DoubleType | LongDoubleType | FloatType
+| LongType | LongIntType | LongLongType | LongLongIntType
+| SizeType | SSizeType | PtrDiffType
 
 and structUnion = Struct | Union
 
@@ -412,7 +419,7 @@ and base_rule_elem =
   | SeqStart      of string mcode (* { *)
   | SeqEnd        of string mcode (* } *)
 
-  | ExprStatement of expression * string mcode (*;*)
+  | ExprStatement of expression option * string mcode (*;*)
   | IfHeader      of string mcode (* if *) * string mcode (* ( *) *
                     expression * string mcode (* ) *)
   | Else          of string mcode (* else *)
@@ -481,7 +488,7 @@ and base_statement =
   | Atomic        of rule_elem
   | Disj          of statement dots list
   | Nest          of string mcode (* <.../<+... *) * statement dots *
-                    string mcode (* ...>/...+> *) * 
+                    string mcode (* ...>/...+> *) *
                     (statement dots,statement) whencode list * multi *
                     dots_whencode list * dots_whencode list
   | FunDecl       of rule_elem (* header *) * rule_elem (* { *) *
@@ -534,7 +541,7 @@ and inc_elem =
   | IncDots
 
 and base_top_level =
-    DECL of statement
+    NONDECL of statement (* cannot match all of a top-level declaration *)
   | CODE of statement dots
   | FILEINFO of string mcode (* old file *) * string mcode (* new file *)
   | ERRORWORDS of expression list