lines | lines error '\n' { yyerror(""); yyerrok;}
error 產生 yacc 自動 call 一次 yyerror
lines .... '\n' reduced 前 你又 call 一次 yyerror
所以就做了兩次
至於yyerrok請看
http://www.gnu.org/software/bison/manual/html_mono/bison.html
搜尋yyerrok
the statement yyerrok, a macro defined automatically by Bison;
its meaning is that error recovery is complete
建議: yyerror 放空, 什麼事都不要做
請看看 tinyC.tgz or tinyC++.tgz 的 system.cpp 檔