diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-12-07 13:38:07 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-12-07 13:38:07 +0000 |
commit | 55d2c54e030c71e71a8b38d17b0e20a1b79517e7 (patch) | |
tree | 06f693e4014278e88bb55cd9cf075214cedfe773 /source4/build/pidl/pidl.pl | |
parent | e10859fd0a45b2415699334be2f0be8b1fd994b2 (diff) | |
download | samba-55d2c54e030c71e71a8b38d17b0e20a1b79517e7.tar.gz samba-55d2c54e030c71e71a8b38d17b0e20a1b79517e7.tar.bz2 samba-55d2c54e030c71e71a8b38d17b0e20a1b79517e7.zip |
re-wrote pidl to use Parse::Yapp instead of Parse::RecDescent, This
makes pidl about 3x faster, and also gives us much better error
reporting and a more standard grammer definition that will be much
easier to code in lex/yacc if we want to do so at a later
date. (Parse::Yapp uses essentially the same grammer file as lex/yacc)
It also means we no longer need Parse::RecDescent, which should make
pidl much more portable.
(This used to be commit 4bbaffeb44dca99ad8c0245beb1fddbe01557215)
Diffstat (limited to 'source4/build/pidl/pidl.pl')
-rwxr-xr-x | source4/build/pidl/pidl.pl | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/source4/build/pidl/pidl.pl b/source4/build/pidl/pidl.pl index 77b80d8bfd..4799389fc4 100755 --- a/source4/build/pidl/pidl.pl +++ b/source4/build/pidl/pidl.pl @@ -31,23 +31,14 @@ my($opt_eparser) = 0; my($opt_keep) = 0; my($opt_output); +my $idl_parser = new idl; + ##################################################################### # parse an IDL file returning a structure containing all the data sub IdlParse($) { - # this autoaction allows us to handle simple nodes without an action -# $::RD_TRACE = 1; - $::RD_AUTOACTION = q { - $#item==1 && ref($item[1]) eq "" ? - $item[1] : - "XX_" . $item[0] . "_XX[$#item]" }; - my($filename) = shift; - my($parser) = idl->new; - my($saved_sep) = $/; - - undef $/; - my($idl) = $parser->idl(`cpp $filename | grep -v '^#'`); - $/ = $saved_sep; + my $filename = shift; + my $idl = $idl_parser->parse_idl($filename); util::CleanData($idl); return $idl; } |