Re: [Cocci] [PATCH v2 05/26] parsing_cocci: visitor_ast: Add cases for ParenType/FunctionType

2020-03-18 Thread Julia Lawall
On Tue, 17 Mar 2020, Jaskaran Singh wrote: > 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

Re: [Cocci] [PATCH 14/26] parsing_cocci: adjust_pragmas: Add cases for ParenType/FunctionType

2020-03-18 Thread Julia Lawall
On Mon, 16 Mar 2020, Jaskaran Singh wrote: > 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

Re: [Cocci] [PATCH 02/26] parsing_cocci: AST: Add ParenType and FunctionType to SmPL ASTs

2020-03-18 Thread Julia Lawall
On Mon, 16 Mar 2020, Jaskaran Singh wrote: > 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. It would be nice to extend the log message to give an example

Re: [Cocci] [PATCH 07/26] parsing_cocci: index: Add cases for ParenType/FunctionType

2020-03-18 Thread Julia Lawall
On Mon, 16 Mar 2020, Jaskaran Singh wrote: > 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

Re: [Cocci] [PATCH 04/26] parsing_cocci: visitor_ast0: Add cases for ParenType/FunctionType

2020-03-18 Thread Julia Lawall
On Mon, 16 Mar 2020, Jaskaran Singh wrote: > 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

Re: [Cocci] [PATCH 10/26] parsing_cocci: single_statement: Add cases for ParenType/FunctionType

2020-03-18 Thread Julia Lawall
On Mon, 16 Mar 2020, Jaskaran Singh wrote: > 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

Re: [Cocci] [PATCH 09/26] parsing_cocci: unparse_ast0: Add cases for ParenType/FunctionType

2020-03-18 Thread Julia Lawall
On Mon, 16 Mar 2020, Jaskaran Singh wrote: > 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

Re: [Cocci] [PATCH 01/26] parsing_cocci: Add Function Prototype token

2020-03-18 Thread Julia Lawall
On Mon, 16 Mar 2020, Jaskaran Singh wrote: > 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). > >

Re: [Cocci] [PATCH 03/26] parsing_cocci: parser: Add direct_declarator/direct_abstract_d rules

2020-03-18 Thread Julia Lawall
On Mon, 16 Mar 2020, Jaskaran Singh wrote: > 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

Re: [Cocci] [PATCH 26/26] tests: Add test case for array of function pointers

2020-03-18 Thread Julia Lawall
On Mon, 16 Mar 2020, Jaskaran Singh wrote: > 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. > Thanks for all of the changes in this series! julia > Signed-off-by: Jaskaran Singh > --- >

Re: [Cocci] [PATCH 15/26] parsing_cocci: compute_lines: Add cases for ParenType/FunctionType

2020-03-18 Thread Julia Lawall
On Mon, 16 Mar 2020, Jaskaran Singh wrote: > 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

Re: [Cocci] [PATCH 21/26] parsing_cocci: pretty_print_cocci: Print ParenType/FunctionType

2020-03-18 Thread Julia Lawall
On Mon, 16 Mar 2020, Jaskaran Singh wrote: > 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

Re: [Cocci] [PATCH 22/26] parsing_c: unparse_cocci: Print ParenType/FunctionType

2020-03-18 Thread Julia Lawall
On Mon, 16 Mar 2020, Jaskaran Singh wrote: > 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

Re: [Cocci] [PATCH 03/26] parsing_cocci: parser: Add direct_declarator/direct_abstract_d rules

2020-03-18 Thread Jaskaran Singh
On Wed, 2020-03-18 at 18:31 +0100, Julia Lawall wrote: > > On Mon, 16 Mar 2020, Jaskaran Singh wrote: > > > 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