r4533: parsing support for:
authorStefan Metzmacher <metze@samba.org>
Wed, 5 Jan 2005 15:26:48 +0000 (15:26 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:08:19 +0000 (13:08 -0500)
typedef [bitmap16bit] bitmap {
FLAG1 = 0x0001,
FLAG2 = 0x8000
} fooflags;

metze
(This used to be commit 192f2495468d5d0c5889d94ca791aa8f371514e8)

source4/build/pidl/idl.yp

index be152c5475a1c71621d8b30ab2ed13538cdfb595..f77062adf640322c78cabfaf011e33c20222dc89 100644 (file)
@@ -16,7 +16,7 @@
 %%
 idl: 
        #empty  { {} }
-    | idl interface { push(@{$_[1]}, $_[2]); $_[1] }
+       | idl interface { push(@{$_[1]}, $_[2]); $_[1] }
        | idl coclass { push(@{$_[1]}, $_[2]); $_[1] }
 ;
 
@@ -96,7 +96,7 @@ typedef: 'typedef' property_list type identifier array_len ';'
         }}
 ;
 
-type:   struct | union | enum | identifier 
+type:   struct | union | enum | bitmap | identifier 
        | void { "void" }
 ;
 
@@ -117,6 +117,21 @@ enum_element: identifier
              | identifier '=' anytext { "$_[1]$_[2]$_[3]" }
 ;
 
+bitmap: 'bitmap' '{' bitmap_elements '}' 
+        {{
+                     "TYPE" => "BITMAP", 
+                    "ELEMENTS" => $_[3]
+        }}
+;
+
+bitmap_elements: 
+      bitmap_element                    { [ $_[1] ] }            
+    | bitmap_elements ',' bitmap_element  { push(@{$_[1]}, $_[3]); $_[1] }
+;
+
+bitmap_element: identifier '=' anytext { "$_[1] ( $_[3] )" }
+;
+
 struct: 'struct' '{' element_list1 '}' 
         {{
                      "TYPE" => "STRUCT", 
@@ -313,7 +328,7 @@ again:
                        $parser->YYData->{LAST_TOKEN} = $1;
                        if ($1 =~ 
                            /^(coclass|interface|const|typedef|union
-                             |struct|enum|void|case|default)$/x) {
+                             |struct|enum|bitmap|void|case|default)$/x) {
                                return $1;
                        }
                        return('IDENTIFIER',$1);