Le 1 nov. 2013 à 14:36, Mark Hounschell <ma...@compro.net> a écrit :
> # make > ./translate5 cpu.def > cat yacc1.yinit yacctoks yacc2.yinit yaccrules yacc3.yinit > yacc.in > yacc -d yacc.in > cat lex1.linit lextext lexfield lex2.linit > lex.in > flex -l lex.in > gcc -ansi -w y.tab.c -o cpu.asm -lgcc > yacc.in: In function ëyyparseí: > yacc.in:2322:3: error: unknown type name ëBEGINí BEGIN is something expected in a lex file, not in a Yacc file. This is fishy. > case 207: > # line 2305 "yacc.in" > { if (yychar != -1) { > yyclearin; > while (yyleng > 0) { > unput(yytext[--yyleng]); }} > BEGIN ctxn;} break; It looks like your Yacc parser is trying to influence your lex scanner. In a properly designed scanner/parser couple, you should never see things such as "BEGIN" or "unput" in the parser: that's the scanner's job only. Either be brave and change all this, or maybe there is a way out, I don't know, by trying to #include the whole scanner in the yacc file. In either case, expect pain :( _______________________________________________ help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison