summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-12-08 02:24:40 +0000
committerAndrew Tridgell <tridge@samba.org>2003-12-08 02:24:40 +0000
commit58714e6bda5c12388119cba8688c7cd7140ce85f (patch)
tree9713af088a3cf1f48dca834aa8baed1b39036f5f /source4
parentdaeffe3f11f4cf2eabb7ab101e0597de005aa165 (diff)
downloadsamba-58714e6bda5c12388119cba8688c7cd7140ce85f.tar.gz
samba-58714e6bda5c12388119cba8688c7cd7140ce85f.tar.bz2
samba-58714e6bda5c12388119cba8688c7cd7140ce85f.zip
* 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 be2c2be459d1bed41c113590e70711cb89ad12b9)
Diffstat (limited to 'source4')
-rw-r--r--source4/build/pidl/Makefile2
-rw-r--r--source4/build/pidl/idl.yp15
-rwxr-xr-xsource4/script/build_idl.sh5
3 files changed, 14 insertions, 8 deletions
diff --git a/source4/build/pidl/Makefile b/source4/build/pidl/Makefile
index 76229ac925..e2cc7be3eb 100644
--- a/source4/build/pidl/Makefile
+++ b/source4/build/pidl/Makefile
@@ -1,5 +1,5 @@
idl.pm: idl.yp
- yapp idl.yp
+ yapp -s idl.yp
clean:
rm -f idl.pm
diff --git a/source4/build/pidl/idl.yp b/source4/build/pidl/idl.yp
index 13f9b05df4..b38104fa02 100644
--- a/source4/build/pidl/idl.yp
+++ b/source4/build/pidl/idl.yp
@@ -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]]); }
;
diff --git a/source4/script/build_idl.sh b/source4/script/build_idl.sh
index 8c04db6f37..c9594f8a80 100755
--- a/source4/script/build_idl.sh
+++ b/source4/script/build_idl.sh
@@ -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"