Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by graff (Chancellor)
on Jan 22, 2003 at 08:01 UTC ( [id://228964]=note: print w/replies, xml ) Need Help??


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

Perhaps it would help if you tried to give a brief description of what your grammar is supposed to handle. Apart from that, it looks like the initial part of your grammar goes wrong in the trace, and there are some likely suspects in the first rule:

  • there is a strandard single-quote character just before $item[2]
  • you're using curly braces, which I think are supposed to be used for bracketing snippets of perl code, but there is no perl code inside them
  • there are parens around a set of "|"-conjoined elements, then some other stuff ouside the parens, which may just be uninterpretable.

I'm already way over my head here -- to date, I've only looked at the PRD man page (I've never written code to use it), and have used lex/yacc only rarely, in a previous life, so one or more of the above items may be a false lead.

Have you arrived at this grammar via a series of preliminary and intermediate steps, building it up from pieces that you have tried successfully? Or have you just created the whole thing from scratch, without testing any single component by itself, and you're now trying to debug the whole thing at once?

Naturally, I'd recommend the former approach if you haven't tried it. Start with something small and constrained (but relevant) -- feed it with equally constrained input if that helps -- then build up incrementally; when you hit a snag, show us what you have, indicating which parts are known to be working, and what incremental piece introduced the snag.

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:46 UTC

    The single-quote character is part of a double-quoted string, the curly braces do have Perl code inside them, and the parens define an implicit subrule, which should be interpretable but apparently isn't. Thanks for taking a look anyway.

    As far as the intermediate steps, I created many subrules, then tested them individually first, which does approximately the same thing IINM.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-03-28 17:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found