linux454 has asked for the wisdom of the Perl Monks concerning the following question:
SomeName val1 val2 "this is val3" NoValDefaultsTo1
I want to match the SomeName with one rule, and then
match each of the whitespace separated values separately.
(i.e. (val1, val2, "this is val3") )
Here is my grammar:
Note: I know that the val terminal is not complete for what I'm trying to do.single: key val(s) { [$item[1], $item[2]] } | key { [$item[1],1] } key: /\w+/ val: <perl_quotelike> { $item[1]->[2] }
My problem is, If I don't use the <perl_quotelike> directive,
(i.e. /.*?$/) then it grabs NoValDefaultsTo1 as a val of
SomeName instead of a key.
I am very new to PRD, any help/advise is greatly appreciated.
Thanks, MG
Update:
P.S.
Could someone explain the difference between <leftop> and <rightop>
I couldn't find this anywhere.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Parse::RecDescent question
by merlyn (Sage) on Dec 12, 2003 at 15:24 UTC | |
by linux454 (Pilgrim) on Dec 12, 2003 at 16:29 UTC | |
by linux454 (Pilgrim) on Dec 12, 2003 at 20:40 UTC | |
|
Re: Parse::RecDescent question
by Abigail-II (Bishop) on Dec 12, 2003 at 15:33 UTC |