|Help with Yacc++ ? firstname.lastname@example.org (1992-02-11)|
|Re: Help with Yacc++ ? email@example.com (1992-02-12)|
|From:||firstname.lastname@example.org (Mark A Biggar)|
|Organization:||Loral Western Development Labs|
|Date:||Wed, 12 Feb 1992 17:27:52 GMT|
In article 92-02-048 email@example.com writes:
>I am having trouble with yacc++, an object oriented version of yacc put
>out by a company called Compiler Resources. ...
>I have a grammar
>S: E ;
>E: Id | -E | E-E | E E ;
>Can someone please tell me why yacc [LALR(1)] accepts this but
>yacc++ [LR(1)] doesn't.
Lets split you grammer up into separate productions like so:
S: E; (1)
E: id; (2)
E: -E; (3)
E: E-E; (4)
E: E E; (5)
What yacc++ is saying is that the input id-id-id is ambigious,
When it sees the second - it can't tell if it should reduce using
production (3) or (4).
Return to the
Search the comp.compilers archives again.