cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: Jaskaran Singh <jaskaransingh7654321@gmail.com>
To: cocci@systeme.lip6.fr
Cc: linux-kernel-mentees@lists.linuxfoundation.org
Subject: [Cocci] [PATCH 02/13] ocaml: coccilib: Reflect changes in SmPL AST for EnumDef
Date: Sun,  8 Mar 2020 14:13:45 +0530	[thread overview]
Message-ID: <20200308084356.14506-3-jaskaransingh7654321@gmail.com> (raw)
In-Reply-To: <20200308084356.14506-1-jaskaransingh7654321@gmail.com>

The EnumDef constructor is changed in the SmPL AST. Reflect
these changes in coccilib.

Signed-off-by: Jaskaran Singh <jaskaransingh7654321@gmail.com>
---
 ocaml/coccilib.mli | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/ocaml/coccilib.mli b/ocaml/coccilib.mli
index 5a913099..9b00e130 100644
--- a/ocaml/coccilib.mli
+++ b/ocaml/coccilib.mli
@@ -2713,7 +2713,7 @@ module Ast_cocci :
       | Decimal of string mcode * string mcode * expression *
           string mcode option * expression option * string mcode
       | EnumName of string mcode * ident option
-      | EnumDef of fullType * string mcode * expression dots * string mcode
+      | EnumDef of fullType * string mcode * enum_decl dots * string mcode
       | StructUnionName of structUnion mcode * ident option
       | StructUnionDef of fullType * string mcode * annotated_field dots *
           string mcode
@@ -2789,6 +2789,12 @@ module Ast_cocci :
       | ConjField of annotated_field list
       | OptField  of annotated_field
     and annotated_field = base_annotated_field wrap
+    and base_enum_decl =
+      Ast_cocci.base_enum_decl =
+        Enum of ident * (string mcode * expression) option
+      | EnumComma of string mcode
+      | EnumDots of string mcode * enum_decl option
+    and enum_decl = base_enum_decl wrap
     and base_initialiser =
       Ast_cocci.base_initialiser =
         MetaInit of meta_name mcode * constraints * keep_binding * inherited
@@ -3357,7 +3363,7 @@ module Ast0_cocci :
       | Decimal of string mcode * string mcode * expression *
           string mcode option * expression option * string mcode
       | EnumName of string mcode * ident option
-      | EnumDef of typeC * string mcode * expression dots * string mcode
+      | EnumDef of typeC * string mcode * enum_decl dots * string mcode
       | StructUnionName of Ast_cocci.structUnion mcode * ident option
       | StructUnionDef of typeC * string mcode * field dots * string mcode
       | TypeOfExpr of string mcode * string mcode * expression * string mcode
@@ -3408,6 +3414,13 @@ module Ast0_cocci :
       | OptField of field
     and bitfield = string mcode * expression
     and field = base_field wrap
+    and base_enum_decl =
+      Ast0_cocci.base_enum_decl =
+        Enum of ident * (string mcode * expression) option
+      | EnumComma of string mcode
+      | EnumDots of string mcode *
+                    (string mcode * string mcode * enum_decl) option
+    and enum_decl = base_enum_decl wrap
     and base_initialiser =
       Ast0_cocci.base_initialiser =
         MetaInit of Ast_cocci.meta_name mcode * constraints * pure
-- 
2.21.1

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

  parent reply	other threads:[~2020-03-08  8:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-08  8:43 [Cocci] [PATCH 00/13] cocci: Align the C AST and SmPL AST for enum Jaskaran Singh
2020-03-08  8:43 ` [Cocci] [PATCH 01/13] parsing_cocci: Align " Jaskaran Singh
2020-03-08  8:43 ` Jaskaran Singh [this message]
2020-03-08  8:43 ` [Cocci] [PATCH 03/13] parsing_cocci: parser: Parse enumerators correctly Jaskaran Singh
2020-03-08  8:43 ` [Cocci] [PATCH 04/13] parsing_cocci: Add EnumDeclTag and EnumDeclDotsTag to SmPL ASTs Jaskaran Singh
2020-03-08  8:43 ` [Cocci] [PATCH 05/13] ocaml: coccilib: Reflect EnumDeclTag and EnumDeclDotsTag Jaskaran Singh
2020-03-08  8:43 ` [Cocci] [PATCH 06/13] parsing_cocci: visitor_ast0: Add visitor functions for enum_decl Jaskaran Singh
2020-03-08  8:43 ` [Cocci] [PATCH 07/13] parsing_cocci: Reflect visitor_ast0 changes in parsing_cocci Jaskaran Singh
2020-03-08  8:43 ` [Cocci] [PATCH 08/13] parsing_cocci: Add visitor functions for enum_decl in visitor_ast Jaskaran Singh
2020-03-08  8:43 ` [Cocci] [PATCH 09/13] cocci: Reflect changes in SmPL visitor_ast in codebase Jaskaran Singh
2020-03-08  8:43 ` [Cocci] [PATCH 10/13] engine: cocci_vs_c: Match enumerators properly as per enum_decl Jaskaran Singh
2020-03-08  8:43 ` [Cocci] [PATCH 11/13] cocci: pretty print EnumDef as per enum_decl type Jaskaran Singh
2020-03-08  8:43 ` [Cocci] [PATCH 12/13] tests: Add test case for assigned enumerator Jaskaran Singh
2020-03-08  8:43 ` [Cocci] [PATCH 13/13] tools: spgen: Reflect visitor changes Jaskaran Singh
2020-03-09 14:15 ` [Cocci] [PATCH 00/13] cocci: Align the C AST and SmPL AST for enum Julia Lawall
2020-03-09 14:51   ` Jaskaran Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200308084356.14506-3-jaskaransingh7654321@gmail.com \
    --to=jaskaransingh7654321@gmail.com \
    --cc=cocci@systeme.lip6.fr \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).