Note that you dont _have_ to use startrule.

You can use the name of the rule you wish to start with.

Have a second look at Damians example.

Yves

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 26 June 2002 19:19
> To: [EMAIL PROTECTED]
> Subject: RE: Line contination characters - how do I access these
> variables - SUMMARY
> 
> 
> 
> > This leads to my next question. Since the returned hash 
> does not have a
> > name, how do I access it? Who is it returned to?
> 
> Thank to proding from Yves, I figured it out:
> 
> my $parser = Parse::RecDescent->new($grammar);
> 
> my $out = $parser->startrule( $text );
> # before I was calling the parser as:
> # $parser->startrule( $text );
> # I was not saving any of the information. 
> 
> # Nexted I used Dumper to figure out what format the data was in
> print Dumper($out);
> 
> # I found out it was an array and was able to access the hash
> print "$out->[1]{comment} \n";
> print "$out->[2]{command} \n";
> 
> 
> Thanks again,
> 
> jr
> 

Reply via email to