[vox-tech] how to get yacc/bison to say "i'm confused"

Takashi Ishihara vox-tech@lists.lugod.org
Thu, 27 Dec 2001 12:40:01 -0800


> i have a rule like:
> 
> 	(snip)
> 	WORD    { ParseError($1); }
> 	;

then WORD is now a part of the grammer, which you don't want.
Try:
0. make sure the grammer is correct, and get rid of shift/reduce
   or red/red conflicts (by adding pref, etc).
1. use yyerror()
2. build a parse tree first (just parse, no evaluation).
   After the completion of the build, evaluate it. 

If you have a time, read the dragon book by aho.

t