54 |
|
|
55 |
# b4_lex_param |
# b4_lex_param |
56 |
# ------------ |
# ------------ |
57 |
# Accumule in b4_lex_param all the yylex arguments. |
# Accumulate in b4_lex_param all the yylex arguments. |
58 |
# b4_lex_param arrives quoted twice, but we want to keep only one level. |
# b4_lex_param arrives quoted twice, but we want to keep only one level. |
59 |
m4_define([b4_lex_param], |
m4_define([b4_lex_param], |
60 |
m4_dquote(b4_pure_if([[[[YYSTYPE *]], [[&yylval]]][]dnl |
m4_dquote(b4_pure_if([[[[YYSTYPE *]], [[&yylval]]][]dnl |
767 |
[[ /* The location stack. */ |
[[ /* The location stack. */ |
768 |
YYLTYPE yylsa[YYINITDEPTH]; |
YYLTYPE yylsa[YYINITDEPTH]; |
769 |
YYLTYPE *yyls = yylsa; |
YYLTYPE *yyls = yylsa; |
770 |
YYLTYPE *yylsp;]])[ |
YYLTYPE *yylsp; |
771 |
|
YYLTYPE *yylerrsp;]])[ |
772 |
|
|
773 |
#define YYPOPSTACK (yyvsp--, yyssp--]b4_location_if([, yylsp--])[) |
#define YYPOPSTACK (yyvsp--, yyssp--]b4_location_if([, yylsp--])[) |
774 |
|
|
1073 |
yyerror (]b4_yyerror_args["syntax error"); |
yyerror (]b4_yyerror_args["syntax error"); |
1074 |
} |
} |
1075 |
|
|
1076 |
|
]b4_location_if([ yylerrsp = yylsp;])[ |
1077 |
|
|
1078 |
if (yyerrstatus == 3) |
if (yyerrstatus == 3) |
1079 |
{ |
{ |
1080 |
/* If just tried and failed to reuse lookahead token after an |
/* If just tried and failed to reuse lookahead token after an |
1098 |
YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); |
YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); |
1099 |
yydestruct (yytoken, &yylval]b4_location_if([, &yylloc])[); |
yydestruct (yytoken, &yylval]b4_location_if([, &yylloc])[); |
1100 |
yychar = YYEMPTY; |
yychar = YYEMPTY; |
1101 |
|
]b4_location_if([ *++yylerrsp = yylloc;])[ |
1102 |
} |
} |
1103 |
|
|
1104 |
/* Else will try to reuse lookahead token after shifting the error |
/* Else will try to reuse lookahead token after shifting the error |
1105 |
token. */ |
token. */ |
1106 |
goto yyerrlab1; |
goto yyerrlab2; |
1107 |
|
|
1108 |
|
|
1109 |
/*----------------------------------------------------. |
/*----------------------------------------------------. |
1110 |
| yyerrlab1 -- error raised explicitly by an action. | |
| yyerrlab1 -- error raised explicitly by an action. | |
1111 |
`----------------------------------------------------*/ |
`----------------------------------------------------*/ |
1112 |
yyerrlab1: |
yyerrlab1: |
1113 |
|
|
1114 |
|
/* Suppress GCC warning that yyerrlab1 is unused when no action |
1115 |
|
invokes YYERROR. */ |
1116 |
|
#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) |
1117 |
|
__attribute__ ((__unused__)) |
1118 |
|
#endif |
1119 |
|
|
1120 |
|
]b4_location_if([ yylerrsp = yylsp; |
1121 |
|
*++yylerrsp = yyloc;])[ |
1122 |
|
goto yyerrlab2; |
1123 |
|
|
1124 |
|
|
1125 |
|
/*---------------------------------------------------------------. |
1126 |
|
| yyerrlab2 -- pop states until the error token can be shifted. | |
1127 |
|
`---------------------------------------------------------------*/ |
1128 |
|
yyerrlab2: |
1129 |
yyerrstatus = 3; /* Each real token shifted decrements this. */ |
yyerrstatus = 3; /* Each real token shifted decrements this. */ |
1130 |
|
|
1131 |
for (;;) |
for (;;) |
1160 |
YYDPRINTF ((stderr, "Shifting error token, ")); |
YYDPRINTF ((stderr, "Shifting error token, ")); |
1161 |
|
|
1162 |
*++yyvsp = yylval; |
*++yyvsp = yylval; |
1163 |
]b4_location_if([ *++yylsp = yylloc;])[ |
]b4_location_if([ YYLLOC_DEFAULT (yyloc, yylsp, (yylerrsp - yylsp)); |
1164 |
|
*++yylsp = yyloc;])[ |
1165 |
|
|
1166 |
yystate = yyn; |
yystate = yyn; |
1167 |
goto yynewstate; |
goto yynewstate; |