On Mon, 2020-03-16 at 20:20 +0100, Markus Elfring wrote:
> > ParenType and FunctionType are added to the SmPL ASTs.
> > Add cases for these types in ….ml.
>
> A change description template was used several times.
> I wonder if there is really a need to modify only a single OCaml
> source file
>
On Mon, 2020-03-16 at 20:10 +0100, Markus Elfring wrote:
> > The order of the terms in ParenType require implementing a special
> > case for ParenType. This case handles only the following:
> …
>
> It seems that this change description was repeated in other update
> steps.
Whoops, dumb mistake.
> ParenType and FunctionType are added to the SmPL ASTs.
> Add cases for these types in ….ml.
A change description template was used several times.
I wonder if there is really a need to modify only a single OCaml source file
in these update steps.
How do you think about to combine such changes in
> The order of the terms in ParenType require implementing a special
> case for ParenType. This case handles only the following:
…
It seems that this change description was repeated in other update steps.
Does this detail indicate a need to reconsider the patch granularity?
Regards,
Markus
> ParenType and FunctionType are types present in the C AST that
> are not present in the SmPL AST.
Will a bit more background information become helpful for these data types?
Regards,
Markus
___
Cocci mailing list
Cocci@systeme.lip6.fr
> Thus, a slightly hacky approach is taken to determine a function
> prototype with not the best certainty but what works for most cases
> in SmPL. If the identifier is preceded by any token that does not
> seem to be part of a type, then it is not identified as a function
> prototype. Else, it
> The aim of this patch series is to add the types ParenType
Can it be that this kind of data processing will need a bit more explanation?
> The FunctionPointer type is removed from the SmPL AST, since
> all the productions that produce FunctionPointers in the SmPL
> parser are replaced by
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 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 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 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 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 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
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 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 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
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/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
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 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
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
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 unparse_ast0.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/unparse_ast0.ml | 43 +++
1 file changed, 43 insertions(+)
diff --git a/parsing_cocci/unparse_ast0.ml
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
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 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.
Signed-off-by: Jaskaran Singh
---
ocaml/coccilib.mli | 6 ++
parsing_cocci/ast0_cocci.ml | 3 +++
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 index.ml.
Signed-off-by: Jaskaran Singh
---
parsing_cocci/index.ml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/parsing_cocci/index.ml b/parsing_cocci/index.ml
index a1103503..5c91f620 100644
---
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
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, rules similar
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
33 matches
Mail list logo