diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2020-07-14 01:54:24 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2020-07-14 01:54:24 +0000 |
commit | b53bb29fed3e69c2561e93c1aee32b92ffe9117f (patch) | |
tree | dd36ed58983549056b8713ca8215703da61bd89e /contrib/byacc/test/btyacc/quote_calc3.tab.c | |
parent | 4cf6caac2f8cfe191833119243821652570fe4fa (diff) | |
parent | 5dd99b746d26517ef72ee914e30ece2761079321 (diff) |
MFV: r362513
Update byacc to 20200330.
Notes
Notes:
svn path=/head/; revision=363170
Diffstat (limited to 'contrib/byacc/test/btyacc/quote_calc3.tab.c')
-rw-r--r-- | contrib/byacc/test/btyacc/quote_calc3.tab.c | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/contrib/byacc/test/btyacc/quote_calc3.tab.c b/contrib/byacc/test/btyacc/quote_calc3.tab.c index ef26f74d9de5..4eae158efdee 100644 --- a/contrib/byacc/test/btyacc/quote_calc3.tab.c +++ b/contrib/byacc/test/btyacc/quote_calc3.tab.c @@ -176,7 +176,7 @@ extern int YYPARSE_DECL(); #define LETTER 270 #define UMINUS 271 #define YYERRCODE 256 -typedef short YYINT; +typedef int YYINT; static const YYINT quote_calc3_lhs[] = { -1, 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, @@ -358,13 +358,16 @@ static const char *const quote_calc3_rule[] = { }; #endif +#if YYDEBUG int yydebug; -int yynerrs; +#endif int yyerrflag; int yychar; YYSTYPE yyval; YYSTYPE yylval; +int yynerrs; + #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) YYLTYPE yyloc; /* position returned by actions */ YYLTYPE yylloc; /* position from the lexer */ @@ -377,17 +380,17 @@ do \ { \ if (n == 0) \ { \ - (loc).first_line = ((rhs)[-1]).last_line; \ - (loc).first_column = ((rhs)[-1]).last_column; \ - (loc).last_line = ((rhs)[-1]).last_line; \ - (loc).last_column = ((rhs)[-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).first_column = YYRHSLOC(rhs, 0).last_column; \ + (loc).last_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).last_column = YYRHSLOC(rhs, 0).last_column; \ } \ else \ { \ - (loc).first_line = ((rhs)[ 0 ]).first_line; \ - (loc).first_column = ((rhs)[ 0 ]).first_column; \ - (loc).last_line = ((rhs)[n-1]).last_line; \ - (loc).last_column = ((rhs)[n-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 1).first_line; \ + (loc).first_column = YYRHSLOC(rhs, 1).first_column; \ + (loc).last_line = YYRHSLOC(rhs, n).last_line; \ + (loc).last_column = YYRHSLOC(rhs, n).last_column; \ } \ } while (0) #endif /* YYLLOC_DEFAULT */ @@ -523,7 +526,7 @@ yylex(void) { } return( c ); } -#line 527 "quote_calc3.tab.c" +#line 530 "quote_calc3.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -662,7 +665,7 @@ YYPARSE_DECL() YYParseState *yyerrctx = NULL; #endif /* YYBTYACC */ #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - YYLTYPE yyerror_loc_range[2]; /* position of error start & end */ + YYLTYPE yyerror_loc_range[3]; /* position of error start/end (0 unused) */ #endif #if YYDEBUG const char *yys; @@ -729,10 +732,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -843,7 +846,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); + yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -1053,7 +1056,7 @@ yyerrhandler: YYERROR_CALL("syntax error"); #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */ + yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */ #endif #if !YYBTYACC @@ -1082,7 +1085,7 @@ yyinrecovery: *++yystack.l_mark = yylval; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* lookahead position is error end position */ - yyerror_loc_range[1] = yylloc; + yyerror_loc_range[2] = yylloc; YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */ *++yystack.p_mark = yyloc; #endif @@ -1098,7 +1101,7 @@ yyinrecovery: if (yystack.s_mark <= yystack.s_base) goto yyabort; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* the current TOS position is the error start position */ - yyerror_loc_range[0] = *yystack.p_mark; + yyerror_loc_range[1] = *yystack.p_mark; #endif #if defined(YYDESTRUCT_CALL) #if YYBTYACC @@ -1184,10 +1187,10 @@ yyreduce: if (!yytrial) #endif /* YYBTYACC */ { - YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym); + YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym); /* just in case YYERROR is invoked within the action, save the start of the rhs as the error start position */ - yyerror_loc_range[0] = yystack.p_mark[1-yym]; + yyerror_loc_range[1] = yystack.p_mark[1-yym]; } #endif @@ -1253,7 +1256,7 @@ case 18: #line 70 "quote_calc3.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1257 "quote_calc3.tab.c" +#line 1260 "quote_calc3.tab.c" default: break; } @@ -1308,12 +1311,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; |