Lines Matching refs:cfp
360 struct config *cfp; /* All configurations in this set */ member
375 struct config *cfp; /* The configuration to which linked */ member
966 struct config *cfp, *bp; in getstate() local
986 cfp = Configlist_return(); in getstate()
987 Configlist_eat(cfp); in getstate()
992 cfp = Configlist_return(); /* Get a pointer to the config list */ in getstate()
996 stp->cfp = cfp; /* Remember the configuration closure */ in getstate()
1026 struct config *cfp; /* For looping thru the config closure of "stp" */ in buildshifts() local
1035 for(cfp=stp->cfp; cfp; cfp=cfp->next) cfp->status = INCOMPLETE; in buildshifts()
1038 for(cfp=stp->cfp; cfp; cfp=cfp->next){ in buildshifts()
1039 if( cfp->status==COMPLETE ) continue; /* Already used by inner loop */ in buildshifts()
1040 if( cfp->dot>=cfp->rp->nrhs ) continue; /* Can't shift this config */ in buildshifts()
1042 sp = cfp->rp->rhs[cfp->dot]; /* Symbol after the dot */ in buildshifts()
1047 for(bcfp=cfp; bcfp; bcfp=bcfp->next){ in buildshifts()
1080 struct config *cfp, *other; in FindLinks() local
1089 for(cfp=stp?stp->cfp:0; cfp; cfp=cfp->next){ in FindLinks()
1090 cfp->stp = stp; in FindLinks()
1098 for(cfp=stp?stp->cfp:0; cfp; cfp=cfp->next){ in FindLinks()
1099 for(plp=cfp->bplp; plp; plp=plp->next){ in FindLinks()
1100 other = plp->cfp; in FindLinks()
1101 Plink_add(&other->fplp,cfp); in FindLinks()
1115 struct config *cfp; in FindFollowSets() local
1122 for(cfp=lemp->sorted[i]->cfp; cfp; cfp=cfp->next){ in FindFollowSets()
1123 cfp->status = INCOMPLETE; in FindFollowSets()
1131 for(cfp=lemp->sorted[i]->cfp; cfp; cfp=cfp->next){ in FindFollowSets()
1132 if( cfp->status==COMPLETE ) continue; in FindFollowSets()
1133 for(plp=cfp->fplp; plp; plp=plp->next){ in FindFollowSets()
1134 change = SetUnion(plp->cfp->fws,cfp->fws); in FindFollowSets()
1136 plp->cfp->status = INCOMPLETE; in FindFollowSets()
1140 cfp->status = COMPLETE; in FindFollowSets()
1153 struct config *cfp; in FindActions() local
1164 for(cfp=stp->cfp; cfp; cfp=cfp->next){ /* Loop over all configurations */ in FindActions()
1165 if( cfp->rp->nrhs==cfp->dot ){ /* Is dot at extreme right? */ in FindActions()
1167 if( SetFind(cfp->fws,j) ){ in FindActions()
1170 Action_add(&stp->ap,REDUCE,lemp->symbols[j],(char *)cfp->rp); in FindActions()
1349 struct config *cfp, model; in Configlist_add() local
1354 cfp = Configtable_find(&model); in Configlist_add()
1355 if( cfp==0 ){ in Configlist_add()
1356 cfp = newconfig(); in Configlist_add()
1357 cfp->rp = rp; in Configlist_add()
1358 cfp->dot = dot; in Configlist_add()
1359 cfp->fws = SetNew(); in Configlist_add()
1360 cfp->stp = 0; in Configlist_add()
1361 cfp->fplp = cfp->bplp = 0; in Configlist_add()
1362 cfp->next = 0; in Configlist_add()
1363 cfp->bp = 0; in Configlist_add()
1364 *currentend = cfp; in Configlist_add()
1365 currentend = &cfp->next; in Configlist_add()
1366 Configtable_insert(cfp); in Configlist_add()
1368 return cfp; in Configlist_add()
1374 struct config *cfp, model; in Configlist_addbasis() local
1380 cfp = Configtable_find(&model); in Configlist_addbasis()
1381 if( cfp==0 ){ in Configlist_addbasis()
1382 cfp = newconfig(); in Configlist_addbasis()
1383 cfp->rp = rp; in Configlist_addbasis()
1384 cfp->dot = dot; in Configlist_addbasis()
1385 cfp->fws = SetNew(); in Configlist_addbasis()
1386 cfp->stp = 0; in Configlist_addbasis()
1387 cfp->fplp = cfp->bplp = 0; in Configlist_addbasis()
1388 cfp->next = 0; in Configlist_addbasis()
1389 cfp->bp = 0; in Configlist_addbasis()
1390 *currentend = cfp; in Configlist_addbasis()
1391 currentend = &cfp->next; in Configlist_addbasis()
1392 *basisend = cfp; in Configlist_addbasis()
1393 basisend = &cfp->bp; in Configlist_addbasis()
1394 Configtable_insert(cfp); in Configlist_addbasis()
1396 return cfp; in Configlist_addbasis()
1402 struct config *cfp, *newcfp; in Configlist_closure() local
1408 for(cfp=current; cfp; cfp=cfp->next){ in Configlist_closure()
1409 rp = cfp->rp; in Configlist_closure()
1410 dot = cfp->dot; in Configlist_closure()
1437 if( i==rp->nrhs ) Plink_add(&cfp->fplp,newcfp); in Configlist_closure()
1481 void Configlist_eat(struct config *cfp) in Configlist_eat() argument
1484 for(; cfp; cfp=nextcfp){ in Configlist_eat()
1485 nextcfp = cfp->next; in Configlist_eat()
1486 assert( cfp->fplp==0 ); in Configlist_eat()
1487 assert( cfp->bplp==0 ); in Configlist_eat()
1488 if( cfp->fws ) SetFree(cfp->fws); in Configlist_eat()
1489 deleteconfig(cfp); in Configlist_eat()
3136 void Plink_add(struct plink **plpp, struct config *cfp) in Plink_add() argument
3142 newlink->cfp = cfp; in Plink_add()
3310 void ConfigPrint(FILE *fp, struct config *cfp){ in ConfigPrint() argument
3311 RulePrint(fp, cfp->rp, cfp->dot); in ConfigPrint()
3342 fprintf(out,"%12s%s (state %2d) ","",tag,plp->cfp->stp->statenum);
3343 ConfigPrint(out,plp->cfp);
3423 struct config *cfp; in ReportOutput() local
3433 if( lemp->basisflag ) cfp=stp->bp; in ReportOutput()
3434 else cfp=stp->cfp; in ReportOutput()
3435 while( cfp ){ in ReportOutput()
3437 if( cfp->dot==cfp->rp->nrhs ){ in ReportOutput()
3438 lemon_sprintf(buf,"(%d)",cfp->rp->iRule); in ReportOutput()
3443 ConfigPrint(fp,cfp); in ReportOutput()
3446 SetPrint(fp,cfp->fws,lemp); in ReportOutput()
3447 PlinkPrint(fp,cfp->fplp,"To "); in ReportOutput()
3448 PlinkPrint(fp,cfp->bplp,"From"); in ReportOutput()
3450 if( lemp->basisflag ) cfp=cfp->bp; in ReportOutput()
3451 else cfp=cfp->next; in ReportOutput()