Richard Jelinek wrote:
> 
> On Fri, Jun 13, 2003 at 01:33:58PM -0700, Ron D. Smith wrote:

> But still I don't get why a
> 
> rule:   prod1
>       | prod1 and something
> 
> won't work. Why always the longest prefix productions have to stand
> first. I even suspect a flaw in the docs as when the parser encounters
> an input string that'd match "prod1 and something" it should fail with
> prod1 and try the second production. In fact it doesn't it throws the
> complete rule away after failing the first production and simply
> states, that input string could not be parsed.
> 
> That bothers me from a pedantic point of view.

bear in mind that p::rd is not a "greedy" parser like something
   you might build with lex/yacc.
order is important because it won't do them all and pick the one that
   consumes the maximal amount of the input text.
i.e. it will, like your kids (or mine at least :-), quit just as soon
   as it's done the minimum it can to get by according to what you've
   specified.
hwn

Reply via email to