in reply to Regexp::Common inside Parse::RecDescent
You'll have to have the use inside the parser code, i.e. in the generated code. This means you should use a start-up action since the first thing to do when the parser starts is to load the module. Try this for the grammar:
See Parse::RecDescent's POD under 'Start-up actions' for details.my $g = q( { use Regexp::Common qw(URI); } CommentLine: '#' /.*/ {{comment=>$item[2]}} UriLine: 'u=' /$RE{URI}{HTTP}/ {{uri => $item[2]}} Line: CommentLine | UriLine {$item[1]} );
IMHO, the grammar should definitely be in single quotes since it should not be interpolated in contrast with what Abigail-II says.
Hope this helps, -gjb-
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regexp::Common inside Parse::RecDescent
by demerphq (Chancellor) on Aug 21, 2003 at 17:49 UTC | |
by Anonymous Monk on Aug 23, 2003 at 17:46 UTC |