Lines Matching refs:cfp
361 struct config *cfp; /* All configurations in this set */ member
376 struct config *cfp; /* The configuration to which linked */ member
967 struct config *cfp, *bp; in getstate() local
987 cfp = Configlist_return(); in getstate()
988 Configlist_eat(cfp); in getstate()
993 cfp = Configlist_return(); /* Get a pointer to the config list */ in getstate()
997 stp->cfp = cfp; /* Remember the configuration closure */ in getstate()
1027 struct config *cfp; /* For looping thru the config closure of "stp" */ in buildshifts() local
1036 for(cfp=stp->cfp; cfp; cfp=cfp->next) cfp->status = INCOMPLETE; in buildshifts()
1039 for(cfp=stp->cfp; cfp; cfp=cfp->next){ in buildshifts()
1040 if( cfp->status==COMPLETE ) continue; /* Already used by inner loop */ in buildshifts()
1041 if( cfp->dot>=cfp->rp->nrhs ) continue; /* Can't shift this config */ in buildshifts()
1043 sp = cfp->rp->rhs[cfp->dot]; /* Symbol after the dot */ in buildshifts()
1048 for(bcfp=cfp; bcfp; bcfp=bcfp->next){ in buildshifts()
1081 struct config *cfp, *other; in FindLinks() local
1090 for(cfp=stp?stp->cfp:0; cfp; cfp=cfp->next){ in FindLinks()
1091 cfp->stp = stp; in FindLinks()
1099 for(cfp=stp?stp->cfp:0; cfp; cfp=cfp->next){ in FindLinks()
1100 for(plp=cfp->bplp; plp; plp=plp->next){ in FindLinks()
1101 other = plp->cfp; in FindLinks()
1102 Plink_add(&other->fplp,cfp); in FindLinks()
1116 struct config *cfp; in FindFollowSets() local
1123 for(cfp=lemp->sorted[i]->cfp; cfp; cfp=cfp->next){ in FindFollowSets()
1124 cfp->status = INCOMPLETE; in FindFollowSets()
1132 for(cfp=lemp->sorted[i]->cfp; cfp; cfp=cfp->next){ in FindFollowSets()
1133 if( cfp->status==COMPLETE ) continue; in FindFollowSets()
1134 for(plp=cfp->fplp; plp; plp=plp->next){ in FindFollowSets()
1135 change = SetUnion(plp->cfp->fws,cfp->fws); in FindFollowSets()
1137 plp->cfp->status = INCOMPLETE; in FindFollowSets()
1141 cfp->status = COMPLETE; in FindFollowSets()
1154 struct config *cfp; in FindActions() local
1165 for(cfp=stp->cfp; cfp; cfp=cfp->next){ /* Loop over all configurations */ in FindActions()
1166 if( cfp->rp->nrhs==cfp->dot ){ /* Is dot at extreme right? */ in FindActions()
1168 if( SetFind(cfp->fws,j) ){ in FindActions()
1171 Action_add(&stp->ap,REDUCE,lemp->symbols[j],(char *)cfp->rp); in FindActions()
1350 struct config *cfp, model; in Configlist_add() local
1355 cfp = Configtable_find(&model); in Configlist_add()
1356 if( cfp==0 ){ in Configlist_add()
1357 cfp = newconfig(); in Configlist_add()
1358 cfp->rp = rp; in Configlist_add()
1359 cfp->dot = dot; in Configlist_add()
1360 cfp->fws = SetNew(); in Configlist_add()
1361 cfp->stp = 0; in Configlist_add()
1362 cfp->fplp = cfp->bplp = 0; in Configlist_add()
1363 cfp->next = 0; in Configlist_add()
1364 cfp->bp = 0; in Configlist_add()
1365 *currentend = cfp; in Configlist_add()
1366 currentend = &cfp->next; in Configlist_add()
1367 Configtable_insert(cfp); in Configlist_add()
1369 return cfp; in Configlist_add()
1375 struct config *cfp, model; in Configlist_addbasis() local
1381 cfp = Configtable_find(&model); in Configlist_addbasis()
1382 if( cfp==0 ){ in Configlist_addbasis()
1383 cfp = newconfig(); in Configlist_addbasis()
1384 cfp->rp = rp; in Configlist_addbasis()
1385 cfp->dot = dot; in Configlist_addbasis()
1386 cfp->fws = SetNew(); in Configlist_addbasis()
1387 cfp->stp = 0; in Configlist_addbasis()
1388 cfp->fplp = cfp->bplp = 0; in Configlist_addbasis()
1389 cfp->next = 0; in Configlist_addbasis()
1390 cfp->bp = 0; in Configlist_addbasis()
1391 *currentend = cfp; in Configlist_addbasis()
1392 currentend = &cfp->next; in Configlist_addbasis()
1393 *basisend = cfp; in Configlist_addbasis()
1394 basisend = &cfp->bp; in Configlist_addbasis()
1395 Configtable_insert(cfp); in Configlist_addbasis()
1397 return cfp; in Configlist_addbasis()
1403 struct config *cfp, *newcfp; in Configlist_closure() local
1409 for(cfp=current; cfp; cfp=cfp->next){ in Configlist_closure()
1410 rp = cfp->rp; in Configlist_closure()
1411 dot = cfp->dot; in Configlist_closure()
1438 if( i==rp->nrhs ) Plink_add(&cfp->fplp,newcfp); in Configlist_closure()
1482 void Configlist_eat(struct config *cfp) in Configlist_eat() argument
1485 for(; cfp; cfp=nextcfp){ in Configlist_eat()
1486 nextcfp = cfp->next; in Configlist_eat()
1487 assert( cfp->fplp==0 ); in Configlist_eat()
1488 assert( cfp->bplp==0 ); in Configlist_eat()
1489 if( cfp->fws ) SetFree(cfp->fws); in Configlist_eat()
1490 deleteconfig(cfp); in Configlist_eat()
3137 void Plink_add(struct plink **plpp, struct config *cfp) in Plink_add() argument
3143 newlink->cfp = cfp; in Plink_add()
3311 void ConfigPrint(FILE *fp, struct config *cfp){ in ConfigPrint() argument
3312 RulePrint(fp, cfp->rp, cfp->dot); in ConfigPrint()
3343 fprintf(out,"%12s%s (state %2d) ","",tag,plp->cfp->stp->statenum);
3344 ConfigPrint(out,plp->cfp);
3424 struct config *cfp; in ReportOutput() local
3434 if( lemp->basisflag ) cfp=stp->bp; in ReportOutput()
3435 else cfp=stp->cfp; in ReportOutput()
3436 while( cfp ){ in ReportOutput()
3438 if( cfp->dot==cfp->rp->nrhs ){ in ReportOutput()
3439 lemon_sprintf(buf,"(%d)",cfp->rp->iRule); in ReportOutput()
3444 ConfigPrint(fp,cfp); in ReportOutput()
3447 SetPrint(fp,cfp->fws,lemp); in ReportOutput()
3448 PlinkPrint(fp,cfp->fplp,"To "); in ReportOutput()
3449 PlinkPrint(fp,cfp->bplp,"From"); in ReportOutput()
3451 if( lemp->basisflag ) cfp=cfp->bp; in ReportOutput()
3452 else cfp=cfp->next; in ReportOutput()