1993-03-21 12:45:37 +03:00
|
|
|
#ifndef lint
|
1993-08-01 21:54:45 +04:00
|
|
|
/*static char yysccsid[] = "from: @(#)yaccpar 1.9 (Berkeley) 02/21/93";*/
|
1997-01-09 23:18:21 +03:00
|
|
|
static char rcsid[] = "$NetBSD: error.tab.c,v 1.4 1997/01/09 20:23:30 tls Exp $";
|
1993-03-21 12:45:37 +03:00
|
|
|
#endif
|
1993-05-28 16:32:12 +04:00
|
|
|
#define YYBYACC 1
|
|
|
|
#define YYMAJOR 1
|
|
|
|
#define YYMINOR 9
|
|
|
|
#define yyclearin (yychar=(-1))
|
|
|
|
#define yyerrok (yyerrflag=0)
|
|
|
|
#define YYRECOVERING (yyerrflag!=0)
|
|
|
|
#define YYPREFIX "yy"
|
1993-03-21 12:45:37 +03:00
|
|
|
#define YYERRCODE 256
|
|
|
|
short yylhs[] = { -1,
|
|
|
|
0,
|
|
|
|
};
|
|
|
|
short yylen[] = { 2,
|
|
|
|
1,
|
|
|
|
};
|
|
|
|
short yydefred[] = { 0,
|
|
|
|
1, 0,
|
|
|
|
};
|
|
|
|
short yydgoto[] = { 2,
|
|
|
|
};
|
|
|
|
short yysindex[] = { -256,
|
|
|
|
0, 0,
|
|
|
|
};
|
|
|
|
short yyrindex[] = { 0,
|
|
|
|
0, 0,
|
|
|
|
};
|
|
|
|
short yygindex[] = { 0,
|
|
|
|
};
|
|
|
|
#define YYTABLESIZE 0
|
|
|
|
short yytable[] = { 1,
|
|
|
|
};
|
|
|
|
short yycheck[] = { 256,
|
|
|
|
};
|
|
|
|
#define YYFINAL 2
|
|
|
|
#ifndef YYDEBUG
|
|
|
|
#define YYDEBUG 0
|
|
|
|
#endif
|
|
|
|
#define YYMAXTOKEN 0
|
|
|
|
#if YYDEBUG
|
|
|
|
char *yyname[] = {
|
|
|
|
"end-of-file",
|
|
|
|
};
|
|
|
|
char *yyrule[] = {
|
|
|
|
"$accept : S",
|
|
|
|
"S : error",
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
#ifndef YYSTYPE
|
|
|
|
typedef int YYSTYPE;
|
|
|
|
#endif
|
1993-05-28 16:32:12 +04:00
|
|
|
#ifdef YYSTACKSIZE
|
|
|
|
#undef YYMAXDEPTH
|
|
|
|
#define YYMAXDEPTH YYSTACKSIZE
|
|
|
|
#else
|
1993-03-21 12:45:37 +03:00
|
|
|
#ifdef YYMAXDEPTH
|
|
|
|
#define YYSTACKSIZE YYMAXDEPTH
|
|
|
|
#else
|
1993-05-28 16:32:12 +04:00
|
|
|
#define YYSTACKSIZE 500
|
|
|
|
#define YYMAXDEPTH 500
|
1993-03-21 12:45:37 +03:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
int yydebug;
|
|
|
|
int yynerrs;
|
|
|
|
int yyerrflag;
|
|
|
|
int yychar;
|
|
|
|
short *yyssp;
|
|
|
|
YYSTYPE *yyvsp;
|
|
|
|
YYSTYPE yyval;
|
|
|
|
YYSTYPE yylval;
|
|
|
|
short yyss[YYSTACKSIZE];
|
|
|
|
YYSTYPE yyvs[YYSTACKSIZE];
|
1993-05-28 16:32:12 +04:00
|
|
|
#define yystacksize YYSTACKSIZE
|
1993-03-21 12:45:37 +03:00
|
|
|
#line 4 "error.y"
|
|
|
|
main(){printf("yyparse() = %d\n",yyparse());}
|
|
|
|
yylex(){return-1;}
|
|
|
|
yyerror(s)char*s;{printf("%s\n",s);}
|
1993-05-28 16:32:12 +04:00
|
|
|
#line 80 "error.tab.c"
|
1993-03-21 12:45:37 +03:00
|
|
|
#define YYABORT goto yyabort
|
1993-05-28 16:32:12 +04:00
|
|
|
#define YYREJECT goto yyabort
|
1993-03-21 12:45:37 +03:00
|
|
|
#define YYACCEPT goto yyaccept
|
|
|
|
#define YYERROR goto yyerrlab
|
|
|
|
int
|
|
|
|
yyparse()
|
|
|
|
{
|
|
|
|
register int yym, yyn, yystate;
|
|
|
|
#if YYDEBUG
|
|
|
|
register char *yys;
|
|
|
|
extern char *getenv();
|
|
|
|
|
|
|
|
if (yys = getenv("YYDEBUG"))
|
|
|
|
{
|
|
|
|
yyn = *yys;
|
1993-05-28 16:32:12 +04:00
|
|
|
if (yyn >= '0' && yyn <= '9')
|
1993-03-21 12:45:37 +03:00
|
|
|
yydebug = yyn - '0';
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
yynerrs = 0;
|
|
|
|
yyerrflag = 0;
|
|
|
|
yychar = (-1);
|
|
|
|
|
|
|
|
yyssp = yyss;
|
|
|
|
yyvsp = yyvs;
|
|
|
|
*yyssp = yystate = 0;
|
|
|
|
|
|
|
|
yyloop:
|
|
|
|
if (yyn = yydefred[yystate]) goto yyreduce;
|
|
|
|
if (yychar < 0)
|
|
|
|
{
|
|
|
|
if ((yychar = yylex()) < 0) yychar = 0;
|
|
|
|
#if YYDEBUG
|
|
|
|
if (yydebug)
|
|
|
|
{
|
|
|
|
yys = 0;
|
|
|
|
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
|
|
|
|
if (!yys) yys = "illegal-symbol";
|
1993-05-28 16:32:12 +04:00
|
|
|
printf("%sdebug: state %d, reading %d (%s)\n",
|
|
|
|
YYPREFIX, yystate, yychar, yys);
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
|
|
|
|
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
|
|
|
|
{
|
|
|
|
#if YYDEBUG
|
|
|
|
if (yydebug)
|
1993-05-28 16:32:12 +04:00
|
|
|
printf("%sdebug: state %d, shifting to state %d\n",
|
|
|
|
YYPREFIX, yystate, yytable[yyn]);
|
1993-03-21 12:45:37 +03:00
|
|
|
#endif
|
|
|
|
if (yyssp >= yyss + yystacksize - 1)
|
|
|
|
{
|
|
|
|
goto yyoverflow;
|
|
|
|
}
|
|
|
|
*++yyssp = yystate = yytable[yyn];
|
|
|
|
*++yyvsp = yylval;
|
|
|
|
yychar = (-1);
|
|
|
|
if (yyerrflag > 0) --yyerrflag;
|
|
|
|
goto yyloop;
|
|
|
|
}
|
|
|
|
if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
|
|
|
|
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
|
|
|
|
{
|
|
|
|
yyn = yytable[yyn];
|
|
|
|
goto yyreduce;
|
|
|
|
}
|
|
|
|
if (yyerrflag) goto yyinrecovery;
|
|
|
|
#ifdef lint
|
|
|
|
goto yynewerror;
|
|
|
|
#endif
|
|
|
|
yynewerror:
|
|
|
|
yyerror("syntax error");
|
|
|
|
#ifdef lint
|
|
|
|
goto yyerrlab;
|
|
|
|
#endif
|
|
|
|
yyerrlab:
|
|
|
|
++yynerrs;
|
|
|
|
yyinrecovery:
|
|
|
|
if (yyerrflag < 3)
|
|
|
|
{
|
|
|
|
yyerrflag = 3;
|
|
|
|
for (;;)
|
|
|
|
{
|
|
|
|
if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
|
|
|
|
yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
|
|
|
|
{
|
|
|
|
#if YYDEBUG
|
|
|
|
if (yydebug)
|
1993-05-28 16:32:12 +04:00
|
|
|
printf("%sdebug: state %d, error recovery shifting\
|
|
|
|
to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
|
1993-03-21 12:45:37 +03:00
|
|
|
#endif
|
|
|
|
if (yyssp >= yyss + yystacksize - 1)
|
|
|
|
{
|
|
|
|
goto yyoverflow;
|
|
|
|
}
|
|
|
|
*++yyssp = yystate = yytable[yyn];
|
|
|
|
*++yyvsp = yylval;
|
|
|
|
goto yyloop;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
#if YYDEBUG
|
|
|
|
if (yydebug)
|
1993-05-28 16:32:12 +04:00
|
|
|
printf("%sdebug: error recovery discarding state %d\n",
|
|
|
|
YYPREFIX, *yyssp);
|
1993-03-21 12:45:37 +03:00
|
|
|
#endif
|
|
|
|
if (yyssp <= yyss) goto yyabort;
|
|
|
|
--yyssp;
|
|
|
|
--yyvsp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (yychar == 0) goto yyabort;
|
|
|
|
#if YYDEBUG
|
|
|
|
if (yydebug)
|
|
|
|
{
|
|
|
|
yys = 0;
|
|
|
|
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
|
|
|
|
if (!yys) yys = "illegal-symbol";
|
1993-05-28 16:32:12 +04:00
|
|
|
printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
|
|
|
|
YYPREFIX, yystate, yychar, yys);
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
yychar = (-1);
|
|
|
|
goto yyloop;
|
|
|
|
}
|
|
|
|
yyreduce:
|
|
|
|
#if YYDEBUG
|
|
|
|
if (yydebug)
|
1993-05-28 16:32:12 +04:00
|
|
|
printf("%sdebug: state %d, reducing by rule %d (%s)\n",
|
|
|
|
YYPREFIX, yystate, yyn, yyrule[yyn]);
|
1993-03-21 12:45:37 +03:00
|
|
|
#endif
|
|
|
|
yym = yylen[yyn];
|
|
|
|
yyval = yyvsp[1-yym];
|
|
|
|
switch (yyn)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
yyssp -= yym;
|
|
|
|
yystate = *yyssp;
|
|
|
|
yyvsp -= yym;
|
|
|
|
yym = yylhs[yyn];
|
|
|
|
if (yystate == 0 && yym == 0)
|
|
|
|
{
|
1993-05-28 16:32:12 +04:00
|
|
|
#if YYDEBUG
|
1993-03-21 12:45:37 +03:00
|
|
|
if (yydebug)
|
1993-05-28 16:32:12 +04:00
|
|
|
printf("%sdebug: after reduction, shifting from state 0 to\
|
|
|
|
state %d\n", YYPREFIX, YYFINAL);
|
1993-03-21 12:45:37 +03:00
|
|
|
#endif
|
|
|
|
yystate = YYFINAL;
|
|
|
|
*++yyssp = YYFINAL;
|
|
|
|
*++yyvsp = yyval;
|
|
|
|
if (yychar < 0)
|
|
|
|
{
|
|
|
|
if ((yychar = yylex()) < 0) yychar = 0;
|
|
|
|
#if YYDEBUG
|
|
|
|
if (yydebug)
|
|
|
|
{
|
|
|
|
yys = 0;
|
|
|
|
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
|
|
|
|
if (!yys) yys = "illegal-symbol";
|
1993-05-28 16:32:12 +04:00
|
|
|
printf("%sdebug: state %d, reading %d (%s)\n",
|
|
|
|
YYPREFIX, YYFINAL, yychar, yys);
|
1993-03-21 12:45:37 +03:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
if (yychar == 0) goto yyaccept;
|
|
|
|
goto yyloop;
|
|
|
|
}
|
|
|
|
if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
|
|
|
|
yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
|
|
|
|
yystate = yytable[yyn];
|
|
|
|
else
|
|
|
|
yystate = yydgoto[yym];
|
1993-05-28 16:32:12 +04:00
|
|
|
#if YYDEBUG
|
1993-03-21 12:45:37 +03:00
|
|
|
if (yydebug)
|
1993-05-28 16:32:12 +04:00
|
|
|
printf("%sdebug: after reduction, shifting from state %d \
|
|
|
|
to state %d\n", YYPREFIX, *yyssp, yystate);
|
1993-03-21 12:45:37 +03:00
|
|
|
#endif
|
|
|
|
if (yyssp >= yyss + yystacksize - 1)
|
|
|
|
{
|
|
|
|
goto yyoverflow;
|
|
|
|
}
|
|
|
|
*++yyssp = yystate;
|
|
|
|
*++yyvsp = yyval;
|
|
|
|
goto yyloop;
|
|
|
|
yyoverflow:
|
|
|
|
yyerror("yacc stack overflow");
|
|
|
|
yyabort:
|
|
|
|
return (1);
|
|
|
|
yyaccept:
|
|
|
|
return (0);
|
|
|
|
}
|