- for (;;)
- {
- yyn = yypact_[yystate];
- if (yyn != yypact_ninf_)
- {
- yyn += yyterror_;
- if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
- {
- yyn = yytable_[yyn];
- if (0 < yyn)
- break;
- }
- }
-
- // Pop the current state because it cannot handle the error token.
- if (yystack_.size () == 1)
- YYABORT;
-
- yyerror_range[0].location = yystack_[0].location;
- yydestruct_ ("Error: popping",
- yystos_[yystate],
- yystack_[0].value, yystack_[0].location);
- yypop_ ();
- yystate = yystack_[0].state;
- YY_STACK_PRINT ();
- }
-
- yyerror_range[1].location = yylloc;
- // Using YYLLOC is tempting, but would change the location of
- // the lookahead. YYLOC is available though.
- YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
-
- /* Shift the error token. */
- yystate = yyn;
- yypush_ ("Shifting", yystate, yylval, yyloc);
+ // Pop the current state because it cannot handle the error token.
+ if (yystack_.size () == 1)
+ YYABORT;
+
+ yyerror_range[0].location = yystack_[0].location;
+ yydestruct_ ("Error: popping",
+ yystos_[yystate],
+ yystack_[0].value, yystack_[0].location);
+ yypop_ ();
+ yystate = yystack_[0].state;
+ YY_STACK_PRINT ();
+ }
+
+ yyerror_range[1].location = yylloc;
+ YYLLOC_DEFAULT (error_token.location, (yyerror_range - 1), 2);
+
+ /* Shift the error token. */
+ yystate = yyn;
+ yypush_ ("Shifting", yystate, error_token.value, error_token.location);
+ }