However, the following code does not work:use strict; use warnings; use Parse::RecDescent; my $grammar = q { start : character character character(s) {print "Found: ", $item[1], $item[2], join "", @{$item[3 +]}, "\n"; } character: /\w/ }; my $parser = Parse::RecDescent->new($grammar); defined $parser->start("ABCD") or die "didn't match";
And by "not work" it prints out "1111" instead of the sequence:use strict; use warnings; use Parse::RecDescent; my $grammar = q { start : character character character(s) {print "Found: ", $item[1], $item[2], join "", @{$item[3 +]}, "\n"; } character: /\w/ {print "Character: $item[1]\n"} }; my $parser = Parse::RecDescent->new($grammar); defined $parser->start("ABCD") or die "didn't match";
I sure that I am misunderstanding how RecDescent works. Can someone enlighten me? I'm using WinXP, the latest ActiveState perl, the latest RecDescent. BTW, this is a minor issue. But what's up with "chatterbox"? Why not use IRC like everyone else?Character: A Character: B Character: C Character: D Found: 1111
In reply to RecDescent help by ikaruga
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |