summaryrefslogtreecommitdiff
path: root/test/btyacc/inherit2.tab.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/btyacc/inherit2.tab.c')
-rw-r--r--test/btyacc/inherit2.tab.c140
1 files changed, 72 insertions, 68 deletions
diff --git a/test/btyacc/inherit2.tab.c b/test/btyacc/inherit2.tab.c
index 67eb0bdf01644..e14f6015b6dbf 100644
--- a/test/btyacc/inherit2.tab.c
+++ b/test/btyacc/inherit2.tab.c
@@ -1,6 +1,6 @@
/* original parser id follows */
/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
-/* (use YYMAJOR/YYMINOR for ifdefs dependent of parser version) */
+/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
#define YYBYACC 1
#define YYMAJOR 1
@@ -136,13 +136,13 @@ extern symbol *mksymbol(type t, class c, name id);
#define YYLEX_DECL() yylex(void)
#define YYERROR_DECL() yyerror(const char *s)
#endif
-#line 39 "inherit2.y"
#ifdef YYSTYPE
#undef YYSTYPE_IS_DECLARED
#define YYSTYPE_IS_DECLARED 1
#endif
#ifndef YYSTYPE_IS_DECLARED
#define YYSTYPE_IS_DECLARED 1
+#line 39 "inherit2.y"
typedef union
{
class cval;
@@ -199,54 +199,54 @@ extern int YYPARSE_DECL();
#define YYERRCODE 256
typedef short YYINT;
static const YYINT inherit2_lhs[] = { -1,
- 5, 6, 0, 7, 0, 3, 3, 4, 4, 1,
- 1, 8, 2,
+ 5, 6, 0, 0, 3, 3, 4, 4, 1, 1,
+ 7, 2,
};
static const YYINT inherit2_len[] = { 2,
- 0, 0, 5, 0, 3, 1, 1, 1, 1, 2,
- 1, 0, 3,
+ 0, 0, 5, 2, 1, 1, 1, 1, 2, 1,
+ 0, 3,
};
static const YYINT inherit2_defred[] = { 0,
- 6, 7, 8, 9, 0, 0, 4, 1, 12, 2,
- 5, 2, 0, 0, 11, 0, 0, 10,
+ 5, 6, 7, 8, 0, 0, 11, 1, 4, 2,
+ 2, 0, 0, 10, 0, 0, 9,
};
static const YYINT inherit2_stos[] = { 0,
- 257, 258, 259, 260, 263, 266, 267, 267, 270, 268,
- 265, 271, 269, 269, 261, 264, 264, 261,
+ 257, 258, 259, 260, 263, 266, 267, 267, 265, 270,
+ 268, 269, 269, 261, 264, 264, 261,
};
static const YYINT inherit2_dgoto[] = { 5,
- 16, 11, 6, 7, 10, 13, 9, 12,
+ 15, 9, 6, 7, 11, 12, 10,
};
static const YYINT inherit2_sindex[] = { -257,
0, 0, 0, 0, 0, -255, 0, 0, 0, 0,
- 0, 0, -254, -254, 0, -253, -253, 0,
+ 0, -254, -254, 0, -253, -253, 0,
};
static const YYINT inherit2_rindex[] = { 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 6, 9, 0,
+ 0, 0, 0, 0, 6, 9, 0,
};
#if YYBTYACC
static const YYINT inherit2_cindex[] = { 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0,
};
#endif
static const YYINT inherit2_gindex[] = { 0,
- -4, 0, 0, 5, 0, 1, 0, 0,
+ -3, 0, 0, 5, 0, 1, 0,
};
-#define YYTABLESIZE 13
+#define YYTABLESIZE 12
static const YYINT inherit2_table[] = { 1,
- 2, 3, 4, 3, 4, 3, 15, 18, 13, 17,
- 8, 0, 14,
+ 2, 3, 4, 3, 4, 12, 14, 17, 3, 16,
+ 8, 13,
};
static const YYINT inherit2_check[] = { 257,
- 258, 259, 260, 259, 260, 0, 261, 261, 0, 14,
- 6, -1, 12,
+ 258, 259, 260, 259, 260, 0, 261, 261, 0, 13,
+ 6, 11,
};
#if YYBTYACC
static const YYINT inherit2_ctable[] = { -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1,
+ -1,
};
#endif
#define YYFINAL 5
@@ -254,7 +254,7 @@ static const YYINT inherit2_ctable[] = { -1,
#define YYDEBUG 0
#endif
#define YYMAXTOKEN 261
-#define YYUNDFTOKEN 272
+#define YYUNDFTOKEN 271
#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
#if YYDEBUG
static const char *const inherit2_name[] = {
@@ -267,23 +267,22 @@ static const char *const inherit2_name[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"error","GLOBAL","LOCAL","REAL","INTEGER",
"NAME","$accept","declaration","namelist","locnamelist","class","type","$$1",
-"$$2","$$3","$$4","illegal-symbol",
+"$$2","$$3","illegal-symbol",
};
static const char *const inherit2_rule[] = {
"$accept : declaration",
"$$1 :",
"$$2 :",
"declaration : class type $$1 $$2 namelist",
-"$$3 :",
-"declaration : type $$3 locnamelist",
+"declaration : type locnamelist",
"class : GLOBAL",
"class : LOCAL",
"type : REAL",
"type : INTEGER",
"namelist : namelist NAME",
"namelist : NAME",
-"$$4 :",
-"locnamelist : $$4 $$2 namelist",
+"$$3 :",
+"locnamelist : $$3 $$2 namelist",
};
#endif
@@ -348,9 +347,9 @@ do \
typedef struct {
unsigned stacksize;
- short *s_base;
- short *s_mark;
- short *s_last;
+ YYINT *s_base;
+ YYINT *s_mark;
+ YYINT *s_last;
YYSTYPE *l_base;
YYSTYPE *l_mark;
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
@@ -416,7 +415,7 @@ static short *yylexemes = 0;
extern int YYLEX_DECL();
extern void YYERROR_DECL();
-#line 420 "inherit2.tab.c"
+#line 419 "inherit2.tab.c"
/* Release memory associated with symbol. */
#if ! defined YYDESTRUCT_IS_DECLARED
@@ -436,7 +435,7 @@ YYDESTRUCT_DECL()
}
}
break;
-#line 440 "inherit2.tab.c"
+#line 439 "inherit2.tab.c"
case 264:
#line 30 "inherit2.y"
{
@@ -448,7 +447,7 @@ YYDESTRUCT_DECL()
}
}
break;
-#line 452 "inherit2.tab.c"
+#line 451 "inherit2.tab.c"
case 265:
#line 30 "inherit2.y"
{
@@ -460,7 +459,7 @@ YYDESTRUCT_DECL()
}
}
break;
-#line 464 "inherit2.tab.c"
+#line 463 "inherit2.tab.c"
}
}
#define YYDESTRUCT_IS_DECLARED 1
@@ -473,18 +472,18 @@ YYDESTRUCT_DECL()
#endif /* YYBTYACC */
#if YYDEBUG
-#include <stdio.h> /* needed for printf */
+#include <stdio.h> /* needed for printf */
#endif
-#include <stdlib.h> /* needed for malloc, etc */
-#include <string.h> /* needed for memset */
+#include <stdlib.h> /* needed for malloc, etc */
+#include <string.h> /* needed for memset */
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
static int yygrowstack(YYSTACKDATA *data)
{
int i;
unsigned newsize;
- short *newss;
+ YYINT *newss;
YYSTYPE *newvs;
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
YYLTYPE *newps;
@@ -498,7 +497,7 @@ static int yygrowstack(YYSTACKDATA *data)
newsize = YYMAXDEPTH;
i = (int) (data->s_mark - data->s_base);
- newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
+ newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
if (newss == 0)
return YYENOMEM;
@@ -562,7 +561,7 @@ yyNewState(unsigned size)
#endif
return p;
}
- p->yystack.s_base = (short *) malloc(size * sizeof(short));
+ p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT));
if (p->yystack.s_base == NULL) return NULL;
p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE));
if (p->yystack.l_base == NULL) return NULL;
@@ -622,6 +621,8 @@ YYPARSE_DECL()
yyps = yyNewState(0); if (yyps == 0) goto yyenomem;
yyps->save = 0;
#endif /* YYBTYACC */
+ yym = 0;
+ yyn = 0;
yynerrs = 0;
yyerrflag = 0;
yychar = YYEMPTY;
@@ -695,11 +696,10 @@ yyloop:
} while (0);
#endif /* YYBTYACC */
if (yychar < 0) yychar = YYEOF;
- /* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
#if YYDEBUG
if (yydebug)
{
- yys = yyname[YYTRANSLATE(yychar)];
+ if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)",
YYDEBUGSTR, yydepth, yystate, yychar, yys);
#ifdef YYSTYPE_TOSTRING
@@ -758,7 +758,7 @@ yyloop:
save->state = yystate;
save->errflag = yyerrflag;
save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base);
- memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
+ memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base);
memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
@@ -839,7 +839,7 @@ yyloop:
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
goto yyoverflow;
yystate = yyctable[ctry];
- *++yystack.s_mark = (short) yystate;
+ *++yystack.s_mark = (YYINT) yystate;
*++yystack.l_mark = yylval;
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
*++yystack.p_mark = yylloc;
@@ -885,9 +885,18 @@ yyloop:
yynewerrflag = 1;
goto yyerrhandler;
- goto yyerrlab;
+ goto yyerrlab; /* redundant goto avoids 'unused label' warning */
yyerrlab:
+ /* explicit YYERROR from an action -- pop the rhs of the rule reduced
+ * before looking for error recovery */
+ yystack.s_mark -= yym;
+ yystate = *yystack.s_mark;
+ yystack.l_mark -= yym;
+#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
+ yystack.p_mark -= yym;
+#endif
+
yynewerrflag = 0;
yyerrhandler:
while (yyps->save)
@@ -912,7 +921,7 @@ yyerrhandler:
yyerrctx->state = yystate;
yyerrctx->errflag = yyerrflag;
yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base);
- memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
+ memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base);
memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
@@ -928,7 +937,7 @@ yyerrhandler:
yylexp = yylexemes + save->lexeme;
yychar = YYEMPTY;
yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base);
- memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
+ memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base);
memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
@@ -963,7 +972,7 @@ yyerrhandler:
yylloc = yylpp[-1];
#endif
yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base);
- memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
+ memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base);
memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
@@ -985,7 +994,7 @@ yyerrhandler:
#endif
#if !YYBTYACC
- goto yyerrlab;
+ goto yyerrlab; /* redundant goto avoids 'unused label' warning */
yyerrlab:
#endif
++yynerrs;
@@ -1054,7 +1063,7 @@ yyinrecovery:
#if YYDEBUG
if (yydebug)
{
- yys = yyname[YYTRANSLATE(yychar)];
+ if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n",
YYDEBUGSTR, yydepth, yystate, yychar, yys);
}
@@ -1134,50 +1143,46 @@ case 3:
{ yyval.nlist = yystack.l_mark[0].nlist; }
break;
case 4:
-#line 52 "inherit2.y"
-yyval.tval = yystack.l_mark[0].tval;
-break;
-case 5:
#line 53 "inherit2.y"
{ yyval.nlist = yystack.l_mark[0].nlist; }
break;
-case 6:
+case 5:
#line 56 "inherit2.y"
{ yyval.cval = cGLOBAL; }
break;
-case 7:
+case 6:
#line 57 "inherit2.y"
{ yyval.cval = cLOCAL; }
break;
-case 8:
+case 7:
#line 60 "inherit2.y"
{ yyval.tval = tREAL; }
break;
-case 9:
+case 8:
#line 61 "inherit2.y"
{ yyval.tval = tINTEGER; }
break;
-case 10:
+case 9:
#line 65 "inherit2.y"
{ yyval.nlist->s = mksymbol(yystack.l_mark[-2].tval, yystack.l_mark[-3].cval, yystack.l_mark[0].id);
yyval.nlist->next = yystack.l_mark[-1].nlist;
}
break;
-case 11:
+case 10:
#line 69 "inherit2.y"
{ yyval.nlist->s = mksymbol(yystack.l_mark[-1].tval, yystack.l_mark[-2].cval, yystack.l_mark[0].id);
yyval.nlist->next = NULL;
}
break;
-case 12:
+case 11:
#line 74 "inherit2.y"
yyval.cval = cLOCAL;
break;
-case 13:
+case 12:
#line 75 "inherit2.y"
{ yyval.nlist = yystack.l_mark[0].nlist; }
break;
-#line 1181 "inherit2.tab.c"
+#line 1186 "inherit2.tab.c"
default:
break;
}
@@ -1265,12 +1270,11 @@ break;
} while (0);
#endif /* YYBTYACC */
if (yychar < 0) yychar = YYEOF;
- /* if ((yychar = YYLEX) < 0) yychar = YYEOF; */
#if YYDEBUG
if (yydebug)
{
- yys = yyname[YYTRANSLATE(yychar)];
- fprintf(stderr, "%s[%d]: state %d, reading %d (%s)\n",
+ if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
+ fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n",
YYDEBUGSTR, yydepth, YYFINAL, yychar, yys);
}
#endif
@@ -1297,7 +1301,7 @@ break;
}
#endif
if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
- *++yystack.s_mark = (short) yystate;
+ *++yystack.s_mark = (YYINT) yystate;
*++yystack.l_mark = yyval;
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)
*++yystack.p_mark = yyloc;
@@ -1332,7 +1336,7 @@ yyvalid:
yylexp = yylexemes + yypath->lexeme;
yychar = YYEMPTY;
yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base);
- memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(short));
+ memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT));
yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base);
memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE));
#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)