#include <stdio.h>
Include dependency graph for yacc.c:

Go to the source code of this file.
Data Structures | |
| struct | yysvf |
| struct | yywork |
Defines | |
| #define | BEGIN yybgin = yysvec + 1 + |
| #define | CON 258 |
| #define | ECHO fprintf(yyout, "%s",yytext) |
| #define | ID 257 |
| #define | INITIAL 0 |
| #define | input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar) |
| #define | NLSTATE yyprevious=YYNEWLINE |
| #define | NLSTATE yyprevious=YYNEWLINE |
| #define | output(c) (void)putc(c,yyout) |
| #define | REJECT { nstr = yyreject(); goto yyfussy;} |
| #define | U(x) x |
| #define | UNARYMINUS 259 |
| #define | unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;} |
| #define | YYABORT return(1) |
| #define | YYACCEPT return(0) |
| #define | yyclearin yychar = -1 |
| #define | YYERRCODE 256 |
| #define | yyerrok yyerrflag = 0 |
| #define | YYERROR goto yyerrlab |
| #define | YYFLAG -1000 |
| #define | YYLAST 249 |
| #define | YYLERR yysvec |
| #define | YYLMAX 200 |
| #define | YYMAXDEPTH 150 |
| #define | yymore() (yymorfg=1) |
| #define | YYNEWLINE 10 |
| #define | YYNPROD 15 |
| #define | YYOPTIM 1 |
| #define | YYSTATE (yyestate-yysvec-1) |
| #define | YYSTYPE int |
| #define | YYTYPE char |
| #define | YYU(x) x |
Functions | |
| main () | |
| yyback (int *p, m) | |
| yyerror (char *s) | |
| yyinput () | |
| yylex () | |
| yylook () | |
| yyoutput (int c) | |
| yyparse () | |
| yyunput (int c) | |
| int | yywrap () |
Variables | |
| short | yyact [] |
| yysvf * | yybgin = yysvec+1 |
| int | yychar = -1 |
| short | yychk [] |
| yywork | yycrank [] |
| short | yydef [] |
| short | yyerrflag = 0 |
| yysvf * | yyestate |
| short | yyexca [] |
| char | yyextra [] |
| int * | yyfnd |
| FILE * | yyin = {stdin} *yyout ={stdout} |
| int | yyleng |
| int | yylineno = 1 |
| yysvf ** | yylsp |
| yysvf * | yylstate [YYLMAX] |
| YYSTYPE | yylval |
| char | yymatch [] |
| int | yymorfg |
| int | yynerrs = 0 |
| yysvf ** | yyolsp |
| short | yypact [] |
| short | yypgo [] |
| int | yyprevious = YYNEWLINE |
| short | yyr1 [] |
| short | yyr2 [] |
| char | yysbuf [] |
| char * | yysptr = yysbuf |
| yysvf | yysvec [] |
| int | yytchar |
| char | yytext [] |
| yywork * | yytop = yycrank+141 |
| YYSTYPE | yyv [YYMAXDEPTH] |
| YYSTYPE | yyval |
| int | yyvstop [] |
|
|
|
|
|
|
|
|
Definition at line 33 of file yacc.c. Referenced by Sys_ConsoleInputInit(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 29 of file yacc.c. Referenced by Decode(), Encode(), yylook(), and yyoutput(). |
|
|
|
|
|
Definition at line 21 of file yacc.c. Referenced by asdl_defconst(), btot(), listnodes(), main(), range(), RE_BeginFrame(), and simplify(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 366 of file yacc.c. Referenced by yyparse(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 172 of file yacc.c. Referenced by yylook(). |
|
|
Definition at line 351 of file yacc.c. References yyparse(). 00351 {
00352 yyparse();
00353 return 0;
00354 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 327 of file yacc.c. References p. Referenced by yylook(). 00329 {
00330 if (p==0) return(0);
00331 while (*p)
00332 {
00333 if (*p++ == m)
00334 return(1);
00335 }
00336 return(0);
00337 }
|
|
|
Definition at line 357 of file yacc.c. Referenced by alloc(), main(), nonterm(), rule(), term(), tree(), YYDEFUN(), yylex(), and yyparse(). 00357 {
00358 printf("%s\n", s);
00359 }
|
Here is the call graph for this function:

|
|
Definition at line 339 of file yacc.c. References input. 00339 {
00340 return(input());
00341 }
|
|
|
Definition at line 48 of file yacc.c. References alloc(), assert, bp, c, code, d, EOF, fprintf(), get(), INT_MAX, isalpha, isdigit, isprint, isspace, n, YYSTYPE::n, p, ppercent, strchr(), YYSTYPE::string, strncmp(), strncpy(), strspn(), yyerror(), yylook(), yylval, yytext, and yywrap(). Referenced by yyparse(). 00048 {
00049 int nstr; extern int yyprevious;
00050 while((nstr = yylook()) >= 0)
00051 yyfussy: switch(nstr){
00052 case 0:
00053 if(yywrap()) return(0); break;
00054 case 1:
00055 return ID;
00056 break;
00057 case 2:
00058 return CON;
00059 break;
00060 case 3:
00061 ;
00062 break;
00063 case 4:
00064 return yytext[0];
00065 break;
00066 case -1:
00067 break;
00068 default:
00069 fprintf(yyout,"bad switch yylook %d",nstr);
00070 } return(0); }
|
Here is the call graph for this function:

|
|
Definition at line 181 of file yacc.c. References yywork::advance, debug, fprintf(), input, output, putchar, unput, yywork::verify, yyback(), yycrank, yyestate, yyextra, yyfnd, yyleng, yylsp, yymatch, yymorfg, yyolsp, yysvf::yyother, yyprevious, yysptr, yysvf::yystoff, yysvec, yytext, yytop, and YYU. Referenced by yylex(). 00181 {
00182 register struct yysvf *yystate, **lsp;
00183 register struct yywork *yyt;
00184 struct yysvf *yyz;
00185 int yych;
00186 struct yywork *yyr;
00187 # ifdef LEXDEBUG
00188 int debug;
00189 # endif
00190 char *yylastch;
00191 /* start off machines */
00192 # ifdef LEXDEBUG
00193 debug = 0;
00194 # endif
00195 if (!yymorfg)
00196 yylastch = yytext;
00197 else {
00198 yymorfg=0;
00199 yylastch = yytext+yyleng;
00200 }
00201 for(;;){
00202 lsp = yylstate;
00203 yyestate = yystate = yybgin;
00204 if (yyprevious==YYNEWLINE) yystate++;
00205 for (;;){
00206 # ifdef LEXDEBUG
00207 if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1);
00208 # endif
00209 yyt = yystate->yystoff;
00210 if(yyt == yycrank){ /* may not be any transitions */
00211 yyz = yystate->yyother;
00212 if(yyz == 0)break;
00213 if(yyz->yystoff == yycrank)break;
00214 }
00215 *yylastch++ = yych = input();
00216 tryagain:
00217 # ifdef LEXDEBUG
00218 if(debug){
00219 fprintf(yyout,"char ");
00220 allprint(yych);
00221 putchar('\n');
00222 }
00223 # endif
00224 yyr = yyt;
00225 if ( yyt > yycrank){
00226 yyt = yyr + yych;
00227 if (yyt <= yytop && yyt->verify+yysvec == yystate){
00228 if(yyt->advance+yysvec == YYLERR) /* error transitions */
00229 {unput(*--yylastch);break;}
00230 *lsp++ = yystate = yyt->advance+yysvec;
00231 goto contin;
00232 }
00233 }
00234 # ifdef YYOPTIM
00235 else if(yyt < yycrank) { /* r < yycrank */
00236 yyt = yyr = yycrank+(yycrank-yyt);
00237 # ifdef LEXDEBUG
00238 if(debug)fprintf(yyout,"compressed state\n");
00239 # endif
00240 yyt = yyt + yych;
00241 if(yyt <= yytop && yyt->verify+yysvec == yystate){
00242 if(yyt->advance+yysvec == YYLERR) /* error transitions */
00243 {unput(*--yylastch);break;}
00244 *lsp++ = yystate = yyt->advance+yysvec;
00245 goto contin;
00246 }
00247 yyt = yyr + YYU(yymatch[yych]);
00248 # ifdef LEXDEBUG
00249 if(debug){
00250 fprintf(yyout,"try fall back character ");
00251 allprint(YYU(yymatch[yych]));
00252 putchar('\n');
00253 }
00254 # endif
00255 if(yyt <= yytop && yyt->verify+yysvec == yystate){
00256 if(yyt->advance+yysvec == YYLERR) /* error transition */
00257 {unput(*--yylastch);break;}
00258 *lsp++ = yystate = yyt->advance+yysvec;
00259 goto contin;
00260 }
00261 }
00262 if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){
00263 # ifdef LEXDEBUG
00264 if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1);
00265 # endif
00266 goto tryagain;
00267 }
00268 # endif
00269 else
00270 {unput(*--yylastch);break;}
00271 contin:
00272 # ifdef LEXDEBUG
00273 if(debug){
00274 fprintf(yyout,"state %d char ",yystate-yysvec-1);
00275 allprint(yych);
00276 putchar('\n');
00277 }
00278 # endif
00279 ;
00280 }
00281 # ifdef LEXDEBUG
00282 if(debug){
00283 fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1);
00284 allprint(yych);
00285 putchar('\n');
00286 }
00287 # endif
00288 while (lsp-- > yylstate){
00289 *yylastch-- = 0;
00290 if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){
00291 yyolsp = lsp;
00292 if(yyextra[*yyfnd]){ /* must backup */
00293 while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){
00294 lsp--;
00295 unput(*yylastch--);
00296 }
00297 }
00298 yyprevious = YYU(*yylastch);
00299 yylsp = lsp;
00300 yyleng = yylastch-yytext+1;
00301 yytext[yyleng] = 0;
00302 # ifdef LEXDEBUG
00303 if(debug){
00304 fprintf(yyout,"\nmatch ");
00305 sprint(yytext);
00306 fprintf(yyout," action %d\n",*yyfnd);
00307 }
00308 # endif
00309 return(*yyfnd++);
00310 }
00311 unput(*yylastch);
00312 }
00313 if (yytext[0] == 0 /* && feof(yyin) */)
00314 {
00315 yysptr=yysbuf;
00316 return(0);
00317 }
00318 yyprevious = yytext[0] = input();
00319 if (yyprevious>0)
00320 output(yyprevious);
00321 yylastch=yytext;
00322 # ifdef LEXDEBUG
00323 if(debug)putchar('\n');
00324 # endif
00325 }
00326 }
|
Here is the call graph for this function:

|
|
Definition at line 342 of file yacc.c. 00343 {
00344 output(c);
00345 }
|
|
|
Definition at line 438 of file yacc.c. References getenv(), n, nonterm(), nonterm::number, printf(), rule(), string(), YYSTYPE::string, term(), tree(), yyact, yychar, yycheck, yychk, YYCONST, yydebug, yydef, yydefred, yydgoto, yyerrflag, yyerror(), YYFINAL, yyfree, yygindex, yygrow(), YYLAST, yylen, yylex(), yylhs, yylineno, yynerrs, yypact, yypgo, yyr1, yyr2, yyrindex, yysindex, yyss, YYSTACKSIZE, yystacksize, yytable, yytext, yyv, yyval, and yyvs. 00438 {
00439
00440 short yys[YYMAXDEPTH];
00441 short yyj, yym;
00442 register YYSTYPE *yypvt;
00443 register short yystate, *yyps, yyn;
00444 register YYSTYPE *yypv;
00445 register short *yyxi;
00446
00447 yystate = 0;
00448 yychar = -1;
00449 yynerrs = 0;
00450 yyerrflag = 0;
00451 yyps= &yys[-1];
00452 yypv= &yyv[-1];
00453
00454 yystack: /* put a state and value onto the stack */
00455
00456 #ifdef YYDEBUG
00457 if( yydebug ) printf( "state %d, char 0%o\n", yystate, yychar );
00458 #endif
00459 if( ++yyps> &yys[YYMAXDEPTH] ) { yyerror( "yacc stack overflow" ); return(1); }
00460 *yyps = yystate;
00461 ++yypv;
00462 *yypv = yyval;
00463
00464 yynewstate:
00465
00466 yyn = yypact[yystate];
00467
00468 if( yyn<= YYFLAG ) goto yydefault; /* simple state */
00469
00470 if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0;
00471 if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault;
00472
00473 if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */
00474 yychar = -1;
00475 yyval = yylval;
00476 yystate = yyn;
00477 if( yyerrflag > 0 ) --yyerrflag;
00478 goto yystack;
00479 }
00480
00481 yydefault:
00482 /* default state action */
00483
00484 if( (yyn=yydef[yystate]) == -2 ) {
00485 if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0;
00486 /* look through exception table */
00487
00488 for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */
00489
00490 while( *(yyxi+=2) >= 0 ){
00491 if( *yyxi == yychar ) break;
00492 }
00493 if( (yyn = yyxi[1]) < 0 ) return(0); /* accept */
00494 }
00495
00496 if( yyn == 0 ){ /* error */
00497 /* error ... attempt to resume parsing */
00498
00499 switch( yyerrflag ){
00500
00501 case 0: /* brand new error */
00502
00503 yyerror( "syntax error" );
00504 yyerrlab:
00505 ++yynerrs;
00506
00507 case 1:
00508 case 2: /* incompletely recovered error ... try again */
00509
00510 yyerrflag = 3;
00511
00512 /* find a state where "error" is a legal shift action */
00513
00514 while ( yyps >= yys ) {
00515 yyn = yypact[*yyps] + YYERRCODE;
00516 if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){
00517 yystate = yyact[yyn]; /* simulate a shift of "error" */
00518 goto yystack;
00519 }
00520 yyn = yypact[*yyps];
00521
00522 /* the current yyps has no shift onn "error", pop stack */
00523
00524 #ifdef YYDEBUG
00525 if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] );
00526 #endif
00527 --yyps;
00528 --yypv;
00529 }
00530
00531 /* there is no state on the stack with an error shift ... abort */
00532
00533 yyabort:
00534 return(1);
00535
00536
00537 case 3: /* no shift yet; clobber input char */
00538
00539 #ifdef YYDEBUG
00540 if( yydebug ) printf( "error recovery discards char %d\n", yychar );
00541 #endif
00542
00543 if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */
00544 yychar = -1;
00545 goto yynewstate; /* try again in the same state */
00546
00547 }
00548
00549 }
00550
00551 /* reduction by production yyn */
00552
00553 #ifdef YYDEBUG
00554 if( yydebug ) printf("reduce %d\n",yyn);
00555 #endif
00556 yyps -= yyr2[yyn];
00557 yypvt = yypv;
00558 yypv -= yyr2[yyn];
00559 yyval = yypv[1];
00560 yym=yyn;
00561 /* consult goto table to find next state */
00562 yyn = yyr1[yyn];
00563 yyj = yypgo[yyn] + *yyps + 1;
00564 if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]];
00565 switch(yym){
00566
00567 case 4:
00568 { yyerrok; } break;
00569 case 5:
00570 { printf("store\n"); } break;
00571 case 6:
00572 { printf("add\n"); } break;
00573 case 7:
00574 { printf("negate\nadd\n"); } break;
00575 case 8:
00576 { printf("multiply\n"); } break;
00577 case 9:
00578 { printf("divide\n"); } break;
00579 case 10:
00580 { printf("negate\n"); } break;
00581 case 12:
00582 { printf("load\n"); } break;
00583 case 13:
00584 { printf("push %s\n", yytext); } break;
00585 case 14:
00586 { printf("%s\n", yytext); } break;
00587 }
00588 goto yystack; /* stack new state and value */
00589
00590 }
|
Here is the call graph for this function:

|
|
Definition at line 346 of file yacc.c. 00347 {
00348 unput(c);
00349 }
|
|
|
Definition at line 591 of file yacc.c. Referenced by yylex(). 00591 { return 1; }
|
|
|
Initial value: {
12, 2, 9, 8, 17, 11, 25, 17, 15, 18,
16, 10, 18, 17, 15, 7, 16, 13, 18, 5,
3, 1, 0, 19, 20, 0, 0, 21, 22, 23,
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, 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, 4, 6 }
Definition at line 367 of file yacc.c. Referenced by yyparse(). |
|
|
|
|
|
Definition at line 434 of file yacc.c. Referenced by yyparse(). |
|
|
Initial value: {
-1000, -1, 10, -2, 256, -3, 257, 10, 10, 61,
-4, 45, 40, -3, 258, 43, 45, 42, 47, -4,
-4, -4, -4, -4, -4, 41 }
Definition at line 410 of file yacc.c. Referenced by yyparse(). |
|
|
Referenced by yylook(). |
|
|
Initial value: {
1, -2, 2, 0, 0, 0, 14, 3, 4, 0,
5, 0, 0, 12, 13, 0, 0, 0, 0, 10,
0, 6, 7, 8, 9, 11 }
Definition at line 415 of file yacc.c. Referenced by yyparse(). |
|
|
Definition at line 436 of file yacc.c. Referenced by yyparse(). |
|
|
Definition at line 45 of file yacc.c. Referenced by yylook(). |
|
|
Initial value: {
-1, 1,
0, -1,
-2, 0,
}
|
|
|
Initial value: {
0,0,0,0,0,0,0,0,
0}
Definition at line 166 of file yacc.c. Referenced by yylook(). |
|
|
Definition at line 178 of file yacc.c. Referenced by yylook(). |
|
|
|
|
|
Definition at line 35 of file yacc.c. Referenced by yylook(). |
|
|
|
|
|
Definition at line 175 of file yacc.c. Referenced by yylook(). |
|
|
|
|
|
|
|
|
Initial value: {
00 ,01 ,01 ,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 ,
011 ,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' ,01 ,01 ,01 ,01 ,01 ,01 ,
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' ,01 ,01 ,01 ,01 ,'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' ,01 ,01 ,01 ,01 ,01 ,
0}
Definition at line 148 of file yacc.c. Referenced by yylook(). |
|
|
Definition at line 36 of file yacc.c. Referenced by yylook(). |
|
|
|
|
|
Definition at line 175 of file yacc.c. Referenced by yylook(). |
|
|
Initial value: {
-1000, -9,-1000, 5, -7, -59,-1000,-1000,-1000, -40,
-29, -40, -40,-1000,-1000, -40, -40, -40, -40, -38,
-35, -38, -38,-1000,-1000,-1000 }
Definition at line 394 of file yacc.c. Referenced by yyparse(). |
|
|
Initial value: {
0, 21, 20, 17, 11 }
Definition at line 399 of file yacc.c. Referenced by yyparse(). |
|
|
Definition at line 180 of file yacc.c. Referenced by yylook(). |
|
|
Initial value: {
0, 1, 1, 1, 1, 2, 4, 4, 4, 4,
4, 4, 4, 4, 3 }
Definition at line 402 of file yacc.c. Referenced by yyparse(). |
|
|
Initial value: {
0, 0, 2, 3, 3, 3, 3, 3, 3, 3,
2, 3, 1, 1, 1 }
Definition at line 406 of file yacc.c. Referenced by yyparse(). |
|
|
|
|
|
Definition at line 177 of file yacc.c. Referenced by yylook(). |
|
|
Initial value: {
0, 0, 0,
yycrank+-1, 0, 0,
yycrank+0, yysvec+1, 0,
yycrank+0, 0, yyvstop+1,
yycrank+0, 0, yyvstop+3,
yycrank+2, 0, yyvstop+6,
yycrank+19, 0, yyvstop+9,
yycrank+0, yysvec+5, yyvstop+12,
yycrank+0, yysvec+6, yyvstop+14,
0, 0, 0}
Definition at line 135 of file yacc.c. Referenced by yylook(). |
|
|
|
|
|
|
|
|
Definition at line 146 of file yacc.c. Referenced by yylook(). |
|
|
Definition at line 433 of file yacc.c. Referenced by yyparse(). |
|
|
|
|
|
Initial value: {
0,
4,
0,
3,
4,
0,
2,
4,
0,
1,
4,
0,
2,
0,
1,
0,
0}
|
1.3.9.1