summaryrefslogtreecommitdiff
path: root/source4/build/pidl/idl.yp
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-07-19 23:34:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:29:45 -0500
commitd5b7249ddd771e8c310c8248456b5a16b3cdbdfa (patch)
tree25f41408dc0665b4bb82f568aeeca1778742018b /source4/build/pidl/idl.yp
parentf3a10494db3fe45b73f261b6f53cf43f041ce4ed (diff)
downloadsamba-d5b7249ddd771e8c310c8248456b5a16b3cdbdfa.tar.gz
samba-d5b7249ddd771e8c310c8248456b5a16b3cdbdfa.tar.bz2
samba-d5b7249ddd771e8c310c8248456b5a16b3cdbdfa.zip
r8622: Support parsing new structs/unions/enums/bitmaps without typedef in
(This used to be commit cd33b5efc544345411db498b178fa532a9a2c82f)
Diffstat (limited to 'source4/build/pidl/idl.yp')
-rw-r--r--source4/build/pidl/idl.yp40
1 files changed, 26 insertions, 14 deletions
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
;