modular parsers (continue)

[email protected] (Terrence Brannon)
Newsgroups perl.recdescent
Message-ID <[email protected]>
Marcel, this example may give you some ideas on how to implement P::RD 
modular parsers:

use strict;
use Parse::RecDescent;

$::RD_ERRORS = 1;
$::RD_WARN = 1;
$::RD_HINT = 1;

our $text_to_parse = "";

my $grammar1 = q{
[...]
}

our $inner_parser = new Parse::RecDescent($grammar1);

my $grammar2 = q{
[...]

rule: TEXT
         {
           $text_to_parse = $item{TEXT};
           if (defined $text_to_parse) { print "executing inner 
parse...\n"; }
           my $p_text = $inner_parser->startrule($text_to_parse);
         }

[...]

}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.