in reply to Parse::RecDescent Grammar Questions

I think I understand what your question is. Does it have to do with this set of rules:
def: "cluster" name "(" Attr(s?) ")" | "system" name "(" Attr(s?) ")" Attr: AttrScalar(s?) | AttrKeyList(s?) | AttrAssociation(s?)
and do you really want the following:
def: "cluster" name "(" Attr(s?) ")" | "system" name "(" Attr(s?) ")" Attr: AttrScalar | AttrKeyList | AttrAssociation
Otherwise I wouldn't be surprised if the parser sees a reduce-reduce conflict.

Replies are listed 'Best First'.
Re^2: Parse::RecDescent Grammar Questions
by ikegami (Patriarch) on May 20, 2008 at 21:05 UTC
    Isn't the expression "reduce-reduce conflict" exclusive to LR parsers? P::RD is a LL parser.
      Yeah, you're probably right. In this case Parse::RecDescent probably resolves it by choosing one without informing you that there are other options - just my guess, though.

        It always tries them in order until one succeeds. If none do, it backtracks.

        In this case, the first one always succeeds (seeing as it can match zero items).