On Wed, Feb 19, 2020 at 11:37:03PM +0100, Julia Lawall wrote:
>
>
> --- Please note the new email address ---
>
>
> On Wed, 19 Feb 2020, Ville Syrjälä wrote:
>
> > Hi all,
> >
> > I was trying to do the following transformation:
> > @@
> > identifier M;
> > expression E;
> > @@
> > - struct
> The order of the terms in ParenType require implementing a special
> case for ParenType. This case handles only the following:
* Would it be nice to mention a key word like “parentheses”?
* How do you distinguish “visitors” for the affected software?
* I would prefer less repeated change
> ParenType and FunctionType are types present in the C AST that
> are not present in the SmPL AST.
Can the understanding of mentioned details be improved by reconsidering
the usage of abbreviations?
> In the pursuit of aligning both the C and SmPL ASTs,
I find this approach also helpful.
>
The order of the terms in ParenType require implementing a special
case for ParenType. This case handles only the following:
( * id [ .* ] ) ( params )
i.e., a function pointer or an array of function pointers, and will fail
for any other cases. This is similar to the function used to
ParenType and FunctionType are now in the SmPL AST, and these
types have replaced all productions related to the FunctionPointer
type in the SmPL parser.
Remove FunctionPointer from the SmPL ASTs, its cases and any functions
or constructs related to it from the codebase.
Signed-off-by: Jaskaran
ParenType and FunctionType are now added to the SmPL ASTs. Add
cases for these types in type_cocci.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/type_cocci.mli | 2 ++
1 file changed, 2 insertions(+)
diff --git a/parsing_cocci/type_cocci.mli b/parsing_cocci/type_cocci.mli
index
ParenType and FunctionType are now added to the SmPL ASTs. Add
cases for these types in compute_lines.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/compute_lines.ml | 11 +++
1 file changed, 11 insertions(+)
diff --git a/parsing_cocci/compute_lines.ml
ParenType and FunctionType are now added to the SmPL ASTs. Add
cases for these types in iso_pattern.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/iso_pattern.ml | 5 +
1 file changed, 5 insertions(+)
diff --git a/parsing_cocci/iso_pattern.ml b/parsing_cocci/iso_pattern.ml
index
ParenType and FunctionType are now added to the SmPL ASTs. Add
cases for these types in disjdistr.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/disjdistr.ml | 10 ++
1 file changed, 10 insertions(+)
diff --git a/parsing_cocci/disjdistr.ml b/parsing_cocci/disjdistr.ml
index
ParenType and FunctionType are added to the SmPL AST as types.
Match these types correctly.
Signed-off-by: Jaskaran Singh
---
engine/check_exhaustive_pattern.ml | 2 ++
engine/cocci_vs_c.ml | 27 +++
2 files changed, 29 insertions(+)
diff --git
ParenType and FunctionType are now added to the SmPL ASTs. Add
cases for these types in position_generator.ml.
Signed-off-by: Jaskaran Singh
---
tools/spgen/source/position_generator.ml | 6 ++
1 file changed, 6 insertions(+)
diff --git a/tools/spgen/source/position_generator.ml
ParenType and FunctionType are now added to the SmPL ASTs. Add
cases for these types in index.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/index.ml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/parsing_cocci/index.ml b/parsing_cocci/index.ml
index
The order of the terms in ParenType require implementing a special
case for ParenType. This case handles only the following:
( * id [ .* ] ) ( params )
i.e., a function pointer or an array of function pointers, and will fail
for any other cases. This is similar to the function used to
ParenType and FunctionType are now added to the SmPL ASTs. Add
cases for these types in ast0toast.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/ast0toast.ml | 6 ++
1 file changed, 6 insertions(+)
diff --git a/parsing_cocci/ast0toast.ml b/parsing_cocci/ast0toast.ml
index
Add a test case to match against an array of function pointers.
This would previously not work due to differences in the C
and SmPL ASTs.
Signed-off-by: Jaskaran Singh
---
tests/funptr_array.c | 1 +
tests/funptr_array.cocci | 9 +
tests/funptr_array.res | 1 +
3 files changed, 11
ParenType and FunctionType are now added to the SmPL ASTs. Add
cases for these types in check_meta.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/check_meta.ml | 5 +
1 file changed, 5 insertions(+)
diff --git a/parsing_cocci/check_meta.ml b/parsing_cocci/check_meta.ml
index
ParenType and FunctionType are now added to the SmPL ASTs. Add
cases for these types in unify_ast.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/unify_ast.ml | 8
1 file changed, 8 insertions(+)
diff --git a/parsing_cocci/unify_ast.ml b/parsing_cocci/unify_ast.ml
index
ParenType and FunctionType are now added to the SmPL ASTs. Add
cases for these types in ast_cocci.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/ast_cocci.ml | 10 ++
1 file changed, 10 insertions(+)
diff --git a/parsing_cocci/ast_cocci.ml b/parsing_cocci/ast_cocci.ml
index
ParenType and FunctionType are now added to the SmPL ASTs. Add
cases for these types in adjust_pragmas.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/adjust_pragmas.ml | 4
1 file changed, 4 insertions(+)
diff --git a/parsing_cocci/adjust_pragmas.ml b/parsing_cocci/adjust_pragmas.ml
ParenType and FunctionType are now added to the SmPL ASTs. Add
cases for these types in context_neg.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/context_neg.ml | 4
1 file changed, 4 insertions(+)
diff --git a/parsing_cocci/context_neg.ml b/parsing_cocci/context_neg.ml
index
The aim of this patch series is to add the types ParenType
and FunctionType to the SmPL AST. These types are present in
the C AST but not in the SmPL AST.
Preliminarily, a hack to resolve a reduce/reduce conflict
with the funproto rule in the SmPL parser is implemented.
Upon this, a rule similar
The direct_declarator rule and the direct_abstract_d rule are
present in the C parser. Add similar rules to the SmPL parser so that
declarators are parsed as they are in the C parser.
For the type ParenType, direct_declarator and direct_abstract_d only
allow the following productions:
(
ParenType and FunctionType are now added to the SmPL ASTs. Add
cases for these types in function_prototypes.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/function_prototypes.ml | 4
1 file changed, 4 insertions(+)
diff --git a/parsing_cocci/function_prototypes.ml
To add the types ParenType and FunctionType to the SmPL AST, a
reduce/reduce conflict with the funproto rule of the SmPL parser
must be resolved. This requires explicitly identifying a function
prototype by use of a token (TFunProto).
While the correct method of identifying a function prototype
ParenType and FunctionType are added to the SmPL ASTs. Add
cases for these types in arity.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/arity.ml | 17 +
1 file changed, 17 insertions(+)
diff --git a/parsing_cocci/arity.ml b/parsing_cocci/arity.ml
index f29b86eb..3b408554
ParenType/FunctionType are now types in the SmPL ASTs. Add
cases for these types in unparse_ast0.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/unparse_ast0.ml | 38 +++
1 file changed, 38 insertions(+)
diff --git a/parsing_cocci/unparse_ast0.ml
The order of the terms in ParenType require implementing a special
case for ParenType. This case handles only the following:
( * id [ .* ] ) ( params )
i.e., a function pointer or an array of function pointers, and will fail
for any other cases. This is similar to the function used to
ParenType and FunctionType are types present in the C AST that
are not present in the SmPL AST. In the pursuit of aligning
both the C and SmPL ASTs, add these types to the SmPL ASTs.
For a function pointer as follows:
int (*x)(params)
The SmPL AST would be as follows:
ParenType -> Pointer ->
The order of the terms in ParenType require implementing a special
case for ParenType. This case handles only the following:
( * id [ .* ] ) ( params )
i.e., a function pointer or an array of function pointers, and will fail
for any other cases. This is similar to the function used to
ParenType/FunctionType are now types in the SmPL ASTs. Add
cases for these types in single_statement.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/single_statement.ml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/parsing_cocci/single_statement.ml
30 matches
Mail list logo