Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Why won't this basic Parse::RecDescent example work?

by 7stud (Deacon)
on Jan 28, 2013 at 04:23 UTC ( #1015626=note: print w/ replies, xml ) Need Help??


in reply to Why won't this basic Parse::RecDescent example work?

Another variation that doesn't produce the expected output:

our %HASH; my $grammar = <<'END_OF_GRAMMAR'; startrule : from_clause from_clause : 'from' dir(s) { print "-->$item{dir}<--\n"; } dir : "hello" | "world" END_OF_GRAMMAR my $parser = Parse::RecDescent->new($grammar); $parser->startrule("from hello world"); use Data::Dumper; say Dumper(\%HASH); --output:-- --><-- $VAR1 = {};
Expected output:
-->SOMETHING<-- $VAR1 = { "dirs" => "SOMETHING"; };


Comment on Re: Why won't this basic Parse::RecDescent example work?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1015626]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2015-07-29 06:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls