OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [tags/] [eco32-0.26/] [lcc/] [tst/] [yacc.c] - Diff between revs 4 and 270

Only display areas with differences | Details | Blame | View Log

Rev 4 Rev 270
# define ID 257
# define ID 257
# define CON 258
# define CON 258
# define UNARYMINUS 259
# define UNARYMINUS 259
#define yyclearin yychar = -1
#define yyclearin yychar = -1
#define yyerrok yyerrflag = 0
#define yyerrok yyerrflag = 0
extern int yychar;
extern int yychar;
extern short yyerrflag;
extern short yyerrflag;
#ifndef YYMAXDEPTH
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 150
#define YYMAXDEPTH 150
#endif
#endif
#ifndef YYSTYPE
#ifndef YYSTYPE
#define YYSTYPE int
#define YYSTYPE int
#endif
#endif
YYSTYPE yylval, yyval;
YYSTYPE yylval, yyval;
# define YYERRCODE 256
# define YYERRCODE 256
 
 
 
 
 
 
#include <stdio.h>
#include <stdio.h>
 
 
# define U(x) x
# define U(x) x
# define NLSTATE yyprevious=YYNEWLINE
# define NLSTATE yyprevious=YYNEWLINE
# define BEGIN yybgin = yysvec + 1 +
# define BEGIN yybgin = yysvec + 1 +
# define INITIAL 0
# define INITIAL 0
# define YYLERR yysvec
# define YYLERR yysvec
# define YYSTATE (yyestate-yysvec-1)
# define YYSTATE (yyestate-yysvec-1)
# define YYOPTIM 1
# define YYOPTIM 1
# define YYLMAX 200
# define YYLMAX 200
# define output(c) (void)putc(c,yyout)
# define output(c) (void)putc(c,yyout)
# define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)
# define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)
# define unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;}
# define unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;}
# define yymore() (yymorfg=1)
# define yymore() (yymorfg=1)
# define ECHO fprintf(yyout, "%s",yytext)
# define ECHO fprintf(yyout, "%s",yytext)
# define REJECT { nstr = yyreject(); goto yyfussy;}
# define REJECT { nstr = yyreject(); goto yyfussy;}
int yyleng; extern char yytext[];
int yyleng; extern char yytext[];
int yymorfg;
int yymorfg;
extern char *yysptr, yysbuf[];
extern char *yysptr, yysbuf[];
int yytchar;
int yytchar;
FILE *yyin = NULL, *yyout = NULL;
FILE *yyin = NULL, *yyout = NULL;
extern int yylineno;
extern int yylineno;
struct yysvf {
struct yysvf {
        struct yywork *yystoff;
        struct yywork *yystoff;
        struct yysvf *yyother;
        struct yysvf *yyother;
        int *yystops;};
        int *yystops;};
struct yysvf *yyestate;
struct yysvf *yyestate;
extern struct yysvf yysvec[], *yybgin;
extern struct yysvf yysvec[], *yybgin;
# define YYNEWLINE 10
# define YYNEWLINE 10
yylex(){
yylex(){
int nstr; extern int yyprevious;
int nstr; extern int yyprevious;
while((nstr = yylook()) >= 0)
while((nstr = yylook()) >= 0)
yyfussy: switch(nstr){
yyfussy: switch(nstr){
case 0:
case 0:
if(yywrap()) return(0); break;
if(yywrap()) return(0); break;
case 1:
case 1:
 return ID;
 return ID;
break;
break;
case 2:
case 2:
                 return CON;
                 return CON;
break;
break;
case 3:
case 3:
                  ;
                  ;
break;
break;
case 4:
case 4:
                   return yytext[0];
                   return yytext[0];
break;
break;
case -1:
case -1:
break;
break;
default:
default:
fprintf(yyout,"bad switch yylook %d",nstr);
fprintf(yyout,"bad switch yylook %d",nstr);
} return(0); }
} return(0); }
/* end of yylex */
/* end of yylex */
int yyvstop[] ={
int yyvstop[] ={
0,
0,
 
 
4,
4,
0,
0,
 
 
3,
3,
4,
4,
0,
0,
 
 
2,
2,
4,
4,
0,
0,
 
 
1,
1,
4,
4,
0,
0,
 
 
2,
2,
0,
0,
 
 
1,
1,
0,
0,
0};
0};
# define YYTYPE char
# define YYTYPE char
struct yywork { YYTYPE verify, advance; } yycrank[] ={
struct yywork { YYTYPE verify, advance; } yycrank[] ={
0,0,      0,0,      1,3,    0,0,
0,0,      0,0,      1,3,    0,0,
0,0,      0,0,      0,0,      0,0,
0,0,      0,0,      0,0,      0,0,
0,0,      0,0,      1,4,    1,3,
0,0,      0,0,      1,4,    1,3,
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,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,      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,      1,5,    5,7,    5,7,
0,0,      1,5,    5,7,    5,7,
5,7,    5,7,    5,7,    5,7,
5,7,    5,7,    5,7,    5,7,
5,7,    5,7,    5,7,    5,7,
5,7,    5,7,    5,7,    5,7,
0,0,      0,0,      0,0,      0,0,
0,0,      0,0,      0,0,      0,0,
0,0,      0,0,      1,6,    6,8,
0,0,      0,0,      1,6,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    0,0,      0,0,      0,0,
6,8,    0,0,      0,0,      0,0,
0,0,      0,0,      0,0,      0,0,
0,0,      0,0,      0,0,      0,0,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    0,0,      0,0,
6,8,    6,8,    0,0,      0,0,
0,0,      0,0,      6,8,    0,0,
0,0,      0,0,      6,8,    0,0,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    6,8,    6,8,
6,8,    6,8,    0,0,      0,0,
6,8,    6,8,    0,0,      0,0,
0,0};
0,0};
struct yysvf yysvec[] ={
struct yysvf yysvec[] ={
0,       0,       0,
0,       0,       0,
yycrank+-1,     0,               0,
yycrank+-1,     0,               0,
yycrank+0,       yysvec+1,       0,
yycrank+0,       yysvec+1,       0,
yycrank+0,       0,               yyvstop+1,
yycrank+0,       0,               yyvstop+1,
yycrank+0,       0,               yyvstop+3,
yycrank+0,       0,               yyvstop+3,
yycrank+2,      0,               yyvstop+6,
yycrank+2,      0,               yyvstop+6,
yycrank+19,     0,               yyvstop+9,
yycrank+19,     0,               yyvstop+9,
yycrank+0,       yysvec+5,       yyvstop+12,
yycrank+0,       yysvec+5,       yyvstop+12,
yycrank+0,       yysvec+6,       yyvstop+14,
yycrank+0,       yysvec+6,       yyvstop+14,
0,       0,       0};
0,       0,       0};
struct yywork *yytop = yycrank+141;
struct yywork *yytop = yycrank+141;
struct yysvf *yybgin = yysvec+1;
struct yysvf *yybgin = yysvec+1;
char yymatch[] ={
char yymatch[] ={
00  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
00  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,011 ,012 ,01  ,01  ,01  ,01  ,01  ,
01  ,011 ,012 ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
011 ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
011 ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,
'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,
'0' ,'0' ,01  ,01  ,01  ,01  ,01  ,01  ,
'0' ,'0' ,01  ,01  ,01  ,01  ,01  ,01  ,
01  ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
01  ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,01  ,01  ,01  ,01  ,'A' ,
'A' ,'A' ,'A' ,01  ,01  ,01  ,01  ,'A' ,
01  ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
01  ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,01  ,01  ,01  ,01  ,01  ,
'A' ,'A' ,'A' ,01  ,01  ,01  ,01  ,01  ,
0};
0};
char yyextra[] ={
char yyextra[] ={
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
0};
0};
/*      ncform  4.1     83/08/11        */
/*      ncform  4.1     83/08/11        */
 
 
int yylineno =1;
int yylineno =1;
# define YYU(x) x
# define YYU(x) x
# define NLSTATE yyprevious=YYNEWLINE
# define NLSTATE yyprevious=YYNEWLINE
char yytext[YYLMAX];
char yytext[YYLMAX];
struct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp;
struct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp;
char yysbuf[YYLMAX];
char yysbuf[YYLMAX];
char *yysptr = yysbuf;
char *yysptr = yysbuf;
int *yyfnd;
int *yyfnd;
extern struct yysvf *yyestate;
extern struct yysvf *yyestate;
int yyprevious = YYNEWLINE;
int yyprevious = YYNEWLINE;
yylook(){
yylook(){
        register struct yysvf *yystate, **lsp;
        register struct yysvf *yystate, **lsp;
        register struct yywork *yyt;
        register struct yywork *yyt;
        struct yysvf *yyz;
        struct yysvf *yyz;
        int yych;
        int yych;
        struct yywork *yyr;
        struct yywork *yyr;
# ifdef LEXDEBUG
# ifdef LEXDEBUG
        int debug;
        int debug;
# endif
# endif
        char *yylastch;
        char *yylastch;
        /* start off machines */
        /* start off machines */
# ifdef LEXDEBUG
# ifdef LEXDEBUG
        debug = 0;
        debug = 0;
# endif
# endif
        if (!yymorfg)
        if (!yymorfg)
                yylastch = yytext;
                yylastch = yytext;
        else {
        else {
                yymorfg=0;
                yymorfg=0;
                yylastch = yytext+yyleng;
                yylastch = yytext+yyleng;
                }
                }
        for(;;){
        for(;;){
                lsp = yylstate;
                lsp = yylstate;
                yyestate = yystate = yybgin;
                yyestate = yystate = yybgin;
                if (yyprevious==YYNEWLINE) yystate++;
                if (yyprevious==YYNEWLINE) yystate++;
                for (;;){
                for (;;){
# ifdef LEXDEBUG
# ifdef LEXDEBUG
                        if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1);
                        if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1);
# endif
# endif
                        yyt = yystate->yystoff;
                        yyt = yystate->yystoff;
                        if(yyt == yycrank){             /* may not be any transitions */
                        if(yyt == yycrank){             /* may not be any transitions */
                                yyz = yystate->yyother;
                                yyz = yystate->yyother;
                                if(yyz == 0)break;
                                if(yyz == 0)break;
                                if(yyz->yystoff == yycrank)break;
                                if(yyz->yystoff == yycrank)break;
                                }
                                }
                        *yylastch++ = yych = input();
                        *yylastch++ = yych = input();
                tryagain:
                tryagain:
# ifdef LEXDEBUG
# ifdef LEXDEBUG
                        if(debug){
                        if(debug){
                                fprintf(yyout,"char ");
                                fprintf(yyout,"char ");
                                allprint(yych);
                                allprint(yych);
                                putchar('\n');
                                putchar('\n');
                                }
                                }
# endif
# endif
                        yyr = yyt;
                        yyr = yyt;
                        if ( yyt > yycrank){
                        if ( yyt > yycrank){
                                yyt = yyr + yych;
                                yyt = yyr + yych;
                                if (yyt <= yytop && yyt->verify+yysvec == yystate){
                                if (yyt <= yytop && yyt->verify+yysvec == yystate){
                                        if(yyt->advance+yysvec == YYLERR)       /* error transitions */
                                        if(yyt->advance+yysvec == YYLERR)       /* error transitions */
                                                {unput(*--yylastch);break;}
                                                {unput(*--yylastch);break;}
                                        *lsp++ = yystate = yyt->advance+yysvec;
                                        *lsp++ = yystate = yyt->advance+yysvec;
                                        goto contin;
                                        goto contin;
                                        }
                                        }
                                }
                                }
# ifdef YYOPTIM
# ifdef YYOPTIM
                        else if(yyt < yycrank) {                /* r < yycrank */
                        else if(yyt < yycrank) {                /* r < yycrank */
                                yyt = yyr = yycrank+(yycrank-yyt);
                                yyt = yyr = yycrank+(yycrank-yyt);
# ifdef LEXDEBUG
# ifdef LEXDEBUG
                                if(debug)fprintf(yyout,"compressed state\n");
                                if(debug)fprintf(yyout,"compressed state\n");
# endif
# endif
                                yyt = yyt + yych;
                                yyt = yyt + yych;
                                if(yyt <= yytop && yyt->verify+yysvec == yystate){
                                if(yyt <= yytop && yyt->verify+yysvec == yystate){
                                        if(yyt->advance+yysvec == YYLERR)       /* error transitions */
                                        if(yyt->advance+yysvec == YYLERR)       /* error transitions */
                                                {unput(*--yylastch);break;}
                                                {unput(*--yylastch);break;}
                                        *lsp++ = yystate = yyt->advance+yysvec;
                                        *lsp++ = yystate = yyt->advance+yysvec;
                                        goto contin;
                                        goto contin;
                                        }
                                        }
                                yyt = yyr + YYU(yymatch[yych]);
                                yyt = yyr + YYU(yymatch[yych]);
# ifdef LEXDEBUG
# ifdef LEXDEBUG
                                if(debug){
                                if(debug){
                                        fprintf(yyout,"try fall back character ");
                                        fprintf(yyout,"try fall back character ");
                                        allprint(YYU(yymatch[yych]));
                                        allprint(YYU(yymatch[yych]));
                                        putchar('\n');
                                        putchar('\n');
                                        }
                                        }
# endif
# endif
                                if(yyt <= yytop && yyt->verify+yysvec == yystate){
                                if(yyt <= yytop && yyt->verify+yysvec == yystate){
                                        if(yyt->advance+yysvec == YYLERR)       /* error transition */
                                        if(yyt->advance+yysvec == YYLERR)       /* error transition */
                                                {unput(*--yylastch);break;}
                                                {unput(*--yylastch);break;}
                                        *lsp++ = yystate = yyt->advance+yysvec;
                                        *lsp++ = yystate = yyt->advance+yysvec;
                                        goto contin;
                                        goto contin;
                                        }
                                        }
                                }
                                }
                        if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){
                        if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){
# ifdef LEXDEBUG
# ifdef LEXDEBUG
                                if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1);
                                if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1);
# endif
# endif
                                goto tryagain;
                                goto tryagain;
                                }
                                }
# endif
# endif
                        else
                        else
                                {unput(*--yylastch);break;}
                                {unput(*--yylastch);break;}
                contin:
                contin:
# ifdef LEXDEBUG
# ifdef LEXDEBUG
                        if(debug){
                        if(debug){
                                fprintf(yyout,"state %d char ",yystate-yysvec-1);
                                fprintf(yyout,"state %d char ",yystate-yysvec-1);
                                allprint(yych);
                                allprint(yych);
                                putchar('\n');
                                putchar('\n');
                                }
                                }
# endif
# endif
                        ;
                        ;
                        }
                        }
# ifdef LEXDEBUG
# ifdef LEXDEBUG
                if(debug){
                if(debug){
                        fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1);
                        fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1);
                        allprint(yych);
                        allprint(yych);
                        putchar('\n');
                        putchar('\n');
                        }
                        }
# endif
# endif
                while (lsp-- > yylstate){
                while (lsp-- > yylstate){
                        *yylastch-- = 0;
                        *yylastch-- = 0;
                        if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){
                        if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){
                                yyolsp = lsp;
                                yyolsp = lsp;
                                if(yyextra[*yyfnd]){            /* must backup */
                                if(yyextra[*yyfnd]){            /* must backup */
                                        while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){
                                        while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){
                                                lsp--;
                                                lsp--;
                                                unput(*yylastch--);
                                                unput(*yylastch--);
                                                }
                                                }
                                        }
                                        }
                                yyprevious = YYU(*yylastch);
                                yyprevious = YYU(*yylastch);
                                yylsp = lsp;
                                yylsp = lsp;
                                yyleng = yylastch-yytext+1;
                                yyleng = yylastch-yytext+1;
                                yytext[yyleng] = 0;
                                yytext[yyleng] = 0;
# ifdef LEXDEBUG
# ifdef LEXDEBUG
                                if(debug){
                                if(debug){
                                        fprintf(yyout,"\nmatch ");
                                        fprintf(yyout,"\nmatch ");
                                        sprint(yytext);
                                        sprint(yytext);
                                        fprintf(yyout," action %d\n",*yyfnd);
                                        fprintf(yyout," action %d\n",*yyfnd);
                                        }
                                        }
# endif
# endif
                                return(*yyfnd++);
                                return(*yyfnd++);
                                }
                                }
                        unput(*yylastch);
                        unput(*yylastch);
                        }
                        }
                if (yytext[0] == 0  /* && feof(yyin) */)
                if (yytext[0] == 0  /* && feof(yyin) */)
                        {
                        {
                        yysptr=yysbuf;
                        yysptr=yysbuf;
                        return(0);
                        return(0);
                        }
                        }
                yyprevious = yytext[0] = input();
                yyprevious = yytext[0] = input();
                if (yyprevious>0)
                if (yyprevious>0)
                        output(yyprevious);
                        output(yyprevious);
                yylastch=yytext;
                yylastch=yytext;
# ifdef LEXDEBUG
# ifdef LEXDEBUG
                if(debug)putchar('\n');
                if(debug)putchar('\n');
# endif
# endif
                }
                }
        }
        }
yyback(p, m)
yyback(p, m)
        int *p;
        int *p;
{
{
if (p==0) return(0);
if (p==0) return(0);
while (*p)
while (*p)
        {
        {
        if (*p++ == m)
        if (*p++ == m)
                return(1);
                return(1);
        }
        }
return(0);
return(0);
}
}
        /* the following are only used in the lex library */
        /* the following are only used in the lex library */
yyinput(){
yyinput(){
        return(input());
        return(input());
        }
        }
yyoutput(c)
yyoutput(c)
  int c; {
  int c; {
        output(c);
        output(c);
        }
        }
yyunput(c)
yyunput(c)
   int c; {
   int c; {
        unput(c);
        unput(c);
        }
        }
 
 
main() {
main() {
        yyin = stdin; yyout = stdout;
        yyin = stdin; yyout = stdout;
        yyparse();
        yyparse();
        return 0;
        return 0;
}
}
 
 
/* yyerror - issue error message */
/* yyerror - issue error message */
yyerror(s) char *s; {
yyerror(s) char *s; {
        printf("%s\n", s);
        printf("%s\n", s);
}
}
short yyexca[] ={
short yyexca[] ={
-1, 1,
-1, 1,
        0, -1,
        0, -1,
        -2, 0,
        -2, 0,
        };
        };
# define YYNPROD 15
# define YYNPROD 15
# define YYLAST 249
# define YYLAST 249
short yyact[]={
short yyact[]={
 
 
  12,   2,   9,   8,  17,  11,  25,  17,  15,  18,
  12,   2,   9,   8,  17,  11,  25,  17,  15,  18,
  16,  10,  18,  17,  15,   7,  16,  13,  18,   5,
  16,  10,  18,  17,  15,   7,  16,  13,  18,   5,
   3,   1,   0,  19,  20,   0,   0,  21,  22,  23,
   3,   1,   0,  19,  20,   0,   0,  21,  22,  23,
  24,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  24,   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,
   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,   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,   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,   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,   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,   0,   0,   6,  14,   0,
   0,   0,   0,   0,   0,   0,   0,   6,  14,   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,   4,   6 };
   0,   0,   0,   0,   0,   0,   0,   4,   6 };
short yypact[]={
short yypact[]={
 
 
-1000,  -9,-1000,   5,  -7, -59,-1000,-1000,-1000, -40,
-1000,  -9,-1000,   5,  -7, -59,-1000,-1000,-1000, -40,
 -29, -40, -40,-1000,-1000, -40, -40, -40, -40, -38,
 -29, -40, -40,-1000,-1000, -40, -40, -40, -40, -38,
 -35, -38, -38,-1000,-1000,-1000 };
 -35, -38, -38,-1000,-1000,-1000 };
short yypgo[]={
short yypgo[]={
 
 
   0,  21,  20,  17,  11 };
   0,  21,  20,  17,  11 };
short yyr1[]={
short yyr1[]={
 
 
   0,   1,   1,   1,   1,   2,   4,   4,   4,   4,
   0,   1,   1,   1,   1,   2,   4,   4,   4,   4,
   4,   4,   4,   4,   3 };
   4,   4,   4,   4,   3 };
short yyr2[]={
short yyr2[]={
 
 
   0,   0,   2,   3,   3,   3,   3,   3,   3,   3,
   0,   0,   2,   3,   3,   3,   3,   3,   3,   3,
   2,   3,   1,   1,   1 };
   2,   3,   1,   1,   1 };
short yychk[]={
short yychk[]={
 
 
-1000,  -1,  10,  -2, 256,  -3, 257,  10,  10,  61,
-1000,  -1,  10,  -2, 256,  -3, 257,  10,  10,  61,
  -4,  45,  40,  -3, 258,  43,  45,  42,  47,  -4,
  -4,  45,  40,  -3, 258,  43,  45,  42,  47,  -4,
  -4,  -4,  -4,  -4,  -4,  41 };
  -4,  -4,  -4,  -4,  -4,  41 };
short yydef[]={
short yydef[]={
 
 
   1,  -2,   2,   0,   0,   0,  14,   3,   4,   0,
   1,  -2,   2,   0,   0,   0,  14,   3,   4,   0,
   5,   0,   0,  12,  13,   0,   0,   0,   0,  10,
   5,   0,   0,  12,  13,   0,   0,   0,   0,  10,
   0,   6,   7,   8,   9,  11 };
   0,   6,   7,   8,   9,  11 };
#ifndef lint
#ifndef lint
#endif
#endif
 
 
# define YYFLAG -1000
# define YYFLAG -1000
# define YYERROR goto yyerrlab
# define YYERROR goto yyerrlab
# define YYACCEPT return(0)
# define YYACCEPT return(0)
# define YYABORT return(1)
# define YYABORT return(1)
 
 
/*      parser for yacc output  */
/*      parser for yacc output  */
 
 
#ifdef YYDEBUG
#ifdef YYDEBUG
int yydebug = 0; /* 1 for debugging */
int yydebug = 0; /* 1 for debugging */
#endif
#endif
YYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */
YYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */
int yychar = -1; /* current input token number */
int yychar = -1; /* current input token number */
int yynerrs = 0;  /* number of errors */
int yynerrs = 0;  /* number of errors */
short yyerrflag = 0;  /* error recovery flag */
short yyerrflag = 0;  /* error recovery flag */
 
 
yyparse() {
yyparse() {
 
 
        short yys[YYMAXDEPTH];
        short yys[YYMAXDEPTH];
        short yyj, yym;
        short yyj, yym;
        register YYSTYPE *yypvt;
        register YYSTYPE *yypvt;
        register short yystate, *yyps, yyn;
        register short yystate, *yyps, yyn;
        register YYSTYPE *yypv;
        register YYSTYPE *yypv;
        register short *yyxi;
        register short *yyxi;
 
 
        yystate = 0;
        yystate = 0;
        yychar = -1;
        yychar = -1;
        yynerrs = 0;
        yynerrs = 0;
        yyerrflag = 0;
        yyerrflag = 0;
        yyps= &yys[-1];
        yyps= &yys[-1];
        yypv= &yyv[-1];
        yypv= &yyv[-1];
 
 
 yystack:    /* put a state and value onto the stack */
 yystack:    /* put a state and value onto the stack */
 
 
#ifdef YYDEBUG
#ifdef YYDEBUG
        if( yydebug  ) printf( "state %d, char 0%o\n", yystate, yychar );
        if( yydebug  ) printf( "state %d, char 0%o\n", yystate, yychar );
#endif
#endif
                if( ++yyps> &yys[YYMAXDEPTH-1] ) { yyerror( "yacc stack overflow" ); return(1); }
                if( ++yyps> &yys[YYMAXDEPTH-1] ) { yyerror( "yacc stack overflow" ); return(1); }
                *yyps = yystate;
                *yyps = yystate;
                ++yypv;
                ++yypv;
                *yypv = yyval;
                *yypv = yyval;
 
 
 yynewstate:
 yynewstate:
 
 
        yyn = yypact[yystate];
        yyn = yypact[yystate];
 
 
        if( yyn<= YYFLAG ) goto yydefault; /* simple state */
        if( yyn<= YYFLAG ) goto yydefault; /* simple state */
 
 
        if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0;
        if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0;
        if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault;
        if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault;
 
 
        if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */
        if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */
                yychar = -1;
                yychar = -1;
                yyval = yylval;
                yyval = yylval;
                yystate = yyn;
                yystate = yyn;
                if( yyerrflag > 0 ) --yyerrflag;
                if( yyerrflag > 0 ) --yyerrflag;
                goto yystack;
                goto yystack;
                }
                }
 
 
 yydefault:
 yydefault:
        /* default state action */
        /* default state action */
 
 
        if( (yyn=yydef[yystate]) == -2 ) {
        if( (yyn=yydef[yystate]) == -2 ) {
                if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0;
                if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0;
                /* look through exception table */
                /* look through exception table */
 
 
                for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */
                for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */
 
 
                while( *(yyxi+=2) >= 0 ){
                while( *(yyxi+=2) >= 0 ){
                        if( *yyxi == yychar ) break;
                        if( *yyxi == yychar ) break;
                        }
                        }
                if( (yyn = yyxi[1]) < 0 ) return(0);   /* accept */
                if( (yyn = yyxi[1]) < 0 ) return(0);   /* accept */
                }
                }
 
 
        if( yyn == 0 ){ /* error */
        if( yyn == 0 ){ /* error */
                /* error ... attempt to resume parsing */
                /* error ... attempt to resume parsing */
 
 
                switch( yyerrflag ){
                switch( yyerrflag ){
 
 
                case 0:   /* brand new error */
                case 0:   /* brand new error */
 
 
                        yyerror( "syntax error" );
                        yyerror( "syntax error" );
                yyerrlab:
                yyerrlab:
                        ++yynerrs;
                        ++yynerrs;
 
 
                case 1:
                case 1:
                case 2: /* incompletely recovered error ... try again */
                case 2: /* incompletely recovered error ... try again */
 
 
                        yyerrflag = 3;
                        yyerrflag = 3;
 
 
                        /* find a state where "error" is a legal shift action */
                        /* find a state where "error" is a legal shift action */
 
 
                        while ( yyps >= yys ) {
                        while ( yyps >= yys ) {
                           yyn = yypact[*yyps] + YYERRCODE;
                           yyn = yypact[*yyps] + YYERRCODE;
                           if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){
                           if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){
                              yystate = yyact[yyn];  /* simulate a shift of "error" */
                              yystate = yyact[yyn];  /* simulate a shift of "error" */
                              goto yystack;
                              goto yystack;
                              }
                              }
                           yyn = yypact[*yyps];
                           yyn = yypact[*yyps];
 
 
                           /* the current yyps has no shift onn "error", pop stack */
                           /* the current yyps has no shift onn "error", pop stack */
 
 
#ifdef YYDEBUG
#ifdef YYDEBUG
                           if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] );
                           if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] );
#endif
#endif
                           --yyps;
                           --yyps;
                           --yypv;
                           --yypv;
                           }
                           }
 
 
                        /* there is no state on the stack with an error shift ... abort */
                        /* there is no state on the stack with an error shift ... abort */
 
 
        yyabort:
        yyabort:
                        return(1);
                        return(1);
 
 
 
 
                case 3:  /* no shift yet; clobber input char */
                case 3:  /* no shift yet; clobber input char */
 
 
#ifdef YYDEBUG
#ifdef YYDEBUG
                        if( yydebug ) printf( "error recovery discards char %d\n", yychar );
                        if( yydebug ) printf( "error recovery discards char %d\n", yychar );
#endif
#endif
 
 
                        if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */
                        if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */
                        yychar = -1;
                        yychar = -1;
                        goto yynewstate;   /* try again in the same state */
                        goto yynewstate;   /* try again in the same state */
 
 
                        }
                        }
 
 
                }
                }
 
 
        /* reduction by production yyn */
        /* reduction by production yyn */
 
 
#ifdef YYDEBUG
#ifdef YYDEBUG
                if( yydebug ) printf("reduce %d\n",yyn);
                if( yydebug ) printf("reduce %d\n",yyn);
#endif
#endif
                yyps -= yyr2[yyn];
                yyps -= yyr2[yyn];
                yypvt = yypv;
                yypvt = yypv;
                yypv -= yyr2[yyn];
                yypv -= yyr2[yyn];
                yyval = yypv[1];
                yyval = yypv[1];
                yym=yyn;
                yym=yyn;
                        /* consult goto table to find next state */
                        /* consult goto table to find next state */
                yyn = yyr1[yyn];
                yyn = yyr1[yyn];
                yyj = yypgo[yyn] + *yyps + 1;
                yyj = yypgo[yyn] + *yyps + 1;
                if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]];
                if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]];
                switch(yym){
                switch(yym){
 
 
case 4:
case 4:
{ yyerrok; } break;
{ yyerrok; } break;
case 5:
case 5:
{ printf("store\n"); } break;
{ printf("store\n"); } break;
case 6:
case 6:
{ printf("add\n"); } break;
{ printf("add\n"); } break;
case 7:
case 7:
{ printf("negate\nadd\n"); } break;
{ printf("negate\nadd\n"); } break;
case 8:
case 8:
{ printf("multiply\n"); } break;
{ printf("multiply\n"); } break;
case 9:
case 9:
{ printf("divide\n"); } break;
{ printf("divide\n"); } break;
case 10:
case 10:
{ printf("negate\n"); } break;
{ printf("negate\n"); } break;
case 12:
case 12:
{ printf("load\n"); } break;
{ printf("load\n"); } break;
case 13:
case 13:
{ printf("push %s\n", yytext); } break;
{ printf("push %s\n", yytext); } break;
case 14:
case 14:
{ printf("%s\n", yytext); } break;
{ printf("%s\n", yytext); } break;
                }
                }
                goto yystack;  /* stack new state and value */
                goto yystack;  /* stack new state and value */
 
 
        }
        }
int yywrap() { return 1; }
int yywrap() { return 1; }
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.