1 1.1 christos /* $NetBSD: expr.oxout.y,v 1.4 2026/01/18 16:41:29 christos Exp $ */ 2 1.1 christos 3 1.1 christos /* output from Ox version G1.04 */ 4 1.1 christos #line 1 "expr.Y" 5 1.1 christos #line 4 "expr.oxout.y" 6 1.1 christos %{ 7 1.1 christos #include <stdlib.h> 8 1.1 christos #include <string.h> 9 1.1 christos %} 10 1.1 christos #line 1 "expr.Y" 11 1.1 christos /* Y-file for translation of infix expressions to prefix and postfix */ 12 1.4 christos %token ID CONST 13 1.4 christos %start yyyAugNonterm 14 1.1 christos %left '+' '-' 15 1.1 christos %left '*' '/' 16 1.1 christos %nonassoc '*' 17 1.1 christos 18 1.4 christos %{ 19 1.4 christos #include "expr.oxout.h" 20 1.1 christos #include <stdio.h> 21 1.1 christos 22 1.1 christos extern int yylex(void); 23 1.1 christos extern void yyerror(const char *); 24 1.4 christos %} 25 1.1 christos 26 1.1 christos #line 25 "expr.oxout.y" 27 1.1 christos 28 1.1 christos %{ 29 1.1 christos #include <limits.h> 30 1.4 christos #define yyyR USHRT_MAX 31 1.1 christos %} 32 1.1 christos %type <yyyOxAttrbs> yyyAugNonterm 33 1.1 christos %union { 34 1.1 christos struct yyyOxAttrbs { 35 1.1 christos struct yyyStackItem *yyyOxStackItem; 36 1.1 christos } yyyOxAttrbs; 37 1.1 christos } 38 1.1 christos 39 1.1 christos %{ 40 1.1 christos #include <stdio.h> 41 1.1 christos #include <stdarg.h> 42 1.1 christos 43 1.1 christos static int yyyYok = 1; 44 1.1 christos 45 1.1 christos extern yyyFT yyyRCIL[]; 46 1.1 christos 47 1.1 christos void yyyExecuteRRsection(yyyGNT *rootNode); 48 1.1 christos void yyyYoxInit(void); 49 1.1 christos void yyyDecorate(void); 50 1.1 christos struct yyyOxAttrbs; /* hack required to compensate for 'msta' behavior */ 51 1.1 christos void yyyGenIntNode(long yyyProdNum, int yyyRHSlength, int yyyNattrbs, struct yyyOxAttrbs *yyval_OxAttrbs, ...); 52 1.1 christos void yyyAdjustINRC(long yyyProdNum, int yyyRHSlength, long startP, long stopP, struct yyyOxAttrbs *yyval_OxAttrbs, ...); 53 1.1 christos void yyyCheckUnsolvedInstTrav(yyyGNT *rootNode,long *nNZrc,long *cycleSum); 54 1.1 christos void yyyUnsolvedInstSearchTrav(yyyGNT *pNode); 55 1.1 christos void yyyUnsolvedInstSearchTravAux(yyyGNT *pNode); 56 1.1 christos void yyyabort(void); 57 1.1 christos 58 1.1 christos %} 59 1.1 christos 60 1.1 christos 61 1.1 christos #line 20 "expr.Y" 62 1.1 christos %% 63 1.1 christos 64 1.1 christos #line 63 "expr.oxout.y" 65 1.4 christos yyyAugNonterm 66 1.1 christos : {yyyYoxInit();} 67 1.1 christos s 68 1.1 christos { 69 1.1 christos yyyDecorate(); yyyExecuteRRsection($<yyyOxAttrbs>2.yyyOxStackItem->node); 70 1.1 christos } 71 1.1 christos ; 72 1.1 christos #line 21 "expr.Y" 73 1.1 christos s : expr 74 1.1 christos #line 73 "expr.oxout.y" 75 1.1 christos {if(yyyYok){ 76 1.1 christos yyyGenIntNode(1,1,0,&$<yyyOxAttrbs>$,&$<yyyOxAttrbs>1); 77 1.1 christos yyyAdjustINRC(1,1,0,0,&$<yyyOxAttrbs>$,&$<yyyOxAttrbs>1);}} 78 1.1 christos 79 1.1 christos #line 27 "expr.Y" 80 1.1 christos expr : expr '*' expr 81 1.1 christos #line 80 "expr.oxout.y" 82 1.1 christos {if(yyyYok){ 83 1.1 christos yyyGenIntNode(2,3,0,&$<yyyOxAttrbs>$,&$<yyyOxAttrbs>1,&$<yyyOxAttrbs>2,&$<yyyOxAttrbs>3); 84 1.1 christos yyyAdjustINRC(2,3,0,0,&$<yyyOxAttrbs>$,&$<yyyOxAttrbs>1,&$<yyyOxAttrbs>2,&$<yyyOxAttrbs>3);}} 85 1.1 christos 86 1.1 christos #line 31 "expr.Y" 87 1.1 christos | expr '+' expr 88 1.1 christos #line 87 "expr.oxout.y" 89 1.1 christos {if(yyyYok){ 90 1.1 christos yyyGenIntNode(3,3,0,&$<yyyOxAttrbs>$,&$<yyyOxAttrbs>1,&$<yyyOxAttrbs>2,&$<yyyOxAttrbs>3); 91 1.1 christos yyyAdjustINRC(3,3,0,0,&$<yyyOxAttrbs>$,&$<yyyOxAttrbs>1,&$<yyyOxAttrbs>2,&$<yyyOxAttrbs>3);}} 92 1.1 christos 93 1.1 christos #line 35 "expr.Y" 94 1.1 christos | expr '/' expr 95 1.1 christos #line 94 "expr.oxout.y" 96 1.1 christos {if(yyyYok){ 97 1.1 christos yyyGenIntNode(4,3,0,&$<yyyOxAttrbs>$,&$<yyyOxAttrbs>1,&$<yyyOxAttrbs>2,&$<yyyOxAttrbs>3); 98 1.1 christos yyyAdjustINRC(4,3,0,0,&$<yyyOxAttrbs>$,&$<yyyOxAttrbs>1,&$<yyyOxAttrbs>2,&$<yyyOxAttrbs>3);}} 99 1.1 christos 100 1.1 christos #line 39 "expr.Y" 101 1.1 christos | expr '-' expr 102 1.1 christos #line 101 "expr.oxout.y" 103 1.1 christos {if(yyyYok){ 104 1.1 christos yyyGenIntNode(5,3,0,&$<yyyOxAttrbs>$,&$<yyyOxAttrbs>1,&$<yyyOxAttrbs>2,&$<yyyOxAttrbs>3); 105 1.1 christos yyyAdjustINRC(5,3,0,0,&$<yyyOxAttrbs>$,&$<yyyOxAttrbs>1,&$<yyyOxAttrbs>2,&$<yyyOxAttrbs>3);}} 106 1.1 christos 107 1.1 christos #line 43 "expr.Y" 108 1.1 christos | '(' expr ')' 109 1.1 christos #line 108 "expr.oxout.y" 110 1.1 christos {if(yyyYok){ 111 1.1 christos yyyGenIntNode(6,3,0,&$<yyyOxAttrbs>$,&$<yyyOxAttrbs>1,&$<yyyOxAttrbs>2,&$<yyyOxAttrbs>3); 112 1.1 christos yyyAdjustINRC(6,3,0,0,&$<yyyOxAttrbs>$,&$<yyyOxAttrbs>1,&$<yyyOxAttrbs>2,&$<yyyOxAttrbs>3);}} 113 1.1 christos #line 44 "expr.Y" 114 1.1 christos | ID 115 1.1 christos #line 114 "expr.oxout.y" 116 1.1 christos {if(yyyYok){ 117 1.1 christos yyyGenIntNode(7,1,0,&$<yyyOxAttrbs>$,&$<yyyOxAttrbs>1); 118 1.1 christos yyyAdjustINRC(7,1,0,0,&$<yyyOxAttrbs>$,&$<yyyOxAttrbs>1);}} 119 1.1 christos 120 1.1 christos #line 48 "expr.Y" 121 1.1 christos | CONST 122 1.1 christos #line 121 "expr.oxout.y" 123 1.1 christos {if(yyyYok){ 124 1.1 christos yyyGenIntNode(8,1,0,&$<yyyOxAttrbs>$,&$<yyyOxAttrbs>1); 125 1.1 christos yyyAdjustINRC(8,1,0,0,&$<yyyOxAttrbs>$,&$<yyyOxAttrbs>1);}} 126 1.1 christos 127 1.1 christos #line 52 "expr.Y" 128 1.1 christos ; 129 1.4 christos %% 130 1.1 christos 131 1.1 christos int yyparse(void); 132 1.1 christos 133 1.4 christos int main() 134 1.4 christos {yyparse(); 135 1.4 christos } 136 1.1 christos 137 1.1 christos 138 1.1 christos 139 1.1 christos #line 138 "expr.oxout.y" 140 1.4 christos long yyySSALspaceSize = 20000; 141 1.4 christos long yyyRSmaxSize = 1000; 142 1.4 christos long yyyTravStackMaxSize = 2000; 143 1.4 christos 144 1.4 christos struct yyySolvedSAlistCell {yyyWAT attrbNum; 145 1.4 christos long next; 146 1.4 christos }; 147 1.4 christos 148 1.4 christos #define yyyLambdaSSAL 0 149 1.4 christos long yyySSALCfreeList = yyyLambdaSSAL; 150 1.4 christos long yyyNewSSALC = 1; 151 1.4 christos 152 1.4 christos struct yyySolvedSAlistCell *yyySSALspace; 153 1.1 christos 154 1.4 christos long yyyNbytesStackStg; 155 1.1 christos 156 1.1 christos 157 1.1 christos 158 1.1 christos yyyFT yyyRCIL[1]; 159 1.1 christos 160 1.1 christos short yyyIIIEL[] = {0, 161 1.1 christos 0,2,6,10,14,18,22,24, 162 1.1 christos }; 163 1.1 christos 164 1.1 christos long yyyIIEL[] = { 165 1.1 christos 0,0,0,0,0,0,0,0,0,0,0,0, 166 1.1 christos 0,0,0,0,0,0,0,0,0,0,0,0, 167 1.1 christos 1,1, 168 1.1 christos }; 169 1.1 christos 170 1.1 christos long yyyIEL[] = { 171 1.1 christos 0,0,0, 172 1.1 christos }; 173 1.1 christos 174 1.1 christos yyyFT yyyEntL[1]; 175 1.1 christos 176 1.1 christos void yyyfatal(char *msg) 177 1.4 christos {fputs(msg,stderr);exit(-1);} 178 1.1 christos 179 1.1 christos 180 1.1 christos 181 1.4 christos #define yyySSALof 'S' 182 1.4 christos #define yyyRSof 'q' 183 1.4 christos #define yyyTSof 't' 184 1.1 christos 185 1.1 christos 186 1.1 christos 187 1.4 christos void yyyHandleOverflow(char which) 188 1.4 christos {char *msg1 = "?", *msg2; 189 1.4 christos long oldSize = 0, newSize; 190 1.4 christos switch(which) 191 1.1 christos { 192 1.4 christos case yyySSALof : 193 1.1 christos msg1 = "SSAL overflow: "; 194 1.4 christos oldSize = yyySSALspaceSize; 195 1.4 christos break; 196 1.4 christos case yyyRSof : 197 1.1 christos msg1 = "ready set overflow: "; 198 1.4 christos oldSize = yyyRSmaxSize; 199 1.4 christos break; 200 1.4 christos case yyyTSof : 201 1.1 christos msg1 = "traversal stack overflow: "; 202 1.4 christos oldSize = yyyTravStackMaxSize; 203 1.4 christos break; 204 1.4 christos default :; 205 1.1 christos } 206 1.4 christos newSize = (3*oldSize)/2; 207 1.4 christos if (newSize < 100) newSize = 100; 208 1.4 christos fputs(msg1,stderr); 209 1.4 christos fprintf(stderr,"size was %ld.\n",oldSize); 210 1.4 christos msg2 = " Have to modify evaluator: -Y%c%ld.\n"; 211 1.4 christos fprintf(stderr,msg2,which,newSize); 212 1.4 christos exit(-1); 213 1.1 christos } 214 1.1 christos 215 1.1 christos 216 1.1 christos 217 1.4 christos void yyySignalEnts(yyyGNT *node,long startP,long stopP) 218 1.4 christos {yyyGNT *dumNode; 219 1.1 christos 220 1.4 christos while (startP < stopP) 221 1.1 christos { 222 1.4 christos if (!yyyEntL[startP]) dumNode = node; 223 1.4 christos else dumNode = (node->cL)[yyyEntL[startP]-1]; 224 1.1 christos if (!(--((dumNode->refCountList)[yyyEntL[startP+1]] 225 1.4 christos ) 226 1.1 christos ) 227 1.4 christos ) 228 1.4 christos { 229 1.4 christos if (++yyyRSTop == yyyAfterRS) 230 1.4 christos {yyyHandleOverflow(yyyRSof); 231 1.4 christos break; 232 1.1 christos } 233 1.4 christos yyyRSTop->node = dumNode; 234 1.4 christos yyyRSTop->whichSym = yyyEntL[startP]; 235 1.4 christos yyyRSTop->wa = yyyEntL[startP+1]; 236 1.4 christos } 237 1.4 christos startP += 2; 238 1.4 christos } 239 1.4 christos } 240 1.1 christos 241 1.1 christos 242 1.1 christos 243 1.1 christos 244 1.1 christos 245 1.1 christos 246 1.1 christos void yyySolveAndSignal() { 247 1.1 christos long yyyiDum,*yyypL; 248 1.1 christos int yyyws,yyywa; 249 1.4 christos yyyGNT *yyyRSTopN,*yyyRefN; 250 1.4 christos yyyParent yyyRSTopNp; 251 1.1 christos 252 1.1 christos 253 1.1 christos yyyRSTopNp = (yyyRSTopN = yyyRSTop->node)->parent; 254 1.1 christos yyyRefN= (yyyws = (yyyRSTop->whichSym))?yyyRSTopNp.noderef:yyyRSTopN; 255 1.4 christos yyywa = yyyRSTop->wa; 256 1.1 christos yyyRSTop--; 257 1.1 christos switch(yyyRefN->prodNum) { 258 1.1 christos case 1: /***yacc rule 1***/ 259 1.1 christos switch (yyyws) { 260 1.1 christos } 261 1.1 christos break; 262 1.1 christos case 2: /***yacc rule 2***/ 263 1.1 christos switch (yyyws) { 264 1.1 christos } 265 1.1 christos break; 266 1.1 christos case 3: /***yacc rule 3***/ 267 1.1 christos switch (yyyws) { 268 1.1 christos } 269 1.1 christos break; 270 1.1 christos case 4: /***yacc rule 4***/ 271 1.1 christos switch (yyyws) { 272 1.1 christos } 273 1.1 christos break; 274 1.1 christos case 5: /***yacc rule 5***/ 275 1.1 christos switch (yyyws) { 276 1.1 christos } 277 1.1 christos break; 278 1.1 christos case 6: /***yacc rule 6***/ 279 1.1 christos switch (yyyws) { 280 1.1 christos } 281 1.1 christos break; 282 1.1 christos case 7: /***yacc rule 7***/ 283 1.1 christos switch (yyyws) { 284 1.1 christos case 1: /**/ 285 1.1 christos switch (yyywa) { 286 1.1 christos } 287 1.1 christos break; 288 1.1 christos } 289 1.1 christos break; 290 1.1 christos case 8: /***yacc rule 8***/ 291 1.1 christos switch (yyyws) { 292 1.1 christos case 1: /**/ 293 1.1 christos switch (yyywa) { 294 1.1 christos } 295 1.1 christos break; 296 1.1 christos } 297 1.1 christos break; 298 1.4 christos } /* switch */ 299 1.1 christos 300 1.4 christos if (yyyws) /* the just-solved instance was inherited. */ 301 1.4 christos {if (yyyRSTopN->prodNum) 302 1.1 christos {yyyiDum = yyyIIEL[yyyIIIEL[yyyRSTopN->prodNum]] + yyywa; 303 1.1 christos yyySignalEnts(yyyRSTopN,yyyIEL[yyyiDum], 304 1.1 christos yyyIEL[yyyiDum+1] 305 1.1 christos ); 306 1.1 christos } 307 1.4 christos } 308 1.4 christos else /* the just-solved instance was synthesized. */ 309 1.4 christos {if (!(yyyRSTopN->parentIsStack)) /* node has a parent. */ 310 1.4 christos {yyyiDum = yyyIIEL[yyyIIIEL[yyyRSTopNp.noderef->prodNum] + 311 1.4 christos yyyRSTopN->whichSym 312 1.4 christos ] + 313 1.1 christos yyywa; 314 1.1 christos yyySignalEnts(yyyRSTopNp.noderef, 315 1.1 christos yyyIEL[yyyiDum], 316 1.4 christos yyyIEL[yyyiDum+1] 317 1.1 christos ); 318 1.4 christos } 319 1.4 christos else /* node is still on the stack--it has no parent yet. */ 320 1.4 christos {yyypL = &(yyyRSTopNp.stackref->solvedSAlist); 321 1.4 christos if (yyySSALCfreeList == yyyLambdaSSAL) 322 1.4 christos {yyySSALspace[yyyNewSSALC].next = *yyypL; 323 1.4 christos if ((*yyypL = yyyNewSSALC++) == yyySSALspaceSize) 324 1.4 christos yyyHandleOverflow(yyySSALof); 325 1.4 christos } 326 1.1 christos else 327 1.4 christos {yyyiDum = yyySSALCfreeList; 328 1.4 christos yyySSALCfreeList = yyySSALspace[yyySSALCfreeList].next; 329 1.4 christos yyySSALspace[yyyiDum].next = *yyypL; 330 1.4 christos *yyypL = yyyiDum; 331 1.4 christos } 332 1.4 christos yyySSALspace[*yyypL].attrbNum = yyywa; 333 1.4 christos } 334 1.1 christos } 335 1.1 christos 336 1.4 christos } /* yyySolveAndSignal */ 337 1.1 christos 338 1.1 christos 339 1.1 christos 340 1.1 christos 341 1.1 christos 342 1.1 christos 343 1.1 christos #define condStg unsigned int conds; 344 1.1 christos #define yyyClearConds {yyyTST->conds = 0;} 345 1.1 christos #define yyySetCond(n) {yyyTST->conds += (1<<(n));} 346 1.1 christos #define yyyCond(n) ((yyyTST->conds & (1<<(n)))?1:0) 347 1.1 christos 348 1.1 christos 349 1.1 christos 350 1.4 christos struct yyyTravStackItem {yyyGNT *node; 351 1.1 christos char isReady; 352 1.1 christos condStg 353 1.1 christos }; 354 1.1 christos 355 1.1 christos 356 1.1 christos 357 1.1 christos void yyyDoTraversals(yyyGNT *rootNode) 358 1.1 christos {struct yyyTravStackItem *yyyTravStack,*yyyTST,*yyyAfterTravStack; 359 1.4 christos yyyGNT *yyyTSTn,**yyyCLptr2; 360 1.1 christos int yyyi,yyyRL,yyyPass; 361 1.1 christos int i; 362 1.1 christos 363 1.1 christos if (!yyyYok) return; 364 1.4 christos if ((yyyTravStack = 365 1.4 christos ((struct yyyTravStackItem *) 366 1.4 christos calloc((size_t)yyyTravStackMaxSize, 367 1.1 christos (size_t)sizeof(struct yyyTravStackItem) 368 1.1 christos ) 369 1.1 christos ) 370 1.1 christos ) 371 1.4 christos == 372 1.1 christos (struct yyyTravStackItem *)NULL 373 1.4 christos ) 374 1.4 christos {fputs("malloc error in traversal stack allocation\n",stderr); 375 1.4 christos exit(-1); 376 1.4 christos } 377 1.1 christos 378 1.4 christos yyyAfterTravStack = yyyTravStack + yyyTravStackMaxSize; 379 1.4 christos yyyTravStack++; 380 1.1 christos 381 1.1 christos 382 1.1 christos for (yyyi=0; yyyi<2; yyyi++) { 383 1.4 christos yyyTST = yyyTravStack; 384 1.1 christos yyyTST->node = rootNode; 385 1.1 christos yyyTST->isReady = 0; 386 1.1 christos yyyClearConds 387 1.1 christos 388 1.1 christos while(yyyTST >= yyyTravStack) 389 1.1 christos {yyyTSTn = yyyTST->node; 390 1.4 christos if (yyyTST->isReady) 391 1.1 christos {yyyPass = 1; 392 1.1 christos goto yyyTravSwitch; 393 1.1 christos yyyTpop: 394 1.1 christos yyyTST--; 395 1.4 christos } 396 1.4 christos else 397 1.1 christos {yyyPass = 0; 398 1.1 christos goto yyyTravSwitch; 399 1.1 christos yyyTpush: 400 1.4 christos yyyTST->isReady = 1; 401 1.1 christos if (yyyTSTn->prodNum) 402 1.1 christos {if (yyyRL) 403 1.4 christos {yyyCLptr2 = yyyTSTn->cL; 404 1.4 christos i = yyyTSTn->cLlen; 405 1.4 christos while (i--) 406 1.1 christos {if (++yyyTST == yyyAfterTravStack) 407 1.1 christos yyyHandleOverflow(yyyTSof); 408 1.1 christos else 409 1.4 christos {yyyTST->node = *yyyCLptr2; 410 1.4 christos yyyTST->isReady = 0; 411 1.1 christos yyyClearConds 412 1.1 christos } 413 1.4 christos yyyCLptr2++; 414 1.4 christos } 415 1.1 christos } /* right to left */ 416 1.1 christos else /* left to right */ 417 1.4 christos {i = yyyTSTn->cLlen; 418 1.4 christos yyyCLptr2 = yyyTSTn->cL + i; 419 1.4 christos while (i--) 420 1.4 christos {yyyCLptr2--; 421 1.1 christos if (++yyyTST == yyyAfterTravStack) 422 1.1 christos yyyHandleOverflow(yyyTSof); 423 1.1 christos else 424 1.4 christos {yyyTST->node = *yyyCLptr2; 425 1.4 christos yyyTST->isReady = 0; 426 1.1 christos yyyClearConds 427 1.1 christos } 428 1.4 christos } 429 1.1 christos } /* left to right */ 430 1.1 christos } 431 1.1 christos } /* else */ 432 1.1 christos continue; 433 1.1 christos yyyTravSwitch: 434 1.1 christos switch(yyyTSTn->prodNum) { 435 1.1 christos case 1: 436 1.4 christos switch(yyyi) { 437 1.1 christos case 0: 438 1.1 christos switch(yyyPass) { 439 1.1 christos case 0: 440 1.1 christos yyyRL = 0;yyySetCond(0) 441 1.1 christos 442 1.1 christos if (! 443 1.1 christos #line 24 "expr.Y" 444 1.1 christos (1) 445 1.1 christos #line 444 "expr.oxout.y" 446 1.1 christos ) yyySetCond(1) 447 1.1 christos yyySetCond(2) 448 1.1 christos 449 1.1 christos case 1: 450 1.1 christos 451 1.1 christos if (yyyCond(0) != yyyPass) { 452 1.1 christos #line 24 "expr.Y" 453 1.4 christos 454 1.1 christos #line 453 "expr.oxout.y" 455 1.1 christos } 456 1.1 christos if (yyyCond(1) != yyyPass) { 457 1.1 christos #line 24 "expr.Y" 458 1.4 christos printf("\n"); 459 1.4 christos 460 1.1 christos #line 459 "expr.oxout.y" 461 1.1 christos } 462 1.1 christos if (yyyCond(2) != yyyPass) { 463 1.1 christos #line 25 "expr.Y" 464 1.1 christos printf("prefix: "); 465 1.4 christos 466 1.1 christos #line 465 "expr.oxout.y" 467 1.1 christos } 468 1.1 christos break; 469 1.1 christos } 470 1.1 christos break; 471 1.1 christos case 1: 472 1.1 christos switch(yyyPass) { 473 1.1 christos case 0: 474 1.1 christos yyyRL = 0; 475 1.1 christos if ( 476 1.1 christos #line 23 "expr.Y" 477 1.1 christos (1) 478 1.1 christos #line 477 "expr.oxout.y" 479 1.1 christos ) yyySetCond(2) 480 1.1 christos 481 1.1 christos case 1: 482 1.1 christos 483 1.1 christos if (yyyCond(0) != yyyPass) { 484 1.1 christos #line 22 "expr.Y" 485 1.4 christos printf("\n"); 486 1.4 christos 487 1.1 christos #line 486 "expr.oxout.y" 488 1.1 christos } 489 1.1 christos if (yyyCond(1) != yyyPass) { 490 1.1 christos #line 23 "expr.Y" 491 1.4 christos 492 1.1 christos #line 491 "expr.oxout.y" 493 1.1 christos } 494 1.1 christos if (yyyCond(2) != yyyPass) { 495 1.1 christos #line 23 "expr.Y" 496 1.3 christos printf("postfix: "); 497 1.4 christos 498 1.1 christos #line 497 "expr.oxout.y" 499 1.1 christos } 500 1.1 christos break; 501 1.1 christos } 502 1.1 christos break; 503 1.1 christos } 504 1.1 christos 505 1.1 christos break; 506 1.1 christos case 2: 507 1.4 christos switch(yyyi) { 508 1.1 christos case 0: 509 1.1 christos switch(yyyPass) { 510 1.1 christos case 0: 511 1.1 christos yyyRL = 0;yyySetCond(0) 512 1.1 christos 513 1.1 christos case 1: 514 1.1 christos 515 1.1 christos if (yyyCond(0) != yyyPass) { 516 1.1 christos #line 29 "expr.Y" 517 1.4 christos printf(" * "); 518 1.4 christos 519 1.1 christos #line 518 "expr.oxout.y" 520 1.1 christos } 521 1.1 christos break; 522 1.1 christos } 523 1.1 christos break; 524 1.1 christos case 1: 525 1.1 christos switch(yyyPass) { 526 1.1 christos case 0: 527 1.1 christos yyyRL = 0; 528 1.1 christos case 1: 529 1.1 christos 530 1.1 christos if (yyyCond(0) != yyyPass) { 531 1.1 christos #line 28 "expr.Y" 532 1.4 christos printf(" * "); 533 1.4 christos 534 1.1 christos #line 533 "expr.oxout.y" 535 1.1 christos } 536 1.1 christos break; 537 1.1 christos } 538 1.1 christos break; 539 1.1 christos } 540 1.1 christos 541 1.1 christos break; 542 1.1 christos case 3: 543 1.4 christos switch(yyyi) { 544 1.1 christos case 0: 545 1.1 christos switch(yyyPass) { 546 1.1 christos case 0: 547 1.1 christos yyyRL = 0;yyySetCond(0) 548 1.1 christos 549 1.1 christos case 1: 550 1.1 christos 551 1.1 christos if (yyyCond(0) != yyyPass) { 552 1.1 christos #line 32 "expr.Y" 553 1.4 christos printf(" + "); 554 1.4 christos 555 1.1 christos #line 554 "expr.oxout.y" 556 1.1 christos } 557 1.1 christos break; 558 1.1 christos } 559 1.1 christos break; 560 1.1 christos case 1: 561 1.1 christos switch(yyyPass) { 562 1.1 christos case 0: 563 1.1 christos yyyRL = 0; 564 1.1 christos case 1: 565 1.1 christos 566 1.1 christos if (yyyCond(0) != yyyPass) { 567 1.1 christos #line 33 "expr.Y" 568 1.4 christos printf(" + "); 569 1.4 christos 570 1.1 christos #line 569 "expr.oxout.y" 571 1.1 christos } 572 1.1 christos break; 573 1.1 christos } 574 1.1 christos break; 575 1.1 christos } 576 1.1 christos 577 1.1 christos break; 578 1.1 christos case 4: 579 1.4 christos switch(yyyi) { 580 1.1 christos case 0: 581 1.1 christos switch(yyyPass) { 582 1.1 christos case 0: 583 1.1 christos yyyRL = 0;yyySetCond(0) 584 1.1 christos 585 1.1 christos case 1: 586 1.1 christos 587 1.1 christos if (yyyCond(0) != yyyPass) { 588 1.1 christos #line 37 "expr.Y" 589 1.4 christos printf(" / "); 590 1.4 christos 591 1.1 christos #line 590 "expr.oxout.y" 592 1.1 christos } 593 1.1 christos break; 594 1.1 christos } 595 1.1 christos break; 596 1.1 christos case 1: 597 1.1 christos switch(yyyPass) { 598 1.1 christos case 0: 599 1.1 christos yyyRL = 0; 600 1.1 christos case 1: 601 1.1 christos 602 1.1 christos if (yyyCond(0) != yyyPass) { 603 1.1 christos #line 36 "expr.Y" 604 1.4 christos printf(" / "); 605 1.4 christos 606 1.1 christos #line 605 "expr.oxout.y" 607 1.1 christos } 608 1.1 christos break; 609 1.1 christos } 610 1.1 christos break; 611 1.1 christos } 612 1.1 christos 613 1.1 christos break; 614 1.1 christos case 5: 615 1.4 christos switch(yyyi) { 616 1.1 christos case 0: 617 1.1 christos switch(yyyPass) { 618 1.1 christos case 0: 619 1.1 christos yyyRL = 0;yyySetCond(0) 620 1.1 christos 621 1.1 christos case 1: 622 1.1 christos 623 1.1 christos if (yyyCond(0) != yyyPass) { 624 1.1 christos #line 41 "expr.Y" 625 1.4 christos printf(" - "); 626 1.4 christos 627 1.1 christos #line 626 "expr.oxout.y" 628 1.1 christos } 629 1.1 christos break; 630 1.1 christos } 631 1.1 christos break; 632 1.1 christos case 1: 633 1.1 christos switch(yyyPass) { 634 1.1 christos case 0: 635 1.1 christos yyyRL = 0; 636 1.1 christos case 1: 637 1.1 christos 638 1.1 christos if (yyyCond(0) != yyyPass) { 639 1.1 christos #line 40 "expr.Y" 640 1.4 christos printf(" - "); 641 1.4 christos 642 1.1 christos #line 641 "expr.oxout.y" 643 1.1 christos } 644 1.1 christos break; 645 1.1 christos } 646 1.1 christos break; 647 1.1 christos } 648 1.1 christos 649 1.1 christos break; 650 1.1 christos case 6: 651 1.4 christos switch(yyyi) { 652 1.1 christos case 0: 653 1.1 christos switch(yyyPass) { 654 1.1 christos case 0: 655 1.1 christos yyyRL = 0; 656 1.1 christos case 1: 657 1.1 christos 658 1.1 christos break; 659 1.1 christos } 660 1.1 christos break; 661 1.1 christos case 1: 662 1.1 christos switch(yyyPass) { 663 1.1 christos case 0: 664 1.1 christos yyyRL = 0; 665 1.1 christos case 1: 666 1.1 christos 667 1.1 christos break; 668 1.1 christos } 669 1.1 christos break; 670 1.1 christos } 671 1.1 christos 672 1.1 christos break; 673 1.1 christos case 7: 674 1.4 christos switch(yyyi) { 675 1.1 christos case 0: 676 1.1 christos switch(yyyPass) { 677 1.1 christos case 0: 678 1.1 christos yyyRL = 0;yyySetCond(0) 679 1.1 christos 680 1.1 christos case 1: 681 1.1 christos 682 1.1 christos if (yyyCond(0) != yyyPass) { 683 1.1 christos #line 46 "expr.Y" 684 1.4 christos printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme); 685 1.4 christos 686 1.1 christos #line 685 "expr.oxout.y" 687 1.1 christos } 688 1.1 christos break; 689 1.1 christos } 690 1.1 christos break; 691 1.1 christos case 1: 692 1.1 christos switch(yyyPass) { 693 1.1 christos case 0: 694 1.1 christos yyyRL = 0; 695 1.1 christos case 1: 696 1.1 christos 697 1.1 christos if (yyyCond(0) != yyyPass) { 698 1.1 christos #line 45 "expr.Y" 699 1.4 christos printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme); 700 1.4 christos 701 1.1 christos #line 700 "expr.oxout.y" 702 1.1 christos } 703 1.1 christos break; 704 1.1 christos } 705 1.1 christos break; 706 1.1 christos } 707 1.1 christos 708 1.1 christos break; 709 1.1 christos case 8: 710 1.4 christos switch(yyyi) { 711 1.1 christos case 0: 712 1.1 christos switch(yyyPass) { 713 1.1 christos case 0: 714 1.1 christos yyyRL = 0;yyySetCond(0) 715 1.1 christos 716 1.1 christos case 1: 717 1.1 christos 718 1.1 christos if (yyyCond(0) != yyyPass) { 719 1.1 christos #line 50 "expr.Y" 720 1.4 christos printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme); 721 1.4 christos 722 1.1 christos #line 721 "expr.oxout.y" 723 1.1 christos } 724 1.1 christos break; 725 1.1 christos } 726 1.1 christos break; 727 1.1 christos case 1: 728 1.1 christos switch(yyyPass) { 729 1.1 christos case 0: 730 1.1 christos yyyRL = 0; 731 1.1 christos case 1: 732 1.1 christos 733 1.1 christos if (yyyCond(0) != yyyPass) { 734 1.1 christos #line 49 "expr.Y" 735 1.4 christos printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme); 736 1.4 christos 737 1.1 christos #line 736 "expr.oxout.y" 738 1.1 christos } 739 1.1 christos break; 740 1.1 christos } 741 1.1 christos break; 742 1.1 christos } 743 1.1 christos 744 1.1 christos break; 745 1.4 christos } /* switch */ 746 1.4 christos if (yyyPass) goto yyyTpop; else goto yyyTpush; 747 1.4 christos } /* while */ 748 1.4 christos } /* for */ 749 1.4 christos } /* yyyDoTraversals */ 750 1.1 christos 751 1.1 christos void yyyExecuteRRsection(yyyGNT *rootNode) { 752 1.4 christos int yyyi; 753 1.4 christos long cycleSum = 0; 754 1.4 christos long nNZrc = 0; 755 1.1 christos 756 1.4 christos if (!yyyYok) return; 757 1.1 christos yyyCheckUnsolvedInstTrav(rootNode,&nNZrc,&cycleSum); 758 1.4 christos if (nNZrc) 759 1.1 christos { 760 1.1 christos fputs("\n\n\n**********\n",stderr); 761 1.1 christos fputs("cycle detected in completed parse tree",stderr); 762 1.1 christos fputs(" after decoration.\n",stderr); 763 1.1 christos #if CYCLE_VERBOSE 764 1.1 christos fprintf(stderr, 765 1.4 christos "number of unsolved attribute instances == %ld.\n", 766 1.4 christos nNZrc 767 1.4 christos ); 768 1.1 christos fprintf(stderr, 769 1.4 christos "total number of remaining dependencies == %ld.\n", 770 1.1 christos cycleSum 771 1.4 christos ); 772 1.1 christos fputs("average number of remaining dependencies\n",stderr); 773 1.4 christos fprintf(stderr," per unsolved instance == %f.\n", 774 1.4 christos ((float)(cycleSum)/(float)(nNZrc)) 775 1.4 christos ); 776 1.1 christos #endif 777 1.1 christos fprintf(stderr, 778 1.1 christos "searching parse tree for %ld unsolved instances:\n", 779 1.1 christos nNZrc 780 1.1 christos ); 781 1.1 christos yyyUnsolvedInstSearchTravAux(rootNode); 782 1.1 christos } 783 1.1 christos yyyDoTraversals(rootNode); 784 1.4 christos } /* yyyExecuteRRsection */ 785 1.1 christos 786 1.1 christos 787 1.1 christos 788 1.1 christos yyyWAT yyyLRCIL[2] = {0,0, 789 1.1 christos }; 790 1.1 christos 791 1.1 christos 792 1.1 christos 793 1.4 christos void yyyYoxInit(void) 794 1.4 christos { 795 1.1 christos static int yyyInitDone = 0; 796 1.1 christos if (yyyInitDone) return; 797 1.4 christos 798 1.4 christos if ((yyyRS = (yyyRSitem *) 799 1.3 christos calloc((size_t)(yyyRSmaxSize+1), (size_t)sizeof(yyyRSitem)) 800 1.4 christos ) 801 1.4 christos == 802 1.4 christos ((yyyRSitem *) NULL) 803 1.4 christos ) 804 1.4 christos yyyfatal("malloc error in ox ready set space allocation\n"); 805 1.4 christos yyyRS++; 806 1.4 christos yyyAfterRS = yyyRS + yyyRSmaxSize; 807 1.4 christos 808 1.4 christos 809 1.4 christos if ((yyySSALspace = (struct yyySolvedSAlistCell *) 810 1.4 christos calloc((size_t)(yyySSALspaceSize+1), (size_t)sizeof(struct yyySolvedSAlistCell)) 811 1.4 christos ) 812 1.4 christos == 813 1.4 christos ((struct yyySolvedSAlistCell *) NULL) 814 1.4 christos ) 815 1.4 christos yyyfatal("malloc error in stack solved list space allocation\n"); 816 1.1 christos yyyInitDone = 1; 817 1.4 christos 818 1.4 christos yyyRSTop = yyyRS - 1; 819 1.4 christos } /* yyyYoxInit */ 820 1.1 christos 821 1.1 christos 822 1.1 christos 823 1.4 christos void yyyDecorate(void) 824 1.4 christos { 825 1.4 christos while (yyyRSTop >= yyyRS) 826 1.4 christos yyySolveAndSignal(); 827 1.4 christos } 828 1.1 christos 829 1.1 christos 830 1.1 christos 831 1.4 christos void yyyGenIntNode(long yyyProdNum, int yyyRHSlength, int yyyNattrbs, struct yyyOxAttrbs *yyval_OxAttrbs, ...) 832 1.1 christos {yyyWST i; 833 1.4 christos yyySIT **yyyOxStackItem = &yyval_OxAttrbs->yyyOxStackItem; 834 1.4 christos yyyGNT *gnpDum; 835 1.4 christos va_list ap; 836 1.1 christos 837 1.4 christos *yyyOxStackItem = (yyySIT *) malloc((size_t)sizeof(yyySIT)); 838 1.4 christos if (*yyyOxStackItem == (yyySIT *) NULL) 839 1.1 christos yyyfatal("malloc error in ox yacc semantic stack space allocation\n"); 840 1.4 christos (*yyyOxStackItem)->node = 841 1.4 christos (yyyGNT *) malloc((size_t)sizeof(yyyGNT)); 842 1.4 christos if ((*yyyOxStackItem)->node == (yyyGNT *) NULL) 843 1.1 christos yyyfatal("malloc error in ox node space allocation\n"); 844 1.4 christos (*yyyOxStackItem)->solvedSAlist = yyyLambdaSSAL; 845 1.4 christos (*yyyOxStackItem)->node->parent.stackref = *yyyOxStackItem; 846 1.4 christos (*yyyOxStackItem)->node->parentIsStack = 1; 847 1.4 christos (*yyyOxStackItem)->node->cLlen = yyyRHSlength; 848 1.4 christos (*yyyOxStackItem)->node->cL = 849 1.4 christos (yyyGNT **) calloc((size_t)yyyRHSlength, (size_t)sizeof(yyyGNT *)); 850 1.4 christos if ((*yyyOxStackItem)->node->cL == (yyyGNT **) NULL) 851 1.1 christos yyyfatal("malloc error in ox child list space allocation\n"); 852 1.4 christos (*yyyOxStackItem)->node->refCountListLen = yyyNattrbs; 853 1.4 christos (*yyyOxStackItem)->node->refCountList = 854 1.4 christos (yyyRCT *) calloc((size_t)yyyNattrbs, (size_t)sizeof(yyyRCT)); 855 1.4 christos if ((*yyyOxStackItem)->node->refCountList == (yyyRCT *) NULL) 856 1.4 christos yyyfatal("malloc error in ox reference count list space allocation\n"); 857 1.4 christos (*yyyOxStackItem)->node->prodNum = (int) yyyProdNum; 858 1.4 christos va_start(ap, yyval_OxAttrbs); 859 1.4 christos for (i=1;i<=yyyRHSlength;i++) 860 1.1 christos {yyySIT *yaccStDum = va_arg(ap,struct yyyOxAttrbs *)->yyyOxStackItem; 861 1.4 christos gnpDum = (*yyyOxStackItem)->node->cL[i-1] = yaccStDum->node; 862 1.4 christos gnpDum->whichSym = i; 863 1.4 christos gnpDum->parent.noderef = (*yyyOxStackItem)->node; 864 1.4 christos gnpDum->parentIsStack = 0; 865 1.4 christos } 866 1.4 christos va_end(ap); 867 1.4 christos } 868 1.1 christos 869 1.1 christos 870 1.1 christos 871 1.4 christos #define yyyDECORfREQ 50 872 1.1 christos 873 1.1 christos 874 1.1 christos 875 1.4 christos void yyyAdjustINRC(long yyyProdNum, int yyyRHSlength, long startP, long stopP, struct yyyOxAttrbs *yyval_OxAttrbs, ...) 876 1.1 christos {yyyWST i; 877 1.1 christos yyySIT *yyyOxStackItem = yyval_OxAttrbs->yyyOxStackItem; 878 1.4 christos long SSALptr,SSALptrHead,*cPtrPtr; 879 1.4 christos long *pL; 880 1.4 christos yyyGNT *gnpDum; 881 1.1 christos long iTemp; 882 1.1 christos long nextP; 883 1.1 christos static unsigned short intNodeCount = yyyDECORfREQ; 884 1.4 christos va_list ap; 885 1.1 christos 886 1.1 christos nextP = startP; 887 1.4 christos while (nextP < stopP) 888 1.4 christos {if (yyyRCIL[nextP] == yyyR) 889 1.1 christos {(yyyOxStackItem->node->refCountList)[yyyRCIL[nextP+1]] = yyyRCIL[nextP+2]; 890 1.4 christos } 891 1.4 christos else 892 1.1 christos {(((yyyOxStackItem->node->cL)[yyyRCIL[nextP]])->refCountList)[yyyRCIL[nextP+1]] = yyyRCIL[nextP+2]; 893 1.4 christos } 894 1.4 christos nextP += 3; 895 1.1 christos } 896 1.4 christos pL = yyyIIEL + yyyIIIEL[yyyProdNum]; 897 1.4 christos va_start(ap, yyval_OxAttrbs); 898 1.4 christos for (i=1;i<=yyyRHSlength;i++) 899 1.1 christos {yyySIT *yaccStDum = va_arg(ap,struct yyyOxAttrbs *)->yyyOxStackItem; 900 1.4 christos pL++; 901 1.4 christos SSALptrHead = SSALptr = *(cPtrPtr = &(yaccStDum->solvedSAlist)); 902 1.4 christos if (SSALptr != yyyLambdaSSAL) 903 1.4 christos {*cPtrPtr = yyyLambdaSSAL; 904 1.4 christos do 905 1.1 christos { 906 1.1 christos iTemp = (*pL+yyySSALspace[SSALptr].attrbNum); 907 1.1 christos yyySignalEnts(yyyOxStackItem->node, 908 1.1 christos yyyIEL[iTemp], 909 1.1 christos yyyIEL[iTemp+1] 910 1.4 christos ); 911 1.4 christos SSALptr = *(cPtrPtr = &(yyySSALspace[SSALptr].next)); 912 1.4 christos } 913 1.4 christos while (SSALptr != yyyLambdaSSAL); 914 1.4 christos *cPtrPtr = yyySSALCfreeList; 915 1.4 christos yyySSALCfreeList = SSALptrHead; 916 1.4 christos } 917 1.4 christos } 918 1.4 christos va_end(ap); 919 1.1 christos nextP = startP + 2; 920 1.4 christos while (nextP < stopP) 921 1.1 christos {if (!yyyRCIL[nextP]) 922 1.4 christos {if (yyyRCIL[nextP-2] == yyyR) 923 1.4 christos {pL = &(yyyOxStackItem->solvedSAlist); 924 1.4 christos if (yyySSALCfreeList == yyyLambdaSSAL) 925 1.4 christos {yyySSALspace[yyyNewSSALC].next = *pL; 926 1.4 christos if ((*pL = yyyNewSSALC++) == yyySSALspaceSize) 927 1.4 christos yyyHandleOverflow(yyySSALof); 928 1.4 christos } 929 1.1 christos else 930 1.4 christos {iTemp = yyySSALCfreeList; 931 1.4 christos yyySSALCfreeList = yyySSALspace[yyySSALCfreeList].next; 932 1.4 christos yyySSALspace[iTemp].next = *pL; 933 1.4 christos *pL = iTemp; 934 1.4 christos } 935 1.4 christos yyySSALspace[*pL].attrbNum = yyyRCIL[nextP-1]; 936 1.4 christos } 937 1.4 christos else 938 1.1 christos {if ((gnpDum = (yyyOxStackItem->node->cL)[yyyRCIL[nextP-2]])->prodNum != 0) 939 1.1 christos { 940 1.1 christos iTemp = yyyIIEL[yyyIIIEL[gnpDum->prodNum]] + yyyRCIL[nextP-1]; 941 1.4 christos yyySignalEnts(gnpDum, 942 1.4 christos yyyIEL[iTemp], 943 1.4 christos yyyIEL[iTemp+1] 944 1.4 christos ); 945 1.4 christos } 946 1.4 christos } 947 1.4 christos } 948 1.4 christos nextP += 3; 949 1.4 christos } 950 1.4 christos if (!--intNodeCount) 951 1.4 christos {intNodeCount = yyyDECORfREQ; 952 1.4 christos yyyDecorate(); 953 1.4 christos } 954 1.4 christos } 955 1.1 christos 956 1.1 christos 957 1.1 christos 958 1.4 christos void yyyGenLeaf(int nAttrbs,int typeNum,long startP,long stopP,YYSTYPE *mylval) 959 1.4 christos {yyyRCT *rcPdum; 960 1.4 christos yyySIT **yyyOxStackItem = &mylval->yyyOxAttrbs.yyyOxStackItem; 961 1.4 christos (*yyyOxStackItem) = (yyySIT *) malloc((size_t)sizeof(yyySIT)); 962 1.4 christos if ((*yyyOxStackItem) == (yyySIT *) NULL) 963 1.1 christos yyyfatal("malloc error in ox yacc semantic stack space allocation\n"); 964 1.4 christos (*yyyOxStackItem)->node = 965 1.4 christos (yyyGNT *) malloc((size_t)sizeof(yyyGNT)) 966 1.4 christos ; 967 1.4 christos if ((*yyyOxStackItem)->node == (yyyGNT *) NULL) 968 1.1 christos yyyfatal("malloc error in ox node space allocation\n"); 969 1.4 christos (*yyyOxStackItem)->solvedSAlist = yyyLambdaSSAL; 970 1.4 christos (*yyyOxStackItem)->node->parent.stackref = *yyyOxStackItem; 971 1.4 christos (*yyyOxStackItem)->node->parentIsStack = 1; 972 1.4 christos (*yyyOxStackItem)->node->cLlen = 0; 973 1.4 christos (*yyyOxStackItem)->node->cL = (yyyGNT **)NULL; 974 1.4 christos (*yyyOxStackItem)->node->refCountListLen = nAttrbs; 975 1.4 christos rcPdum = (*yyyOxStackItem)->node->refCountList = 976 1.4 christos (yyyRCT *) calloc((size_t)nAttrbs, (size_t)sizeof(yyyRCT)); 977 1.4 christos if (rcPdum == (yyyRCT *) NULL) 978 1.4 christos yyyfatal("malloc error in ox reference count list space allocation\n"); 979 1.4 christos while (startP < stopP) rcPdum[yyyLRCIL[startP++]] = 0; 980 1.4 christos (*yyyOxStackItem)->node->prodNum = 0; 981 1.4 christos (*yyyOxStackItem)->node->whichSym = 0; 982 1.4 christos } 983 1.1 christos 984 1.1 christos 985 1.1 christos 986 1.1 christos void yyyabort(void) 987 1.4 christos {yyyYok = 0; 988 1.4 christos } 989 1.1 christos 990 1.1 christos 991 1.1 christos 992 1.1 christos 993 1.1 christos 994 1.1 christos #define yyyLastProdNum 8 995 1.1 christos 996 1.1 christos 997 1.1 christos #define yyyNsorts 1 998 1.1 christos 999 1.1 christos 1000 1.1 christos int yyyProdsInd[] = { 1001 1.1 christos 0, 1002 1.1 christos 0, 2, 6, 10, 14, 18, 22, 24, 1003 1.1 christos 26, 1004 1.1 christos }; 1005 1.1 christos 1006 1.1 christos 1007 1.1 christos int yyyProds[][2] = { 1008 1.1 christos { 116, 0},{ 462, 0},{ 462, 0},{ 462, 0},{ 412, 0}, 1009 1.1 christos { 462, 0},{ 462, 0},{ 462, 0},{ 420, 0},{ 462, 0}, 1010 1.1 christos { 462, 0},{ 462, 0},{ 452, 0},{ 462, 0},{ 462, 0}, 1011 1.1 christos { 462, 0},{ 436, 0},{ 462, 0},{ 462, 0},{ 396, 0}, 1012 1.1 christos { 462, 0},{ 404, 0},{ 462, 0},{ 619, 1},{ 462, 0}, 1013 1.1 christos { 567, 1}, 1014 1.1 christos }; 1015 1.1 christos 1016 1.1 christos 1017 1.1 christos int yyySortsInd[] = { 1018 1.1 christos 0, 1019 1.1 christos 0, 1020 1.1 christos 1, 1021 1.1 christos }; 1022 1.1 christos 1023 1.1 christos 1024 1.1 christos int yyySorts[] = { 1025 1.1 christos 413, 1026 1.1 christos }; 1027 1.1 christos 1028 1.1 christos 1029 1.1 christos 1030 1.1 christos char *yyyStringTab[] = { 1031 1.4 christos NULL,NULL,NULL,NULL,NULL, 1032 1.4 christos NULL,NULL,NULL,NULL,NULL, 1033 1.4 christos NULL,NULL,NULL,NULL,NULL, 1034 1.4 christos NULL,NULL,NULL,NULL,NULL, 1035 1.4 christos NULL,NULL,NULL,NULL,NULL, 1036 1.4 christos NULL,NULL,NULL,NULL,NULL, 1037 1.4 christos NULL,NULL,NULL,NULL,NULL, 1038 1.4 christos NULL,NULL,NULL,NULL,NULL, 1039 1.4 christos NULL,NULL,NULL,NULL,NULL, 1040 1.4 christos NULL,NULL,NULL,NULL,NULL, 1041 1.4 christos NULL,NULL,NULL,NULL,NULL, 1042 1.4 christos NULL,NULL,NULL,NULL,NULL, 1043 1.4 christos NULL,NULL,NULL,NULL,NULL, 1044 1.4 christos NULL,NULL,NULL,NULL,NULL, 1045 1.4 christos NULL,NULL,NULL,NULL,NULL, 1046 1.4 christos NULL,NULL,NULL,NULL,NULL, 1047 1.4 christos NULL,NULL,NULL,NULL,NULL, 1048 1.4 christos NULL,NULL,NULL,NULL,NULL, 1049 1.4 christos NULL,NULL,NULL,NULL,NULL, 1050 1.4 christos NULL,NULL,NULL,NULL,NULL, 1051 1.4 christos NULL,NULL,NULL,NULL,NULL, 1052 1.4 christos NULL,NULL,NULL,NULL,NULL, 1053 1.4 christos NULL,NULL,NULL,NULL,NULL, 1054 1.4 christos NULL,"s",NULL,NULL,NULL, 1055 1.4 christos NULL,NULL,"y",NULL,NULL, 1056 1.4 christos NULL,NULL,NULL,NULL,NULL, 1057 1.4 christos NULL,NULL,NULL,NULL,NULL, 1058 1.4 christos NULL,NULL,NULL,NULL,NULL, 1059 1.4 christos NULL,NULL,NULL,NULL,NULL, 1060 1.4 christos NULL,NULL,NULL,NULL,NULL, 1061 1.4 christos NULL,NULL,NULL,NULL,NULL, 1062 1.4 christos NULL,NULL,NULL,NULL,NULL, 1063 1.4 christos NULL,NULL,NULL,NULL,NULL, 1064 1.4 christos NULL,NULL,NULL,NULL,NULL, 1065 1.4 christos NULL,NULL,NULL,NULL,NULL, 1066 1.4 christos NULL,NULL,NULL,NULL,NULL, 1067 1.4 christos NULL,NULL,NULL,NULL,NULL, 1068 1.4 christos NULL,NULL,NULL,NULL,NULL, 1069 1.4 christos NULL,NULL,NULL,NULL,NULL, 1070 1.4 christos NULL,NULL,NULL,NULL,NULL, 1071 1.4 christos NULL,NULL,NULL,NULL,NULL, 1072 1.4 christos NULL,NULL,NULL,NULL,NULL, 1073 1.4 christos NULL,NULL,NULL,NULL,NULL, 1074 1.4 christos NULL,NULL,NULL,NULL,NULL, 1075 1.4 christos NULL,NULL,NULL,NULL,NULL, 1076 1.4 christos NULL,NULL,NULL,NULL,NULL, 1077 1.4 christos NULL,NULL,NULL,NULL,NULL, 1078 1.4 christos NULL,NULL,NULL,NULL,NULL, 1079 1.4 christos NULL,NULL,NULL,NULL,NULL, 1080 1.4 christos NULL,NULL,NULL,NULL,NULL, 1081 1.4 christos NULL,NULL,NULL,NULL,NULL, 1082 1.4 christos NULL,NULL,NULL,NULL,NULL, 1083 1.4 christos NULL,NULL,NULL,NULL,NULL, 1084 1.4 christos NULL,NULL,NULL,NULL,NULL, 1085 1.4 christos NULL,NULL,NULL,NULL,NULL, 1086 1.4 christos NULL,NULL,NULL,NULL,NULL, 1087 1.4 christos NULL,NULL,NULL,NULL,NULL, 1088 1.4 christos NULL,NULL,NULL,NULL,NULL, 1089 1.4 christos NULL,NULL,NULL,NULL,NULL, 1090 1.4 christos NULL,NULL,NULL,NULL,NULL, 1091 1.4 christos NULL,NULL,NULL,NULL,NULL, 1092 1.4 christos NULL,NULL,NULL,NULL,NULL, 1093 1.4 christos NULL,NULL,NULL,NULL,NULL, 1094 1.4 christos NULL,NULL,NULL,NULL,NULL, 1095 1.4 christos NULL,NULL,NULL,NULL,NULL, 1096 1.4 christos NULL,"LRpre",NULL,NULL,NULL, 1097 1.4 christos NULL,NULL,NULL,NULL,NULL, 1098 1.4 christos NULL,NULL,NULL,NULL,NULL, 1099 1.4 christos NULL,NULL,NULL,NULL,NULL, 1100 1.4 christos NULL,NULL,NULL,NULL,NULL, 1101 1.4 christos NULL,NULL,NULL,NULL,NULL, 1102 1.4 christos NULL,NULL,NULL,NULL,NULL, 1103 1.4 christos NULL,NULL,NULL,NULL,NULL, 1104 1.4 christos NULL,NULL,NULL,NULL,NULL, 1105 1.4 christos NULL,NULL,NULL,NULL,NULL, 1106 1.4 christos NULL,NULL,NULL,NULL,NULL, 1107 1.4 christos NULL,NULL,NULL,NULL,NULL, 1108 1.4 christos NULL,NULL,NULL,NULL,NULL, 1109 1.4 christos NULL,NULL,NULL,NULL,NULL, 1110 1.4 christos NULL,"'('",NULL,NULL,NULL, 1111 1.4 christos NULL,NULL,NULL,NULL,"')'", 1112 1.4 christos NULL,NULL,NULL,NULL,NULL, 1113 1.4 christos NULL,NULL,"'*'","lexeme",NULL, 1114 1.4 christos NULL,NULL,NULL,NULL,NULL, 1115 1.4 christos "'+'",NULL,NULL,NULL,NULL, 1116 1.4 christos NULL,NULL,NULL,NULL,NULL, 1117 1.4 christos NULL,NULL,NULL,NULL,NULL, 1118 1.4 christos NULL,"'-'",NULL,NULL,NULL, 1119 1.4 christos NULL,NULL,NULL,NULL,NULL, 1120 1.4 christos NULL,NULL,NULL,NULL,NULL, 1121 1.4 christos NULL,NULL,"'/'",NULL,NULL, 1122 1.4 christos NULL,NULL,NULL,NULL,NULL, 1123 1.4 christos NULL,NULL,"expr",NULL,NULL, 1124 1.4 christos NULL,NULL,NULL,NULL,NULL, 1125 1.4 christos NULL,NULL,NULL,NULL,NULL, 1126 1.4 christos NULL,"printf",NULL,NULL,NULL, 1127 1.4 christos NULL,NULL,NULL,NULL,NULL, 1128 1.4 christos NULL,NULL,NULL,NULL,NULL, 1129 1.4 christos NULL,NULL,NULL,NULL,NULL, 1130 1.4 christos NULL,NULL,NULL,NULL,NULL, 1131 1.4 christos NULL,NULL,NULL,NULL,NULL, 1132 1.4 christos NULL,NULL,NULL,NULL,NULL, 1133 1.4 christos NULL,NULL,NULL,NULL,NULL, 1134 1.4 christos NULL,NULL,NULL,NULL,NULL, 1135 1.4 christos NULL,NULL,NULL,NULL,NULL, 1136 1.4 christos NULL,NULL,NULL,NULL,NULL, 1137 1.4 christos NULL,NULL,NULL,NULL,NULL, 1138 1.4 christos NULL,NULL,NULL,NULL,NULL, 1139 1.4 christos NULL,NULL,NULL,NULL,NULL, 1140 1.4 christos NULL,NULL,NULL,NULL,NULL, 1141 1.4 christos NULL,NULL,NULL,NULL,NULL, 1142 1.4 christos NULL,NULL,NULL,NULL,NULL, 1143 1.4 christos NULL,NULL,NULL,NULL,NULL, 1144 1.4 christos NULL,NULL,"CONST","LRpost",NULL, 1145 1.4 christos NULL,NULL,NULL,NULL,NULL, 1146 1.4 christos NULL,NULL,NULL,NULL,NULL, 1147 1.4 christos NULL,NULL,NULL,NULL,NULL, 1148 1.4 christos NULL,NULL,NULL,NULL,NULL, 1149 1.4 christos NULL,NULL,NULL,NULL,NULL, 1150 1.4 christos NULL,NULL,NULL,NULL,NULL, 1151 1.4 christos NULL,NULL,NULL,NULL,NULL, 1152 1.4 christos NULL,NULL,NULL,NULL,NULL, 1153 1.4 christos NULL,NULL,NULL,NULL,NULL, 1154 1.4 christos NULL,NULL,NULL,NULL,"ID", 1155 1.4 christos NULL,NULL,NULL,NULL,NULL, 1156 1.4 christos NULL,NULL,NULL,NULL,NULL, 1157 1.4 christos NULL,NULL,NULL,NULL,NULL, 1158 1.4 christos NULL,NULL,NULL,NULL,NULL, 1159 1.4 christos NULL,NULL,NULL,NULL,NULL, 1160 1.4 christos NULL,NULL,NULL,NULL,NULL, 1161 1.4 christos NULL,NULL,NULL,NULL,NULL, 1162 1.4 christos NULL,NULL,NULL,NULL,NULL, 1163 1.4 christos NULL,NULL,NULL,NULL,NULL, 1164 1.4 christos NULL,NULL,NULL,NULL,NULL, 1165 1.4 christos NULL,NULL,NULL,NULL,NULL, 1166 1.4 christos NULL,NULL,NULL,NULL,NULL, 1167 1.4 christos NULL,NULL,NULL,NULL,NULL, 1168 1.4 christos NULL,NULL,NULL,NULL,NULL, 1169 1.4 christos NULL,NULL,NULL,NULL,NULL, 1170 1.4 christos NULL,NULL,NULL,NULL,NULL, 1171 1.4 christos NULL,NULL,NULL,NULL,NULL, 1172 1.4 christos NULL,NULL,NULL,NULL,NULL, 1173 1.4 christos NULL,NULL,NULL,NULL,NULL, 1174 1.4 christos NULL,NULL,NULL,NULL,NULL, 1175 1.4 christos NULL,NULL,NULL,NULL,NULL, 1176 1.4 christos NULL,NULL,NULL,NULL,NULL, 1177 1.4 christos NULL,NULL,NULL,NULL,NULL, 1178 1.4 christos NULL,NULL,NULL,NULL,NULL, 1179 1.4 christos NULL,NULL,NULL,NULL,NULL, 1180 1.4 christos NULL,NULL,NULL,NULL,NULL, 1181 1.4 christos NULL,NULL,NULL,NULL,NULL, 1182 1.4 christos NULL,NULL,NULL,NULL,NULL, 1183 1.4 christos NULL,NULL,NULL,NULL,NULL, 1184 1.4 christos NULL,NULL,NULL,NULL,NULL, 1185 1.4 christos NULL,NULL,NULL,NULL,NULL, 1186 1.4 christos NULL,NULL,NULL,NULL,NULL, 1187 1.4 christos NULL,NULL,NULL,NULL,NULL, 1188 1.4 christos NULL,NULL,NULL,NULL,NULL, 1189 1.4 christos NULL,NULL,NULL,NULL,NULL, 1190 1.4 christos NULL,NULL,NULL,NULL,NULL, 1191 1.4 christos NULL,NULL,NULL,NULL,NULL, 1192 1.4 christos NULL,NULL,NULL,NULL,NULL, 1193 1.4 christos NULL,NULL,NULL,NULL,NULL, 1194 1.4 christos NULL,NULL,NULL,NULL,NULL, 1195 1.4 christos NULL,NULL,NULL,NULL,NULL, 1196 1.4 christos NULL,NULL,NULL,NULL,NULL, 1197 1.4 christos NULL,NULL,NULL,NULL,NULL, 1198 1.4 christos NULL,NULL,NULL,NULL,NULL, 1199 1.4 christos NULL,NULL,NULL,NULL,NULL, 1200 1.4 christos NULL,NULL,NULL,NULL,NULL, 1201 1.4 christos NULL,NULL,NULL,NULL,NULL, 1202 1.4 christos NULL,NULL,NULL,NULL,NULL, 1203 1.4 christos NULL,NULL,NULL,NULL,NULL, 1204 1.4 christos NULL,NULL,NULL,NULL,NULL, 1205 1.4 christos NULL,NULL,NULL,NULL,NULL, 1206 1.4 christos NULL,NULL,NULL,NULL,NULL, 1207 1.4 christos NULL,NULL,NULL,NULL,NULL, 1208 1.4 christos NULL,NULL,NULL,NULL,NULL, 1209 1.4 christos NULL,NULL,NULL,NULL,NULL, 1210 1.4 christos NULL,NULL,NULL,NULL,NULL, 1211 1.4 christos NULL,NULL,NULL,NULL,NULL, 1212 1.4 christos NULL,NULL,NULL,NULL,NULL, 1213 1.4 christos NULL,NULL,NULL,NULL,NULL, 1214 1.4 christos NULL,NULL,NULL,NULL,NULL, 1215 1.4 christos NULL,NULL,NULL,NULL,NULL, 1216 1.4 christos NULL,NULL,NULL,NULL,NULL, 1217 1.4 christos NULL,NULL,NULL,NULL,NULL, 1218 1.4 christos NULL,NULL,NULL,NULL,NULL, 1219 1.4 christos NULL,NULL,NULL,NULL,NULL, 1220 1.4 christos NULL,NULL,NULL,NULL,NULL, 1221 1.4 christos NULL,NULL,NULL,NULL,NULL, 1222 1.4 christos NULL,NULL,NULL,NULL,NULL, 1223 1.4 christos NULL,NULL,NULL,NULL,NULL, 1224 1.4 christos NULL,NULL,NULL,NULL,NULL, 1225 1.4 christos NULL,NULL,NULL,NULL,NULL, 1226 1.4 christos NULL,NULL,NULL,NULL,NULL, 1227 1.4 christos NULL,NULL,NULL,NULL,NULL, 1228 1.4 christos NULL,NULL,NULL,NULL,NULL, 1229 1.4 christos NULL,NULL,NULL,NULL,NULL, 1230 1.4 christos NULL,NULL,NULL,NULL,NULL, 1231 1.4 christos NULL,NULL,NULL,NULL,NULL, 1232 1.4 christos NULL,NULL,NULL,NULL,NULL, 1233 1.4 christos NULL,NULL,NULL,NULL,NULL, 1234 1.4 christos NULL,NULL,NULL,NULL,NULL, 1235 1.4 christos NULL,NULL,NULL,NULL,NULL, 1236 1.4 christos NULL,NULL,NULL,NULL,NULL, 1237 1.4 christos NULL,NULL,NULL,NULL,NULL, 1238 1.4 christos NULL,NULL,NULL,NULL,NULL, 1239 1.4 christos NULL,NULL,NULL,NULL,NULL, 1240 1.4 christos NULL,NULL,NULL,NULL,NULL, 1241 1.4 christos NULL,NULL,NULL,NULL,NULL, 1242 1.4 christos NULL,NULL,NULL,NULL,NULL, 1243 1.4 christos NULL,NULL,NULL,NULL,NULL, 1244 1.4 christos NULL,NULL,NULL,NULL,NULL, 1245 1.4 christos NULL,NULL,NULL,NULL,NULL, 1246 1.4 christos NULL,NULL,NULL,NULL,NULL, 1247 1.4 christos NULL,NULL,NULL,NULL,NULL, 1248 1.4 christos NULL,NULL,NULL,NULL,NULL, 1249 1.4 christos NULL,NULL,NULL,NULL,NULL, 1250 1.4 christos NULL,NULL,NULL,NULL,NULL, 1251 1.4 christos NULL,NULL,NULL,NULL,NULL, 1252 1.4 christos NULL,NULL,NULL,NULL,NULL, 1253 1.4 christos NULL,NULL,NULL,NULL,NULL, 1254 1.4 christos NULL,NULL,NULL,NULL,NULL, 1255 1.4 christos NULL,NULL,NULL,NULL,NULL, 1256 1.4 christos NULL,NULL,NULL,NULL,NULL, 1257 1.4 christos NULL,NULL,NULL,NULL,NULL, 1258 1.4 christos NULL,NULL,NULL,NULL,NULL, 1259 1.4 christos NULL,NULL,NULL,NULL,NULL, 1260 1.4 christos NULL,NULL,NULL,NULL,NULL, 1261 1.4 christos NULL,NULL,NULL,NULL,NULL, 1262 1.4 christos NULL,NULL,NULL,NULL,NULL, 1263 1.4 christos NULL,NULL,NULL,NULL,NULL, 1264 1.4 christos NULL,NULL,NULL,NULL,NULL, 1265 1.4 christos NULL,NULL,NULL,NULL,NULL, 1266 1.4 christos NULL,NULL,NULL,NULL,NULL, 1267 1.4 christos NULL,NULL,NULL,NULL,NULL, 1268 1.4 christos NULL,NULL,NULL,NULL,NULL, 1269 1.4 christos NULL,NULL,NULL,NULL,NULL, 1270 1.4 christos NULL,NULL,NULL,NULL,NULL, 1271 1.4 christos NULL,NULL,NULL,NULL,NULL, 1272 1.4 christos NULL,NULL,NULL,NULL,NULL, 1273 1.4 christos NULL,NULL,NULL,NULL,NULL, 1274 1.4 christos NULL,NULL,NULL,NULL,NULL, 1275 1.4 christos NULL,NULL,NULL,NULL,NULL, 1276 1.4 christos NULL,NULL,NULL,NULL,NULL, 1277 1.4 christos NULL, 1278 1.1 christos }; 1279 1.1 christos 1280 1.1 christos 1281 1.1 christos 1282 1.1 christos #define yyySizeofProd(num) (yyyProdsInd[(num)+1] - yyyProdsInd[(num)]) 1283 1.1 christos 1284 1.1 christos #define yyyGSoccurStr(prodNum,symPos) \ 1285 1.1 christos (yyyStringTab[yyyProds[yyyProdsInd[(prodNum)] + (symPos)][0]]) 1286 1.1 christos 1287 1.1 christos #define yyySizeofSort(num) (yyySortsInd[(num)+1] - yyySortsInd[(num)]) 1288 1.1 christos 1289 1.1 christos #define yyySortOf(prodNum,symPos) \ 1290 1.4 christos (yyyProds[yyyProdsInd[(prodNum)] + (symPos)][1]) 1291 1.1 christos 1292 1.1 christos #define yyyAttrbStr(prodNum,symPos,attrbNum) \ 1293 1.1 christos (yyyStringTab[yyySorts[yyySortsInd[yyySortOf(prodNum,symPos)] + \ 1294 1.1 christos (attrbNum) \ 1295 1.1 christos ] \ 1296 1.1 christos ] \ 1297 1.1 christos ) 1298 1.1 christos 1299 1.1 christos 1300 1.1 christos 1301 1.1 christos void yyyShowProd(int i) 1302 1.1 christos {int j,nSyms; 1303 1.1 christos 1304 1.1 christos nSyms = yyySizeofProd(i); 1305 1.1 christos for (j=0; j<nSyms; j++) 1306 1.1 christos { 1307 1.1 christos fprintf(stderr,"%s",yyyGSoccurStr(i,j)); 1308 1.1 christos if (j == 0) fputs(" : ",stderr); else putc(' ',stderr); 1309 1.1 christos } 1310 1.1 christos fputs(";\n",stderr); 1311 1.1 christos } 1312 1.1 christos 1313 1.1 christos 1314 1.1 christos 1315 1.1 christos void yyyShowProds() 1316 1.1 christos {int i; for (i=1; i<=yyyLastProdNum; i++) yyyShowProd(i);} 1317 1.1 christos 1318 1.1 christos 1319 1.1 christos 1320 1.1 christos void yyyShowSymsAndSorts() 1321 1.4 christos {int i; 1322 1.1 christos 1323 1.4 christos for (i=1; i<=yyyLastProdNum; i++) 1324 1.1 christos {int j, nSyms; 1325 1.1 christos 1326 1.1 christos fprintf(stderr, 1327 1.1 christos "\n\n\n---------------------------------- %3.1d\n",i); 1328 1.4 christos /* yyyShowProd(i); */ 1329 1.4 christos nSyms = yyySizeofProd(i); 1330 1.4 christos for (j=0; j<nSyms; j++) 1331 1.1 christos {int k, sortSize; 1332 1.1 christos 1333 1.1 christos fprintf(stderr,"%s\n",yyyGSoccurStr(i,j)); 1334 1.1 christos sortSize = yyySizeofSort(yyySortOf(i,j)); 1335 1.4 christos for (k=0; k<sortSize; k++) 1336 1.1 christos fprintf(stderr," %s\n",yyyAttrbStr(i,j,k)); 1337 1.4 christos if (j == 0) fputs("->\n",stderr); 1338 1.4 christos else 1339 1.4 christos putc('\n',stderr); 1340 1.1 christos } 1341 1.1 christos } 1342 1.1 christos } 1343 1.1 christos 1344 1.1 christos 1345 1.1 christos 1346 1.1 christos void yyyCheckNodeInstancesSolved(yyyGNT *np) 1347 1.1 christos {int mysort,sortSize,i,prodNum,symPos,inTerminalNode; 1348 1.1 christos int nUnsolvedInsts = 0; 1349 1.1 christos 1350 1.1 christos if (np->prodNum != 0) 1351 1.1 christos {inTerminalNode = 0; 1352 1.1 christos prodNum = np->prodNum; 1353 1.1 christos symPos = 0; 1354 1.1 christos } 1355 1.1 christos else 1356 1.1 christos {inTerminalNode = 1; 1357 1.1 christos prodNum = np->parent.noderef->prodNum; 1358 1.1 christos symPos = np->whichSym; 1359 1.1 christos } 1360 1.1 christos mysort = yyySortOf(prodNum,symPos); 1361 1.1 christos sortSize = yyySizeofSort(mysort); 1362 1.1 christos for (i=0; i<sortSize; i++) 1363 1.1 christos if ((np->refCountList)[i] != 0) nUnsolvedInsts += 1; 1364 1.1 christos if (nUnsolvedInsts) 1365 1.1 christos {fprintf(stderr, 1366 1.1 christos "\nFound node that has %d unsolved attribute instance(s).\n", 1367 1.1 christos nUnsolvedInsts 1368 1.1 christos ); 1369 1.1 christos fprintf(stderr,"Node is labeled \"%s\".\n", 1370 1.1 christos yyyGSoccurStr(prodNum,symPos)); 1371 1.1 christos if (inTerminalNode) 1372 1.1 christos {fputs("Node is terminal. Its parent production is:\n ",stderr); 1373 1.1 christos yyyShowProd(prodNum); 1374 1.1 christos } 1375 1.1 christos else 1376 1.1 christos {fputs("Node is nonterminal. ",stderr); 1377 1.1 christos if (!(np->parentIsStack)) 1378 1.1 christos {fprintf(stderr, 1379 1.1 christos "Node is %dth child in its parent production:\n ", 1380 1.1 christos np->whichSym 1381 1.1 christos ); 1382 1.1 christos yyyShowProd(np->parent.noderef->prodNum); 1383 1.1 christos } 1384 1.1 christos fputs("Node is on left hand side of this production:\n ",stderr); 1385 1.1 christos yyyShowProd(np->prodNum); 1386 1.1 christos } 1387 1.1 christos fputs("The following instances are unsolved:\n",stderr); 1388 1.1 christos for (i=0; i<sortSize; i++) 1389 1.1 christos if ((np->refCountList)[i] != 0) 1390 1.1 christos fprintf(stderr," %-16s still has %1d dependencies.\n", 1391 1.1 christos yyyAttrbStr(prodNum,symPos,i),(np->refCountList)[i]); 1392 1.1 christos } 1393 1.1 christos } 1394 1.1 christos 1395 1.1 christos 1396 1.1 christos 1397 1.1 christos void yyyCheckUnsolvedInstTrav(yyyGNT *pNode,long *nNZrc,long *cycleSum) 1398 1.1 christos {yyyGNT **yyyCLpdum; 1399 1.1 christos yyyRCT *rcp; 1400 1.1 christos int i; 1401 1.4 christos 1402 1.4 christos /* visit the refCountList of each node in the tree, and sum the non-zero refCounts */ 1403 1.4 christos rcp = pNode->refCountList; 1404 1.4 christos i = pNode->refCountListLen; 1405 1.4 christos while (i--) 1406 1.4 christos if (*rcp++) {*cycleSum += *(rcp - 1); (*nNZrc)++;} 1407 1.1 christos yyyCLpdum = pNode->cL; 1408 1.1 christos i = pNode->cLlen; 1409 1.1 christos while (i--) 1410 1.1 christos { 1411 1.1 christos yyyCheckUnsolvedInstTrav(*yyyCLpdum,nNZrc,cycleSum); 1412 1.1 christos yyyCLpdum++; 1413 1.1 christos } 1414 1.1 christos } 1415 1.1 christos 1416 1.1 christos 1417 1.1 christos 1418 1.1 christos void yyyUnsolvedInstSearchTravAux(yyyGNT *pNode) 1419 1.1 christos {yyyGNT **yyyCLpdum; 1420 1.1 christos int i; 1421 1.4 christos 1422 1.4 christos yyyCheckNodeInstancesSolved(pNode); 1423 1.1 christos yyyCLpdum = pNode->cL; 1424 1.1 christos i = pNode->cLlen; 1425 1.1 christos while (i--) 1426 1.1 christos { 1427 1.1 christos yyyUnsolvedInstSearchTravAux(*yyyCLpdum); 1428 1.1 christos yyyCLpdum++; 1429 1.1 christos } 1430 1.1 christos } 1431 1.1 christos 1432 1.1 christos 1433 1.1 christos 1434 1.1 christos void yyyUnsolvedInstSearchTrav(yyyGNT *pNode) 1435 1.1 christos {yyyGNT **yyyCLpdum; 1436 1.1 christos int i; 1437 1.4 christos 1438 1.1 christos yyyCLpdum = pNode->cL; 1439 1.1 christos i = pNode->cLlen; 1440 1.1 christos while (i--) 1441 1.1 christos { 1442 1.1 christos yyyUnsolvedInstSearchTravAux(*yyyCLpdum); 1443 1.1 christos yyyCLpdum++; 1444 1.1 christos } 1445 1.1 christos } 1446 1.1 christos 1447 1.1 christos 1448 1.1 christos 1449