+ /* Error raised explicitly by an action. */
+ yyerrlab1:
+ if (errstatus == 3)
+ {
+ /* If just tried and failed to reuse lookahead token after an
+ error, discard it. */
+
+ /* Return failure if at end of input. */
+ if (looka == eof_)
+ goto yyabortlab;
+ YYDPRINTF ((stderr, "Discarding token %d (%s).\n", looka, name_[[ilooka]]));
+ looka = empty_;
+ }
+
+ /* Else will try to reuse lookahead token after shifting the error
+ token. */
+
+ errstatus = 3;
+ goto yyerrhandle;
+
+ /* Pop the current state because it cannot handle the error token. */
+ yyerrdefault:
+ yyerrpop:
+ if (!state_stack.height ())
+ goto yyabortlab;
+ state = (state_stack.pop (), state_stack[[0]]);
+ semantic_stack.pop ();
+ location_stack.pop ();;
+
+#if YYDEBUG
+ if (debug_)
+ {
+ YYFPRINTF (stderr, "Error: state stack now");
+ for (StateStack::ConstIterator i = state_stack.begin ();
+ i != state_stack.end (); ++i)
+ YYFPRINTF (stderr, " %d", *i);
+ YYFPRINTF (stderr, "\n");
+ }
+#endif
+
+ yyerrhandle:
+ n = pact_[[state]];
+ if (n == b4_flag)
+ goto yyerrdefault;
+
+ n += terror_;
+ if (n < 0 || n > b4_last || check_[[n]] != terror_)
+ goto yyerrdefault;
+
+ n = table_[[n]];
+ if (n < 0)
+ {
+ if (n == b4_flag)
+ goto yyerrpop;
+ n = -n;
+ goto yyreduce;
+ }
+ else if (!n)
+ goto yyerrpop;
+
+ if (n == b4_final)
+ goto yyacceptlab;
+
+ YYDPRINTF ((stderr, "Shifting error token, "));
+
+ semantic_stack.push (value);
+ location_stack.push (location);
+
+ state = n;
+ goto yynewstate;
+