diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-01 14:47:47 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-01 14:47:47 +0900 |
commit | 5591a2e17d739c0b4c84056a3b675ae9c81e9047 (patch) | |
tree | ed4d3ad0b7d871eb09cbe8ac9e9bc2e8c0956bb6 /test | |
parent | baae776bdbbc9cb77023eaa92064fc5c237dd04f (diff) | |
download | byacc-5591a2e17d739c0b4c84056a3b675ae9c81e9047.tar.gz byacc-5591a2e17d739c0b4c84056a3b675ae9c81e9047.tar.bz2 byacc-5591a2e17d739c0b4c84056a3b675ae9c81e9047.zip |
Imported Upstream version 20161202upstream/20161202
Diffstat (limited to 'test')
41 files changed, 685 insertions, 579 deletions
diff --git a/test/btyacc/btyacc_calc1.tab.c b/test/btyacc/btyacc_calc1.tab.c index 17e7962..d646360 100644 --- a/test/btyacc/btyacc_calc1.tab.c +++ b/test/btyacc/btyacc_calc1.tab.c @@ -215,6 +215,7 @@ static const YYINT calc1_defred[] = { 1, 0, 24, 0, 26, 0, 0, 23, 25, 14, 0, 0, 0, 0, 0, 0, 0, 0, 12, 13, 17, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT calc1_stos[] = { 0, 262, 256, 257, 258, 259, 45, 40, 263, 264, 265, 10, 61, 61, 257, 258, 263, 264, 263, 264, 43, @@ -223,6 +224,7 @@ static const YYINT calc1_stos[] = { 0, 263, 264, 263, 264, 264, 264, 264, 264, 263, 263, 43, 45, 42, 47, 263, 263, 263, 263, 263, 41, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT calc1_dgoto[] = { 1, 32, 9, 10, }; @@ -613,7 +615,7 @@ vdiv(double a, double b, INTERVAL v) { return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo)); } -#line 617 "btyacc_calc1.tab.c" +#line 619 "btyacc_calc1.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -792,9 +794,9 @@ YYPARSE_DECL() #endif /* Current position at lexical token queue */ - static short *yylexp = 0; + static YYINT *yylexp = 0; - static short *yylexemes = 0; + static YYINT *yylexemes = 0; #endif /* YYBTYACC */ int yym, yyn, yystate, yyresult; #if YYBTYACC @@ -866,10 +868,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -879,7 +881,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -980,7 +982,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -1004,7 +1006,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1523,7 +1525,7 @@ case 28: yyval.vval = yystack.l_mark[-1].vval; } break; -#line 1527 "btyacc_calc1.tab.c" +#line 1529 "btyacc_calc1.tab.c" default: break; } @@ -1578,12 +1580,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1594,7 +1596,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/btyacc_demo.tab.c b/test/btyacc/btyacc_demo.tab.c index 0954a40..618da35 100644 --- a/test/btyacc/btyacc_demo.tab.c +++ b/test/btyacc/btyacc_demo.tab.c @@ -173,9 +173,11 @@ typedef struct YYLTYPE int first_column; int last_line; int last_column; + unsigned source; } YYLTYPE; #define YYLTYPE_IS_DECLARED 1 #endif +#define YYRHSLOC(rhs, k) ((rhs)[k]) /* compatibility with bison */ #ifdef YYPARSE_PARAM @@ -200,10 +202,10 @@ typedef struct YYLTYPE /* Parameters sent to yyerror. */ #ifndef YYERROR_DECL -#define YYERROR_DECL() yyerror(YYLTYPE loc, const char *s) +#define YYERROR_DECL() yyerror(YYLTYPE *loc, const char *s) #endif #ifndef YYERROR_CALL -#define YYERROR_CALL(msg) yyerror(yylloc, msg) +#define YYERROR_CALL(msg) yyerror(&yylloc, msg) #endif #ifndef YYDESTRUCT_DECL @@ -258,6 +260,7 @@ static const YYINT demo_defred[] = { 5, 45, 44, 0, 0, 49, 58, 0, 30, 50, 56, 0, 0, 0, 51, 0, 0, 52, 0, 53, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT demo_stos[] = { 0, 271, 289, 275, 290, 261, 262, 263, 264, 265, 269, 273, 281, 282, 283, 285, 286, 42, 40, 259, 274, @@ -270,6 +273,7 @@ static const YYINT demo_stos[] = { 0, 272, 272, 266, 272, 273, 276, 298, 40, 59, 278, 294, 272, 41, 267, 296, 276, 268, 297, 276, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT demo_dgoto[] = { 1, 84, 85, 20, 3, 86, 66, 40, 21, 44, 12, 13, 14, 24, 15, 16, 46, 47, 2, 22, 30, @@ -624,9 +628,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 200 "btyacc_demo.y" @@ -656,7 +660,7 @@ extern Expr * var_expr(Scope *scope, char *id); extern Code * build_expr_code(Expr *expr); extern Code * build_if(Expr *cond_expr, Code *then_stmt, Code *else_stmt); extern Code * code_append(Code *stmt_list, Code *stmt); -#line 660 "btyacc_demo.tab.c" +#line 664 "btyacc_demo.tab.c" /* Release memory associated with symbol. */ #if ! defined YYDESTRUCT_IS_DECLARED @@ -673,7 +677,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 677 "btyacc_demo.tab.c" +#line 681 "btyacc_demo.tab.c" case 45: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -682,7 +686,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 686 "btyacc_demo.tab.c" +#line 690 "btyacc_demo.tab.c" case 42: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -691,7 +695,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 695 "btyacc_demo.tab.c" +#line 699 "btyacc_demo.tab.c" case 47: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -700,7 +704,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 704 "btyacc_demo.tab.c" +#line 708 "btyacc_demo.tab.c" case 37: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -709,7 +713,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 713 "btyacc_demo.tab.c" +#line 717 "btyacc_demo.tab.c" case 257: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -718,7 +722,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 722 "btyacc_demo.tab.c" +#line 726 "btyacc_demo.tab.c" case 258: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -727,7 +731,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 731 "btyacc_demo.tab.c" +#line 735 "btyacc_demo.tab.c" case 40: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -736,7 +740,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 740 "btyacc_demo.tab.c" +#line 744 "btyacc_demo.tab.c" case 91: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -745,7 +749,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 749 "btyacc_demo.tab.c" +#line 753 "btyacc_demo.tab.c" case 46: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -754,7 +758,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 758 "btyacc_demo.tab.c" +#line 762 "btyacc_demo.tab.c" case 259: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -763,7 +767,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).id); } break; -#line 767 "btyacc_demo.tab.c" +#line 771 "btyacc_demo.tab.c" case 260: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -772,7 +776,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).expr); } break; -#line 776 "btyacc_demo.tab.c" +#line 780 "btyacc_demo.tab.c" case 261: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -781,7 +785,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 785 "btyacc_demo.tab.c" +#line 789 "btyacc_demo.tab.c" case 262: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -790,7 +794,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 794 "btyacc_demo.tab.c" +#line 798 "btyacc_demo.tab.c" case 263: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -799,7 +803,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 803 "btyacc_demo.tab.c" +#line 807 "btyacc_demo.tab.c" case 264: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -808,7 +812,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 812 "btyacc_demo.tab.c" +#line 816 "btyacc_demo.tab.c" case 265: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -817,7 +821,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 821 "btyacc_demo.tab.c" +#line 825 "btyacc_demo.tab.c" case 266: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -826,7 +830,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 830 "btyacc_demo.tab.c" +#line 834 "btyacc_demo.tab.c" case 267: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -835,7 +839,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 839 "btyacc_demo.tab.c" +#line 843 "btyacc_demo.tab.c" case 268: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -844,7 +848,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 848 "btyacc_demo.tab.c" +#line 852 "btyacc_demo.tab.c" case 269: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -853,7 +857,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 857 "btyacc_demo.tab.c" +#line 861 "btyacc_demo.tab.c" case 59: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -862,7 +866,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 866 "btyacc_demo.tab.c" +#line 870 "btyacc_demo.tab.c" case 44: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -871,7 +875,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 875 "btyacc_demo.tab.c" +#line 879 "btyacc_demo.tab.c" case 41: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -880,7 +884,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 884 "btyacc_demo.tab.c" +#line 888 "btyacc_demo.tab.c" case 93: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -889,7 +893,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 893 "btyacc_demo.tab.c" +#line 897 "btyacc_demo.tab.c" case 123: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -898,7 +902,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 902 "btyacc_demo.tab.c" +#line 906 "btyacc_demo.tab.c" case 125: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -907,7 +911,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 911 "btyacc_demo.tab.c" +#line 915 "btyacc_demo.tab.c" case 270: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -916,7 +920,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 920 "btyacc_demo.tab.c" +#line 924 "btyacc_demo.tab.c" case 271: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -925,7 +929,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 929 "btyacc_demo.tab.c" +#line 933 "btyacc_demo.tab.c" case 272: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -934,7 +938,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).expr); } break; -#line 938 "btyacc_demo.tab.c" +#line 942 "btyacc_demo.tab.c" case 273: #line 67 "btyacc_demo.y" { /* 'msg' is a 'char *' indicating the context of destructor invocation*/ @@ -944,7 +948,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).decl->scope); free((*val).decl->type); } break; -#line 948 "btyacc_demo.tab.c" +#line 952 "btyacc_demo.tab.c" case 274: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -953,7 +957,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 957 "btyacc_demo.tab.c" +#line 961 "btyacc_demo.tab.c" case 275: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -962,7 +966,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 966 "btyacc_demo.tab.c" +#line 970 "btyacc_demo.tab.c" case 276: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -971,7 +975,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).code); } break; -#line 975 "btyacc_demo.tab.c" +#line 979 "btyacc_demo.tab.c" case 277: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -980,7 +984,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).code); } break; -#line 984 "btyacc_demo.tab.c" +#line 988 "btyacc_demo.tab.c" case 278: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -989,7 +993,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).code); } break; -#line 993 "btyacc_demo.tab.c" +#line 997 "btyacc_demo.tab.c" case 279: #line 73 "btyacc_demo.y" { printf("%s accessed by symbol with type <decl> (case s.b. 279 & 280) @ position[%d,%d..%d,%d]\n", @@ -998,7 +1002,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).decl); } break; -#line 1002 "btyacc_demo.tab.c" +#line 1006 "btyacc_demo.tab.c" case 280: #line 73 "btyacc_demo.y" { printf("%s accessed by symbol with type <decl> (case s.b. 279 & 280) @ position[%d,%d..%d,%d]\n", @@ -1007,7 +1011,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).decl); } break; -#line 1011 "btyacc_demo.tab.c" +#line 1015 "btyacc_demo.tab.c" case 281: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1016,7 +1020,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).type); } break; -#line 1020 "btyacc_demo.tab.c" +#line 1024 "btyacc_demo.tab.c" case 282: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1025,7 +1029,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).type); } break; -#line 1029 "btyacc_demo.tab.c" +#line 1033 "btyacc_demo.tab.c" case 283: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1034,7 +1038,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).type); } break; -#line 1038 "btyacc_demo.tab.c" +#line 1042 "btyacc_demo.tab.c" case 284: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1043,7 +1047,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).type); } break; -#line 1047 "btyacc_demo.tab.c" +#line 1051 "btyacc_demo.tab.c" case 285: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1052,7 +1056,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).type); } break; -#line 1056 "btyacc_demo.tab.c" +#line 1060 "btyacc_demo.tab.c" case 286: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1061,7 +1065,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).scope); } break; -#line 1065 "btyacc_demo.tab.c" +#line 1069 "btyacc_demo.tab.c" case 287: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1070,7 +1074,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).dlist); } break; -#line 1074 "btyacc_demo.tab.c" +#line 1078 "btyacc_demo.tab.c" case 288: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1079,7 +1083,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).dlist); } break; -#line 1083 "btyacc_demo.tab.c" +#line 1087 "btyacc_demo.tab.c" case 289: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1088,7 +1092,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).scope); } break; -#line 1092 "btyacc_demo.tab.c" +#line 1096 "btyacc_demo.tab.c" case 290: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1097,7 +1101,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).scope); } break; -#line 1101 "btyacc_demo.tab.c" +#line 1105 "btyacc_demo.tab.c" case 291: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1106,7 +1110,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).scope); } break; -#line 1110 "btyacc_demo.tab.c" +#line 1114 "btyacc_demo.tab.c" case 292: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1115,7 +1119,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).scope); } break; -#line 1119 "btyacc_demo.tab.c" +#line 1123 "btyacc_demo.tab.c" case 293: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1124,7 +1128,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).type); } break; -#line 1128 "btyacc_demo.tab.c" +#line 1132 "btyacc_demo.tab.c" case 294: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1133,7 +1137,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).scope); } break; -#line 1137 "btyacc_demo.tab.c" +#line 1141 "btyacc_demo.tab.c" case 295: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1142,7 +1146,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).type); } break; -#line 1146 "btyacc_demo.tab.c" +#line 1150 "btyacc_demo.tab.c" case 296: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1151,7 +1155,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).scope); } break; -#line 1155 "btyacc_demo.tab.c" +#line 1159 "btyacc_demo.tab.c" case 297: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1160,7 +1164,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).scope); } break; -#line 1164 "btyacc_demo.tab.c" +#line 1168 "btyacc_demo.tab.c" case 298: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1169,7 +1173,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).scope); } break; -#line 1173 "btyacc_demo.tab.c" +#line 1177 "btyacc_demo.tab.c" } } #define YYDESTRUCT_IS_DECLARED 1 @@ -1376,10 +1380,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -1389,7 +1393,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -1490,7 +1494,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -1514,7 +1518,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -2099,7 +2103,7 @@ case 59: #line 197 "btyacc_demo.y" { yyval.code = yystack.l_mark[-1].code; } break; -#line 2103 "btyacc_demo.tab.c" +#line 2107 "btyacc_demo.tab.c" default: break; } @@ -2154,12 +2158,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -2170,7 +2174,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/btyacc_demo.tab.h b/test/btyacc/btyacc_demo.tab.h index 33139eb..c219fb1 100644 --- a/test/btyacc/btyacc_demo.tab.h +++ b/test/btyacc/btyacc_demo.tab.h @@ -33,4 +33,18 @@ typedef union { #endif /* !YYSTYPE_IS_DECLARED */ extern YYSTYPE demo_lval; +#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED +/* Default: YYLTYPE is the text position type. */ +typedef struct YYLTYPE +{ + int first_line; + int first_column; + int last_line; + int last_column; + unsigned source; +} YYLTYPE; +#define YYLTYPE_IS_DECLARED 1 +#endif +#define YYRHSLOC(rhs, k) ((rhs)[k]) + #endif /* _demo__defines_h_ */ diff --git a/test/btyacc/btyacc_destroy1.tab.c b/test/btyacc/btyacc_destroy1.tab.c index c598913..ae87b3b 100644 --- a/test/btyacc/btyacc_destroy1.tab.c +++ b/test/btyacc/btyacc_destroy1.tab.c @@ -214,11 +214,13 @@ static const YYINT destroy1_defred[] = { 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 9, 1, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT destroy1_stos[] = { 0, 257, 258, 259, 260, 263, 265, 266, 266, 261, 264, 267, 267, 40, 261, 40, 40, 265, 258, 265, 41, 44, 44, 266, 266, 41, 41, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT destroy1_dgoto[] = { 5, 10, 6, 7, 11, }; @@ -475,15 +477,15 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 89 "btyacc_destroy1.y" extern int YYLEX_DECL(); extern void YYERROR_DECL(); -#line 487 "btyacc_destroy1.tab.c" +#line 489 "btyacc_destroy1.tab.c" /* Release memory associated with symbol. */ #if ! defined YYDESTRUCT_IS_DECLARED @@ -503,7 +505,7 @@ YYDESTRUCT_DECL() } } break; -#line 507 "btyacc_destroy1.tab.c" +#line 509 "btyacc_destroy1.tab.c" } } #define YYDESTRUCT_IS_DECLARED 1 @@ -710,10 +712,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -723,7 +725,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -824,7 +826,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -848,7 +850,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1223,7 +1225,7 @@ case 9: #line 86 "btyacc_destroy1.y" { yyval.nlist = yystack.l_mark[-5].nlist; } break; -#line 1227 "btyacc_destroy1.tab.c" +#line 1229 "btyacc_destroy1.tab.c" default: break; } @@ -1278,12 +1280,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1294,7 +1296,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/btyacc_destroy2.tab.c b/test/btyacc/btyacc_destroy2.tab.c index 04d4d37..17621b0 100644 --- a/test/btyacc/btyacc_destroy2.tab.c +++ b/test/btyacc/btyacc_destroy2.tab.c @@ -214,11 +214,13 @@ static const YYINT destroy2_defred[] = { 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 9, 1, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT destroy2_stos[] = { 0, 257, 258, 259, 260, 263, 265, 266, 266, 261, 264, 267, 267, 40, 261, 40, 40, 265, 258, 265, 41, 44, 44, 266, 266, 41, 41, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT destroy2_dgoto[] = { 5, 10, 6, 7, 11, }; @@ -475,15 +477,15 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 89 "btyacc_destroy2.y" extern int YYLEX_DECL(); extern void YYERROR_DECL(); -#line 487 "btyacc_destroy2.tab.c" +#line 489 "btyacc_destroy2.tab.c" /* Release memory associated with symbol. */ #if ! defined YYDESTRUCT_IS_DECLARED @@ -503,7 +505,7 @@ YYDESTRUCT_DECL() } } break; -#line 507 "btyacc_destroy2.tab.c" +#line 509 "btyacc_destroy2.tab.c" } } #define YYDESTRUCT_IS_DECLARED 1 @@ -710,10 +712,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -723,7 +725,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -824,7 +826,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -848,7 +850,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1223,7 +1225,7 @@ case 9: #line 86 "btyacc_destroy2.y" { yyval.nlist = yystack.l_mark[-5].nlist; } break; -#line 1227 "btyacc_destroy2.tab.c" +#line 1229 "btyacc_destroy2.tab.c" default: break; } @@ -1278,12 +1280,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1294,7 +1296,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/btyacc_destroy3.tab.c b/test/btyacc/btyacc_destroy3.tab.c index fca98b8..d16181b 100644 --- a/test/btyacc/btyacc_destroy3.tab.c +++ b/test/btyacc/btyacc_destroy3.tab.c @@ -214,11 +214,13 @@ static const YYINT destroy3_defred[] = { 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 9, 1, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT destroy3_stos[] = { 0, 257, 258, 259, 260, 263, 265, 266, 266, 261, 264, 267, 267, 40, 261, 40, 40, 265, 258, 265, 41, 44, 44, 266, 266, 41, 41, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT destroy3_dgoto[] = { 5, 10, 6, 7, 11, }; @@ -475,15 +477,15 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 92 "btyacc_destroy3.y" extern int YYLEX_DECL(); extern void YYERROR_DECL(); -#line 487 "btyacc_destroy3.tab.c" +#line 489 "btyacc_destroy3.tab.c" /* Release memory associated with symbol. */ #if ! defined YYDESTRUCT_IS_DECLARED @@ -503,7 +505,7 @@ YYDESTRUCT_DECL() } } break; -#line 507 "btyacc_destroy3.tab.c" +#line 509 "btyacc_destroy3.tab.c" } } #define YYDESTRUCT_IS_DECLARED 1 @@ -710,10 +712,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -723,7 +725,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -824,7 +826,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -848,7 +850,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1223,7 +1225,7 @@ case 9: #line 89 "btyacc_destroy3.y" { yyval.nlist = yystack.l_mark[-5].nlist; } break; -#line 1227 "btyacc_destroy3.tab.c" +#line 1229 "btyacc_destroy3.tab.c" default: break; } @@ -1278,12 +1280,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1294,7 +1296,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/calc.tab.c b/test/btyacc/calc.tab.c index 03d5236..82e1f39 100644 --- a/test/btyacc/calc.tab.c +++ b/test/btyacc/calc.tab.c @@ -185,12 +185,14 @@ static const YYINT calc_defred[] = { 1, 0, 0, 18, 0, 6, 0, 0, 0, 0, 9, 10, 11, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT calc_stos[] = { 0, 261, 256, 257, 258, 45, 40, 262, 263, 264, 10, 61, 258, 263, 263, 10, 124, 38, 43, 45, 42, 47, 37, 257, 263, 41, 263, 263, 263, 263, 263, 263, 263, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT calc_dgoto[] = { 1, 7, 8, 9, }; @@ -456,9 +458,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 66 "calc.y" /* start of programs */ @@ -502,7 +504,7 @@ yylex(void) } return( c ); } -#line 506 "calc.tab.c" +#line 508 "calc.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -705,10 +707,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -718,7 +720,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -819,7 +821,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -843,7 +845,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1229,7 +1231,7 @@ case 18: #line 63 "calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1233 "calc.tab.c" +#line 1235 "calc.tab.c" default: break; } @@ -1284,12 +1286,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1300,7 +1302,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/calc1.tab.c b/test/btyacc/calc1.tab.c index 4046fd3..48a94a6 100644 --- a/test/btyacc/calc1.tab.c +++ b/test/btyacc/calc1.tab.c @@ -215,6 +215,7 @@ static const YYINT calc1_defred[] = { 0, 0, 0, 0, 0, 5, 6, 0, 0, 0, 12, 13, 17, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT calc1_stos[] = { 0, 256, 257, 258, 259, 45, 40, 262, 263, 264, 10, 61, 61, 257, 258, 263, 264, 263, 264, 43, 45, @@ -224,6 +225,7 @@ static const YYINT calc1_stos[] = { 0, 43, 45, 42, 47, 10, 10, 263, 263, 263, 263, 263, 41, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT calc1_dgoto[] = { 7, 32, 9, 0, }; @@ -511,9 +513,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 176 "calc1.y" /* beginning of subroutines section */ @@ -646,7 +648,7 @@ vdiv(double a, double b, INTERVAL v) { return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo)); } -#line 650 "calc1.tab.c" +#line 652 "calc1.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -849,10 +851,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -862,7 +864,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -963,7 +965,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -987,7 +989,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1476,7 +1478,7 @@ case 28: yyval.vval = yystack.l_mark[-1].vval; } break; -#line 1480 "calc1.tab.c" +#line 1482 "calc1.tab.c" default: break; } @@ -1531,12 +1533,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1547,7 +1549,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/calc2.tab.c b/test/btyacc/calc2.tab.c index 99c381e..694e797 100644 --- a/test/btyacc/calc2.tab.c +++ b/test/btyacc/calc2.tab.c @@ -187,12 +187,14 @@ static const YYINT calc2_defred[] = { 1, 0, 0, 18, 0, 6, 0, 0, 0, 0, 9, 10, 11, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT calc2_stos[] = { 0, 261, 256, 257, 258, 45, 40, 262, 263, 264, 10, 61, 258, 263, 263, 10, 124, 38, 43, 45, 42, 47, 37, 257, 263, 41, 263, 263, 263, 263, 263, 263, 263, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT calc2_dgoto[] = { 1, 7, 8, 9, }; @@ -458,9 +460,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 73 "calc2.y" /* start of programs */ @@ -515,7 +517,7 @@ YYLEX_DECL() } return( c ); } -#line 519 "calc2.tab.c" +#line 521 "calc2.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -718,10 +720,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -731,7 +733,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -832,7 +834,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -856,7 +858,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1242,7 +1244,7 @@ case 18: #line 70 "calc2.y" { yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1246 "calc2.tab.c" +#line 1248 "calc2.tab.c" default: break; } @@ -1297,12 +1299,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1313,7 +1315,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/calc3.tab.c b/test/btyacc/calc3.tab.c index b3ba798..383d634 100644 --- a/test/btyacc/calc3.tab.c +++ b/test/btyacc/calc3.tab.c @@ -192,12 +192,14 @@ static const YYINT calc3_defred[] = { 1, 0, 0, 18, 0, 6, 0, 0, 0, 0, 9, 10, 11, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT calc3_stos[] = { 0, 261, 256, 257, 258, 45, 40, 262, 263, 264, 10, 61, 258, 263, 263, 10, 124, 38, 43, 45, 42, 47, 37, 257, 263, 41, 263, 263, 263, 263, 263, 263, 263, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT calc3_dgoto[] = { 1, 7, 8, 9, }; @@ -470,7 +472,7 @@ YYLEX_DECL() } return( c ); } -#line 474 "calc3.tab.c" +#line 476 "calc3.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -649,9 +651,9 @@ YYPARSE_DECL() #endif /* Current position at lexical token queue */ - static short *yylexp = 0; + static YYINT *yylexp = 0; - static short *yylexemes = 0; + static YYINT *yylexemes = 0; #endif /* YYBTYACC */ int yym, yyn, yystate, yyresult; #if YYBTYACC @@ -723,10 +725,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -736,7 +738,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -837,7 +839,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -861,7 +863,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1247,7 +1249,7 @@ case 18: #line 73 "calc3.y" { yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1251 "calc3.tab.c" +#line 1253 "calc3.tab.c" default: break; } @@ -1302,12 +1304,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1318,7 +1320,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/code_calc.code.c b/test/btyacc/code_calc.code.c index a7d322a..1b5cf0f 100644 --- a/test/btyacc/code_calc.code.c +++ b/test/btyacc/code_calc.code.c @@ -327,9 +327,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 70 "code_calc.y" /* start of programs */ @@ -580,10 +580,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -593,7 +593,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -694,7 +694,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -718,7 +718,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1159,12 +1159,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1175,7 +1175,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/code_calc.tab.c b/test/btyacc/code_calc.tab.c index 0de2897..6486b83 100644 --- a/test/btyacc/code_calc.tab.c +++ b/test/btyacc/code_calc.tab.c @@ -16,12 +16,14 @@ const YYINT calc_defred[] = { 1, 0, 0, 18, 0, 6, 0, 0, 0, 0, 9, 10, 11, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) const YYINT calc_stos[] = { 0, 261, 256, 257, 258, 45, 40, 262, 263, 264, 10, 61, 258, 263, 263, 10, 124, 38, 43, 45, 42, 47, 37, 257, 263, 41, 263, 263, 263, 263, 263, 263, 263, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ const YYINT calc_dgoto[] = { 1, 7, 8, 9, }; diff --git a/test/btyacc/code_error.code.c b/test/btyacc/code_error.code.c index f9ccb5a..f1cd1c6 100644 --- a/test/btyacc/code_error.code.c +++ b/test/btyacc/code_error.code.c @@ -317,9 +317,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 12 "code_error.y" @@ -550,10 +550,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -563,7 +563,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -664,7 +664,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -688,7 +688,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1068,12 +1068,12 @@ yyreduce: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1084,7 +1084,7 @@ yyreduce: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/code_error.tab.c b/test/btyacc/code_error.tab.c index d5288b2..88cff35 100644 --- a/test/btyacc/code_error.tab.c +++ b/test/btyacc/code_error.tab.c @@ -11,9 +11,11 @@ const YYINT error_len[] = { 2, const YYINT error_defred[] = { 0, 1, 0, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) const YYINT error_stos[] = { 0, 256, 258, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ const YYINT error_dgoto[] = { 2, }; const YYINT error_sindex[] = { -256, diff --git a/test/btyacc/empty.tab.c b/test/btyacc/empty.tab.c index da0fbf9..a2935ef 100644 --- a/test/btyacc/empty.tab.c +++ b/test/btyacc/empty.tab.c @@ -174,9 +174,11 @@ static const YYINT empty_len[] = { 2, static const YYINT empty_defred[] = { 1, 0, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT empty_stos[] = { 0, 258, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT empty_dgoto[] = { 1, }; static const YYINT empty_sindex[] = { 0, @@ -347,9 +349,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 13 "empty.y" @@ -364,7 +366,7 @@ static void YYERROR_DECL() { printf("%s\n",s); } -#line 368 "empty.tab.c" +#line 370 "empty.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -567,10 +569,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -580,7 +582,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -681,7 +683,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -705,7 +707,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1085,12 +1087,12 @@ yyreduce: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1101,7 +1103,7 @@ yyreduce: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/err_inherit3.tab.c b/test/btyacc/err_inherit3.tab.c index 6cb563e..95c1724 100644 --- a/test/btyacc/err_inherit3.tab.c +++ b/test/btyacc/err_inherit3.tab.c @@ -210,10 +210,12 @@ static const YYINT err_inherit3_defred[] = { 0, 5, 6, 7, 8, 0, 0, 12, 1, 4, 2, 2, 0, 0, 11, 13, 0, 3, 0, 10, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT err_inherit3_stos[] = { 0, 257, 258, 259, 260, 263, 266, 267, 267, 265, 271, 268, 269, 269, 261, 264, 270, 264, 264, 261, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT err_inherit3_dgoto[] = { 5, 15, 9, 6, 7, 11, 12, 16, 10, }; @@ -408,15 +410,15 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 78 "err_inherit3.y" extern int YYLEX_DECL(); extern void YYERROR_DECL(); -#line 420 "err_inherit3.tab.c" +#line 422 "err_inherit3.tab.c" /* Release memory associated with symbol. */ #if ! defined YYDESTRUCT_IS_DECLARED @@ -436,7 +438,7 @@ YYDESTRUCT_DECL() } } break; -#line 440 "err_inherit3.tab.c" +#line 442 "err_inherit3.tab.c" case 264: #line 30 "err_inherit3.y" { @@ -448,7 +450,7 @@ YYDESTRUCT_DECL() } } break; -#line 452 "err_inherit3.tab.c" +#line 454 "err_inherit3.tab.c" case 265: #line 30 "err_inherit3.y" { @@ -460,7 +462,7 @@ YYDESTRUCT_DECL() } } break; -#line 464 "err_inherit3.tab.c" +#line 466 "err_inherit3.tab.c" } } #define YYDESTRUCT_IS_DECLARED 1 @@ -667,10 +669,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -680,7 +682,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -781,7 +783,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -805,7 +807,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1187,7 +1189,7 @@ case 13: #line 75 "err_inherit3.y" { yyval.nlist = yystack.l_mark[0].nlist; } break; -#line 1191 "err_inherit3.tab.c" +#line 1193 "err_inherit3.tab.c" default: break; } @@ -1242,12 +1244,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1258,7 +1260,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/err_inherit4.tab.c b/test/btyacc/err_inherit4.tab.c index daa6881..25db455 100644 --- a/test/btyacc/err_inherit4.tab.c +++ b/test/btyacc/err_inherit4.tab.c @@ -169,9 +169,11 @@ typedef struct YYLTYPE int first_column; int last_line; int last_column; + unsigned source; } YYLTYPE; #define YYLTYPE_IS_DECLARED 1 #endif +#define YYRHSLOC(rhs, k) ((rhs)[k]) /* compatibility with bison */ #ifdef YYPARSE_PARAM @@ -196,10 +198,10 @@ typedef struct YYLTYPE /* Parameters sent to yyerror. */ #ifndef YYERROR_DECL -#define YYERROR_DECL() yyerror(YYLTYPE loc, const char *s) +#define YYERROR_DECL() yyerror(YYLTYPE *loc, const char *s) #endif #ifndef YYERROR_CALL -#define YYERROR_CALL(msg) yyerror(yylloc, msg) +#define YYERROR_CALL(msg) yyerror(&yylloc, msg) #endif #ifndef YYDESTRUCT_DECL @@ -230,10 +232,12 @@ static const YYINT err_inherit4_defred[] = { 0, 5, 6, 7, 8, 0, 0, 0, 1, 10, 0, 4, 2, 9, 0, 0, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT err_inherit4_stos[] = { 0, 257, 258, 259, 260, 263, 266, 267, 267, 261, 264, 265, 268, 261, 269, 264, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT err_inherit4_dgoto[] = { 5, 10, 11, 6, 7, 12, 14, }; @@ -425,15 +429,15 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 80 "err_inherit4.y" extern int YYLEX_DECL(); extern void YYERROR_DECL(); -#line 437 "err_inherit4.tab.c" +#line 441 "err_inherit4.tab.c" /* Release memory associated with symbol. */ #if ! defined YYDESTRUCT_IS_DECLARED @@ -446,17 +450,17 @@ YYDESTRUCT_DECL() #line 28 "err_inherit4.y" { } break; -#line 450 "err_inherit4.tab.c" +#line 454 "err_inherit4.tab.c" case 264: #line 28 "err_inherit4.y" { } break; -#line 455 "err_inherit4.tab.c" +#line 459 "err_inherit4.tab.c" case 265: #line 28 "err_inherit4.y" { } break; -#line 460 "err_inherit4.tab.c" +#line 464 "err_inherit4.tab.c" } } #define YYDESTRUCT_IS_DECLARED 1 @@ -663,10 +667,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -676,7 +680,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -777,7 +781,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -801,7 +805,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1175,7 +1179,7 @@ case 11: #line 77 "err_inherit4.y" { yyval.nlist = yystack.l_mark[0].nlist; yyloc = yystack.p_mark[1]; } break; -#line 1179 "err_inherit4.tab.c" +#line 1183 "err_inherit4.tab.c" default: break; } @@ -1230,12 +1234,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1246,7 +1250,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/err_inherit4.tab.h b/test/btyacc/err_inherit4.tab.h index 5561fd8..758d426 100644 --- a/test/btyacc/err_inherit4.tab.h +++ b/test/btyacc/err_inherit4.tab.h @@ -22,4 +22,18 @@ typedef union #endif /* !YYSTYPE_IS_DECLARED */ extern YYSTYPE err_inherit4_lval; +#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED +/* Default: YYLTYPE is the text position type. */ +typedef struct YYLTYPE +{ + int first_line; + int first_column; + int last_line; + int last_column; + unsigned source; +} YYLTYPE; +#define YYLTYPE_IS_DECLARED 1 +#endif +#define YYRHSLOC(rhs, k) ((rhs)[k]) + #endif /* _err_inherit4__defines_h_ */ diff --git a/test/btyacc/err_syntax10.tab.c b/test/btyacc/err_syntax10.tab.c index 8d1d20f..bdbc7f7 100644 --- a/test/btyacc/err_syntax10.tab.c +++ b/test/btyacc/err_syntax10.tab.c @@ -164,9 +164,11 @@ static const YYINT err_syntax10_len[] = { 2, static const YYINT err_syntax10_defred[] = { 0, 1, 0, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT err_syntax10_stos[] = { 0, 256, 258, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT err_syntax10_dgoto[] = { 2, }; static const YYINT err_syntax10_sindex[] = { -256, @@ -337,9 +339,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 12 "err_syntax10.y" @@ -363,7 +365,7 @@ yyerror(const char* s) { printf("%s\n", s); } -#line 367 "err_syntax10.tab.c" +#line 369 "err_syntax10.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -566,10 +568,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -579,7 +581,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -680,7 +682,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -704,7 +706,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1084,12 +1086,12 @@ yyreduce: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1100,7 +1102,7 @@ yyreduce: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/err_syntax11.tab.c b/test/btyacc/err_syntax11.tab.c index d949102..f1e09db 100644 --- a/test/btyacc/err_syntax11.tab.c +++ b/test/btyacc/err_syntax11.tab.c @@ -170,9 +170,11 @@ static const YYINT err_syntax11_len[] = { 2, static const YYINT err_syntax11_defred[] = { 0, 1, 0, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT err_syntax11_stos[] = { 0, 256, 258, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT err_syntax11_dgoto[] = { 2, }; static const YYINT err_syntax11_sindex[] = { -256, @@ -343,9 +345,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 12 "err_syntax11.y" @@ -369,7 +371,7 @@ yyerror(const char* s) { printf("%s\n", s); } -#line 373 "err_syntax11.tab.c" +#line 375 "err_syntax11.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -572,10 +574,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -585,7 +587,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -686,7 +688,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -710,7 +712,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1090,12 +1092,12 @@ yyreduce: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1106,7 +1108,7 @@ yyreduce: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/err_syntax12.tab.c b/test/btyacc/err_syntax12.tab.c index 5a3105e..8590cad 100644 --- a/test/btyacc/err_syntax12.tab.c +++ b/test/btyacc/err_syntax12.tab.c @@ -171,9 +171,11 @@ static const YYINT err_syntax12_len[] = { 2, static const YYINT err_syntax12_defred[] = { 0, 1, 0, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT err_syntax12_stos[] = { 0, 256, 458, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT err_syntax12_dgoto[] = { 2, }; static const YYINT err_syntax12_sindex[] = { -256, @@ -349,9 +351,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 12 "err_syntax12.y" @@ -375,7 +377,7 @@ yyerror(const char* s) { printf("%s\n", s); } -#line 379 "err_syntax12.tab.c" +#line 381 "err_syntax12.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -578,10 +580,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -591,7 +593,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -692,7 +694,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -716,7 +718,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1096,12 +1098,12 @@ yyreduce: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1112,7 +1114,7 @@ yyreduce: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/err_syntax18.tab.c b/test/btyacc/err_syntax18.tab.c index 1221906..57a0616 100644 --- a/test/btyacc/err_syntax18.tab.c +++ b/test/btyacc/err_syntax18.tab.c @@ -170,9 +170,11 @@ static const YYINT err_syntax18_len[] = { 2, static const YYINT err_syntax18_defred[] = { 0, 0, 0, 0, 1, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT err_syntax18_stos[] = { 0, 40, 258, 258, 41, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT err_syntax18_dgoto[] = { 2, }; static const YYINT err_syntax18_sindex[] = { -40, @@ -346,9 +348,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 13 "err_syntax18.y" @@ -372,7 +374,7 @@ yyerror(const char* s) { printf("%s\n", s); } -#line 376 "err_syntax18.tab.c" +#line 378 "err_syntax18.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -575,10 +577,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -588,7 +590,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -689,7 +691,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -713,7 +715,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1043,7 +1045,7 @@ case 1: #line 9 "err_syntax18.y" { yyval = yystack.l_mark[1]; } break; -#line 1047 "err_syntax18.tab.c" +#line 1049 "err_syntax18.tab.c" default: break; } @@ -1098,12 +1100,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1114,7 +1116,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/err_syntax20.tab.c b/test/btyacc/err_syntax20.tab.c index 73f2074..42ac3e1 100644 --- a/test/btyacc/err_syntax20.tab.c +++ b/test/btyacc/err_syntax20.tab.c @@ -165,9 +165,11 @@ static const YYINT err_syntax20_len[] = { 2, static const YYINT err_syntax20_defred[] = { 0, 0, 0, 0, 1, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT err_syntax20_stos[] = { 0, 40, 259, 257, 41, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT err_syntax20_dgoto[] = { 2, }; static const YYINT err_syntax20_sindex[] = { -40, @@ -341,9 +343,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 16 "err_syntax20.y" @@ -367,7 +369,7 @@ yyerror(const char* s) { printf("%s\n", s); } -#line 371 "err_syntax20.tab.c" +#line 373 "err_syntax20.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -570,10 +572,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -583,7 +585,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -684,7 +686,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -708,7 +710,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1038,7 +1040,7 @@ case 1: #line 12 "err_syntax20.y" { yystack.l_mark[-1].rechk = 3; } break; -#line 1042 "err_syntax20.tab.c" +#line 1044 "err_syntax20.tab.c" default: break; } @@ -1093,12 +1095,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1109,7 +1111,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/error.tab.c b/test/btyacc/error.tab.c index 493690d..26de46d 100644 --- a/test/btyacc/error.tab.c +++ b/test/btyacc/error.tab.c @@ -170,9 +170,11 @@ static const YYINT error_len[] = { 2, static const YYINT error_defred[] = { 0, 1, 0, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT error_stos[] = { 0, 256, 258, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT error_dgoto[] = { 2, }; static const YYINT error_sindex[] = { -256, @@ -342,9 +344,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 8 "error.y" @@ -368,7 +370,7 @@ yyerror(const char* s) { printf("%s\n", s); } -#line 372 "error.tab.c" +#line 374 "error.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -571,10 +573,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -584,7 +586,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -685,7 +687,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -709,7 +711,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1089,12 +1091,12 @@ yyreduce: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1105,7 +1107,7 @@ yyreduce: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/grammar.tab.c b/test/btyacc/grammar.tab.c index 2d3e4ec..187d064 100644 --- a/test/btyacc/grammar.tab.c +++ b/test/btyacc/grammar.tab.c @@ -519,6 +519,7 @@ static const YYINT grammar_defred[] = { 0, 29, 114, 0, 0, 0, 109, 0, 93, 95, 102, 18, 0, 0, 108, 113, 112, 0, 24, 27, 111, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT grammar_stos[] = { 0, 256, 40, 42, 38, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, @@ -536,6 +537,7 @@ static const YYINT grammar_stos[] = { 0, 285, 41, 305, 307, 40, 283, 306, 286, 309, 316, 59, 44, 331, 41, 41, 41, 307, 303, 285, 41, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT grammar_dgoto[] = { 33, 87, 35, 36, 37, 38, 39, 40, 69, 70, 41, 42, 119, 120, 100, 101, 102, 103, 104, 43, 44, @@ -1166,9 +1168,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 1014 "grammar.y" @@ -1341,7 +1343,7 @@ free_parser(void) #endif } #endif -#line 1345 "grammar.tab.c" +#line 1347 "grammar.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -1544,10 +1546,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -1557,7 +1559,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -1658,7 +1660,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -1682,7 +1684,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -2682,7 +2684,7 @@ case 114: yyval.declarator->func_def = FUNC_ANSI; } break; -#line 2686 "grammar.tab.c" +#line 2688 "grammar.tab.c" default: break; } @@ -2737,12 +2739,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -2753,7 +2755,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/inherit0.tab.c b/test/btyacc/inherit0.tab.c index 1c75db5..264aed9 100644 --- a/test/btyacc/inherit0.tab.c +++ b/test/btyacc/inherit0.tab.c @@ -184,10 +184,12 @@ static const YYINT inherit0_defred[] = { 0, 3, 4, 5, 6, 0, 0, 9, 0, 2, 10, 8, 0, 0, 7, 0, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT inherit0_stos[] = { 0, 257, 258, 259, 260, 263, 264, 265, 265, 267, 268, 261, 266, 269, 261, 266, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT inherit0_dgoto[] = { 5, 6, 7, 12, 9, 10, 13, }; @@ -379,15 +381,15 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 46 "inherit0.y" extern int YYLEX_DECL(); extern void YYERROR_DECL(); -#line 391 "inherit0.tab.c" +#line 393 "inherit0.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -590,10 +592,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -603,7 +605,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -704,7 +706,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -728,7 +730,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1098,7 +1100,7 @@ case 11: #line 43 "inherit0.y" { yyval = yystack.l_mark[0]; } break; -#line 1102 "inherit0.tab.c" +#line 1104 "inherit0.tab.c" default: break; } @@ -1153,12 +1155,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1169,7 +1171,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/inherit1.tab.c b/test/btyacc/inherit1.tab.c index 99bbddb..f454a81 100644 --- a/test/btyacc/inherit1.tab.c +++ b/test/btyacc/inherit1.tab.c @@ -205,10 +205,12 @@ static const YYINT inherit1_defred[] = { 0, 3, 4, 5, 6, 0, 0, 9, 0, 2, 10, 8, 0, 0, 7, 0, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT inherit1_stos[] = { 0, 257, 258, 259, 260, 263, 266, 267, 267, 265, 268, 261, 264, 269, 261, 264, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT inherit1_dgoto[] = { 5, 12, 9, 6, 7, 10, 13, }; @@ -400,15 +402,15 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 74 "inherit1.y" extern int YYLEX_DECL(); extern void YYERROR_DECL(); -#line 412 "inherit1.tab.c" +#line 414 "inherit1.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -611,10 +613,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -624,7 +626,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -725,7 +727,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -749,7 +751,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1123,7 +1125,7 @@ case 11: #line 71 "inherit1.y" { yyval.nlist = yystack.l_mark[0].nlist; } break; -#line 1127 "inherit1.tab.c" +#line 1129 "inherit1.tab.c" default: break; } @@ -1178,12 +1180,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1194,7 +1196,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/inherit2.tab.c b/test/btyacc/inherit2.tab.c index e14f601..821d650 100644 --- a/test/btyacc/inherit2.tab.c +++ b/test/btyacc/inherit2.tab.c @@ -210,10 +210,12 @@ static const YYINT inherit2_defred[] = { 0, 5, 6, 7, 8, 0, 0, 11, 1, 4, 2, 2, 0, 0, 10, 0, 0, 9, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT inherit2_stos[] = { 0, 257, 258, 259, 260, 263, 266, 267, 267, 265, 270, 268, 269, 269, 261, 264, 264, 261, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT inherit2_dgoto[] = { 5, 15, 9, 6, 7, 11, 12, 10, }; @@ -407,15 +409,15 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 78 "inherit2.y" extern int YYLEX_DECL(); extern void YYERROR_DECL(); -#line 419 "inherit2.tab.c" +#line 421 "inherit2.tab.c" /* Release memory associated with symbol. */ #if ! defined YYDESTRUCT_IS_DECLARED @@ -435,7 +437,7 @@ YYDESTRUCT_DECL() } } break; -#line 439 "inherit2.tab.c" +#line 441 "inherit2.tab.c" case 264: #line 30 "inherit2.y" { @@ -447,7 +449,7 @@ YYDESTRUCT_DECL() } } break; -#line 451 "inherit2.tab.c" +#line 453 "inherit2.tab.c" case 265: #line 30 "inherit2.y" { @@ -459,7 +461,7 @@ YYDESTRUCT_DECL() } } break; -#line 463 "inherit2.tab.c" +#line 465 "inherit2.tab.c" } } #define YYDESTRUCT_IS_DECLARED 1 @@ -666,10 +668,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -679,7 +681,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -780,7 +782,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -804,7 +806,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1182,7 +1184,7 @@ case 12: #line 75 "inherit2.y" { yyval.nlist = yystack.l_mark[0].nlist; } break; -#line 1186 "inherit2.tab.c" +#line 1188 "inherit2.tab.c" default: break; } @@ -1237,12 +1239,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1253,7 +1255,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/ok_syntax1.tab.c b/test/btyacc/ok_syntax1.tab.c index 7177374..85b682c 100644 --- a/test/btyacc/ok_syntax1.tab.c +++ b/test/btyacc/ok_syntax1.tab.c @@ -213,12 +213,14 @@ static const YYINT ok_syntax1_defred[] = { 1, 0, 0, 18, 0, 6, 0, 0, 0, 0, 9, 10, 11, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT ok_syntax1_stos[] = { 0, 275, 256, 257, 258, 45, 40, 276, 277, 278, 10, 61, 258, 277, 277, 10, 124, 38, 43, 45, 42, 47, 37, 257, 277, 41, 277, 277, 277, 277, 277, 277, 277, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT ok_syntax1_dgoto[] = { 1, 7, 8, 9, }; @@ -493,7 +495,7 @@ YYLEX_DECL() } return( c ); } -#line 497 "ok_syntax1.tab.c" +#line 499 "ok_syntax1.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -672,9 +674,9 @@ YYPARSE_DECL() #endif /* Current position at lexical token queue */ - static short *yylexp = 0; + static YYINT *yylexp = 0; - static short *yylexemes = 0; + static YYINT *yylexemes = 0; #endif /* YYBTYACC */ int yym, yyn, yystate, yyresult; #if YYBTYACC @@ -746,10 +748,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -759,7 +761,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -860,7 +862,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -884,7 +886,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1270,7 +1272,7 @@ case 18: #line 101 "ok_syntax1.y" { yyval.ival = (*base) * yystack.l_mark[-1].ival + yystack.l_mark[0].ival; } break; -#line 1274 "ok_syntax1.tab.c" +#line 1276 "ok_syntax1.tab.c" default: break; } @@ -1325,12 +1327,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1341,7 +1343,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/pure_calc.tab.c b/test/btyacc/pure_calc.tab.c index 380bccf..9bb8959 100644 --- a/test/btyacc/pure_calc.tab.c +++ b/test/btyacc/pure_calc.tab.c @@ -195,12 +195,14 @@ static const YYINT calc_defred[] = { 1, 0, 0, 18, 0, 6, 0, 0, 0, 0, 9, 10, 11, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT calc_stos[] = { 0, 261, 256, 257, 258, 45, 40, 262, 263, 264, 10, 61, 258, 263, 263, 10, 124, 38, 43, 45, 42, 47, 37, 257, 263, 41, 263, 263, 263, 263, 263, 263, 263, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT calc_dgoto[] = { 1, 7, 8, 9, }; @@ -466,7 +468,7 @@ YYLEX_DECL() } return( c ); } -#line 470 "pure_calc.tab.c" +#line 472 "pure_calc.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -645,9 +647,9 @@ YYPARSE_DECL() #endif /* Current position at lexical token queue */ - static short *yylexp = 0; + static YYINT *yylexp = 0; - static short *yylexemes = 0; + static YYINT *yylexemes = 0; #endif /* YYBTYACC */ int yym, yyn, yystate, yyresult; #if YYBTYACC @@ -719,10 +721,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -732,7 +734,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -833,7 +835,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -857,7 +859,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1243,7 +1245,7 @@ case 18: #line 69 "pure_calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1247 "pure_calc.tab.c" +#line 1249 "pure_calc.tab.c" default: break; } @@ -1298,12 +1300,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1314,7 +1316,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/pure_error.tab.c b/test/btyacc/pure_error.tab.c index c895348..07dd116 100644 --- a/test/btyacc/pure_error.tab.c +++ b/test/btyacc/pure_error.tab.c @@ -182,9 +182,11 @@ static const YYINT error_len[] = { 2, static const YYINT error_defred[] = { 0, 1, 0, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT error_stos[] = { 0, 256, 258, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT error_dgoto[] = { 2, }; static const YYINT error_sindex[] = { -256, @@ -334,7 +336,7 @@ yyerror(const char* s) { printf("%s\n", s); } -#line 338 "pure_error.tab.c" +#line 340 "pure_error.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -513,9 +515,9 @@ YYPARSE_DECL() #endif /* Current position at lexical token queue */ - static short *yylexp = 0; + static YYINT *yylexp = 0; - static short *yylexemes = 0; + static YYINT *yylexemes = 0; #endif /* YYBTYACC */ int yym, yyn, yystate, yyresult; #if YYBTYACC @@ -587,10 +589,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -600,7 +602,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -701,7 +703,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -725,7 +727,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1105,12 +1107,12 @@ yyreduce: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1121,7 +1123,7 @@ yyreduce: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/quote_calc-s.tab.c b/test/btyacc/quote_calc-s.tab.c index 5860296..1f84f7d 100644 --- a/test/btyacc/quote_calc-s.tab.c +++ b/test/btyacc/quote_calc-s.tab.c @@ -191,12 +191,14 @@ static const YYINT quote_calc_defred[] = { 1, 0, 0, 18, 0, 6, 0, 0, 0, 0, 0, 0, 0, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT quote_calc_stos[] = { 0, 273, 256, 259, 269, 270, 40, 274, 275, 276, 10, 270, 275, 61, 275, 10, 257, 259, 261, 263, 265, 267, 124, 269, 275, 41, 275, 275, 275, 275, 275, 275, 275, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT quote_calc_dgoto[] = { 1, 7, 8, 9, }; @@ -475,9 +477,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 73 "quote_calc.y" /* start of programs */ @@ -520,7 +522,7 @@ yylex(void) { } return( c ); } -#line 524 "quote_calc-s.tab.c" +#line 526 "quote_calc-s.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -723,10 +725,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -736,7 +738,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -837,7 +839,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -861,7 +863,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1247,7 +1249,7 @@ case 18: #line 70 "quote_calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1251 "quote_calc-s.tab.c" +#line 1253 "quote_calc-s.tab.c" default: break; } @@ -1302,12 +1304,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1318,7 +1320,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/quote_calc.tab.c b/test/btyacc/quote_calc.tab.c index 0fa5e60..08661fe 100644 --- a/test/btyacc/quote_calc.tab.c +++ b/test/btyacc/quote_calc.tab.c @@ -197,12 +197,14 @@ static const YYINT quote_calc_defred[] = { 1, 0, 0, 18, 0, 6, 0, 0, 0, 0, 0, 0, 0, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT quote_calc_stos[] = { 0, 273, 256, 259, 269, 270, 40, 274, 275, 276, 10, 270, 275, 61, 275, 10, 257, 259, 261, 263, 265, 267, 124, 269, 275, 41, 275, 275, 275, 275, 275, 275, 275, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT quote_calc_dgoto[] = { 1, 7, 8, 9, }; @@ -481,9 +483,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 73 "quote_calc.y" /* start of programs */ @@ -526,7 +528,7 @@ yylex(void) { } return( c ); } -#line 530 "quote_calc.tab.c" +#line 532 "quote_calc.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -729,10 +731,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -742,7 +744,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -843,7 +845,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -867,7 +869,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1253,7 +1255,7 @@ case 18: #line 70 "quote_calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1257 "quote_calc.tab.c" +#line 1259 "quote_calc.tab.c" default: break; } @@ -1308,12 +1310,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1324,7 +1326,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/quote_calc2-s.tab.c b/test/btyacc/quote_calc2-s.tab.c index 72ea6ec..ed86452 100644 --- a/test/btyacc/quote_calc2-s.tab.c +++ b/test/btyacc/quote_calc2-s.tab.c @@ -191,12 +191,14 @@ static const YYINT quote_calc2_defred[] = { 1, 0, 0, 18, 0, 6, 0, 0, 0, 0, 0, 0, 0, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT quote_calc2_stos[] = { 0, 273, 256, 260, 269, 270, 40, 274, 275, 276, 10, 270, 275, 61, 275, 10, 258, 260, 262, 264, 266, 268, 124, 269, 275, 41, 275, 275, 275, 275, 275, 275, 275, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT quote_calc2_dgoto[] = { 1, 7, 8, 9, }; @@ -475,9 +477,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 73 "quote_calc2.y" /* start of programs */ @@ -520,7 +522,7 @@ yylex(void) { } return( c ); } -#line 524 "quote_calc2-s.tab.c" +#line 526 "quote_calc2-s.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -723,10 +725,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -736,7 +738,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -837,7 +839,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -861,7 +863,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1247,7 +1249,7 @@ case 18: #line 70 "quote_calc2.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1251 "quote_calc2-s.tab.c" +#line 1253 "quote_calc2-s.tab.c" default: break; } @@ -1302,12 +1304,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1318,7 +1320,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/quote_calc2.tab.c b/test/btyacc/quote_calc2.tab.c index c5e2430..5378828 100644 --- a/test/btyacc/quote_calc2.tab.c +++ b/test/btyacc/quote_calc2.tab.c @@ -197,12 +197,14 @@ static const YYINT quote_calc2_defred[] = { 1, 0, 0, 18, 0, 6, 0, 0, 0, 0, 0, 0, 0, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT quote_calc2_stos[] = { 0, 273, 256, 260, 269, 270, 40, 274, 275, 276, 10, 270, 275, 61, 275, 10, 258, 260, 262, 264, 266, 268, 124, 269, 275, 41, 275, 275, 275, 275, 275, 275, 275, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT quote_calc2_dgoto[] = { 1, 7, 8, 9, }; @@ -481,9 +483,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 73 "quote_calc2.y" /* start of programs */ @@ -526,7 +528,7 @@ yylex(void) { } return( c ); } -#line 530 "quote_calc2.tab.c" +#line 532 "quote_calc2.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -729,10 +731,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -742,7 +744,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -843,7 +845,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -867,7 +869,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1253,7 +1255,7 @@ case 18: #line 70 "quote_calc2.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1257 "quote_calc2.tab.c" +#line 1259 "quote_calc2.tab.c" default: break; } @@ -1308,12 +1310,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1324,7 +1326,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/quote_calc3-s.tab.c b/test/btyacc/quote_calc3-s.tab.c index 93af811..14caffb 100644 --- a/test/btyacc/quote_calc3-s.tab.c +++ b/test/btyacc/quote_calc3-s.tab.c @@ -191,12 +191,14 @@ static const YYINT quote_calc3_defred[] = { 1, 0, 0, 18, 0, 6, 0, 0, 0, 0, 0, 0, 0, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT quote_calc3_stos[] = { 0, 273, 256, 259, 269, 270, 40, 274, 275, 276, 10, 270, 275, 61, 275, 10, 257, 259, 261, 263, 265, 267, 124, 269, 275, 41, 275, 275, 275, 275, 275, 275, 275, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT quote_calc3_dgoto[] = { 1, 7, 8, 9, }; @@ -476,9 +478,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 73 "quote_calc3.y" /* start of programs */ @@ -521,7 +523,7 @@ yylex(void) { } return( c ); } -#line 525 "quote_calc3-s.tab.c" +#line 527 "quote_calc3-s.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -724,10 +726,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -737,7 +739,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -838,7 +840,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -862,7 +864,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1248,7 +1250,7 @@ case 18: #line 70 "quote_calc3.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1252 "quote_calc3-s.tab.c" +#line 1254 "quote_calc3-s.tab.c" default: break; } @@ -1303,12 +1305,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1319,7 +1321,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/quote_calc3.tab.c b/test/btyacc/quote_calc3.tab.c index 2e929c5..1e4087d 100644 --- a/test/btyacc/quote_calc3.tab.c +++ b/test/btyacc/quote_calc3.tab.c @@ -191,12 +191,14 @@ static const YYINT quote_calc3_defred[] = { 1, 0, 0, 18, 0, 6, 0, 0, 0, 0, 0, 0, 0, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT quote_calc3_stos[] = { 0, 273, 256, 259, 269, 270, 40, 274, 275, 276, 10, 270, 275, 61, 275, 10, 257, 259, 261, 263, 265, 267, 124, 269, 275, 41, 275, 275, 275, 275, 275, 275, 275, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT quote_calc3_dgoto[] = { 1, 7, 8, 9, }; @@ -476,9 +478,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 73 "quote_calc3.y" /* start of programs */ @@ -521,7 +523,7 @@ yylex(void) { } return( c ); } -#line 525 "quote_calc3.tab.c" +#line 527 "quote_calc3.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -724,10 +726,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -737,7 +739,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -838,7 +840,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -862,7 +864,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1248,7 +1250,7 @@ case 18: #line 70 "quote_calc3.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1252 "quote_calc3.tab.c" +#line 1254 "quote_calc3.tab.c" default: break; } @@ -1303,12 +1305,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1319,7 +1321,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/quote_calc4-s.tab.c b/test/btyacc/quote_calc4-s.tab.c index e95a599..6f91ab7 100644 --- a/test/btyacc/quote_calc4-s.tab.c +++ b/test/btyacc/quote_calc4-s.tab.c @@ -191,12 +191,14 @@ static const YYINT quote_calc4_defred[] = { 1, 0, 0, 18, 0, 6, 0, 0, 0, 0, 0, 0, 0, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT quote_calc4_stos[] = { 0, 273, 256, 260, 269, 270, 40, 274, 275, 276, 10, 270, 275, 61, 275, 10, 258, 260, 262, 264, 266, 268, 124, 269, 275, 41, 275, 275, 275, 275, 275, 275, 275, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT quote_calc4_dgoto[] = { 1, 7, 8, 9, }; @@ -476,9 +478,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 73 "quote_calc4.y" /* start of programs */ @@ -521,7 +523,7 @@ yylex(void) { } return( c ); } -#line 525 "quote_calc4-s.tab.c" +#line 527 "quote_calc4-s.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -724,10 +726,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -737,7 +739,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -838,7 +840,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -862,7 +864,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1248,7 +1250,7 @@ case 18: #line 70 "quote_calc4.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1252 "quote_calc4-s.tab.c" +#line 1254 "quote_calc4-s.tab.c" default: break; } @@ -1303,12 +1305,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1319,7 +1321,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/quote_calc4.tab.c b/test/btyacc/quote_calc4.tab.c index fd5fc8e..ab95058 100644 --- a/test/btyacc/quote_calc4.tab.c +++ b/test/btyacc/quote_calc4.tab.c @@ -191,12 +191,14 @@ static const YYINT quote_calc4_defred[] = { 1, 0, 0, 18, 0, 6, 0, 0, 0, 0, 0, 0, 0, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT quote_calc4_stos[] = { 0, 273, 256, 260, 269, 270, 40, 274, 275, 276, 10, 270, 275, 61, 275, 10, 258, 260, 262, 264, 266, 268, 124, 269, 275, 41, 275, 275, 275, 275, 275, 275, 275, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT quote_calc4_dgoto[] = { 1, 7, 8, 9, }; @@ -476,9 +478,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 73 "quote_calc4.y" /* start of programs */ @@ -521,7 +523,7 @@ yylex(void) { } return( c ); } -#line 525 "quote_calc4.tab.c" +#line 527 "quote_calc4.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -724,10 +726,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -737,7 +739,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -838,7 +840,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -862,7 +864,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1248,7 +1250,7 @@ case 18: #line 70 "quote_calc4.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1252 "quote_calc4.tab.c" +#line 1254 "quote_calc4.tab.c" default: break; } @@ -1303,12 +1305,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1319,7 +1321,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/rename_debug.c b/test/btyacc/rename_debug.c index ecb1221..ce7cb3d 100644 --- a/test/btyacc/rename_debug.c +++ b/test/btyacc/rename_debug.c @@ -29,9 +29,11 @@ static const YYINT yylen[] = { 2, static const YYINT yydefred[] = { 0, 1, 0, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT yystos[] = { 0, 256, 258, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT yydgoto[] = { 2, }; static const YYINT yysindex[] = { -256, @@ -201,9 +203,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 12 "code_debug.y" @@ -231,7 +233,7 @@ yyerror(const char* s) { printf("%s\n", s); } -#line 236 "rename_debug.c" +#line 238 "rename_debug.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -434,10 +436,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -447,7 +449,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -548,7 +550,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -572,7 +574,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -952,12 +954,12 @@ yyreduce: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -968,7 +970,7 @@ yyreduce: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) diff --git a/test/btyacc/varsyntax_calc1.tab.c b/test/btyacc/varsyntax_calc1.tab.c index 16422a9..48723e1 100644 --- a/test/btyacc/varsyntax_calc1.tab.c +++ b/test/btyacc/varsyntax_calc1.tab.c @@ -216,6 +216,7 @@ static const YYINT varsyntax_calc1_defred[] = { 0, 0, 0, 0, 0, 5, 6, 0, 0, 0, 12, 13, 17, }; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) static const YYINT varsyntax_calc1_stos[] = { 0, 256, 257, 258, 259, 45, 40, 262, 263, 264, 10, 61, 61, 257, 258, 263, 264, 263, 264, 43, 45, @@ -225,6 +226,7 @@ static const YYINT varsyntax_calc1_stos[] = { 0, 43, 45, 42, 47, 10, 10, 263, 263, 263, 263, 263, 41, }; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ static const YYINT varsyntax_calc1_dgoto[] = { 7, 32, 9, 0, }; @@ -512,9 +514,9 @@ static YYLTYPE *yylplim = 0; #endif /* Current position at lexical token queue */ -static short *yylexp = 0; +static YYINT *yylexp = 0; -static short *yylexemes = 0; +static YYINT *yylexemes = 0; #endif /* YYBTYACC */ #line 178 "varsyntax_calc1.y" /* beginning of subroutines section */ @@ -647,7 +649,7 @@ vdiv(double a, double b, INTERVAL v) { return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo)); } -#line 651 "varsyntax_calc1.tab.c" +#line 653 "varsyntax_calc1.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -850,10 +852,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -863,7 +865,7 @@ yyloop: #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) @@ -964,7 +966,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = (short *) malloc((YYLVQUEUEGROWTH) * sizeof(short)); + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -988,7 +990,7 @@ yyloop: #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) *yylpe++ = yylloc; #endif - *yylexp = (short) yychar; + *yylexp = (YYINT) yychar; yychar = YYEMPTY; } } @@ -1477,7 +1479,7 @@ case 28: yyval.vval = yystack.l_mark[-1].vval; } break; -#line 1481 "varsyntax_calc1.tab.c" +#line 1483 "varsyntax_calc1.tab.c" default: break; } @@ -1532,12 +1534,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = (short *) realloc(yylexemes, s * sizeof(short))) == NULL) + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = (YYSTYPE *) realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = (YYLTYPE *) realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; @@ -1548,7 +1550,7 @@ break; #endif yylexp = yylexemes + p; } - *yylexp = (short) YYLEX; + *yylexp = (YYINT) YYLEX; *yylvp++ = yylval; yylve++; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) |