X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/17acead581306a47622213c3ff949bb237b1268f..2cdb2a7b057fbcb3278427f2d623ea9dcf8a5312:/data/yacc.c diff --git a/data/yacc.c b/data/yacc.c index 31ee8436..35e8da4f 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -307,6 +307,12 @@ b4_location_if( #endif +#if defined (__STDC__) || defined (__cplusplus) + typedef signed char yysigned_char; +#else + typedef short yysigned_char; +#endif + /* YYFINAL -- State number of the termination state. */ #define YYFINAL b4_final_state_number #define YYLAST b4_last @@ -414,7 +420,8 @@ static const b4_int_type_for([b4_pgoto]) yypgoto[[]] = /* YYTABLE[[YYPACT[STATE-NUM]]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. */ + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, parse error. */ #define YYTABLE_NINF b4_table_ninf static const b4_int_type_for([b4_table]) yytable[[]] = { @@ -499,13 +506,14 @@ while (0) /* YYLEX -- calling `yylex' with the right arguments. */ -b4_pure_if( -[#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval[]b4_location_if([, &yylloc]), YYLEX_PARAM) +#ifdef YYLEX_PARAM +# define YYLEX yylex (b4_pure_if([&yylval[]b4_location_if([, &yylloc]), ])YYLEX_PARAM) #else -# define YYLEX yylex (&yylval[]b4_location_if([, &yylloc])) -#endif], -[#define YYLEX yylex ()]) +# define YYLEX b4_c_function_call([yylex], [int], + b4_pure_if([[[[]], [[&yylval]]], + b4_location_if([[[], [&yylloc]],])]) + m4_fst(b4_lex_param)) +#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -917,28 +925,19 @@ yybackup: YYDPRINTF ((stderr, "\n")); } + /* If the proper action on seeing token YYCHAR1 is to reduce or to + detect an error, take that action. */ yyn += yychar1; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1) goto yydefault; - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) + if (yyn <= 0) { - if (yyn == YYTABLE_NINF) + if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } - else if (yyn == 0) - goto yyerrlab; if (yyn == YYFINAL) YYACCEPT;