X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/f2b30bdf3713e6fa9fafd0fc6caed68e38248ebc..c981ce9b2b825d09920e70ffe5a5045f13b6341f:/data/lalr1.cc diff --git a/data/lalr1.cc b/data/lalr1.cc index 36c8d581..ac2fa35b 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -147,6 +147,7 @@ dnl FIXME: This is wrong, we want computed header guards. ]b4_percent_code_get([[requires]])[ ]b4_parse_assert_if([#include ])[ +#include #include #include #include "stack.hh" @@ -668,7 +669,7 @@ b4_percent_code_get[]dnl inline bool ]b4_parser_class_name[::yy_table_value_is_error_ (int yyvalue) { - return yyvalue == 0 || yyvalue == yytable_ninf_; + return yyvalue == yytable_ninf_; } int @@ -814,12 +815,21 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[ // Perform the reduction. YY_REDUCE_PRINT (yyn); - switch (yyn) + try + { + switch (yyn) { ]b4_user_actions[ default: break; } + } + catch (const syntax_error& yyexc) + { + error (]b4_args(b4_locations_if([yyexc.location]), + [[yyexc.what()]])[); + YYERROR; + } YY_SYMBOL_PRINT ("-> $$ =", yylhs); ]b4_variant_if([[ // Destroy the rhs symbols.