r8919: Return references to structs and unions in parse tree. Fill in type
authorTim Potter <tpot@samba.org>
Tue, 2 Aug 2005 16:06:35 +0000 (16:06 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:30:57 +0000 (13:30 -0500)
names for structs and unions also.
(This used to be commit c31be383461d8a2784aa85619b38f81a389024f2)

source4/build/pidl/smb_interfaces.yp

index 0281fad4c6038e782118b26c3069ba53332be4fb..b84ed1c1c159ff031fad344d35e72a0a3e596669 100644 (file)
@@ -27,7 +27,7 @@ struct: STRUCT optional_identifier '{' elements '}' pointers optional_identifier
                my $name = defined($_[2]) ? $_[2] : $_[7];
                {
                        "NAME" => $name,
-                       "TYPE" => "STRUCT",
+                       "TYPE" => "struct",
                        "DATA" => $_[4],
                }
        }
@@ -39,7 +39,7 @@ union:
                my $name = defined($_[2]) ? $_[2] : $_[7];
                {
                        "NAME" => $name,
-                       "TYPE" => "UNION",
+                       "TYPE" => "union",
                        "DATA" => $_[4],
                }
        }
@@ -69,19 +69,29 @@ element:
        | struct
        | union
        | STRUCT IDENTIFIER pointers IDENTIFIER ';'
+               {{
+                       "NAME" => $_[2],
+                       "POINTERS" => $_[3],
+                       "TYPE" => "struct $_[2]",
+               }}
        | UNION IDENTIFIER pointers IDENTIFIER ';'
+               {{
+                       "NAME" => $_[2],
+                       "POINTERS" => $_[3],
+                       "TYPE" => "union $_[2]",
+               }}
        | CONST type pointers IDENTIFIER array ';'
-             {{
+               {{
                           "NAME" => $_[4],
                           "TYPE" => $_[2],
                           "POINTERS" => $_[3],
-              }}
+               }}
        | type pointers IDENTIFIER array ';'
-             {{
+               {{
                           "NAME" => $_[3],
                           "TYPE" => $_[1],
                           "POINTERS" => $_[2],
-              }}
+               }}
 ;
 
 array: #empty
@@ -90,6 +100,7 @@ array: #empty
 
 type: IDENTIFIER
        | ENUM IDENTIFIER
+               { "enum $_[2]" }
 ;
 
 pointers: