1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

* reduced the number of grammer conflicts a lot using (arbitrary)

precedence rules

 * build a standalone parser. When we come to distributing Samba4 we
   can just include idl.pm and other developers won't need Parse::Yapp
   installed

 * avoid the recursive make in most cases in build_idl.sh
(This used to be commit be2c2be459)
This commit is contained in:
Andrew Tridgell 2003-12-08 02:24:40 +00:00
parent daeffe3f11
commit 58714e6bda
3 changed files with 14 additions and 8 deletions

View File

@ -1,5 +1,5 @@
idl.pm: idl.yp
yapp idl.yp
yapp -s idl.yp
clean:
rm -f idl.pm

View File

@ -5,6 +5,12 @@
# 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
%%
@ -166,28 +172,25 @@ pointers:
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]]); }
;

View File

@ -4,7 +4,10 @@ FULLBUILD=$1
[ -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"