Author: tpot
Date: 2005-08-02 16:06:35 +0000 (Tue, 02 Aug 2005)
New Revision: 8919

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=8919

Log:
Return references to structs and unions in parse tree.  Fill in type
names for structs and unions also.

Modified:
   branches/SAMBA_4_0/source/build/pidl/smb_interfaces.yp


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/smb_interfaces.yp
===================================================================
--- branches/SAMBA_4_0/source/build/pidl/smb_interfaces.yp      2005-08-02 
14:58:59 UTC (rev 8918)
+++ branches/SAMBA_4_0/source/build/pidl/smb_interfaces.yp      2005-08-02 
16:06:35 UTC (rev 8919)
@@ -27,7 +27,7 @@
                my $name = defined($_[2]) ? $_[2] : $_[7];
                {
                        "NAME" => $name,
-                       "TYPE" => "STRUCT",
+                       "TYPE" => "struct",
                        "DATA" => $_[4],
                }
        }
@@ -39,7 +39,7 @@
                my $name = defined($_[2]) ? $_[2] : $_[7];
                {
                        "NAME" => $name,
-                       "TYPE" => "UNION",
+                       "TYPE" => "union",
                        "DATA" => $_[4],
                }
        }
@@ -69,19 +69,29 @@
        | 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 @@
 
 type: IDENTIFIER
        | ENUM IDENTIFIER
+               { "enum $_[2]" }
 ;
 
 pointers: 

Reply via email to