Release coccinelle-0.2.4
[bpt/coccinelle.git] / parsing_cocci / parser_cocci.mly
index b34a116..bc1e0ef 100644 (file)
@@ -1,23 +1,49 @@
 /*
-* Copyright 2005-2008, Ecole des Mines de Nantes, University of Copenhagen
-* Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller
-* This file is part of Coccinelle.
-* 
-* Coccinelle is free software: you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation, according to version 2 of the License.
-* 
-* Coccinelle is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU General Public License for more details.
-* 
-* You should have received a copy of the GNU General Public License
-* along with Coccinelle.  If not, see <http://www.gnu.org/licenses/>.
-* 
-* The authors reserve the right to distribute this or future versions of
-* Coccinelle under other licenses.
-*/
+ * Copyright 2010, 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
+ * This file is part of Coccinelle.
+ *
+ * Coccinelle is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, according to version 2 of the License.
+ *
+ * Coccinelle is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Coccinelle.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * The authors reserve the right to distribute this or future versions of
+ * Coccinelle under other licenses.
+ */
+
+
+/*
+ * Copyright 2010, 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
+ * This file is part of Coccinelle.
+ *
+ * Coccinelle is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, according to version 2 of the License.
+ *
+ * Coccinelle is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Coccinelle.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * The authors reserve the right to distribute this or future versions of
+ * Coccinelle under other licenses.
+ */
 
 
 %{
@@ -34,8 +60,8 @@ parameter needs both a type and an identifier *)
 module Ast0 = Ast0_cocci
 module Ast = Ast_cocci
 
-(*let warning s v = 
-  if !Flag.verbose_parsing 
+(*let warning s v =
+  if !Flag.verbose_parsing
   then Common.warning s v
   else v*)
 
@@ -133,12 +159,12 @@ TMetaExp TMetaConst
 %token <Data.line_type * int * int> TAndLog
 %token <Data.line_type * int * int> TOr
 %token <Data.line_type * int * int> TXor
-%token <Data.line_type * int * int> TAnd 
+%token <Data.line_type * int * int> TAnd
 %token <Data.line_type * int * int> TEqEq TNotEq
-%token <Data.line_type * int * int> TInf TSup TInfEq TSupEq 
+%token <Data.line_type * int * int> TInf TSup TInfEq TSupEq
 %token <Data.line_type * int * int> TShl TShr
 %token <Data.line_type * int * int> TPlus TMinus
-%token <Data.line_type * int * int> TMul TDiv TMod 
+%token <Data.line_type * int * int> TMul TDiv TMod
 
 %token <Data.line_type * int * int> TOBrace TCBrace
 %token <Data.line_type * int * int> TOCro TCCro
@@ -156,14 +182,14 @@ TMetaExp TMetaConst
 %left TAndLog
 %left TOr
 %left TXor
-%left TAnd 
+%left TAnd
 %left TEqEq TNotEq
-%left TInf TSup TInfEq TSupEq 
+%left TInf TSup TInfEq TSupEq
 %left TShl TShr
 %left TPlus TMinus
-%left TMul TDiv TMod 
+%left TMul TDiv TMod
 
-%start main 
+%start main
 %type <Ast0_cocci.rule> main
 
 %start meta_main
@@ -199,19 +225,19 @@ meta_var:
        (function name ->
          !Data.add_type_meta name;
          Ast.MetaTypeDecl($1,name))
-       $3 } 
+       $3 }
 | arity TParameter pure_ident_or_meta_ident_list TPtVirg
     { List.map
        (function name ->
          !Data.add_param_meta name;
          Ast.MetaParamDecl($1,name))
-       $3 } 
+       $3 }
 | arity TParameter Tlist pure_ident_or_meta_ident_list TPtVirg
     { List.map
        (function name ->
          !Data.add_paramlist_meta name;
          Ast.MetaParamListDecl($1,name))
-       $4 } 
+       $4 }
 | arity TError pure_ident_or_meta_ident_list TPtVirg
     { List.map
        (function name ->
@@ -558,7 +584,7 @@ eassign_expr: econd_expr                         { $1 }
            | eunary_expr TEq eassign_expr
                { Ast0.Assignment($1,clt2mcode Ast.SimpleAssign $2,$3)  }
 
-econd_expr: earith_expr                          { $1 } 
+econd_expr: earith_expr                          { $1 }
          | earith_expr TWhy eexpr_opt TDotDot econd_expr
             { Ast0.CondExpr ($1, clt2mcode "?" $2, $3, clt2mcode "?" $4, $5) }
 
@@ -650,7 +676,7 @@ dassign_expr: dcond_expr                         { $1 }
            | dunary_expr TEq dassign_expr
                { Ast0.Assignment($1,clt2mcode Ast.SimpleAssign $2,$3)  }
 
-dcond_expr: darith_expr                          { $1 } 
+dcond_expr: darith_expr                          { $1 }
          | darith_expr TWhy eexpr_opt TDotDot dcond_expr
             { Ast0.CondExpr ($1, clt2mcode "?" $2, $3, clt2mcode "?" $4, $5) }