+# the precedence actually doesn't matter at all for this grammer, but
+# by providing a precedence we reduce the number of conflicts
+# enormously
+%left '-' '+' '&' '|' '*' '>' '.' '/' '(' ')' '[' ',' ';'
+
+
################
# grammer
%%
element_list1:
#empty
- | base_element ';' { [ $_[1] ] }
| element_list1 base_element ';' { push(@{$_[1]}, $_[2]); $_[1] }
;
element_list2:
#empty
- | 'void'
- | base_element { [ $_[1] ] }
+ | 'void'
+ | base_element { [ $_[1] ] }
| element_list2 ',' base_element { push(@{$_[1]}, $_[3]); $_[1] }
;
array_len:
#empty
| '[' ']' { "*" }
- | '[' '*' ']' { "*" }
| '[' anytext ']' { "$_[2]" }
;
property_list:
- #empty
- | '[' properties ']' { $_[2] }
+ #empty
| property_list '[' properties ']' { util::FlattenArray([$_[1],$_[3]]); }
;
[ -d librpc/gen_ndr ] || mkdir -p librpc/gen_ndr || exit 1
-( cd build/pidl && make ) || exit 1
+if [ ! -f build/pidl/idl.pm -o build/pidl/idl.yp -nt build/pidl/idl.pm ]; then
+ echo Rebuilding IDL parser
+ ( cd build/pidl && make ) || exit 1;
+fi
PIDL="build/pidl/pidl.pl --output librpc/gen_ndr/ndr_ --parse --header --parser"
TABLES="build/pidl/tables.pl --output librpc/gen_ndr/tables"