在gram.c 中,有一行:#define yyparse base_yyparse
看gram.y 中,与此对应的是: %name-prefix="base_yy"
而看 bison 的 manual:
http://www.gnu.org/software/bison/manual/html_node/Parser-Function.html
4.1 The Parser Function yyparse
You call the function yyparse to cause parsing to occur. This function reads tokens, executes actions, and ultimately returns when it encounters end-of-input or an unrecoverable syntax error. You can also write an action which directs yyparse to return immediately without reading further.
— Function: int yyparse (void)
The value returned by yyparse is 0 if parsing was successful (return is due to end-of-input).
The value is 1 if parsing failed because of invalid input, i.e., input that contains a syntax error or that causes YYABORT to be invoked.
The value is 2 if parsing failed due to memory exhaustion.
本文转自健哥的数据花园博客园博客,原文链接:http://www.cnblogs.com/gaojian/archive/2012/09/12/2681178.html,如需转载请自行联系原作者