From d5b7249ddd771e8c310c8248456b5a16b3cdbdfa Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 19 Jul 2005 23:34:02 +0000 Subject: r8622: Support parsing new structs/unions/enums/bitmaps without typedef in (This used to be commit cd33b5efc544345411db498b178fa532a9a2c82f) --- source4/build/pidl/idl.yp | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) (limited to 'source4/build/pidl/idl.yp') diff --git a/source4/build/pidl/idl.yp b/source4/build/pidl/idl.yp index 0e505b81fb..23403fbef4 100644 --- a/source4/build/pidl/idl.yp +++ b/source4/build/pidl/idl.yp @@ -59,7 +59,7 @@ definitions: ; -definition: function | const | typedef | declare +definition: function | const | typedef | declare | typedecl ; const: 'const' identifier identifier '=' anytext ';' @@ -134,15 +134,19 @@ typedef: 'typedef' property_list type identifier array_len ';' }} ; -type: struct | union | enum | bitmap | identifier +usertype: struct | union | enum | bitmap; + +typedecl: usertype ';' { $_[1] }; + +type: usertype | identifier | void { "void" } ; - -enum: 'enum' '{' enum_elements '}' +enum: 'enum' optional_identifier '{' enum_elements '}' {{ "TYPE" => "ENUM", - "ELEMENTS" => $_[3] + "NAME" => $_[2], + "ELEMENTS" => $_[4] }} ; @@ -155,10 +159,11 @@ enum_element: identifier | identifier '=' anytext { "$_[1]$_[2]$_[3]" } ; -bitmap: 'bitmap' '{' bitmap_elements '}' +bitmap: 'bitmap' optional_identifier '{' bitmap_elements '}' {{ - "TYPE" => "BITMAP", - "ELEMENTS" => $_[3] + "TYPE" => "BITMAP", + "NAME" => $_[2], + "ELEMENTS" => $_[4] }} ; @@ -170,10 +175,11 @@ bitmap_elements: bitmap_element: identifier '=' anytext { "$_[1] ( $_[3] )" } ; -struct: 'struct' '{' element_list1 '}' +struct: 'struct' optional_identifier '{' element_list1 '}' {{ - "TYPE" => "STRUCT", - "ELEMENTS" => $_[3] + "TYPE" => "STRUCT", + "NAME" => $_[2], + "ELEMENTS" => $_[4] }} ; @@ -200,10 +206,11 @@ union_elements: | union_elements optional_base_element { push(@{$_[1]}, $_[2]); $_[1] } ; -union: 'union' '{' union_elements '}' +union: 'union' optional_identifier '{' union_elements '}' {{ - "TYPE" => "UNION", - "ELEMENTS" => $_[3] + "TYPE" => "UNION", + "NAME" => $_[2], + "ELEMENTS" => $_[4] }} ; @@ -288,6 +295,11 @@ anytext: #empty identifier: IDENTIFIER ; +optional_identifier: + IDENTIFIER + | #empty { undef } +; + constant: CONSTANT ; -- cgit