HCoop
/
bpt
/
coccinelle.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Coccinelle release 0.2.5-rc5
[bpt/coccinelle.git]
/
parsing_cocci
/
parser_cocci_menhir.mly
diff --git
a/parsing_cocci/parser_cocci_menhir.mly
b/parsing_cocci/parser_cocci_menhir.mly
index
fa56672
..
0df359d
100644
(file)
--- a/
parsing_cocci/parser_cocci_menhir.mly
+++ b/
parsing_cocci/parser_cocci_menhir.mly
@@
-744,8
+744,8
@@
continue_struct_decl_list:
/* very restricted what kinds of expressions can appear in an enum decl */
enum_decl_one:
/* very restricted what kinds of expressions can appear in an enum decl */
enum_decl_one:
- |
m
ident { Ast0.wrap(Ast0.Ident($1)) }
- |
m
ident TEq enum_val
+ |
disj_
ident { Ast0.wrap(Ast0.Ident($1)) }
+ |
disj_
ident TEq enum_val
{ let id = Ast0.wrap(Ast0.Ident($1)) in
Ast0.wrap
(Ast0.Assignment
{ let id = Ast0.wrap(Ast0.Ident($1)) in
Ast0.wrap
(Ast0.Assignment
@@
-989,10
+989,10
@@
storage:
| s=Tregister { P.clt2mcode Ast.Register s }
| s=Textern { P.clt2mcode Ast.Extern s }
| s=Tregister { P.clt2mcode Ast.Register s }
| s=Textern { P.clt2mcode Ast.Extern s }
-decl: t=ctype i=ident
+decl: t=ctype i=
disj_
ident
{ Ast0.wrap(Ast0.Param(t, Some i)) }
| t=ctype { (*verify in FunDecl*) Ast0.wrap(Ast0.Param(t, None)) }
{ Ast0.wrap(Ast0.Param(t, Some i)) }
| t=ctype { (*verify in FunDecl*) Ast0.wrap(Ast0.Param(t, None)) }
- | t=ctype lp=TOPar s=TMul i=ident rp=TCPar
+ | t=ctype lp=TOPar s=TMul i=
disj_
ident rp=TCPar
lp1=TOPar d=decl_list(name_opt_decl) rp1=TCPar
{ let fnptr =
Ast0.wrap
lp1=TOPar d=decl_list(name_opt_decl) rp1=TCPar
{ let fnptr =
Ast0.wrap
@@
-1049,7
+1049,7
@@
statement:
| TBreak TPtVirg { P.break $1 $2 }
| TContinue TPtVirg { P.cont $1 $2 }
| mident TDotDot { P.label $1 $2 }
| TBreak TPtVirg { P.break $1 $2 }
| TContinue TPtVirg { P.cont $1 $2 }
| mident TDotDot { P.label $1 $2 }
-| TGoto
m
ident TPtVirg { P.goto $1 $2 $3 }
+| TGoto
disj_
ident TPtVirg { P.goto $1 $2 $3 }
| TOBrace fun_start TCBrace
{ P.seq $1 $2 $3 }
| TOBrace fun_start TCBrace
{ P.seq $1 $2 $3 }
@@
-1237,7
+1237,7
@@
one_decl_var:
d_ident:
d_ident:
-
m
ident list(array_dec)
+
disj_
ident list(array_dec)
{ ($1,
function t ->
List.fold_right
{ ($1,
function t ->
List.fold_right
@@
-1281,7
+1281,7
@@
initialize2:
{ Ast0.wrap(Ast0.InitGccName($1,P.clt2mcode ":" $2,$3)) } /* in old kernel */
designator:
{ Ast0.wrap(Ast0.InitGccName($1,P.clt2mcode ":" $2,$3)) } /* in old kernel */
designator:
- | TDot
m
ident
+ | TDot
disj_
ident
{ Ast0.DesignatorField (P.clt2mcode "." $1,$2) }
| TOCro eexpr TCCro
{ Ast0.DesignatorIndex (P.clt2mcode "[" $1,$2,P.clt2mcode "]" $3) }
{ Ast0.DesignatorField (P.clt2mcode "." $1,$2) }
| TOCro eexpr TCCro
{ Ast0.DesignatorIndex (P.clt2mcode "[" $1,$2,P.clt2mcode "]" $3) }
@@
-1540,9
+1540,9
@@
postfix_expr(r,pe):
| postfix_expr(r,pe) TOCro eexpr TCCro
{ Ast0.wrap(Ast0.ArrayAccess ($1,P.clt2mcode "[" $2,$3,
P.clt2mcode "]" $4)) }
| postfix_expr(r,pe) TOCro eexpr TCCro
{ Ast0.wrap(Ast0.ArrayAccess ($1,P.clt2mcode "[" $2,$3,
P.clt2mcode "]" $4)) }
- | postfix_expr(r,pe) TDot
m
ident
+ | postfix_expr(r,pe) TDot
disj_
ident
{ Ast0.wrap(Ast0.RecordAccess($1, P.clt2mcode "." $2, $3)) }
{ Ast0.wrap(Ast0.RecordAccess($1, P.clt2mcode "." $2, $3)) }
- | postfix_expr(r,pe) TPtrOp
m
ident
+ | postfix_expr(r,pe) TPtrOp
disj_
ident
{ Ast0.wrap(Ast0.RecordPtAccess($1, P.clt2mcode "->" $2,
$3)) }
| postfix_expr(r,pe) TInc
{ Ast0.wrap(Ast0.RecordPtAccess($1, P.clt2mcode "->" $2,
$3)) }
| postfix_expr(r,pe) TInc
@@
-1856,7
+1856,7
@@
func_ident: ident { $1 }
Ast0.wrap
(Ast0.MetaLocalFunc(P.clt2mcode nm clt,constraints,pure)) }
Ast0.wrap
(Ast0.MetaLocalFunc(P.clt2mcode nm clt,constraints,pure)) }
-fn_ident:
m
ident { $1 }
+fn_ident:
disj_
ident { $1 }
| TMetaFunc
{ let (nm,constraints,pure,clt) = $1 in
Ast0.wrap(Ast0.MetaFunc(P.clt2mcode nm clt,constraints,pure)) }
| TMetaFunc
{ let (nm,constraints,pure,clt) = $1 in
Ast0.wrap(Ast0.MetaFunc(P.clt2mcode nm clt,constraints,pure)) }
@@
-1878,7
+1878,14
@@
mident: pure_ident
{ let (nm,constraints,pure,clt) = $1 in
Ast0.wrap(Ast0.MetaId(P.clt2mcode nm clt,constraints,pure)) }
{ let (nm,constraints,pure,clt) = $1 in
Ast0.wrap(Ast0.MetaId(P.clt2mcode nm clt,constraints,pure)) }
-type_ident: mident { $1 }
+disj_ident:
+ mident { $1 }
+ | lp=TOPar0 t=midzero_list(disj_ident,disj_ident) rp=TCPar0
+ { let (mids,code) = t in
+ Ast0.wrap
+ (Ast0.DisjId(P.clt2mcode "(" lp,code,mids, P.clt2mcode ")" rp)) }
+
+type_ident: disj_ident { $1 }
| TTypeId
{ Ast0.wrap(Ast0.Id(P.id2mcode $1)) }
| TTypeId
{ Ast0.wrap(Ast0.Id(P.id2mcode $1)) }