Coccinelle release 0.2.5-rc8
[bpt/coccinelle.git] / parsing_cocci / ast0_cocci.mli
index be0e456..4e3b2ed 100644 (file)
@@ -96,6 +96,8 @@ and base_ident =
   | MetaId        of Ast_cocci.meta_name mcode * Ast_cocci.idconstraint * pure
   | MetaFunc      of Ast_cocci.meta_name mcode * Ast_cocci.idconstraint * pure
   | MetaLocalFunc of Ast_cocci.meta_name mcode * Ast_cocci.idconstraint * pure
+  | DisjId        of string mcode * ident list *
+                     string mcode list (* the |s *) * string mcode
   | OptIdent      of ident
   | UniqueIdent   of ident
 
@@ -154,7 +156,10 @@ and constraints =
   | NotExpCstrt    of expression list
   | SubExpCstrt    of Ast_cocci.meta_name list
 
-and listlen = Ast_cocci.meta_name mcode option
+and listlen =
+    MetaListLen of Ast_cocci.meta_name mcode
+  | CstListLen of int
+  | AnyListLen
 
 (* --------------------------------------------------------------------- *)
 (* Types *)
@@ -172,7 +177,9 @@ and base_typeC =
                        string mcode (* ) *)
   | Array           of typeC * string mcode (* [ *) *
                       expression option * string mcode (* ] *)
-  | EnumName        of string mcode (*enum*) * ident (* name *)
+  | EnumName        of string mcode (*enum*) * ident option (* name *)
+  | EnumDef  of typeC (* either StructUnionName or metavar *) *
+       string mcode (* { *) * expression dots * string mcode (* } *)
   | StructUnionName of Ast_cocci.structUnion mcode * ident option (* name *)
   | StructUnionDef  of typeC (* either StructUnionName or metavar *) *
        string mcode (* { *) * declaration dots * string mcode (* } *)
@@ -191,7 +198,10 @@ and typeC = base_typeC wrap
    split out into multiple declarations of a single variable each. *)
 
 and base_declaration =
-    Init       of Ast_cocci.storage mcode option * typeC * ident *
+    MetaDecl   of Ast_cocci.meta_name mcode * pure (* variables *)
+  | MetaField  of Ast_cocci.meta_name mcode * pure (* structure fields *)
+  | MetaFieldList of Ast_cocci.meta_name mcode * listlen * pure
+  | Init       of Ast_cocci.storage mcode option * typeC * ident *
        string mcode (*=*) * initialiser * string mcode (*;*)
   | UnInit     of Ast_cocci.storage mcode option * typeC * ident *
        string mcode (* ; *)
@@ -213,7 +223,8 @@ and declaration = base_declaration wrap
 and base_initialiser =
     MetaInit of Ast_cocci.meta_name mcode * pure
   | InitExpr of expression
-  | InitList of string mcode (*{*) * initialiser_list * string mcode (*}*)
+  | InitList of string mcode (*{*) * initialiser_list * string mcode (*}*) *
+       bool (* true if ordered, false if unordered *)
   | InitGccExt of
       designator list (* name *) * string mcode (*=*) *
        initialiser (* gccext: *)
@@ -336,6 +347,7 @@ and base_statement =
        string mcode (* { *) * statement dots *
        string mcode (* } *)
   | Include of string mcode (* #include *) * Ast_cocci.inc_file mcode(* file *)
+  | Undef of string mcode (* #define *) * ident (* name *)
   | Define of string mcode (* #define *) * ident (* name *) *
        define_parameters (*params*) * statement dots
   | OptStm   of statement
@@ -396,7 +408,8 @@ and parsed_rule =
   | ScriptRule of string (* name *) *
       string * Ast_cocci.dependency *
        (Ast_cocci.script_meta_name *
-          Ast_cocci.meta_name * Ast_cocci.metavar) list *
+          Ast_cocci.meta_name * Ast_cocci.metavar) list (*inherited vars*) *
+       Ast_cocci.meta_name list (*script vars*) *
        string
   | InitialScriptRule of string (* name *) *
       string (*language*) * Ast_cocci.dependency * string (*code*)
@@ -490,6 +503,7 @@ val fresh_index : unit -> int
 val set_mcode_data : 'a -> 'a mcode -> 'a mcode
 val make_mcode : 'a -> 'a mcode
 val make_mcode_info : 'a -> info -> 'a mcode
+val make_minus_mcode : 'a -> 'a mcode
 
 val ast0_type_to_type : typeC -> Type_cocci.typeC
 val reverse_type : Type_cocci.typeC -> base_typeC