Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Converting BNF for use in Parse::RecDescent

by hanenkamp (Pilgrim)
on Nov 01, 2003 at 17:23 UTC ( [id://303818]=note: print w/replies, xml ) Need Help??


in reply to Converting BNF for use in Parse::RecDescent

You might want to read the GOTCHAs section of Parse::Recdescent too. It has a formula for guaranteeing that either the whole thing parses, or nothing at all parses--assuming that the input string should be completely parsed. Anyway, if added to your code, you could add these two productions like this so that where is the new toplevel production:

where : condition eofile eofile : /^\Z/

If you don't need to parse the whole input, you could make eofile an appropriate end marker for the parsed input. Adding <error> directives in the right places in your other productions may also help.

Log In?
Username:
Password:

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

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

    No recent polls found