[Cocci] Re: problems with typecasts
Julia Lawall
julia at diku.dk
Thu Mar 5 16:31:21 CET 2009
On Thu, 5 Mar 2009, Carl-Daniel Hailfinger wrote:
> Hi,
>
> sorry for posting an immediate followup, but I had some progress on
> removing redundancies from the semantic patch. However, it seems I
> misread the SmPL grammar somewhere because I now get an error from spatch:
> Fatal error: exception Failure("minus: parse error:
> = File "writeb.cocci", line 21, column 0, charpos = 197
> around = '|', whole content = |
> ")
In an ( | ) the different possibilities have to be proper terms
(statements, expressions, whatever). In your case, you have eg
"writeb(a," which is not an anything. If you really want to combine them,
you could say:
(
read
|
write
)
(...,
- (T)
b)
(Note that there is a space before the ( in the sixth line)
For the problem with parentheses, a possibility is to do the following,
etc for the read case:
- a = *(b)
+ a = readb(b)
In your standard.iso file you should have:
Expression
@ paren @
expression E;
@@
(E) => E
This means that something with a parenthesis will match something without
it as well. So the above will also match a = *b.
julia
More information about the Cocci
mailing list