Re: [作业] 请问compiler中error的问题

楼主: sophialiege (with friends)   2007-05-28 22:58:01
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 档
作者: hahasouliu (微积分爆炸啦!!!)   2007-05-28 23:33:00
感谢~~

Links booklink

Contact Us: admin [ a t ] ucptt.com