Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Parse::RecDescent eats large part of grammar, thinking it to be implicit subrule

by castaway (Parson)
on Jan 22, 2003 at 10:00 UTC ( [id://228981]=note: print w/replies, xml ) Need Help??


in reply to Parse::RecDescent eats large part of grammar, thinking it to be implicit subrule

I tink that P::RD is getting confused with your very first line:
command: ( oops /\s+/ word { "(oops '$item[2])" }
I also had some problems doing "( rule | rule2 | rule3 ) rule4", I'd suggest trying splitting it up:
command: subcommand ...!/\S/ subcommand: oops {action} | np {action} | ..
BTW, you don't need to explicitly say that commands/words has any number of spaces between them, the parser assumes that anyway. (At least, mine did :)

C.

Replies are listed 'Best First'.
Re: Re: Parse::RecDescent eats large part of grammar, thinking it to be implicit subrule
by premchai21 (Curate) on Jan 23, 2003 at 01:24 UTC

    In response to making the subrule explicit: I'll try that, thank you.

    In response to your other suggestion: yes, whitespace will be skipped, but I want to force it to only match when there is at least one space in between. However, me being stupid, I did not notice that the default is not + but *; using + instead would probably do what I want.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-25 20:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found