X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/660bc8dd090bbdbcac3b3d01945aa4c515ed8041..69078d4b3bf695e94ea0c0a61740e524f829f50e:/data/bison.simple?ds=inline diff --git a/data/bison.simple b/data/bison.simple index 7a491feb..8b5eda87 100644 --- a/data/bison.simple +++ b/data/bison.simple @@ -175,6 +175,8 @@ m4_if(b4_prefix[], [yy], [], /* Copy the first part of user declarations. */ b4_pre_prologue +b4_token_defines(b4_tokens) + /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG b4_debug @@ -312,8 +314,6 @@ union yyalloc #endif -b4_token_defines(b4_tokens) - /* YYFINAL -- State number of the termination state. */ #define YYFINAL b4_final #define YYFLAG b4_flag @@ -362,7 +362,7 @@ static const b4_uint_type(b4_rline_max) yyrline[[]] = }; #endif -#if (YYDEBUG) || YYERROR_VERBOSE +#if YYDEBUG || YYERROR_VERBOSE /* YYTNME[[SYMBOL-NUM]] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[[]] = @@ -371,7 +371,8 @@ static const char *const yytname[[]] = }; #endif -/* YYTOKNUM[[YYN]] -- Index in YYTNAME corresponding to YYLEX. */ +/* YYTOKNUM[[YYLEX-NUM]] -- Internal token number corresponding to + token YYLEX-NUM. */ static const short yytoknum[[]] = { b4_toknum @@ -389,9 +390,9 @@ static const b4_uint_type(b4_r2_max) yyr2[[]] = b4_r2 }; -/* YYDEFACT[[S]] -- default rule to reduce with in state S when YYTABLE - doesn't specify something else to do. Zero means the default is an - error. */ +/* YYDEFACT[[STATE-NAME]] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ static const short yydefact[[]] = { b4_defact @@ -429,6 +430,14 @@ static const short yycheck[[]] = b4_check }; +#if YYDEBUG +/* YYSTOS[[STATE-NUM]] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const b4_uint_type(b4_stos_max) yystos[[]] = +{ + b4_stos +}; +#endif #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ @@ -1137,6 +1146,27 @@ yyerrlab1: /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; + +#if YYDEBUG + if (yydebug) + { + if (yystos[yystate] < YYNTOKENS) + { + YYFPRINTF (stderr, "Error: popping token %d (%s", + yytoknum[yystos[yystate]], yytname[yystos[yystate]]); +# ifdef YYPRINT + YYPRINT (stderr, yytoknum[yystos[yystate]], *yyvsp); +# endif + YYFPRINTF (stderr, ")\n"); + } + else + { + YYFPRINTF (stderr, "Error: popping nonterminal (%s)\n", + yytname[yystos[yystate]]); + } + } +#endif + yyvsp--; yystate = *--yyssp; #if YYLSP_NEEDED