diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-11-22 22:09:10 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-11-22 22:09:10 +0000 |
commit | e79e6bc4726dc96d553e245e34e94e39de7c2da3 (patch) | |
tree | 7f30f01f8f4223795f7daa5e35723c11155b2d95 /source4/build/pidl/idl.gram | |
parent | 277322b9d4b9d009782f1a47baf09ee4033c8328 (diff) | |
download | samba-e79e6bc4726dc96d553e245e34e94e39de7c2da3.tar.gz samba-e79e6bc4726dc96d553e245e34e94e39de7c2da3.tar.bz2 samba-e79e6bc4726dc96d553e245e34e94e39de7c2da3.zip |
added support for 'const' in IDL files. This makes it easy to define
symbolic names for bitfields etc.
(This used to be commit 344a6e1682cc1afab24735e73d05cf15f6eb9816)
Diffstat (limited to 'source4/build/pidl/idl.gram')
-rw-r--r-- | source4/build/pidl/idl.gram | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source4/build/pidl/idl.gram b/source4/build/pidl/idl.gram index ac373a5260..70d1c36b5e 100644 --- a/source4/build/pidl/idl.gram +++ b/source4/build/pidl/idl.gram @@ -28,6 +28,16 @@ interface: 'interface' <commit> identifier '{' definition(s?) '}' definition : cpp_prefix | typedef { $item[1] } | function { $item[1] } + | const { $item[1] } + +const : 'const' <commit> identifier identifier '=' constant ';' + {{ + "TYPE" => "CONST", + "DTYPE" => $item[3], + "NAME" => $item[4], + "VALUE" => $item{constant} + }} + | <error?> typedef : 'typedef' <commit> type identifier array_len(?) ';' {{ @@ -165,7 +175,7 @@ anytext: text2 '(' <commit> anytext ')' anytext call: expression '(' <commit> expression ')' {{ "$item[1]($item[4])" }} -constant: /-?\d+/ +constant: /-?[\dx]+/ | '*' cpp_prefix: '#' /.*/ |