1 /* original parser id follows */ 2 /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ 3 /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ 4 5 #define YYBYACC 1 6 #define YYMAJOR 1 7 #define YYMINOR 9 8 #define YYCHECK "yyyymmdd" 9 10 #define YYEMPTY (-1) 11 #define yyclearin (yychar = YYEMPTY) 12 #define yyerrok (yyerrflag = 0) 13 #define YYRECOVERING() (yyerrflag != 0) 14 #define YYENOMEM (-2) 15 #define YYEOF 0 16 #undef YYBTYACC 17 #define YYBTYACC 0 18 #define YYDEBUGSTR YYPREFIX "debug" 19 20 #ifndef yyparse 21 #define yyparse expr.oxout_parse 22 #endif /* yyparse */ 23 24 #ifndef yylex 25 #define yylex expr.oxout_lex 26 #endif /* yylex */ 27 28 #ifndef yyerror 29 #define yyerror expr.oxout_error 30 #endif /* yyerror */ 31 32 #ifndef yychar 33 #define yychar expr.oxout_char 34 #endif /* yychar */ 35 36 #ifndef yyval 37 #define yyval expr.oxout_val 38 #endif /* yyval */ 39 40 #ifndef yylval 41 #define yylval expr.oxout_lval 42 #endif /* yylval */ 43 44 #ifndef yydebug 45 #define yydebug expr.oxout_debug 46 #endif /* yydebug */ 47 48 #ifndef yynerrs 49 #define yynerrs expr.oxout_nerrs 50 #endif /* yynerrs */ 51 52 #ifndef yyerrflag 53 #define yyerrflag expr.oxout_errflag 54 #endif /* yyerrflag */ 55 56 #ifndef yylhs 57 #define yylhs expr.oxout_lhs 58 #endif /* yylhs */ 59 60 #ifndef yylen 61 #define yylen expr.oxout_len 62 #endif /* yylen */ 63 64 #ifndef yydefred 65 #define yydefred expr.oxout_defred 66 #endif /* yydefred */ 67 68 #ifndef yystos 69 #define yystos expr.oxout_stos 70 #endif /* yystos */ 71 72 #ifndef yydgoto 73 #define yydgoto expr.oxout_dgoto 74 #endif /* yydgoto */ 75 76 #ifndef yysindex 77 #define yysindex expr.oxout_sindex 78 #endif /* yysindex */ 79 80 #ifndef yyrindex 81 #define yyrindex expr.oxout_rindex 82 #endif /* yyrindex */ 83 84 #ifndef yygindex 85 #define yygindex expr.oxout_gindex 86 #endif /* yygindex */ 87 88 #ifndef yytable 89 #define yytable expr.oxout_table 90 #endif /* yytable */ 91 92 #ifndef yycheck 93 #define yycheck expr.oxout_check 94 #endif /* yycheck */ 95 96 #ifndef yyname 97 #define yyname expr.oxout_name 98 #endif /* yyname */ 99 100 #ifndef yyrule 101 #define yyrule expr.oxout_rule 102 #endif /* yyrule */ 103 104 #if YYBTYACC 105 106 #ifndef yycindex 107 #define yycindex expr.oxout_cindex 108 #endif /* yycindex */ 109 110 #ifndef yyctable 111 #define yyctable expr.oxout_ctable 112 #endif /* yyctable */ 113 114 #endif /* YYBTYACC */ 115 116 #define YYPREFIX "expr.oxout_" 117 118 #define YYPURE 0 119 120 #line 5 "expr.oxout.y" 121 #include <stdlib.h> 122 #include <string.h> 123 #line 8 "expr.Y" 124 125 #include "expr.oxout.h" 126 #include <stdio.h> 127 128 extern int yylex(void); 129 extern void yyerror(const char *); 130 #line 27 "expr.oxout.y" 131 #include <limits.h> 132 #define yyyR USHRT_MAX 133 #ifdef YYSTYPE 134 #undef YYSTYPE_IS_DECLARED 135 #define YYSTYPE_IS_DECLARED 1 136 #endif 137 #ifndef YYSTYPE_IS_DECLARED 138 #define YYSTYPE_IS_DECLARED 1 139 #line 31 "expr.oxout.y" 140 typedef union { 141 struct yyyOxAttrbs { 142 struct yyyStackItem *yyyOxStackItem; 143 } yyyOxAttrbs; 144 } YYSTYPE; 145 #endif /* !YYSTYPE_IS_DECLARED */ 146 #line 38 "expr.oxout.y" 147 #include <stdio.h> 148 #include <stdarg.h> 149 150 static int yyyYok = 1; 151 152 extern yyyFT yyyRCIL[]; 153 154 void yyyExecuteRRsection(yyyGNT *rootNode); 155 void yyyYoxInit(void); 156 void yyyDecorate(void); 157 struct yyyOxAttrbs; /* hack required to compensate for 'msta' behavior */ 158 void yyyGenIntNode(long yyyProdNum, int yyyRHSlength, int yyyNattrbs, struct yyyOxAttrbs *yyval_OxAttrbs, ...); 159 void yyyAdjustINRC(long yyyProdNum, int yyyRHSlength, long startP, long stopP, struct yyyOxAttrbs *yyval_OxAttrbs, ...); 160 void yyyCheckUnsolvedInstTrav(yyyGNT *rootNode,long *nNZrc,long *cycleSum); 161 void yyyUnsolvedInstSearchTrav(yyyGNT *pNode); 162 void yyyUnsolvedInstSearchTravAux(yyyGNT *pNode); 163 void yyyabort(void); 164 165 #line 166 "expr.oxout.tab.c" 166 167 /* compatibility with bison */ 168 #ifdef YYPARSE_PARAM 169 /* compatibility with FreeBSD */ 170 # ifdef YYPARSE_PARAM_TYPE 171 # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) 172 # else 173 # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) 174 # endif 175 #else 176 # define YYPARSE_DECL() yyparse(void) 177 #endif 178 179 /* Parameters sent to lex. */ 180 #ifdef YYLEX_PARAM 181 # define YYLEX_DECL() yylex(void *YYLEX_PARAM) 182 # define YYLEX yylex(YYLEX_PARAM) 183 #else 184 # define YYLEX_DECL() yylex(void) 185 # define YYLEX yylex() 186 #endif 187 188 /* Parameters sent to yyerror. */ 189 #ifndef YYERROR_DECL 190 #define YYERROR_DECL() yyerror(const char *s) 191 #endif 192 #ifndef YYERROR_CALL 193 #define YYERROR_CALL(msg) yyerror(msg) 194 #endif 195 196 extern int YYPARSE_DECL(); 197 198 #define ID 257 199 #define CONST 258 200 #define YYERRCODE 256 201 typedef short YYINT; 202 static const YYINT expr.oxout_lhs[] = { -1, 203 2, 0, 1, 3, 3, 3, 3, 3, 3, 3, 204 }; 205 static const YYINT expr.oxout_len[] = { 2, 206 0, 2, 1, 3, 3, 3, 3, 3, 1, 1, 207 }; 208 static const YYINT expr.oxout_defred[] = { 1, 209 0, 0, 9, 10, 0, 2, 0, 0, 0, 0, 210 0, 0, 8, 0, 0, 4, 0, 211 }; 212 #if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) 213 static const YYINT expr.oxout_stos[] = { 0, 214 260, 262, 257, 258, 40, 261, 263, 263, 43, 45, 215 42, 47, 41, 263, 263, 263, 263, 216 }; 217 #endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ 218 static const YYINT expr.oxout_dgoto[] = { 1, 219 6, 2, 7, 220 }; 221 static const YYINT expr.oxout_sindex[] = { 0, 222 0, -40, 0, 0, -40, 0, -18, -24, -40, -40, 223 -40, -40, 0, -37, -37, 0, -39, 224 }; 225 static const YYINT expr.oxout_rindex[] = { 0, 226 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 227 0, 0, 0, 2, 8, 0, 1, 228 }; 229 #if YYBTYACC 230 static const YYINT expr.oxout_cindex[] = { 0, 231 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232 0, 0, 0, 0, 0, 0, 0, 233 }; 234 #endif 235 static const YYINT expr.oxout_gindex[] = { 0, 236 0, 0, 4, 237 }; 238 #define YYTABLESIZE 218 239 static const YYINT expr.oxout_table[] = { 5, 240 6, 5, 11, 0, 11, 3, 0, 7, 8, 12, 241 0, 0, 14, 15, 16, 17, 13, 11, 9, 0, 242 10, 0, 12, 11, 9, 0, 10, 0, 12, 0, 243 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 244 0, 6, 5, 6, 5, 6, 5, 6, 7, 0, 245 7, 0, 7, 0, 0, 0, 0, 0, 0, 0, 246 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 249 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 251 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 252 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 253 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 254 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 256 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 257 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 258 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 259 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 260 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 261 0, 0, 0, 0, 0, 0, 3, 4, 262 }; 263 static const YYINT expr.oxout_check[] = { 40, 264 0, 0, 42, -1, 42, 0, -1, 0, 5, 47, 265 -1, -1, 9, 10, 11, 12, 41, 42, 43, -1, 266 45, -1, 47, 42, 43, -1, 45, -1, 47, -1, 267 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 268 -1, 41, 41, 43, 43, 45, 45, 47, 41, -1, 269 43, -1, 45, -1, -1, -1, -1, -1, -1, -1, 270 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 271 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 272 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 273 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 274 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 275 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 276 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 277 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 278 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 279 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 280 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 281 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 282 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 283 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 284 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 285 -1, -1, -1, -1, -1, -1, 257, 258, 286 }; 287 #if YYBTYACC 288 static const YYINT expr.oxout_ctable[] = { -1, 289 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 290 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 291 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 292 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 293 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 294 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 296 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 297 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 298 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 299 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 300 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 301 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 302 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 303 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 304 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 305 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 306 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 307 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 308 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 309 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 310 -1, -1, -1, -1, -1, -1, -1, 311 }; 312 #endif 313 #define YYFINAL 1 314 #ifndef YYDEBUG 315 #define YYDEBUG 0 316 #endif 317 #define YYMAXTOKEN 258 318 #define YYUNDFTOKEN 264 319 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) 320 #if YYDEBUG 321 static const char *const expr.oxout_name[] = { 322 323 "$end",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 324 0,0,0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 325 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 326 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 327 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 328 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 329 0,0,0,0,0,0,0,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","ID", 330 "CONST","$accept","yyyAugNonterm","s","$$1","expr","illegal-symbol", 331 }; 332 static const char *const expr.oxout_rule[] = { 333 "$accept : yyyAugNonterm", 334 "$$1 :", 335 "yyyAugNonterm : $$1 s", 336 "s : expr", 337 "expr : expr '*' expr", 338 "expr : expr '+' expr", 339 "expr : expr '/' expr", 340 "expr : expr '-' expr", 341 "expr : '(' expr ')'", 342 "expr : ID", 343 "expr : CONST", 344 345 }; 346 #endif 347 348 int yydebug; 349 int yynerrs; 350 351 int yyerrflag; 352 int yychar; 353 YYSTYPE yyval; 354 YYSTYPE yylval; 355 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 356 YYLTYPE yyloc; /* position returned by actions */ 357 YYLTYPE yylloc; /* position from the lexer */ 358 #endif 359 360 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 361 #ifndef YYLLOC_DEFAULT 362 #define YYLLOC_DEFAULT(loc, rhs, n) \ 363 do \ 364 { \ 365 if (n == 0) \ 366 { \ 367 (loc).first_line = ((rhs)[-1]).last_line; \ 368 (loc).first_column = ((rhs)[-1]).last_column; \ 369 (loc).last_line = ((rhs)[-1]).last_line; \ 370 (loc).last_column = ((rhs)[-1]).last_column; \ 371 } \ 372 else \ 373 { \ 374 (loc).first_line = ((rhs)[ 0 ]).first_line; \ 375 (loc).first_column = ((rhs)[ 0 ]).first_column; \ 376 (loc).last_line = ((rhs)[n-1]).last_line; \ 377 (loc).last_column = ((rhs)[n-1]).last_column; \ 378 } \ 379 } while (0) 380 #endif /* YYLLOC_DEFAULT */ 381 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 382 #if YYBTYACC 383 384 #ifndef YYLVQUEUEGROWTH 385 #define YYLVQUEUEGROWTH 32 386 #endif 387 #endif /* YYBTYACC */ 388 389 /* define the initial stack-sizes */ 390 #ifdef YYSTACKSIZE 391 #undef YYMAXDEPTH 392 #define YYMAXDEPTH YYSTACKSIZE 393 #else 394 #ifdef YYMAXDEPTH 395 #define YYSTACKSIZE YYMAXDEPTH 396 #else 397 #define YYSTACKSIZE 10000 398 #define YYMAXDEPTH 10000 399 #endif 400 #endif 401 402 #ifndef YYINITSTACKSIZE 403 #define YYINITSTACKSIZE 200 404 #endif 405 406 typedef struct { 407 unsigned stacksize; 408 YYINT *s_base; 409 YYINT *s_mark; 410 YYINT *s_last; 411 YYSTYPE *l_base; 412 YYSTYPE *l_mark; 413 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 414 YYLTYPE *p_base; 415 YYLTYPE *p_mark; 416 #endif 417 } YYSTACKDATA; 418 #if YYBTYACC 419 420 struct YYParseState_s 421 { 422 struct YYParseState_s *save; /* Previously saved parser state */ 423 YYSTACKDATA yystack; /* saved parser stack */ 424 int state; /* saved parser state */ 425 int errflag; /* saved error recovery status */ 426 int lexeme; /* saved index of the conflict lexeme in the lexical queue */ 427 YYINT ctry; /* saved index in yyctable[] for this conflict */ 428 }; 429 typedef struct YYParseState_s YYParseState; 430 #endif /* YYBTYACC */ 431 /* variables for the parser stack */ 432 static YYSTACKDATA yystack; 433 #if YYBTYACC 434 435 /* Current parser state */ 436 static YYParseState *yyps = 0; 437 438 /* yypath != NULL: do the full parse, starting at *yypath parser state. */ 439 static YYParseState *yypath = 0; 440 441 /* Base of the lexical value queue */ 442 static YYSTYPE *yylvals = 0; 443 444 /* Current position at lexical value queue */ 445 static YYSTYPE *yylvp = 0; 446 447 /* End position of lexical value queue */ 448 static YYSTYPE *yylve = 0; 449 450 /* The last allocated position at the lexical value queue */ 451 static YYSTYPE *yylvlim = 0; 452 453 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 454 /* Base of the lexical position queue */ 455 static YYLTYPE *yylpsns = 0; 456 457 /* Current position at lexical position queue */ 458 static YYLTYPE *yylpp = 0; 459 460 /* End position of lexical position queue */ 461 static YYLTYPE *yylpe = 0; 462 463 /* The last allocated position at the lexical position queue */ 464 static YYLTYPE *yylplim = 0; 465 #endif 466 467 /* Current position at lexical token queue */ 468 static YYINT *yylexp = 0; 469 470 static YYINT *yylexemes = 0; 471 #endif /* YYBTYACC */ 472 #line 53 "expr.Y" 473 474 475 int yyparse(void); 476 477 int main() 478 {yyparse(); 479 } 480 481 482 483 #line 138 "expr.oxout.y" 484 long yyySSALspaceSize = 20000; 485 long yyyRSmaxSize = 1000; 486 long yyyTravStackMaxSize = 2000; 487 488 struct yyySolvedSAlistCell {yyyWAT attrbNum; 489 long next; 490 }; 491 492 #define yyyLambdaSSAL 0 493 long yyySSALCfreeList = yyyLambdaSSAL; 494 long yyyNewSSALC = 1; 495 496 struct yyySolvedSAlistCell *yyySSALspace; 497 498 long yyyNbytesStackStg; 499 500 501 502 yyyFT yyyRCIL[1]; 503 504 short yyyIIIEL[] = {0, 505 0,2,6,10,14,18,22,24, 506 }; 507 508 long yyyIIEL[] = { 509 0,0,0,0,0,0,0,0,0,0,0,0, 510 0,0,0,0,0,0,0,0,0,0,0,0, 511 1,1, 512 }; 513 514 long yyyIEL[] = { 515 0,0,0, 516 }; 517 518 yyyFT yyyEntL[1]; 519 520 void yyyfatal(char *msg) 521 {fputs(msg,stderr);exit(-1);} 522 523 524 525 #define yyySSALof 'S' 526 #define yyyRSof 'q' 527 #define yyyTSof 't' 528 529 530 531 void yyyHandleOverflow(char which) 532 {char *msg1,*msg2; 533 long oldSize,newSize; 534 switch(which) 535 { 536 case yyySSALof : 537 msg1 = "SSAL overflow: "; 538 oldSize = yyySSALspaceSize; 539 break; 540 case yyyRSof : 541 msg1 = "ready set overflow: "; 542 oldSize = yyyRSmaxSize; 543 break; 544 case yyyTSof : 545 msg1 = "traversal stack overflow: "; 546 oldSize = yyyTravStackMaxSize; 547 break; 548 default :; 549 } 550 newSize = (3*oldSize)/2; 551 if (newSize < 100) newSize = 100; 552 fputs(msg1,stderr); 553 fprintf(stderr,"size was %ld.\n",oldSize); 554 msg2 = " Have to modify evaluator: -Y%c%ld.\n"; 555 fprintf(stderr,msg2,which,newSize); 556 exit(-1); 557 } 558 559 560 561 void yyySignalEnts(yyyGNT *node,long startP,long stopP) 562 {yyyGNT *dumNode; 563 564 while (startP < stopP) 565 { 566 if (!yyyEntL[startP]) dumNode = node; 567 else dumNode = (node->cL)[yyyEntL[startP]-1]; 568 if (!(--((dumNode->refCountList)[yyyEntL[startP+1]] 569 ) 570 ) 571 ) 572 { 573 if (++yyyRSTop == yyyAfterRS) 574 {yyyHandleOverflow(yyyRSof); 575 break; 576 } 577 yyyRSTop->node = dumNode; 578 yyyRSTop->whichSym = yyyEntL[startP]; 579 yyyRSTop->wa = yyyEntL[startP+1]; 580 } 581 startP += 2; 582 } 583 } 584 585 586 587 588 589 590 void yyySolveAndSignal() { 591 long yyyiDum,*yyypL; 592 int yyyws,yyywa; 593 yyyGNT *yyyRSTopN,*yyyRefN; 594 yyyParent yyyRSTopNp; 595 596 597 yyyRSTopNp = (yyyRSTopN = yyyRSTop->node)->parent; 598 yyyRefN= (yyyws = (yyyRSTop->whichSym))?yyyRSTopNp.noderef:yyyRSTopN; 599 yyywa = yyyRSTop->wa; 600 yyyRSTop--; 601 switch(yyyRefN->prodNum) { 602 case 1: /***yacc rule 1***/ 603 switch (yyyws) { 604 } 605 break; 606 case 2: /***yacc rule 2***/ 607 switch (yyyws) { 608 } 609 break; 610 case 3: /***yacc rule 3***/ 611 switch (yyyws) { 612 } 613 break; 614 case 4: /***yacc rule 4***/ 615 switch (yyyws) { 616 } 617 break; 618 case 5: /***yacc rule 5***/ 619 switch (yyyws) { 620 } 621 break; 622 case 6: /***yacc rule 6***/ 623 switch (yyyws) { 624 } 625 break; 626 case 7: /***yacc rule 7***/ 627 switch (yyyws) { 628 case 1: /**/ 629 switch (yyywa) { 630 } 631 break; 632 } 633 break; 634 case 8: /***yacc rule 8***/ 635 switch (yyyws) { 636 case 1: /**/ 637 switch (yyywa) { 638 } 639 break; 640 } 641 break; 642 } /* switch */ 643 644 if (yyyws) /* the just-solved instance was inherited. */ 645 {if (yyyRSTopN->prodNum) 646 {yyyiDum = yyyIIEL[yyyIIIEL[yyyRSTopN->prodNum]] + yyywa; 647 yyySignalEnts(yyyRSTopN,yyyIEL[yyyiDum], 648 yyyIEL[yyyiDum+1] 649 ); 650 } 651 } 652 else /* the just-solved instance was synthesized. */ 653 {if (!(yyyRSTopN->parentIsStack)) /* node has a parent. */ 654 {yyyiDum = yyyIIEL[yyyIIIEL[yyyRSTopNp.noderef->prodNum] + 655 yyyRSTopN->whichSym 656 ] + 657 yyywa; 658 yyySignalEnts(yyyRSTopNp.noderef, 659 yyyIEL[yyyiDum], 660 yyyIEL[yyyiDum+1] 661 ); 662 } 663 else /* node is still on the stack--it has no parent yet. */ 664 {yyypL = &(yyyRSTopNp.stackref->solvedSAlist); 665 if (yyySSALCfreeList == yyyLambdaSSAL) 666 {yyySSALspace[yyyNewSSALC].next = *yyypL; 667 if ((*yyypL = yyyNewSSALC++) == yyySSALspaceSize) 668 yyyHandleOverflow(yyySSALof); 669 } 670 else 671 {yyyiDum = yyySSALCfreeList; 672 yyySSALCfreeList = yyySSALspace[yyySSALCfreeList].next; 673 yyySSALspace[yyyiDum].next = *yyypL; 674 *yyypL = yyyiDum; 675 } 676 yyySSALspace[*yyypL].attrbNum = yyywa; 677 } 678 } 679 680 } /* yyySolveAndSignal */ 681 682 683 684 685 686 687 #define condStg unsigned int conds; 688 #define yyyClearConds {yyyTST->conds = 0;} 689 #define yyySetCond(n) {yyyTST->conds += (1<<(n));} 690 #define yyyCond(n) ((yyyTST->conds & (1<<(n)))?1:0) 691 692 693 694 struct yyyTravStackItem {yyyGNT *node; 695 char isReady; 696 condStg 697 }; 698 699 700 701 void yyyDoTraversals(yyyGNT *rootNode) 702 {struct yyyTravStackItem *yyyTravStack,*yyyTST,*yyyAfterTravStack; 703 yyyGNT *yyyTSTn,**yyyCLptr2; 704 int yyyi,yyyRL,yyyPass; 705 int i; 706 707 if (!yyyYok) return; 708 if ((yyyTravStack = 709 ((struct yyyTravStackItem *) 710 calloc((size_t)yyyTravStackMaxSize, 711 (size_t)sizeof(struct yyyTravStackItem) 712 ) 713 ) 714 ) 715 == 716 (struct yyyTravStackItem *)NULL 717 ) 718 {fputs("malloc error in traversal stack allocation\n",stderr); 719 exit(-1); 720 } 721 722 yyyAfterTravStack = yyyTravStack + yyyTravStackMaxSize; 723 yyyTravStack++; 724 725 726 for (yyyi=0; yyyi<2; yyyi++) { 727 yyyTST = yyyTravStack; 728 yyyTST->node = rootNode; 729 yyyTST->isReady = 0; 730 yyyClearConds 731 732 while(yyyTST >= yyyTravStack) 733 {yyyTSTn = yyyTST->node; 734 if (yyyTST->isReady) 735 {yyyPass = 1; 736 goto yyyTravSwitch; 737 yyyTpop: 738 yyyTST--; 739 } 740 else 741 {yyyPass = 0; 742 goto yyyTravSwitch; 743 yyyTpush: 744 yyyTST->isReady = 1; 745 if (yyyTSTn->prodNum) 746 {if (yyyRL) 747 {yyyCLptr2 = yyyTSTn->cL; 748 i = yyyTSTn->cLlen; 749 while (i--) 750 {if (++yyyTST == yyyAfterTravStack) 751 yyyHandleOverflow(yyyTSof); 752 else 753 {yyyTST->node = *yyyCLptr2; 754 yyyTST->isReady = 0; 755 yyyClearConds 756 } 757 yyyCLptr2++; 758 } 759 } /* right to left */ 760 else /* left to right */ 761 {i = yyyTSTn->cLlen; 762 yyyCLptr2 = yyyTSTn->cL + i; 763 while (i--) 764 {yyyCLptr2--; 765 if (++yyyTST == yyyAfterTravStack) 766 yyyHandleOverflow(yyyTSof); 767 else 768 {yyyTST->node = *yyyCLptr2; 769 yyyTST->isReady = 0; 770 yyyClearConds 771 } 772 } 773 } /* left to right */ 774 } 775 } /* else */ 776 continue; 777 yyyTravSwitch: 778 switch(yyyTSTn->prodNum) { 779 case 1: 780 switch(yyyi) { 781 case 0: 782 switch(yyyPass) { 783 case 0: 784 yyyRL = 0;yyySetCond(0) 785 786 if (! 787 #line 24 "expr.Y" 788 (1) 789 #line 444 "expr.oxout.y" 790 ) yyySetCond(1) 791 yyySetCond(2) 792 793 case 1: 794 795 if (yyyCond(0) != yyyPass) { 796 #line 24 "expr.Y" 797 798 #line 453 "expr.oxout.y" 799 } 800 if (yyyCond(1) != yyyPass) { 801 #line 24 "expr.Y" 802 printf("\n"); 803 804 #line 459 "expr.oxout.y" 805 } 806 if (yyyCond(2) != yyyPass) { 807 #line 25 "expr.Y" 808 printf("prefix: "); 809 810 #line 465 "expr.oxout.y" 811 } 812 break; 813 } 814 break; 815 case 1: 816 switch(yyyPass) { 817 case 0: 818 yyyRL = 0; 819 if ( 820 #line 23 "expr.Y" 821 (1) 822 #line 477 "expr.oxout.y" 823 ) yyySetCond(2) 824 825 case 1: 826 827 if (yyyCond(0) != yyyPass) { 828 #line 22 "expr.Y" 829 printf("\n"); 830 831 #line 486 "expr.oxout.y" 832 } 833 if (yyyCond(1) != yyyPass) { 834 #line 23 "expr.Y" 835 836 #line 491 "expr.oxout.y" 837 } 838 if (yyyCond(2) != yyyPass) { 839 #line 23 "expr.Y" 840 printf("postfix: ")/* missing ; */ 841 842 #line 497 "expr.oxout.y" 843 } 844 break; 845 } 846 break; 847 } 848 849 break; 850 case 2: 851 switch(yyyi) { 852 case 0: 853 switch(yyyPass) { 854 case 0: 855 yyyRL = 0;yyySetCond(0) 856 857 case 1: 858 859 if (yyyCond(0) != yyyPass) { 860 #line 29 "expr.Y" 861 printf(" * "); 862 863 #line 518 "expr.oxout.y" 864 } 865 break; 866 } 867 break; 868 case 1: 869 switch(yyyPass) { 870 case 0: 871 yyyRL = 0; 872 case 1: 873 874 if (yyyCond(0) != yyyPass) { 875 #line 28 "expr.Y" 876 printf(" * "); 877 878 #line 533 "expr.oxout.y" 879 } 880 break; 881 } 882 break; 883 } 884 885 break; 886 case 3: 887 switch(yyyi) { 888 case 0: 889 switch(yyyPass) { 890 case 0: 891 yyyRL = 0;yyySetCond(0) 892 893 case 1: 894 895 if (yyyCond(0) != yyyPass) { 896 #line 32 "expr.Y" 897 printf(" + "); 898 899 #line 554 "expr.oxout.y" 900 } 901 break; 902 } 903 break; 904 case 1: 905 switch(yyyPass) { 906 case 0: 907 yyyRL = 0; 908 case 1: 909 910 if (yyyCond(0) != yyyPass) { 911 #line 33 "expr.Y" 912 printf(" + "); 913 914 #line 569 "expr.oxout.y" 915 } 916 break; 917 } 918 break; 919 } 920 921 break; 922 case 4: 923 switch(yyyi) { 924 case 0: 925 switch(yyyPass) { 926 case 0: 927 yyyRL = 0;yyySetCond(0) 928 929 case 1: 930 931 if (yyyCond(0) != yyyPass) { 932 #line 37 "expr.Y" 933 printf(" / "); 934 935 #line 590 "expr.oxout.y" 936 } 937 break; 938 } 939 break; 940 case 1: 941 switch(yyyPass) { 942 case 0: 943 yyyRL = 0; 944 case 1: 945 946 if (yyyCond(0) != yyyPass) { 947 #line 36 "expr.Y" 948 printf(" / "); 949 950 #line 605 "expr.oxout.y" 951 } 952 break; 953 } 954 break; 955 } 956 957 break; 958 case 5: 959 switch(yyyi) { 960 case 0: 961 switch(yyyPass) { 962 case 0: 963 yyyRL = 0;yyySetCond(0) 964 965 case 1: 966 967 if (yyyCond(0) != yyyPass) { 968 #line 41 "expr.Y" 969 printf(" - "); 970 971 #line 626 "expr.oxout.y" 972 } 973 break; 974 } 975 break; 976 case 1: 977 switch(yyyPass) { 978 case 0: 979 yyyRL = 0; 980 case 1: 981 982 if (yyyCond(0) != yyyPass) { 983 #line 40 "expr.Y" 984 printf(" - "); 985 986 #line 641 "expr.oxout.y" 987 } 988 break; 989 } 990 break; 991 } 992 993 break; 994 case 6: 995 switch(yyyi) { 996 case 0: 997 switch(yyyPass) { 998 case 0: 999 yyyRL = 0; 1000 case 1: 1001 1002 break; 1003 } 1004 break; 1005 case 1: 1006 switch(yyyPass) { 1007 case 0: 1008 yyyRL = 0; 1009 case 1: 1010 1011 break; 1012 } 1013 break; 1014 } 1015 1016 break; 1017 case 7: 1018 switch(yyyi) { 1019 case 0: 1020 switch(yyyPass) { 1021 case 0: 1022 yyyRL = 0;yyySetCond(0) 1023 1024 case 1: 1025 1026 if (yyyCond(0) != yyyPass) { 1027 #line 46 "expr.Y" 1028 printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme); 1029 1030 #line 685 "expr.oxout.y" 1031 } 1032 break; 1033 } 1034 break; 1035 case 1: 1036 switch(yyyPass) { 1037 case 0: 1038 yyyRL = 0; 1039 case 1: 1040 1041 if (yyyCond(0) != yyyPass) { 1042 #line 45 "expr.Y" 1043 printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme); 1044 1045 #line 700 "expr.oxout.y" 1046 } 1047 break; 1048 } 1049 break; 1050 } 1051 1052 break; 1053 case 8: 1054 switch(yyyi) { 1055 case 0: 1056 switch(yyyPass) { 1057 case 0: 1058 yyyRL = 0;yyySetCond(0) 1059 1060 case 1: 1061 1062 if (yyyCond(0) != yyyPass) { 1063 #line 50 "expr.Y" 1064 printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme); 1065 1066 #line 721 "expr.oxout.y" 1067 } 1068 break; 1069 } 1070 break; 1071 case 1: 1072 switch(yyyPass) { 1073 case 0: 1074 yyyRL = 0; 1075 case 1: 1076 1077 if (yyyCond(0) != yyyPass) { 1078 #line 49 "expr.Y" 1079 printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme); 1080 1081 #line 736 "expr.oxout.y" 1082 } 1083 break; 1084 } 1085 break; 1086 } 1087 1088 break; 1089 } /* switch */ 1090 if (yyyPass) goto yyyTpop; else goto yyyTpush; 1091 } /* while */ 1092 } /* for */ 1093 } /* yyyDoTraversals */ 1094 1095 void yyyExecuteRRsection(yyyGNT *rootNode) { 1096 int yyyi; 1097 long cycleSum = 0; 1098 long nNZrc = 0; 1099 1100 if (!yyyYok) return; 1101 yyyCheckUnsolvedInstTrav(rootNode,&nNZrc,&cycleSum); 1102 if (nNZrc) 1103 { 1104 fputs("\n\n\n**********\n",stderr); 1105 fputs("cycle detected in completed parse tree",stderr); 1106 fputs(" after decoration.\n",stderr); 1107 #if CYCLE_VERBOSE 1108 fprintf(stderr, 1109 "number of unsolved attribute instances == %ld.\n", 1110 nNZrc 1111 ); 1112 fprintf(stderr, 1113 "total number of remaining dependencies == %ld.\n", 1114 cycleSum 1115 ); 1116 fputs("average number of remaining dependencies\n",stderr); 1117 fprintf(stderr," per unsolved instance == %f.\n", 1118 ((float)(cycleSum)/(float)(nNZrc)) 1119 ); 1120 #endif 1121 fprintf(stderr, 1122 "searching parse tree for %ld unsolved instances:\n", 1123 nNZrc 1124 ); 1125 yyyUnsolvedInstSearchTravAux(rootNode); 1126 } 1127 yyyDoTraversals(rootNode); 1128 } /* yyyExecuteRRsection */ 1129 1130 1131 1132 yyyWAT yyyLRCIL[2] = {0,0, 1133 }; 1134 1135 1136 1137 void yyyYoxInit(void) 1138 { 1139 static int yyyInitDone = 0; 1140 if (yyyInitDone) return; 1141 1142 if ((yyyRS = (struct yyyRSitem *) 1143 calloc((size_t)(yyyRSmaxSize+1), (size_t)sizeof(struct yyyRSitem)) 1144 ) 1145 == 1146 ((struct yyyRSitem *) NULL) 1147 ) 1148 yyyfatal("malloc error in ox ready set space allocation\n"); 1149 yyyRS++; 1150 yyyAfterRS = yyyRS + yyyRSmaxSize; 1151 1152 1153 if ((yyySSALspace = (struct yyySolvedSAlistCell *) 1154 calloc((size_t)(yyySSALspaceSize+1), (size_t)sizeof(struct yyySolvedSAlistCell)) 1155 ) 1156 == 1157 ((struct yyySolvedSAlistCell *) NULL) 1158 ) 1159 yyyfatal("malloc error in stack solved list space allocation\n"); 1160 yyyInitDone = 1; 1161 1162 yyyRSTop = yyyRS - 1; 1163 } /* yyyYoxInit */ 1164 1165 1166 1167 void yyyDecorate(void) 1168 { 1169 while (yyyRSTop >= yyyRS) 1170 yyySolveAndSignal(); 1171 } 1172 1173 1174 1175 void yyyGenIntNode(long yyyProdNum, int yyyRHSlength, int yyyNattrbs, struct yyyOxAttrbs *yyval_OxAttrbs, ...) 1176 {yyyWST i; 1177 yyySIT **yyyOxStackItem = &yyval_OxAttrbs->yyyOxStackItem; 1178 yyyGNT *gnpDum; 1179 va_list ap; 1180 1181 *yyyOxStackItem = (yyySIT *) malloc((size_t)sizeof(yyySIT)); 1182 if (*yyyOxStackItem == (yyySIT *) NULL) 1183 yyyfatal("malloc error in ox yacc semantic stack space allocation\n"); 1184 (*yyyOxStackItem)->node = 1185 (yyyGNT *) malloc((size_t)sizeof(yyyGNT)); 1186 if ((*yyyOxStackItem)->node == (yyyGNT *) NULL) 1187 yyyfatal("malloc error in ox node space allocation\n"); 1188 (*yyyOxStackItem)->solvedSAlist = yyyLambdaSSAL; 1189 (*yyyOxStackItem)->node->parent.stackref = *yyyOxStackItem; 1190 (*yyyOxStackItem)->node->parentIsStack = 1; 1191 (*yyyOxStackItem)->node->cLlen = yyyRHSlength; 1192 (*yyyOxStackItem)->node->cL = 1193 (yyyGNT **) calloc((size_t)yyyRHSlength, (size_t)sizeof(yyyGNT *)); 1194 if ((*yyyOxStackItem)->node->cL == (yyyGNT **) NULL) 1195 yyyfatal("malloc error in ox child list space allocation\n"); 1196 (*yyyOxStackItem)->node->refCountListLen = yyyNattrbs; 1197 (*yyyOxStackItem)->node->refCountList = 1198 (yyyRCT *) calloc((size_t)yyyNattrbs, (size_t)sizeof(yyyRCT)); 1199 if ((*yyyOxStackItem)->node->refCountList == (yyyRCT *) NULL) 1200 yyyfatal("malloc error in ox reference count list space allocation\n"); 1201 (*yyyOxStackItem)->node->prodNum = yyyProdNum; 1202 va_start(ap, yyval_OxAttrbs); 1203 for (i=1;i<=yyyRHSlength;i++) 1204 {yyySIT *yaccStDum = va_arg(ap,struct yyyOxAttrbs *)->yyyOxStackItem; 1205 gnpDum = (*yyyOxStackItem)->node->cL[i-1] = yaccStDum->node; 1206 gnpDum->whichSym = i; 1207 gnpDum->parent.noderef = (*yyyOxStackItem)->node; 1208 gnpDum->parentIsStack = 0; 1209 } 1210 va_end(ap); 1211 } 1212 1213 1214 1215 #define yyyDECORfREQ 50 1216 1217 1218 1219 void yyyAdjustINRC(long yyyProdNum, int yyyRHSlength, long startP, long stopP, struct yyyOxAttrbs *yyval_OxAttrbs, ...) 1220 {yyyWST i; 1221 yyySIT *yyyOxStackItem = yyval_OxAttrbs->yyyOxStackItem; 1222 long SSALptr,SSALptrHead,*cPtrPtr; 1223 long *pL; 1224 yyyGNT *gnpDum; 1225 long iTemp; 1226 long nextP; 1227 static unsigned short intNodeCount = yyyDECORfREQ; 1228 va_list ap; 1229 1230 nextP = startP; 1231 while (nextP < stopP) 1232 {if (yyyRCIL[nextP] == yyyR) 1233 {(yyyOxStackItem->node->refCountList)[yyyRCIL[nextP+1]] = yyyRCIL[nextP+2]; 1234 } 1235 else 1236 {(((yyyOxStackItem->node->cL)[yyyRCIL[nextP]])->refCountList)[yyyRCIL[nextP+1]] = yyyRCIL[nextP+2]; 1237 } 1238 nextP += 3; 1239 } 1240 pL = yyyIIEL + yyyIIIEL[yyyProdNum]; 1241 va_start(ap, yyval_OxAttrbs); 1242 for (i=1;i<=yyyRHSlength;i++) 1243 {yyySIT *yaccStDum = va_arg(ap,struct yyyOxAttrbs *)->yyyOxStackItem; 1244 pL++; 1245 SSALptrHead = SSALptr = *(cPtrPtr = &(yaccStDum->solvedSAlist)); 1246 if (SSALptr != yyyLambdaSSAL) 1247 {*cPtrPtr = yyyLambdaSSAL; 1248 do 1249 { 1250 iTemp = (*pL+yyySSALspace[SSALptr].attrbNum); 1251 yyySignalEnts(yyyOxStackItem->node, 1252 yyyIEL[iTemp], 1253 yyyIEL[iTemp+1] 1254 ); 1255 SSALptr = *(cPtrPtr = &(yyySSALspace[SSALptr].next)); 1256 } 1257 while (SSALptr != yyyLambdaSSAL); 1258 *cPtrPtr = yyySSALCfreeList; 1259 yyySSALCfreeList = SSALptrHead; 1260 } 1261 } 1262 va_end(ap); 1263 nextP = startP + 2; 1264 while (nextP < stopP) 1265 {if (!yyyRCIL[nextP]) 1266 {if (yyyRCIL[nextP-2] == yyyR) 1267 {pL = &(yyyOxStackItem->solvedSAlist); 1268 if (yyySSALCfreeList == yyyLambdaSSAL) 1269 {yyySSALspace[yyyNewSSALC].next = *pL; 1270 if ((*pL = yyyNewSSALC++) == yyySSALspaceSize) 1271 yyyHandleOverflow(yyySSALof); 1272 } 1273 else 1274 {iTemp = yyySSALCfreeList; 1275 yyySSALCfreeList = yyySSALspace[yyySSALCfreeList].next; 1276 yyySSALspace[iTemp].next = *pL; 1277 *pL = iTemp; 1278 } 1279 yyySSALspace[*pL].attrbNum = yyyRCIL[nextP-1]; 1280 } 1281 else 1282 {if ((gnpDum = (yyyOxStackItem->node->cL)[yyyRCIL[nextP-2]])->prodNum != 0) 1283 { 1284 iTemp = yyyIIEL[yyyIIIEL[gnpDum->prodNum]] + yyyRCIL[nextP-1]; 1285 yyySignalEnts(gnpDum, 1286 yyyIEL[iTemp], 1287 yyyIEL[iTemp+1] 1288 ); 1289 } 1290 } 1291 } 1292 nextP += 3; 1293 } 1294 if (!--intNodeCount) 1295 {intNodeCount = yyyDECORfREQ; 1296 yyyDecorate(); 1297 } 1298 } 1299 1300 1301 1302 void yyyGenLeaf(int nAttrbs,int typeNum,long startP,long stopP,YYSTYPE *yylval) 1303 {yyyRCT *rcPdum; 1304 yyySIT **yyyOxStackItem = &yylval->yyyOxAttrbs.yyyOxStackItem; 1305 (*yyyOxStackItem) = (yyySIT *) malloc((size_t)sizeof(yyySIT)); 1306 if ((*yyyOxStackItem) == (yyySIT *) NULL) 1307 yyyfatal("malloc error in ox yacc semantic stack space allocation\n"); 1308 (*yyyOxStackItem)->node = 1309 (yyyGNT *) malloc((size_t)sizeof(yyyGNT)) 1310 ; 1311 if ((*yyyOxStackItem)->node == (yyyGNT *) NULL) 1312 yyyfatal("malloc error in ox node space allocation\n"); 1313 (*yyyOxStackItem)->solvedSAlist = yyyLambdaSSAL; 1314 (*yyyOxStackItem)->node->parent.stackref = *yyyOxStackItem; 1315 (*yyyOxStackItem)->node->parentIsStack = 1; 1316 (*yyyOxStackItem)->node->cLlen = 0; 1317 (*yyyOxStackItem)->node->cL = (yyyGNT **)NULL; 1318 (*yyyOxStackItem)->node->refCountListLen = nAttrbs; 1319 rcPdum = (*yyyOxStackItem)->node->refCountList = 1320 (yyyRCT *) calloc((size_t)nAttrbs, (size_t)sizeof(yyyRCT)); 1321 if (rcPdum == (yyyRCT *) NULL) 1322 yyyfatal("malloc error in ox reference count list space allocation\n"); 1323 while (startP < stopP) rcPdum[yyyLRCIL[startP++]] = 0; 1324 (*yyyOxStackItem)->node->prodNum = 0; 1325 (*yyyOxStackItem)->node->whichSym = 0; 1326 } 1327 1328 1329 1330 void yyyabort(void) 1331 {yyyYok = 0; 1332 } 1333 1334 1335 1336 1337 1338 #define yyyLastProdNum 8 1339 1340 1341 #define yyyNsorts 1 1342 1343 1344 int yyyProdsInd[] = { 1345 0, 1346 0, 2, 6, 10, 14, 18, 22, 24, 1347 26, 1348 }; 1349 1350 1351 int yyyProds[][2] = { 1352 { 116, 0},{ 462, 0},{ 462, 0},{ 462, 0},{ 412, 0}, 1353 { 462, 0},{ 462, 0},{ 462, 0},{ 420, 0},{ 462, 0}, 1354 { 462, 0},{ 462, 0},{ 452, 0},{ 462, 0},{ 462, 0}, 1355 { 462, 0},{ 436, 0},{ 462, 0},{ 462, 0},{ 396, 0}, 1356 { 462, 0},{ 404, 0},{ 462, 0},{ 619, 1},{ 462, 0}, 1357 { 567, 1}, 1358 }; 1359 1360 1361 int yyySortsInd[] = { 1362 0, 1363 0, 1364 1, 1365 }; 1366 1367 1368 int yyySorts[] = { 1369 413, 1370 }; 1371 1372 1373 1374 char *yyyStringTab[] = { 1375 0,0,0,0,0, 1376 0,0,0,0,0, 1377 0,0,0,0,0, 1378 0,0,0,0,0, 1379 0,0,0,0,0, 1380 0,0,0,0,0, 1381 0,0,0,0,0, 1382 0,0,0,0,0, 1383 0,0,0,0,0, 1384 0,0,0,0,0, 1385 0,0,0,0,0, 1386 0,0,0,0,0, 1387 0,0,0,0,0, 1388 0,0,0,0,0, 1389 0,0,0,0,0, 1390 0,0,0,0,0, 1391 0,0,0,0,0, 1392 0,0,0,0,0, 1393 0,0,0,0,0, 1394 0,0,0,0,0, 1395 0,0,0,0,0, 1396 0,0,0,0,0, 1397 0,0,0,0,0, 1398 0,"s",0,0,0, 1399 0,0,"y",0,0, 1400 0,0,0,0,0, 1401 0,0,0,0,0, 1402 0,0,0,0,0, 1403 0,0,0,0,0, 1404 0,0,0,0,0, 1405 0,0,0,0,0, 1406 0,0,0,0,0, 1407 0,0,0,0,0, 1408 0,0,0,0,0, 1409 0,0,0,0,0, 1410 0,0,0,0,0, 1411 0,0,0,0,0, 1412 0,0,0,0,0, 1413 0,0,0,0,0, 1414 0,0,0,0,0, 1415 0,0,0,0,0, 1416 0,0,0,0,0, 1417 0,0,0,0,0, 1418 0,0,0,0,0, 1419 0,0,0,0,0, 1420 0,0,0,0,0, 1421 0,0,0,0,0, 1422 0,0,0,0,0, 1423 0,0,0,0,0, 1424 0,0,0,0,0, 1425 0,0,0,0,0, 1426 0,0,0,0,0, 1427 0,0,0,0,0, 1428 0,0,0,0,0, 1429 0,0,0,0,0, 1430 0,0,0,0,0, 1431 0,0,0,0,0, 1432 0,0,0,0,0, 1433 0,0,0,0,0, 1434 0,0,0,0,0, 1435 0,0,0,0,0, 1436 0,0,0,0,0, 1437 0,0,0,0,0, 1438 0,0,0,0,0, 1439 0,0,0,0,0, 1440 0,"LRpre",0,0,0, 1441 0,0,0,0,0, 1442 0,0,0,0,0, 1443 0,0,0,0,0, 1444 0,0,0,0,0, 1445 0,0,0,0,0, 1446 0,0,0,0,0, 1447 0,0,0,0,0, 1448 0,0,0,0,0, 1449 0,0,0,0,0, 1450 0,0,0,0,0, 1451 0,0,0,0,0, 1452 0,0,0,0,0, 1453 0,0,0,0,0, 1454 0,"'('",0,0,0, 1455 0,0,0,0,"')'", 1456 0,0,0,0,0, 1457 0,0,"'*'","lexeme",0, 1458 0,0,0,0,0, 1459 "'+'",0,0,0,0, 1460 0,0,0,0,0, 1461 0,0,0,0,0, 1462 0,"'-'",0,0,0, 1463 0,0,0,0,0, 1464 0,0,0,0,0, 1465 0,0,"'/'",0,0, 1466 0,0,0,0,0, 1467 0,0,"expr",0,0, 1468 0,0,0,0,0, 1469 0,0,0,0,0, 1470 0,"printf",0,0,0, 1471 0,0,0,0,0, 1472 0,0,0,0,0, 1473 0,0,0,0,0, 1474 0,0,0,0,0, 1475 0,0,0,0,0, 1476 0,0,0,0,0, 1477 0,0,0,0,0, 1478 0,0,0,0,0, 1479 0,0,0,0,0, 1480 0,0,0,0,0, 1481 0,0,0,0,0, 1482 0,0,0,0,0, 1483 0,0,0,0,0, 1484 0,0,0,0,0, 1485 0,0,0,0,0, 1486 0,0,0,0,0, 1487 0,0,0,0,0, 1488 0,0,"CONST","LRpost",0, 1489 0,0,0,0,0, 1490 0,0,0,0,0, 1491 0,0,0,0,0, 1492 0,0,0,0,0, 1493 0,0,0,0,0, 1494 0,0,0,0,0, 1495 0,0,0,0,0, 1496 0,0,0,0,0, 1497 0,0,0,0,0, 1498 0,0,0,0,"ID", 1499 0,0,0,0,0, 1500 0,0,0,0,0, 1501 0,0,0,0,0, 1502 0,0,0,0,0, 1503 0,0,0,0,0, 1504 0,0,0,0,0, 1505 0,0,0,0,0, 1506 0,0,0,0,0, 1507 0,0,0,0,0, 1508 0,0,0,0,0, 1509 0,0,0,0,0, 1510 0,0,0,0,0, 1511 0,0,0,0,0, 1512 0,0,0,0,0, 1513 0,0,0,0,0, 1514 0,0,0,0,0, 1515 0,0,0,0,0, 1516 0,0,0,0,0, 1517 0,0,0,0,0, 1518 0,0,0,0,0, 1519 0,0,0,0,0, 1520 0,0,0,0,0, 1521 0,0,0,0,0, 1522 0,0,0,0,0, 1523 0,0,0,0,0, 1524 0,0,0,0,0, 1525 0,0,0,0,0, 1526 0,0,0,0,0, 1527 0,0,0,0,0, 1528 0,0,0,0,0, 1529 0,0,0,0,0, 1530 0,0,0,0,0, 1531 0,0,0,0,0, 1532 0,0,0,0,0, 1533 0,0,0,0,0, 1534 0,0,0,0,0, 1535 0,0,0,0,0, 1536 0,0,0,0,0, 1537 0,0,0,0,0, 1538 0,0,0,0,0, 1539 0,0,0,0,0, 1540 0,0,0,0,0, 1541 0,0,0,0,0, 1542 0,0,0,0,0, 1543 0,0,0,0,0, 1544 0,0,0,0,0, 1545 0,0,0,0,0, 1546 0,0,0,0,0, 1547 0,0,0,0,0, 1548 0,0,0,0,0, 1549 0,0,0,0,0, 1550 0,0,0,0,0, 1551 0,0,0,0,0, 1552 0,0,0,0,0, 1553 0,0,0,0,0, 1554 0,0,0,0,0, 1555 0,0,0,0,0, 1556 0,0,0,0,0, 1557 0,0,0,0,0, 1558 0,0,0,0,0, 1559 0,0,0,0,0, 1560 0,0,0,0,0, 1561 0,0,0,0,0, 1562 0,0,0,0,0, 1563 0,0,0,0,0, 1564 0,0,0,0,0, 1565 0,0,0,0,0, 1566 0,0,0,0,0, 1567 0,0,0,0,0, 1568 0,0,0,0,0, 1569 0,0,0,0,0, 1570 0,0,0,0,0, 1571 0,0,0,0,0, 1572 0,0,0,0,0, 1573 0,0,0,0,0, 1574 0,0,0,0,0, 1575 0,0,0,0,0, 1576 0,0,0,0,0, 1577 0,0,0,0,0, 1578 0,0,0,0,0, 1579 0,0,0,0,0, 1580 0,0,0,0,0, 1581 0,0,0,0,0, 1582 0,0,0,0,0, 1583 0,0,0,0,0, 1584 0,0,0,0,0, 1585 0,0,0,0,0, 1586 0,0,0,0,0, 1587 0,0,0,0,0, 1588 0,0,0,0,0, 1589 0,0,0,0,0, 1590 0,0,0,0,0, 1591 0,0,0,0,0, 1592 0,0,0,0,0, 1593 0,0,0,0,0, 1594 0,0,0,0,0, 1595 0,0,0,0,0, 1596 0,0,0,0,0, 1597 0,0,0,0,0, 1598 0,0,0,0,0, 1599 0,0,0,0,0, 1600 0,0,0,0,0, 1601 0,0,0,0,0, 1602 0,0,0,0,0, 1603 0,0,0,0,0, 1604 0,0,0,0,0, 1605 0,0,0,0,0, 1606 0,0,0,0,0, 1607 0,0,0,0,0, 1608 0,0,0,0,0, 1609 0,0,0,0,0, 1610 0,0,0,0,0, 1611 0,0,0,0,0, 1612 0,0,0,0,0, 1613 0,0,0,0,0, 1614 0,0,0,0,0, 1615 0,0,0,0,0, 1616 0,0,0,0,0, 1617 0,0,0,0,0, 1618 0,0,0,0,0, 1619 0,0,0,0,0, 1620 0,0,0,0,0, 1621 0, 1622 }; 1623 1624 1625 1626 #define yyySizeofProd(num) (yyyProdsInd[(num)+1] - yyyProdsInd[(num)]) 1627 1628 #define yyyGSoccurStr(prodNum,symPos) \ 1629 (yyyStringTab[yyyProds[yyyProdsInd[(prodNum)] + (symPos)][0]]) 1630 1631 #define yyySizeofSort(num) (yyySortsInd[(num)+1] - yyySortsInd[(num)]) 1632 1633 #define yyySortOf(prodNum,symPos) \ 1634 (yyyProds[yyyProdsInd[(prodNum)] + (symPos)][1]) 1635 1636 #define yyyAttrbStr(prodNum,symPos,attrbNum) \ 1637 (yyyStringTab[yyySorts[yyySortsInd[yyySortOf(prodNum,symPos)] + \ 1638 (attrbNum) \ 1639 ] \ 1640 ] \ 1641 ) 1642 1643 1644 1645 void yyyShowProd(int i) 1646 {int j,nSyms; 1647 1648 nSyms = yyySizeofProd(i); 1649 for (j=0; j<nSyms; j++) 1650 { 1651 fprintf(stderr,"%s",yyyGSoccurStr(i,j)); 1652 if (j == 0) fputs(" : ",stderr); else putc(' ',stderr); 1653 } 1654 fputs(";\n",stderr); 1655 } 1656 1657 1658 1659 void yyyShowProds() 1660 {int i; for (i=1; i<=yyyLastProdNum; i++) yyyShowProd(i);} 1661 1662 1663 1664 void yyyShowSymsAndSorts() 1665 {int i; 1666 1667 for (i=1; i<=yyyLastProdNum; i++) 1668 {int j, nSyms; 1669 1670 fprintf(stderr, 1671 "\n\n\n---------------------------------- %3.1d\n",i); 1672 /* yyyShowProd(i); */ 1673 nSyms = yyySizeofProd(i); 1674 for (j=0; j<nSyms; j++) 1675 {int k, sortSize; 1676 1677 fprintf(stderr,"%s\n",yyyGSoccurStr(i,j)); 1678 sortSize = yyySizeofSort(yyySortOf(i,j)); 1679 for (k=0; k<sortSize; k++) 1680 fprintf(stderr," %s\n",yyyAttrbStr(i,j,k)); 1681 if (j == 0) fputs("->\n",stderr); 1682 else 1683 putc('\n',stderr); 1684 } 1685 } 1686 } 1687 1688 1689 1690 void yyyCheckNodeInstancesSolved(yyyGNT *np) 1691 {int mysort,sortSize,i,prodNum,symPos,inTerminalNode; 1692 int nUnsolvedInsts = 0; 1693 1694 if (np->prodNum != 0) 1695 {inTerminalNode = 0; 1696 prodNum = np->prodNum; 1697 symPos = 0; 1698 } 1699 else 1700 {inTerminalNode = 1; 1701 prodNum = np->parent.noderef->prodNum; 1702 symPos = np->whichSym; 1703 } 1704 mysort = yyySortOf(prodNum,symPos); 1705 sortSize = yyySizeofSort(mysort); 1706 for (i=0; i<sortSize; i++) 1707 if ((np->refCountList)[i] != 0) nUnsolvedInsts += 1; 1708 if (nUnsolvedInsts) 1709 {fprintf(stderr, 1710 "\nFound node that has %d unsolved attribute instance(s).\n", 1711 nUnsolvedInsts 1712 ); 1713 fprintf(stderr,"Node is labeled \"%s\".\n", 1714 yyyGSoccurStr(prodNum,symPos)); 1715 if (inTerminalNode) 1716 {fputs("Node is terminal. Its parent production is:\n ",stderr); 1717 yyyShowProd(prodNum); 1718 } 1719 else 1720 {fputs("Node is nonterminal. ",stderr); 1721 if (!(np->parentIsStack)) 1722 {fprintf(stderr, 1723 "Node is %dth child in its parent production:\n ", 1724 np->whichSym 1725 ); 1726 yyyShowProd(np->parent.noderef->prodNum); 1727 } 1728 fputs("Node is on left hand side of this production:\n ",stderr); 1729 yyyShowProd(np->prodNum); 1730 } 1731 fputs("The following instances are unsolved:\n",stderr); 1732 for (i=0; i<sortSize; i++) 1733 if ((np->refCountList)[i] != 0) 1734 fprintf(stderr," %-16s still has %1d dependencies.\n", 1735 yyyAttrbStr(prodNum,symPos,i),(np->refCountList)[i]); 1736 } 1737 } 1738 1739 1740 1741 void yyyCheckUnsolvedInstTrav(yyyGNT *pNode,long *nNZrc,long *cycleSum) 1742 {yyyGNT **yyyCLpdum; 1743 yyyRCT *rcp; 1744 int i; 1745 1746 /* visit the refCountList of each node in the tree, and sum the non-zero refCounts */ 1747 rcp = pNode->refCountList; 1748 i = pNode->refCountListLen; 1749 while (i--) 1750 if (*rcp++) {*cycleSum += *(rcp - 1); (*nNZrc)++;} 1751 yyyCLpdum = pNode->cL; 1752 i = pNode->cLlen; 1753 while (i--) 1754 { 1755 yyyCheckUnsolvedInstTrav(*yyyCLpdum,nNZrc,cycleSum); 1756 yyyCLpdum++; 1757 } 1758 } 1759 1760 1761 1762 void yyyUnsolvedInstSearchTravAux(yyyGNT *pNode) 1763 {yyyGNT **yyyCLpdum; 1764 int i; 1765 1766 yyyCheckNodeInstancesSolved(pNode); 1767 yyyCLpdum = pNode->cL; 1768 i = pNode->cLlen; 1769 while (i--) 1770 { 1771 yyyUnsolvedInstSearchTravAux(*yyyCLpdum); 1772 yyyCLpdum++; 1773 } 1774 } 1775 1776 1777 1778 void yyyUnsolvedInstSearchTrav(yyyGNT *pNode) 1779 {yyyGNT **yyyCLpdum; 1780 int i; 1781 1782 yyyCLpdum = pNode->cL; 1783 i = pNode->cLlen; 1784 while (i--) 1785 { 1786 yyyUnsolvedInstSearchTravAux(*yyyCLpdum); 1787 yyyCLpdum++; 1788 } 1789 } 1790 1791 1792 1793 #line 1794 "expr.oxout.tab.c" 1794 1795 /* For use in generated program */ 1796 #define yydepth (int)(yystack.s_mark - yystack.s_base) 1797 #if YYBTYACC 1798 #define yytrial (yyps->save) 1799 #endif /* YYBTYACC */ 1800 1801 #if YYDEBUG 1802 #include <stdio.h> /* needed for printf */ 1803 #endif 1804 1805 #include <stdlib.h> /* needed for malloc, etc */ 1806 #include <string.h> /* needed for memset */ 1807 1808 /* allocate initial stack or double stack size, up to YYMAXDEPTH */ 1809 static int yygrowstack(YYSTACKDATA *data) 1810 { 1811 int i; 1812 unsigned newsize; 1813 YYINT *newss; 1814 YYSTYPE *newvs; 1815 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1816 YYLTYPE *newps; 1817 #endif 1818 1819 if ((newsize = data->stacksize) == 0) 1820 newsize = YYINITSTACKSIZE; 1821 else if (newsize >= YYMAXDEPTH) 1822 return YYENOMEM; 1823 else if ((newsize *= 2) > YYMAXDEPTH) 1824 newsize = YYMAXDEPTH; 1825 1826 i = (int) (data->s_mark - data->s_base); 1827 newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); 1828 if (newss == 0) 1829 return YYENOMEM; 1830 1831 data->s_base = newss; 1832 data->s_mark = newss + i; 1833 1834 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); 1835 if (newvs == 0) 1836 return YYENOMEM; 1837 1838 data->l_base = newvs; 1839 data->l_mark = newvs + i; 1840 1841 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1842 newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); 1843 if (newps == 0) 1844 return YYENOMEM; 1845 1846 data->p_base = newps; 1847 data->p_mark = newps + i; 1848 #endif 1849 1850 data->stacksize = newsize; 1851 data->s_last = data->s_base + newsize - 1; 1852 1853 #if YYDEBUG 1854 if (yydebug) 1855 fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize); 1856 #endif 1857 return 0; 1858 } 1859 1860 #if YYPURE || defined(YY_NO_LEAKS) 1861 static void yyfreestack(YYSTACKDATA *data) 1862 { 1863 free(data->s_base); 1864 free(data->l_base); 1865 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1866 free(data->p_base); 1867 #endif 1868 memset(data, 0, sizeof(*data)); 1869 } 1870 #else 1871 #define yyfreestack(data) /* nothing */ 1872 #endif /* YYPURE || defined(YY_NO_LEAKS) */ 1873 #if YYBTYACC 1874 1875 static YYParseState * 1876 yyNewState(unsigned size) 1877 { 1878 YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState)); 1879 if (p == NULL) return NULL; 1880 1881 p->yystack.stacksize = size; 1882 if (size == 0) 1883 { 1884 p->yystack.s_base = NULL; 1885 p->yystack.l_base = NULL; 1886 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1887 p->yystack.p_base = NULL; 1888 #endif 1889 return p; 1890 } 1891 p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT)); 1892 if (p->yystack.s_base == NULL) return NULL; 1893 p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE)); 1894 if (p->yystack.l_base == NULL) return NULL; 1895 memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE)); 1896 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1897 p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE)); 1898 if (p->yystack.p_base == NULL) return NULL; 1899 memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE)); 1900 #endif 1901 1902 return p; 1903 } 1904 1905 static void 1906 yyFreeState(YYParseState *p) 1907 { 1908 yyfreestack(&p->yystack); 1909 free(p); 1910 } 1911 #endif /* YYBTYACC */ 1912 1913 #define YYABORT goto yyabort 1914 #define YYREJECT goto yyabort 1915 #define YYACCEPT goto yyaccept 1916 #define YYERROR goto yyerrlab 1917 #if YYBTYACC 1918 #define YYVALID do { if (yyps->save) goto yyvalid; } while(0) 1919 #define YYVALID_NESTED do { if (yyps->save && \ 1920 yyps->save->save == 0) goto yyvalid; } while(0) 1921 #endif /* YYBTYACC */ 1922 1923 int 1924 YYPARSE_DECL() 1925 { 1926 int yym, yyn, yystate, yyresult; 1927 #if YYBTYACC 1928 int yynewerrflag; 1929 YYParseState *yyerrctx = NULL; 1930 #endif /* YYBTYACC */ 1931 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1932 YYLTYPE yyerror_loc_range[2]; /* position of error start & end */ 1933 #endif 1934 #if YYDEBUG 1935 const char *yys; 1936 1937 if ((yys = getenv("YYDEBUG")) != 0) 1938 { 1939 yyn = *yys; 1940 if (yyn >= '0' && yyn <= '9') 1941 yydebug = yyn - '0'; 1942 } 1943 if (yydebug) 1944 fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); 1945 #endif 1946 1947 #if YYBTYACC 1948 yyps = yyNewState(0); if (yyps == 0) goto yyenomem; 1949 yyps->save = 0; 1950 #endif /* YYBTYACC */ 1951 yym = 0; 1952 yyn = 0; 1953 yynerrs = 0; 1954 yyerrflag = 0; 1955 yychar = YYEMPTY; 1956 yystate = 0; 1957 1958 #if YYPURE 1959 memset(&yystack, 0, sizeof(yystack)); 1960 #endif 1961 1962 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 1963 yystack.s_mark = yystack.s_base; 1964 yystack.l_mark = yystack.l_base; 1965 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1966 yystack.p_mark = yystack.p_base; 1967 #endif 1968 yystate = 0; 1969 *yystack.s_mark = 0; 1970 1971 yyloop: 1972 if ((yyn = yydefred[yystate]) != 0) goto yyreduce; 1973 if (yychar < 0) 1974 { 1975 #if YYBTYACC 1976 do { 1977 if (yylvp < yylve) 1978 { 1979 /* we're currently re-reading tokens */ 1980 yylval = *yylvp++; 1981 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1982 yylloc = *yylpp++; 1983 #endif 1984 yychar = *yylexp++; 1985 break; 1986 } 1987 if (yyps->save) 1988 { 1989 /* in trial mode; save scanner results for future parse attempts */ 1990 if (yylvp == yylvlim) 1991 { /* Enlarge lexical value queue */ 1992 size_t p = (size_t) (yylvp - yylvals); 1993 size_t s = (size_t) (yylvlim - yylvals); 1994 1995 s += YYLVQUEUEGROWTH; 1996 if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; 1997 if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; 1998 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 1999 if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; 2000 #endif 2001 yylvp = yylve = yylvals + p; 2002 yylvlim = yylvals + s; 2003 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2004 yylpp = yylpe = yylpsns + p; 2005 yylplim = yylpsns + s; 2006 #endif 2007 yylexp = yylexemes + p; 2008 } 2009 *yylexp = (YYINT) YYLEX; 2010 *yylvp++ = yylval; 2011 yylve++; 2012 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2013 *yylpp++ = yylloc; 2014 yylpe++; 2015 #endif 2016 yychar = *yylexp++; 2017 break; 2018 } 2019 /* normal operation, no conflict encountered */ 2020 #endif /* YYBTYACC */ 2021 yychar = YYLEX; 2022 #if YYBTYACC 2023 } while (0); 2024 #endif /* YYBTYACC */ 2025 if (yychar < 0) yychar = YYEOF; 2026 #if YYDEBUG 2027 if (yydebug) 2028 { 2029 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 2030 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)", 2031 YYDEBUGSTR, yydepth, yystate, yychar, yys); 2032 #ifdef YYSTYPE_TOSTRING 2033 #if YYBTYACC 2034 if (!yytrial) 2035 #endif /* YYBTYACC */ 2036 fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval)); 2037 #endif 2038 fputc('\n', stderr); 2039 } 2040 #endif 2041 } 2042 #if YYBTYACC 2043 2044 /* Do we have a conflict? */ 2045 if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 && 2046 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 2047 { 2048 YYINT ctry; 2049 2050 if (yypath) 2051 { 2052 YYParseState *save; 2053 #if YYDEBUG 2054 if (yydebug) 2055 fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n", 2056 YYDEBUGSTR, yydepth, yystate); 2057 #endif 2058 /* Switch to the next conflict context */ 2059 save = yypath; 2060 yypath = save->save; 2061 save->save = NULL; 2062 ctry = save->ctry; 2063 if (save->state != yystate) YYABORT; 2064 yyFreeState(save); 2065 2066 } 2067 else 2068 { 2069 2070 /* Unresolved conflict - start/continue trial parse */ 2071 YYParseState *save; 2072 #if YYDEBUG 2073 if (yydebug) 2074 { 2075 fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate); 2076 if (yyps->save) 2077 fputs("ALREADY in conflict, continuing trial parse.\n", stderr); 2078 else 2079 fputs("Starting trial parse.\n", stderr); 2080 } 2081 #endif 2082 save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1)); 2083 if (save == NULL) goto yyenomem; 2084 save->save = yyps->save; 2085 save->state = yystate; 2086 save->errflag = yyerrflag; 2087 save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base); 2088 memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 2089 save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base); 2090 memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 2091 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2092 save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base); 2093 memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 2094 #endif 2095 ctry = yytable[yyn]; 2096 if (yyctable[ctry] == -1) 2097 { 2098 #if YYDEBUG 2099 if (yydebug && yychar >= YYEOF) 2100 fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth); 2101 #endif 2102 ctry++; 2103 } 2104 save->ctry = ctry; 2105 if (yyps->save == NULL) 2106 { 2107 /* If this is a first conflict in the stack, start saving lexemes */ 2108 if (!yylexemes) 2109 { 2110 yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); 2111 if (yylexemes == NULL) goto yyenomem; 2112 yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); 2113 if (yylvals == NULL) goto yyenomem; 2114 yylvlim = yylvals + YYLVQUEUEGROWTH; 2115 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2116 yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE)); 2117 if (yylpsns == NULL) goto yyenomem; 2118 yylplim = yylpsns + YYLVQUEUEGROWTH; 2119 #endif 2120 } 2121 if (yylvp == yylve) 2122 { 2123 yylvp = yylve = yylvals; 2124 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2125 yylpp = yylpe = yylpsns; 2126 #endif 2127 yylexp = yylexemes; 2128 if (yychar >= YYEOF) 2129 { 2130 *yylve++ = yylval; 2131 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2132 *yylpe++ = yylloc; 2133 #endif 2134 *yylexp = (YYINT) yychar; 2135 yychar = YYEMPTY; 2136 } 2137 } 2138 } 2139 if (yychar >= YYEOF) 2140 { 2141 yylvp--; 2142 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2143 yylpp--; 2144 #endif 2145 yylexp--; 2146 yychar = YYEMPTY; 2147 } 2148 save->lexeme = (int) (yylvp - yylvals); 2149 yyps->save = save; 2150 } 2151 if (yytable[yyn] == ctry) 2152 { 2153 #if YYDEBUG 2154 if (yydebug) 2155 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n", 2156 YYDEBUGSTR, yydepth, yystate, yyctable[ctry]); 2157 #endif 2158 if (yychar < 0) 2159 { 2160 yylvp++; 2161 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2162 yylpp++; 2163 #endif 2164 yylexp++; 2165 } 2166 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) 2167 goto yyoverflow; 2168 yystate = yyctable[ctry]; 2169 *++yystack.s_mark = (YYINT) yystate; 2170 *++yystack.l_mark = yylval; 2171 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2172 *++yystack.p_mark = yylloc; 2173 #endif 2174 yychar = YYEMPTY; 2175 if (yyerrflag > 0) --yyerrflag; 2176 goto yyloop; 2177 } 2178 else 2179 { 2180 yyn = yyctable[ctry]; 2181 goto yyreduce; 2182 } 2183 } /* End of code dealing with conflicts */ 2184 #endif /* YYBTYACC */ 2185 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 && 2186 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 2187 { 2188 #if YYDEBUG 2189 if (yydebug) 2190 fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n", 2191 YYDEBUGSTR, yydepth, yystate, yytable[yyn]); 2192 #endif 2193 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 2194 yystate = yytable[yyn]; 2195 *++yystack.s_mark = yytable[yyn]; 2196 *++yystack.l_mark = yylval; 2197 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2198 *++yystack.p_mark = yylloc; 2199 #endif 2200 yychar = YYEMPTY; 2201 if (yyerrflag > 0) --yyerrflag; 2202 goto yyloop; 2203 } 2204 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 && 2205 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) 2206 { 2207 yyn = yytable[yyn]; 2208 goto yyreduce; 2209 } 2210 if (yyerrflag != 0) goto yyinrecovery; 2211 #if YYBTYACC 2212 2213 yynewerrflag = 1; 2214 goto yyerrhandler; 2215 goto yyerrlab; /* redundant goto avoids 'unused label' warning */ 2216 2217 yyerrlab: 2218 /* explicit YYERROR from an action -- pop the rhs of the rule reduced 2219 * before looking for error recovery */ 2220 yystack.s_mark -= yym; 2221 yystate = *yystack.s_mark; 2222 yystack.l_mark -= yym; 2223 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2224 yystack.p_mark -= yym; 2225 #endif 2226 2227 yynewerrflag = 0; 2228 yyerrhandler: 2229 while (yyps->save) 2230 { 2231 int ctry; 2232 YYParseState *save = yyps->save; 2233 #if YYDEBUG 2234 if (yydebug) 2235 fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n", 2236 YYDEBUGSTR, yydepth, yystate, yyps->save->state, 2237 (int)(yylvp - yylvals - yyps->save->lexeme)); 2238 #endif 2239 /* Memorize most forward-looking error state in case it's really an error. */ 2240 if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals) 2241 { 2242 /* Free old saved error context state */ 2243 if (yyerrctx) yyFreeState(yyerrctx); 2244 /* Create and fill out new saved error context state */ 2245 yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1)); 2246 if (yyerrctx == NULL) goto yyenomem; 2247 yyerrctx->save = yyps->save; 2248 yyerrctx->state = yystate; 2249 yyerrctx->errflag = yyerrflag; 2250 yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base); 2251 memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 2252 yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base); 2253 memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 2254 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2255 yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base); 2256 memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 2257 #endif 2258 yyerrctx->lexeme = (int) (yylvp - yylvals); 2259 } 2260 yylvp = yylvals + save->lexeme; 2261 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2262 yylpp = yylpsns + save->lexeme; 2263 #endif 2264 yylexp = yylexemes + save->lexeme; 2265 yychar = YYEMPTY; 2266 yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base); 2267 memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 2268 yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base); 2269 memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 2270 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2271 yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base); 2272 memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 2273 #endif 2274 ctry = ++save->ctry; 2275 yystate = save->state; 2276 /* We tried shift, try reduce now */ 2277 if ((yyn = yyctable[ctry]) >= 0) goto yyreduce; 2278 yyps->save = save->save; 2279 save->save = NULL; 2280 yyFreeState(save); 2281 2282 /* Nothing left on the stack -- error */ 2283 if (!yyps->save) 2284 { 2285 #if YYDEBUG 2286 if (yydebug) 2287 fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n", 2288 YYPREFIX, yydepth); 2289 #endif 2290 /* Restore state as it was in the most forward-advanced error */ 2291 yylvp = yylvals + yyerrctx->lexeme; 2292 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2293 yylpp = yylpsns + yyerrctx->lexeme; 2294 #endif 2295 yylexp = yylexemes + yyerrctx->lexeme; 2296 yychar = yylexp[-1]; 2297 yylval = yylvp[-1]; 2298 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2299 yylloc = yylpp[-1]; 2300 #endif 2301 yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base); 2302 memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 2303 yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base); 2304 memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 2305 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2306 yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base); 2307 memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 2308 #endif 2309 yystate = yyerrctx->state; 2310 yyFreeState(yyerrctx); 2311 yyerrctx = NULL; 2312 } 2313 yynewerrflag = 1; 2314 } 2315 if (yynewerrflag == 0) goto yyinrecovery; 2316 #endif /* YYBTYACC */ 2317 2318 YYERROR_CALL("syntax error"); 2319 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2320 yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */ 2321 #endif 2322 2323 #if !YYBTYACC 2324 goto yyerrlab; /* redundant goto avoids 'unused label' warning */ 2325 yyerrlab: 2326 #endif 2327 ++yynerrs; 2328 2329 yyinrecovery: 2330 if (yyerrflag < 3) 2331 { 2332 yyerrflag = 3; 2333 for (;;) 2334 { 2335 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 && 2336 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE) 2337 { 2338 #if YYDEBUG 2339 if (yydebug) 2340 fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n", 2341 YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]); 2342 #endif 2343 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 2344 yystate = yytable[yyn]; 2345 *++yystack.s_mark = yytable[yyn]; 2346 *++yystack.l_mark = yylval; 2347 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2348 /* lookahead position is error end position */ 2349 yyerror_loc_range[1] = yylloc; 2350 YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */ 2351 *++yystack.p_mark = yyloc; 2352 #endif 2353 goto yyloop; 2354 } 2355 else 2356 { 2357 #if YYDEBUG 2358 if (yydebug) 2359 fprintf(stderr, "%s[%d]: error recovery discarding state %d\n", 2360 YYDEBUGSTR, yydepth, *yystack.s_mark); 2361 #endif 2362 if (yystack.s_mark <= yystack.s_base) goto yyabort; 2363 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2364 /* the current TOS position is the error start position */ 2365 yyerror_loc_range[0] = *yystack.p_mark; 2366 #endif 2367 #if defined(YYDESTRUCT_CALL) 2368 #if YYBTYACC 2369 if (!yytrial) 2370 #endif /* YYBTYACC */ 2371 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2372 YYDESTRUCT_CALL("error: discarding state", 2373 yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark); 2374 #else 2375 YYDESTRUCT_CALL("error: discarding state", 2376 yystos[*yystack.s_mark], yystack.l_mark); 2377 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 2378 #endif /* defined(YYDESTRUCT_CALL) */ 2379 --yystack.s_mark; 2380 --yystack.l_mark; 2381 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2382 --yystack.p_mark; 2383 #endif 2384 } 2385 } 2386 } 2387 else 2388 { 2389 if (yychar == YYEOF) goto yyabort; 2390 #if YYDEBUG 2391 if (yydebug) 2392 { 2393 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 2394 fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n", 2395 YYDEBUGSTR, yydepth, yystate, yychar, yys); 2396 } 2397 #endif 2398 #if defined(YYDESTRUCT_CALL) 2399 #if YYBTYACC 2400 if (!yytrial) 2401 #endif /* YYBTYACC */ 2402 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2403 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc); 2404 #else 2405 YYDESTRUCT_CALL("error: discarding token", yychar, &yylval); 2406 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 2407 #endif /* defined(YYDESTRUCT_CALL) */ 2408 yychar = YYEMPTY; 2409 goto yyloop; 2410 } 2411 2412 yyreduce: 2413 yym = yylen[yyn]; 2414 #if YYDEBUG 2415 if (yydebug) 2416 { 2417 fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)", 2418 YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]); 2419 #ifdef YYSTYPE_TOSTRING 2420 #if YYBTYACC 2421 if (!yytrial) 2422 #endif /* YYBTYACC */ 2423 if (yym > 0) 2424 { 2425 int i; 2426 fputc('<', stderr); 2427 for (i = yym; i > 0; i--) 2428 { 2429 if (i != yym) fputs(", ", stderr); 2430 fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]], 2431 yystack.l_mark[1-i]), stderr); 2432 } 2433 fputc('>', stderr); 2434 } 2435 #endif 2436 fputc('\n', stderr); 2437 } 2438 #endif 2439 if (yym > 0) 2440 yyval = yystack.l_mark[1-yym]; 2441 else 2442 memset(&yyval, 0, sizeof yyval); 2443 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2444 2445 /* Perform position reduction */ 2446 memset(&yyloc, 0, sizeof(yyloc)); 2447 #if YYBTYACC 2448 if (!yytrial) 2449 #endif /* YYBTYACC */ 2450 { 2451 YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym); 2452 /* just in case YYERROR is invoked within the action, save 2453 the start of the rhs as the error start position */ 2454 yyerror_loc_range[0] = yystack.p_mark[1-yym]; 2455 } 2456 #endif 2457 2458 switch (yyn) 2459 { 2460 case 1: 2461 #line 64 "expr.oxout.y" 2462 {yyyYoxInit();} 2463 break; 2464 case 2: 2465 #line 66 "expr.oxout.y" 2466 { 2467 yyyDecorate(); yyyExecuteRRsection(yystack.l_mark[0].yyyOxAttrbs.yyyOxStackItem->node); 2468 } 2469 break; 2470 case 3: 2471 #line 73 "expr.oxout.y" 2472 {if(yyyYok){ 2473 yyyGenIntNode(1,1,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); 2474 yyyAdjustINRC(1,1,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} 2475 break; 2476 case 4: 2477 #line 80 "expr.oxout.y" 2478 {if(yyyYok){ 2479 yyyGenIntNode(2,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); 2480 yyyAdjustINRC(2,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} 2481 break; 2482 case 5: 2483 #line 87 "expr.oxout.y" 2484 {if(yyyYok){ 2485 yyyGenIntNode(3,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); 2486 yyyAdjustINRC(3,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} 2487 break; 2488 case 6: 2489 #line 94 "expr.oxout.y" 2490 {if(yyyYok){ 2491 yyyGenIntNode(4,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); 2492 yyyAdjustINRC(4,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} 2493 break; 2494 case 7: 2495 #line 101 "expr.oxout.y" 2496 {if(yyyYok){ 2497 yyyGenIntNode(5,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); 2498 yyyAdjustINRC(5,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} 2499 break; 2500 case 8: 2501 #line 108 "expr.oxout.y" 2502 {if(yyyYok){ 2503 yyyGenIntNode(6,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); 2504 yyyAdjustINRC(6,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} 2505 break; 2506 case 9: 2507 #line 114 "expr.oxout.y" 2508 {if(yyyYok){ 2509 yyyGenIntNode(7,1,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); 2510 yyyAdjustINRC(7,1,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} 2511 break; 2512 case 10: 2513 #line 121 "expr.oxout.y" 2514 {if(yyyYok){ 2515 yyyGenIntNode(8,1,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); 2516 yyyAdjustINRC(8,1,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} 2517 break; 2518 #line 2519 "expr.oxout.tab.c" 2519 default: 2520 break; 2521 } 2522 yystack.s_mark -= yym; 2523 yystate = *yystack.s_mark; 2524 yystack.l_mark -= yym; 2525 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2526 yystack.p_mark -= yym; 2527 #endif 2528 yym = yylhs[yyn]; 2529 if (yystate == 0 && yym == 0) 2530 { 2531 #if YYDEBUG 2532 if (yydebug) 2533 { 2534 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth); 2535 #ifdef YYSTYPE_TOSTRING 2536 #if YYBTYACC 2537 if (!yytrial) 2538 #endif /* YYBTYACC */ 2539 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval)); 2540 #endif 2541 fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL); 2542 } 2543 #endif 2544 yystate = YYFINAL; 2545 *++yystack.s_mark = YYFINAL; 2546 *++yystack.l_mark = yyval; 2547 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2548 *++yystack.p_mark = yyloc; 2549 #endif 2550 if (yychar < 0) 2551 { 2552 #if YYBTYACC 2553 do { 2554 if (yylvp < yylve) 2555 { 2556 /* we're currently re-reading tokens */ 2557 yylval = *yylvp++; 2558 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2559 yylloc = *yylpp++; 2560 #endif 2561 yychar = *yylexp++; 2562 break; 2563 } 2564 if (yyps->save) 2565 { 2566 /* in trial mode; save scanner results for future parse attempts */ 2567 if (yylvp == yylvlim) 2568 { /* Enlarge lexical value queue */ 2569 size_t p = (size_t) (yylvp - yylvals); 2570 size_t s = (size_t) (yylvlim - yylvals); 2571 2572 s += YYLVQUEUEGROWTH; 2573 if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) 2574 goto yyenomem; 2575 if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) 2576 goto yyenomem; 2577 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2578 if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) 2579 goto yyenomem; 2580 #endif 2581 yylvp = yylve = yylvals + p; 2582 yylvlim = yylvals + s; 2583 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2584 yylpp = yylpe = yylpsns + p; 2585 yylplim = yylpsns + s; 2586 #endif 2587 yylexp = yylexemes + p; 2588 } 2589 *yylexp = (YYINT) YYLEX; 2590 *yylvp++ = yylval; 2591 yylve++; 2592 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2593 *yylpp++ = yylloc; 2594 yylpe++; 2595 #endif 2596 yychar = *yylexp++; 2597 break; 2598 } 2599 /* normal operation, no conflict encountered */ 2600 #endif /* YYBTYACC */ 2601 yychar = YYLEX; 2602 #if YYBTYACC 2603 } while (0); 2604 #endif /* YYBTYACC */ 2605 if (yychar < 0) yychar = YYEOF; 2606 #if YYDEBUG 2607 if (yydebug) 2608 { 2609 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; 2610 fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n", 2611 YYDEBUGSTR, yydepth, YYFINAL, yychar, yys); 2612 } 2613 #endif 2614 } 2615 if (yychar == YYEOF) goto yyaccept; 2616 goto yyloop; 2617 } 2618 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 && 2619 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate) 2620 yystate = yytable[yyn]; 2621 else 2622 yystate = yydgoto[yym]; 2623 #if YYDEBUG 2624 if (yydebug) 2625 { 2626 fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth); 2627 #ifdef YYSTYPE_TOSTRING 2628 #if YYBTYACC 2629 if (!yytrial) 2630 #endif /* YYBTYACC */ 2631 fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval)); 2632 #endif 2633 fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate); 2634 } 2635 #endif 2636 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; 2637 *++yystack.s_mark = (YYINT) yystate; 2638 *++yystack.l_mark = yyval; 2639 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2640 *++yystack.p_mark = yyloc; 2641 #endif 2642 goto yyloop; 2643 #if YYBTYACC 2644 2645 /* Reduction declares that this path is valid. Set yypath and do a full parse */ 2646 yyvalid: 2647 if (yypath) YYABORT; 2648 while (yyps->save) 2649 { 2650 YYParseState *save = yyps->save; 2651 yyps->save = save->save; 2652 save->save = yypath; 2653 yypath = save; 2654 } 2655 #if YYDEBUG 2656 if (yydebug) 2657 fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n", 2658 YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme)); 2659 #endif 2660 if (yyerrctx) 2661 { 2662 yyFreeState(yyerrctx); 2663 yyerrctx = NULL; 2664 } 2665 yylvp = yylvals + yypath->lexeme; 2666 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2667 yylpp = yylpsns + yypath->lexeme; 2668 #endif 2669 yylexp = yylexemes + yypath->lexeme; 2670 yychar = YYEMPTY; 2671 yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base); 2672 memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); 2673 yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base); 2674 memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); 2675 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2676 yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base); 2677 memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); 2678 #endif 2679 yystate = yypath->state; 2680 goto yyloop; 2681 #endif /* YYBTYACC */ 2682 2683 yyoverflow: 2684 YYERROR_CALL("yacc stack overflow"); 2685 #if YYBTYACC 2686 goto yyabort_nomem; 2687 yyenomem: 2688 YYERROR_CALL("memory exhausted"); 2689 yyabort_nomem: 2690 #endif /* YYBTYACC */ 2691 yyresult = 2; 2692 goto yyreturn; 2693 2694 yyabort: 2695 yyresult = 1; 2696 goto yyreturn; 2697 2698 yyaccept: 2699 #if YYBTYACC 2700 if (yyps->save) goto yyvalid; 2701 #endif /* YYBTYACC */ 2702 yyresult = 0; 2703 2704 yyreturn: 2705 #if defined(YYDESTRUCT_CALL) 2706 if (yychar != YYEOF && yychar != YYEMPTY) 2707 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2708 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc); 2709 #else 2710 YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval); 2711 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 2712 2713 { 2714 YYSTYPE *pv; 2715 #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) 2716 YYLTYPE *pp; 2717 2718 for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp) 2719 YYDESTRUCT_CALL("cleanup: discarding state", 2720 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp); 2721 #else 2722 for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv) 2723 YYDESTRUCT_CALL("cleanup: discarding state", 2724 yystos[*(yystack.s_base + (pv - yystack.l_base))], pv); 2725 #endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ 2726 } 2727 #endif /* defined(YYDESTRUCT_CALL) */ 2728 2729 #if YYBTYACC 2730 if (yyerrctx) 2731 { 2732 yyFreeState(yyerrctx); 2733 yyerrctx = NULL; 2734 } 2735 while (yyps) 2736 { 2737 YYParseState *save = yyps; 2738 yyps = save->save; 2739 save->save = NULL; 2740 yyFreeState(save); 2741 } 2742 while (yypath) 2743 { 2744 YYParseState *save = yypath; 2745 yypath = save->save; 2746 save->save = NULL; 2747 yyFreeState(save); 2748 } 2749 #endif /* YYBTYACC */ 2750 yyfreestack(&yystack); 2751 return (yyresult); 2752 } 2753