Help with Yacc++ ?

nick@manasys.co.nz
Tue, 11 Feb 1992 02:04:22 GMT

          From comp.compilers

Related articles
Help with Yacc++ ? nick@manasys.co.nz (1992-02-11)
Re: Help with Yacc++ ? mab@wdl39.wdl.loral.com (1992-02-12)
| List of all articles for this month |
Newsgroups: comp.compilers
From: nick@manasys.co.nz
Keywords: yacc, question
Organization: Computer Science Dept. University of Auckland
Date: Tue, 11 Feb 1992 02:04:22 GMT

I am having trouble with yacc++, an object oriented version of yacc put
out by a company called Compiler Resources. Does anyone out there use it?
Here is my problem:


I have a grammar
S: E ;
E: Id | -E | E-E | E E ;


This grammar is not accepted by yacc++. It says that with a lookahead of
"-" there are two productions which both reduce to E from a state.
However, when I put it through yacc it only gives shift/reduce errors.
Ha??? How can this be? I don't understand. Can someone please tell me why
yacc [LALR(1)] accepts this but yacc++ [LR(1)] doesn't.


Please reply by e-mail to me at
nick@manasys.co.nz
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.