aboutsummaryrefslogtreecommitdiff
path: root/test/btyacc/err_inherit4.tab.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/btyacc/err_inherit4.tab.c')
-rw-r--r--test/btyacc/err_inherit4.tab.c132
1 files changed, 68 insertions, 64 deletions
diff --git a/test/btyacc/err_inherit4.tab.c b/test/btyacc/err_inherit4.tab.c
index 7e8e04242eee..daa6881f0f72 100644
--- a/test/btyacc/err_inherit4.tab.c
+++ b/test/btyacc/err_inherit4.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
@@ -144,13 +144,13 @@ extern symbol *mksymbol(type t, class c, name id);
#define YYLEX_DECL() yylex(void)
#define YYERROR_DECL() yyerror(const char *s)
#endif
-#line 41 "err_inherit4.y"
#ifdef YYSTYPE
#undef YYSTYPE_IS_DECLARED
#define YYSTYPE_IS_DECLARED 1
#endif
#ifndef YYSTYPE_IS_DECLARED
#define YYSTYPE_IS_DECLARED 1
+#line 41 "err_inherit4.y"
typedef union
{
class cval;
@@ -219,44 +219,44 @@ extern int YYPARSE_DECL();
#define YYERRCODE 256
typedef short YYINT;
static const YYINT err_inherit4_lhs[] = { -1,
- 5, 6, 0, 7, 0, 3, 3, 4, 4, 1,
- 1, 2,
+ 5, 6, 0, 0, 3, 3, 4, 4, 1, 1,
+ 2,
};
static const YYINT err_inherit4_len[] = { 2,
- 0, 0, 5, 0, 3, 1, 1, 1, 1, 2,
- 1, 1,
+ 0, 0, 5, 2, 1, 1, 1, 1, 2, 1,
+ 1,
};
static const YYINT err_inherit4_defred[] = { 0,
- 6, 7, 8, 9, 0, 0, 4, 1, 0, 2,
- 11, 0, 5, 0, 10, 0,
+ 5, 6, 7, 8, 0, 0, 0, 1, 10, 0,
+ 4, 2, 9, 0, 0,
};
static const YYINT err_inherit4_stos[] = { 0,
- 257, 258, 259, 260, 263, 266, 267, 267, 270, 268,
- 261, 264, 265, 269, 261, 264,
+ 257, 258, 259, 260, 263, 266, 267, 267, 261, 264,
+ 265, 268, 261, 269, 264,
};
static const YYINT err_inherit4_dgoto[] = { 5,
- 12, 13, 6, 7, 10, 14, 9,
+ 10, 11, 6, 7, 12, 14,
};
static const YYINT err_inherit4_sindex[] = { -257,
- 0, 0, 0, 0, 0, -255, 0, 0, -254, 0,
- 0, -253, 0, -254, 0, -253,
+ 0, 0, 0, 0, 0, -255, -254, 0, 0, -253,
+ 0, 0, 0, -254, -253,
};
static const YYINT err_inherit4_rindex[] = { 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 6, 0, 0, 0, 9,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,
+ 0, 0, 0, 0, 9,
};
#if YYBTYACC
static const YYINT err_inherit4_cindex[] = { 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 err_inherit4_gindex[] = { 0,
- -4, 0, 0, 5, 0, 0, 0,
+ -4, 0, 0, 5, 0, 0,
};
#define YYTABLESIZE 11
static const YYINT err_inherit4_table[] = { 1,
- 2, 3, 4, 3, 4, 12, 11, 15, 3, 16,
+ 2, 3, 4, 3, 4, 11, 9, 13, 3, 15,
8,
};
static const YYINT err_inherit4_check[] = { 257,
@@ -273,7 +273,7 @@ static const YYINT err_inherit4_ctable[] = { -1,
#define YYDEBUG 0
#endif
#define YYMAXTOKEN 261
-#define YYUNDFTOKEN 271
+#define YYUNDFTOKEN 270
#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
#if YYDEBUG
static const char *const err_inherit4_name[] = {
@@ -286,15 +286,14 @@ static const char *const err_inherit4_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","illegal-symbol",
+"$$2","illegal-symbol",
};
static const char *const err_inherit4_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",
@@ -366,9 +365,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)
@@ -434,7 +433,7 @@ static short *yylexemes = 0;
extern int YYLEX_DECL();
extern void YYERROR_DECL();
-#line 438 "err_inherit4.tab.c"
+#line 437 "err_inherit4.tab.c"
/* Release memory associated with symbol. */
#if ! defined YYDESTRUCT_IS_DECLARED
@@ -447,17 +446,17 @@ YYDESTRUCT_DECL()
#line 28 "err_inherit4.y"
{ }
break;
-#line 451 "err_inherit4.tab.c"
+#line 450 "err_inherit4.tab.c"
case 264:
#line 28 "err_inherit4.y"
{ }
break;
-#line 456 "err_inherit4.tab.c"
+#line 455 "err_inherit4.tab.c"
case 265:
#line 28 "err_inherit4.y"
{ }
break;
-#line 461 "err_inherit4.tab.c"
+#line 460 "err_inherit4.tab.c"
}
}
#define YYDESTRUCT_IS_DECLARED 1
@@ -470,18 +469,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;
@@ -495,7 +494,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;
@@ -559,7 +558,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;
@@ -619,6 +618,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;
@@ -692,11 +693,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
@@ -755,7 +755,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)
@@ -836,7 +836,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;
@@ -882,9 +882,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)
@@ -909,7 +918,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)
@@ -925,7 +934,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)
@@ -960,7 +969,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)
@@ -982,7 +991,7 @@ yyerrhandler:
#endif
#if !YYBTYACC
- goto yyerrlab;
+ goto yyerrlab; /* redundant goto avoids 'unused label' warning */
yyerrlab:
#endif
++yynerrs;
@@ -1051,7 +1060,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);
}
@@ -1128,49 +1137,45 @@ yyval.tval = yystack.l_mark[-1].tval;
break;
case 3:
#line 53 "err_inherit4.y"
- { yyval.nlist = yystack.l_mark[0].nlist; }
+ { yyval.nlist = yystack.l_mark[0].nlist; yyloc = yystack.p_mark[0]; }
break;
case 4:
-#line 54 "err_inherit4.y"
-yyval.tval = yystack.l_mark[0].tval;
-break;
-case 5:
#line 55 "err_inherit4.y"
- { yyval.nlist = yystack.l_mark[0].nlist; }
+ { yyval.nlist = yystack.l_mark[0].nlist; yyloc = yystack.p_mark[-3]; }
break;
-case 6:
+case 5:
#line 58 "err_inherit4.y"
{ yyval.cval = cGLOBAL; }
break;
-case 7:
+case 6:
#line 59 "err_inherit4.y"
{ yyval.cval = cLOCAL; }
break;
-case 8:
+case 7:
#line 62 "err_inherit4.y"
{ yyval.tval = tREAL; }
break;
-case 9:
+case 8:
#line 63 "err_inherit4.y"
{ yyval.tval = tINTEGER; }
break;
-case 10:
+case 9:
#line 67 "err_inherit4.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 71 "err_inherit4.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 77 "err_inherit4.y"
{ yyval.nlist = yystack.l_mark[0].nlist; yyloc = yystack.p_mark[1]; }
break;
-#line 1174 "err_inherit4.tab.c"
+#line 1179 "err_inherit4.tab.c"
default:
break;
}
@@ -1258,12 +1263,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
@@ -1290,7 +1294,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;
@@ -1325,7 +1329,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)