On Sun, 8 Mar 2020, Markus Elfring wrote:
> Hello,
>
> I have tried the following small script variant out again for
> the semantic patch language.
>
> @display@
> expression action;
> expression* pointer, target, x;
> identifier member, var;
> statement is;
> type t;
> @@
> (
> *t* var =
Hello,
I have tried the following small script variant out again for
the semantic patch language.
@display@
expression action;
expression* pointer, target, x;
identifier member, var;
statement is;
type t;
@@
(
*t* var = pointer->member;
|
*pointer->member;
|
*target = pointer->member;
|
*t* var
Visitor_ast0 has changes with respect to enums. Reflect these
changes in spgen by adding additional arguments in the combiners
and rebuilders.
Signed-off-by: Jaskaran Singh
---
tools/spgen/source/detect_patch.ml | 6 --
tools/spgen/source/meta_variable.ml | 6 --
The SmPL AST has a separate enum_decl for a enumerator. Make
corresponding changes in Unparse_cocci and Pretty_print_cocci
to correctly pretty print enumerators.
Signed-off-by: Jaskaran Singh
---
parsing_c/unparse_cocci.ml | 27 ---
Add a test case to verify correct pretty printing of
enumerators that are assigned. The test case should cover
minused assigned enumerators, plussed assigned enumerators
and correct matching of an enum with an assigned enumerator.
Signed-off-by: Jaskaran Singh
---
tests/enum_assign.c | 6
The SmPL AST0 visitor has functions for handling enumerators
separately. Handle these collateral evolutions in parsing_cocci
by creating visitor functions for enum and enumdots in various places,
as well as adding the additional arguments needed in the visitor
combiners and rebuilders.
The SmPL AST has a separate enum_decl type for an enumerator.
Make corresponding changes in Cocci_vs_c to correctly match
enumerators.
Signed-off-by: Jaskaran Singh
---
engine/cocci_vs_c.ml | 44 ++--
1 file changed, 18 insertions(+), 26 deletions(-)
The SmPL AST visitor has functions for handling enumerators
separately. Handle these collateral evolutions in the codebase
by creating visitor functions for enum and enumdots in various places,
as well as adding the additional arguments needed in the visitor
combiners and rebuilders.
An enumerator in the SmPL AST now has the enum_decl type.
Add corresponding functions for the combiner, combiner_rebuilder
and rebuilder in Visitor_ast.
Signed-off-by: Jaskaran Singh n
---
parsing_cocci/visitor_ast.ml | 72 +++
parsing_cocci/visitor_ast.mli | 8
The EnumDef constructor is changed in the SmPL AST. Reflect
these changes in coccilib.
Signed-off-by: Jaskaran Singh
---
ocaml/coccilib.mli | 17 +++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/ocaml/coccilib.mli b/ocaml/coccilib.mli
index 5a913099..9b00e130
The EnumDef constructor of the SmPL AST has changed. Make
the SmPL parser parse an EnumDef correctly.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/parse_aux.ml| 5 +
parsing_cocci/parse_aux.mli | 9 +
parsing_cocci/parser_cocci_menhir.mly | 13
These constructors are needed by the visitor and various other
functions in the codebase. Maintain consistency and add these
constructs w/r/t changes in the SmPL AST.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/ast0_cocci.ml | 4
parsing_cocci/ast0_cocci.mli | 4
An enumerator in the SmPL AST now has the enum_decl type.
Add corresponding functions for the combiner, combiner_rebuilder
and rebuilder in Visitor_ast0.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/visitor_ast0.ml| 72 ++--
parsing_cocci/visitor_ast0.mli
The C AST and SmPL AST differs with respect to the enum type.
For an enumerator, the C AST is as follows:
Enum -> list of (name, (info, expression))
For the same, the SmPL AST is as follows:
EnumDef -> list of expression
While the SmPL parser does make sure that enumerators are
The SmPL AST now has these constructors. Reflect these changes in
coccilib.
Signed-off-by: Jaskaran Singh
---
ocaml/coccilib.mli | 5 +
1 file changed, 5 insertions(+)
diff --git a/ocaml/coccilib.mli b/ocaml/coccilib.mli
index 9b00e130..d01d2a93 100644
--- a/ocaml/coccilib.mli
+++
The C AST and SmPL AST differs with respect to the enum type.
For an enumerator, the C AST is as follows:
Enum -> list of (name, (info, expression))
For the same, the SmPL AST is as follows:
EnumDef -> list of expression
While the SmPL parser does make sure that enumerators
16 matches
Mail list logo