From aca94b5ff20067472482f64c8ee9d3f0962bf054 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 5 Jan 2005 15:26:48 +0000 Subject: r4533: parsing support for: typedef [bitmap16bit] bitmap { FLAG1 = 0x0001, FLAG2 = 0x8000 } fooflags; metze (This used to be commit 192f2495468d5d0c5889d94ca791aa8f371514e8) --- source4/build/pidl/idl.yp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'source4/build') diff --git a/source4/build/pidl/idl.yp b/source4/build/pidl/idl.yp index be152c5475..f77062adf6 100644 --- a/source4/build/pidl/idl.yp +++ b/source4/build/pidl/idl.yp @@ -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); -- cgit