Coccinelle archive on lore.kernel.org
 help / color / Atom feed
* Re: [Cocci] [PATCH 02/26] parsing_cocci: AST: Add ParenType and FunctionType to SmPL ASTs
@ 2020-03-16 18:00 Markus Elfring
  0 siblings, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2020-03-16 18:00 UTC (permalink / raw)
  To: Jaskaran Singh, cocci; +Cc: linux-kernel-mentees

> 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
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Cocci] [PATCH 02/26] parsing_cocci: AST: Add ParenType and FunctionType to SmPL ASTs
  2020-03-16 10:02 ` [Cocci] [PATCH 02/26] parsing_cocci: AST: Add ParenType and FunctionType " Jaskaran Singh
@ 2020-03-18 17:27   ` Julia Lawall
  0 siblings, 0 replies; 3+ messages in thread
From: Julia Lawall @ 2020-03-18 17:27 UTC (permalink / raw)
  To: Jaskaran Singh; +Cc: linux-kernel-mentees, cocci



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 of how these
constructors would be used.

julia

>
> Signed-off-by: Jaskaran Singh <jaskaransingh7654321@gmail.com>
> ---
>  ocaml/coccilib.mli           | 6 ++++++
>  parsing_cocci/ast0_cocci.ml  | 3 +++
>  parsing_cocci/ast0_cocci.mli | 3 +++
>  parsing_cocci/ast_cocci.ml   | 3 +++
>  parsing_cocci/ast_cocci.mli  | 3 +++
>  5 files changed, 18 insertions(+)
>
> diff --git a/ocaml/coccilib.mli b/ocaml/coccilib.mli
> index 5a913099..e5409a97 100644
> --- a/ocaml/coccilib.mli
> +++ b/ocaml/coccilib.mli
> @@ -2709,6 +2709,9 @@ module Ast_cocci :
>        | Pointer of fullType * string mcode
>        | FunctionPointer of fullType * string mcode * string mcode *
>            string mcode * string mcode * parameter_list * string mcode
> +      | ParenType of string mcode (* ( *) * fullType * string mcode (* ) *)
> +      | FunctionType of fullType *
> +          string mcode (* ( *) * parameter_list * string mcode (* ) *)
>        | Array of fullType * string mcode * expression option * string mcode
>        | Decimal of string mcode * string mcode * expression *
>            string mcode option * expression option * string mcode
> @@ -3353,6 +3356,9 @@ module Ast0_cocci :
>        | Pointer of typeC * string mcode
>        | FunctionPointer of typeC * string mcode * string mcode *
>            string mcode * string mcode * parameter_list * string mcode
> +      | ParenType of string mcode * typeC * string mcode
> +      | FunctionType of typeC *
> +          string mcode * parameter_list * string mcode
>        | Array of typeC * string mcode * expression option * string mcode
>        | Decimal of string mcode * string mcode * expression *
>            string mcode option * expression option * string mcode
> diff --git a/parsing_cocci/ast0_cocci.ml b/parsing_cocci/ast0_cocci.ml
> index 77dc46f0..0acbeaa4 100644
> --- a/parsing_cocci/ast0_cocci.ml
> +++ b/parsing_cocci/ast0_cocci.ml
> @@ -203,6 +203,9 @@ and base_typeC =
>    | FunctionPointer of typeC *
>  	          string mcode(* ( *)*string mcode(* * *)*string mcode(* ) *)*
>                    string mcode (* ( *)*parameter_list*string mcode(* ) *)
> +  | ParenType       of string mcode (* ( *) * typeC * string mcode (* ) *)
> +  | FunctionType    of typeC *
> +                  string mcode (* ( *) * parameter_list * string mcode (* ) *)
>    | Array           of typeC * string mcode (* [ *) *
>  	               expression option * string mcode (* ] *)
>    | Decimal         of string mcode (* decimal *) * string mcode (* ( *) *
> diff --git a/parsing_cocci/ast0_cocci.mli b/parsing_cocci/ast0_cocci.mli
> index 274c6bc2..33bd12b2 100644
> --- a/parsing_cocci/ast0_cocci.mli
> +++ b/parsing_cocci/ast0_cocci.mli
> @@ -194,6 +194,9 @@ and base_typeC =
>    | FunctionPointer of typeC *
>  	          string mcode(* ( *)*string mcode(* * *)*string mcode(* ) *)*
>                    string mcode (* ( *)*parameter_list*string mcode(* ) *)
> +  | ParenType       of string mcode (* ( *) * typeC * string mcode (* ) *)
> +  | FunctionType    of typeC *
> +                  string mcode (* ( *) * parameter_list * string mcode (* ) *)
>    | Array           of typeC * string mcode (* [ *) *
>  	               expression option * string mcode (* ] *)
>    | Decimal         of string mcode (* decimal *) * string mcode (* ( *) *
> diff --git a/parsing_cocci/ast_cocci.ml b/parsing_cocci/ast_cocci.ml
> index ba6ec29e..f8e6dee6 100644
> --- a/parsing_cocci/ast_cocci.ml
> +++ b/parsing_cocci/ast_cocci.ml
> @@ -343,6 +343,9 @@ and base_typeC =
>    | FunctionPointer of fullType *
>  	          string mcode(* ( *)*string mcode(* * *)*string mcode(* ) *)*
>                    string mcode (* ( *)*parameter_list*string mcode(* ) *)
> +  | ParenType       of string mcode (* ( *) * fullType * string mcode (* ) *)
> +  | FunctionType    of fullType *
> +                  string mcode (* ( *) * parameter_list * string mcode (* ) *)
>    | Array           of fullType * string mcode (* [ *) *
>  	               expression option * string mcode (* ] *)
>    | Decimal         of string mcode (* decimal *) * string mcode (* ( *) *
> diff --git a/parsing_cocci/ast_cocci.mli b/parsing_cocci/ast_cocci.mli
> index 5f21664b..7fb54e4d 100644
> --- a/parsing_cocci/ast_cocci.mli
> +++ b/parsing_cocci/ast_cocci.mli
> @@ -325,6 +325,9 @@ and base_typeC =
>    | FunctionPointer of fullType *
>  	          string mcode(* ( *)*string mcode(* * *)*string mcode(* ) *)*
>                    string mcode (* ( *)*parameter_list*string mcode(* ) *)
> +  | ParenType       of string mcode (* ( *) * fullType * string mcode (* ) *)
> +  | FunctionType    of fullType *
> +                  string mcode (* ( *) * parameter_list * string mcode (* ) *)
>    | Array           of fullType * string mcode (* [ *) *
>  	               expression option * string mcode (* ] *)
>    | Decimal         of string mcode (* decimal *) * string mcode (* ( *) *
> --
> 2.21.1
>
>
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Cocci] [PATCH 02/26] parsing_cocci: AST: Add ParenType and FunctionType to SmPL ASTs
  2020-03-16 10:02 [Cocci] [PATCH 00/26] cocci: Add ParenType/FunctionType " Jaskaran Singh
@ 2020-03-16 10:02 ` " Jaskaran Singh
  2020-03-18 17:27   ` Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Jaskaran Singh @ 2020-03-16 10:02 UTC (permalink / raw)
  To: cocci; +Cc: linux-kernel-mentees

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 <jaskaransingh7654321@gmail.com>
---
 ocaml/coccilib.mli           | 6 ++++++
 parsing_cocci/ast0_cocci.ml  | 3 +++
 parsing_cocci/ast0_cocci.mli | 3 +++
 parsing_cocci/ast_cocci.ml   | 3 +++
 parsing_cocci/ast_cocci.mli  | 3 +++
 5 files changed, 18 insertions(+)

diff --git a/ocaml/coccilib.mli b/ocaml/coccilib.mli
index 5a913099..e5409a97 100644
--- a/ocaml/coccilib.mli
+++ b/ocaml/coccilib.mli
@@ -2709,6 +2709,9 @@ module Ast_cocci :
       | Pointer of fullType * string mcode
       | FunctionPointer of fullType * string mcode * string mcode *
           string mcode * string mcode * parameter_list * string mcode
+      | ParenType of string mcode (* ( *) * fullType * string mcode (* ) *)
+      | FunctionType of fullType *
+          string mcode (* ( *) * parameter_list * string mcode (* ) *)
       | Array of fullType * string mcode * expression option * string mcode
       | Decimal of string mcode * string mcode * expression *
           string mcode option * expression option * string mcode
@@ -3353,6 +3356,9 @@ module Ast0_cocci :
       | Pointer of typeC * string mcode
       | FunctionPointer of typeC * string mcode * string mcode *
           string mcode * string mcode * parameter_list * string mcode
+      | ParenType of string mcode * typeC * string mcode
+      | FunctionType of typeC *
+          string mcode * parameter_list * string mcode
       | Array of typeC * string mcode * expression option * string mcode
       | Decimal of string mcode * string mcode * expression *
           string mcode option * expression option * string mcode
diff --git a/parsing_cocci/ast0_cocci.ml b/parsing_cocci/ast0_cocci.ml
index 77dc46f0..0acbeaa4 100644
--- a/parsing_cocci/ast0_cocci.ml
+++ b/parsing_cocci/ast0_cocci.ml
@@ -203,6 +203,9 @@ and base_typeC =
   | FunctionPointer of typeC *
 	          string mcode(* ( *)*string mcode(* * *)*string mcode(* ) *)*
                   string mcode (* ( *)*parameter_list*string mcode(* ) *)
+  | ParenType       of string mcode (* ( *) * typeC * string mcode (* ) *)
+  | FunctionType    of typeC *
+                  string mcode (* ( *) * parameter_list * string mcode (* ) *)
   | Array           of typeC * string mcode (* [ *) *
 	               expression option * string mcode (* ] *)
   | Decimal         of string mcode (* decimal *) * string mcode (* ( *) *
diff --git a/parsing_cocci/ast0_cocci.mli b/parsing_cocci/ast0_cocci.mli
index 274c6bc2..33bd12b2 100644
--- a/parsing_cocci/ast0_cocci.mli
+++ b/parsing_cocci/ast0_cocci.mli
@@ -194,6 +194,9 @@ and base_typeC =
   | FunctionPointer of typeC *
 	          string mcode(* ( *)*string mcode(* * *)*string mcode(* ) *)*
                   string mcode (* ( *)*parameter_list*string mcode(* ) *)
+  | ParenType       of string mcode (* ( *) * typeC * string mcode (* ) *)
+  | FunctionType    of typeC *
+                  string mcode (* ( *) * parameter_list * string mcode (* ) *)
   | Array           of typeC * string mcode (* [ *) *
 	               expression option * string mcode (* ] *)
   | Decimal         of string mcode (* decimal *) * string mcode (* ( *) *
diff --git a/parsing_cocci/ast_cocci.ml b/parsing_cocci/ast_cocci.ml
index ba6ec29e..f8e6dee6 100644
--- a/parsing_cocci/ast_cocci.ml
+++ b/parsing_cocci/ast_cocci.ml
@@ -343,6 +343,9 @@ and base_typeC =
   | FunctionPointer of fullType *
 	          string mcode(* ( *)*string mcode(* * *)*string mcode(* ) *)*
                   string mcode (* ( *)*parameter_list*string mcode(* ) *)
+  | ParenType       of string mcode (* ( *) * fullType * string mcode (* ) *)
+  | FunctionType    of fullType *
+                  string mcode (* ( *) * parameter_list * string mcode (* ) *)
   | Array           of fullType * string mcode (* [ *) *
 	               expression option * string mcode (* ] *)
   | Decimal         of string mcode (* decimal *) * string mcode (* ( *) *
diff --git a/parsing_cocci/ast_cocci.mli b/parsing_cocci/ast_cocci.mli
index 5f21664b..7fb54e4d 100644
--- a/parsing_cocci/ast_cocci.mli
+++ b/parsing_cocci/ast_cocci.mli
@@ -325,6 +325,9 @@ and base_typeC =
   | FunctionPointer of fullType *
 	          string mcode(* ( *)*string mcode(* * *)*string mcode(* ) *)*
                   string mcode (* ( *)*parameter_list*string mcode(* ) *)
+  | ParenType       of string mcode (* ( *) * fullType * string mcode (* ) *)
+  | FunctionType    of fullType *
+                  string mcode (* ( *) * parameter_list * string mcode (* ) *)
   | Array           of fullType * string mcode (* [ *) *
 	               expression option * string mcode (* ] *)
   | Decimal         of string mcode (* decimal *) * string mcode (* ( *) *
-- 
2.21.1

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-16 18:00 [Cocci] [PATCH 02/26] parsing_cocci: AST: Add ParenType and FunctionType to SmPL ASTs Markus Elfring
  -- strict thread matches above, loose matches on Subject: below --
2020-03-16 10:02 [Cocci] [PATCH 00/26] cocci: Add ParenType/FunctionType " Jaskaran Singh
2020-03-16 10:02 ` [Cocci] [PATCH 02/26] parsing_cocci: AST: Add ParenType and FunctionType " Jaskaran Singh
2020-03-18 17:27   ` Julia Lawall

Coccinelle archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/cocci/0 cocci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 cocci cocci/ https://lore.kernel.org/cocci \
		cocci@systeme.lip6.fr
	public-inbox-index cocci

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/fr.lip6.systeme.cocci


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git