Checking the parsing for a specific SmPL disjunction
Hello,
I know that the following SmPL script example gets accepted by the Coccinelle software.
@display@
expression x, y;
@@
*y = ... *(x) ...
I have tried another tiny script variant out for the semantic patch language (according to the software combination “Coccinelle 1.0.8-00131-g675b9670”).
@display@
expression action, x, y;
@@
(
*y = ... *(x) ...
|
*action(..., x, ...)
)
elfring@Sonne:~/Projekte/Coccinelle/janitor> spatch --parse-cocci show_pointer_dereferences3.cocciinit_defs_builtins: /usr/local/bin/../lib/coccinelle/standard.h
minus: parse error:
File "show_pointer_dereferences3.cocci", line 5, column 14, charpos = 54
around = '...',
whole content = *y = ... *(x) ...
Should such SmPL disjunctions work in the future?
Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci
Quoted 9 lines · Markus Elfring
Hello,
I know that the following SmPL script example gets accepted by the Coccinelle software.
@display@
expression x, y;
@@
*y = ... *(x) ...
This is probably not what you think. It is an assignment of y to a multiplication followed by some other code (the second ...).
julia
Quoted 23 lines
I have tried another tiny script variant out for the semantic patch language (according to the software combination “Coccinelle 1.0.8-00131-g675b9670”).
@display@
expression action, x, y;
@@
(
*y = ... *(x) ...
|
*action(..., x, ...)
)elfring@Sonne:~/Projekte/Coccinelle/janitor> spatch --parse-cocci
show_pointer_dereferences3.cocciinit_defs_builtins:/usr/local/bin/../lib/coccinelle/standard.h
minus: parse error:
File "show_pointer_dereferences3.cocci", line 5, column 14, charpos = 54
around = '...',
whole content = *y = ... *(x) ...
Quoted 9 lines
Should such SmPL disjunctions work in the future?
Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 15 lines · Markus Elfring
Quoted 7 lines
Quoted 4 lines
@display@
expression x, y;
@@
*y = ... *(x) ...This is probably not what you think. It is an assignment of y to a multiplication followed by some other code (the second ...).
I would interpret such a source code search approach in the way that a varying expression which contains one known (?) operation is assigned to an other target.
Can the ambiguity for the asterisk (before the parentheses) be avoided?
Quoted 8 lines
Should the following script variant for the semantic patch language match only code with pointer dereferences?
@display@
expression* x;
expression y;
@@
*y = ... *(x) ...
There is no ... like this at the expression level. You can say <+... *(x) ...+> if you want *(x) to be a subexpression of the right hand side.
julia
Quoted 12 lines
Quoted 11 lines
Quoted 11 lines
@display@
expression action, x, y;
@@
(
*y = ... *(x) ...
|
*action(..., x, ...)
)
Quoted 5 lines
May I expect that such SmPL disjunctions should also work?
Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci