Lines Matching defs:cfp
211 struct config *cfp; /* All configurations in this set */
224 struct config *cfp; /* The configuration to which linked */
726 struct config *cfp, *bp;
746 cfp = Configlist_return();
747 Configlist_eat(cfp);
752 cfp = Configlist_return(); /* Get a pointer to the config list */
756 stp->cfp = cfp; /* Remember the configuration closure */
772 struct config *cfp; /* For looping thru the config closure of "stp" */
775 struct symbol *sp; /* Symbol following the dot in configuration "cfp" */
781 for(cfp=stp->cfp; cfp; cfp=cfp->next) cfp->status = INCOMPLETE;
784 for(cfp=stp->cfp; cfp; cfp=cfp->next){
785 if( cfp->status==COMPLETE ) continue; /* Already used by inner loop */
786 if( cfp->dot>=cfp->rp->nrhs ) continue; /* Can't shift this config */
788 sp = cfp->rp->rhs[cfp->dot]; /* Symbol after the dot */
793 for(bcfp=cfp; bcfp; bcfp=bcfp->next){
797 if( bsp!=sp ) continue; /* Must be same as for "cfp" */
820 struct config *cfp, *other;
829 for(cfp=stp->cfp; cfp; cfp=cfp->next){
830 cfp->stp = stp;
838 for(cfp=stp->cfp; cfp; cfp=cfp->next){
839 for(plp=cfp->bplp; plp; plp=plp->next){
840 other = plp->cfp;
841 Plink_add(&other->fplp,cfp);
856 struct config *cfp;
862 for(cfp=lemp->sorted[i]->cfp; cfp; cfp=cfp->next){
863 cfp->status = INCOMPLETE;
870 for(cfp=lemp->sorted[i]->cfp; cfp; cfp=cfp->next){
871 if( cfp->status==COMPLETE ) continue;
872 for(plp=cfp->fplp; plp; plp=plp->next){
873 change = SetUnion(plp->cfp->fws,cfp->fws);
875 plp->cfp->status = INCOMPLETE;
879 cfp->status = COMPLETE;
893 struct config *cfp;
904 for(cfp=stp->cfp; cfp; cfp=cfp->next){ /* Loop over all configurations */
905 if( cfp->rp->nrhs==cfp->dot ){ /* Is dot at extreme right? */
907 if( SetFind(cfp->fws,j) ){
909 ** rule "cfp->rp" if the lookahead symbol is "lemp->symbols[j]" */
910 Action_add(&stp->ap,REDUCE,lemp->symbols[j],(char *)cfp->rp);
1092 struct config *cfp, model;
1097 cfp = Configtable_find(&model);
1098 if( cfp==0 ){
1099 cfp = newconfig();
1100 cfp->rp = rp;
1101 cfp->dot = dot;
1102 cfp->fws = SetNew();
1103 cfp->stp = 0;
1104 cfp->fplp = cfp->bplp = 0;
1105 cfp->next = 0;
1106 cfp->bp = 0;
1107 *currentend = cfp;
1108 currentend = &cfp->next;
1109 Configtable_insert(cfp);
1111 return cfp;
1119 struct config *cfp, model;
1125 cfp = Configtable_find(&model);
1126 if( cfp==0 ){
1127 cfp = newconfig();
1128 cfp->rp = rp;
1129 cfp->dot = dot;
1130 cfp->fws = SetNew();
1131 cfp->stp = 0;
1132 cfp->fplp = cfp->bplp = 0;
1133 cfp->next = 0;
1134 cfp->bp = 0;
1135 *currentend = cfp;
1136 currentend = &cfp->next;
1137 *basisend = cfp;
1138 basisend = &cfp->bp;
1139 Configtable_insert(cfp);
1141 return cfp;
1148 struct config *cfp, *newcfp;
1154 for(cfp=current; cfp; cfp=cfp->next){
1155 rp = cfp->rp;
1156 dot = cfp->dot;
1177 if( i==rp->nrhs ) Plink_add(&cfp->fplp,newcfp);
1219 void Configlist_eat(cfp)
1220 struct config *cfp;
1223 for(; cfp; cfp=nextcfp){
1224 nextcfp = cfp->next;
1225 assert( cfp->fplp==0 );
1226 assert( cfp->bplp==0 );
1227 if( cfp->fws ) SetFree(cfp->fws);
1228 deleteconfig(cfp);
2449 void Plink_add(plpp,cfp)
2451 struct config *cfp;
2457 new->cfp = cfp;
2578 void ConfigPrint(fp,cfp)
2580 struct config *cfp;
2584 rp = cfp->rp;
2587 if( i==cfp->dot ) fprintf(fp," *");
2621 fprintf(out,"%12s%s (state %2d) ","",tag,plp->cfp->stp->index);
2622 ConfigPrint(out,plp->cfp);
2666 struct config *cfp;
2676 if( lemp->basisflag ) cfp=stp->bp;
2677 else cfp=stp->cfp;
2678 while( cfp ){
2680 if( cfp->dot==cfp->rp->nrhs ){
2681 sprintf(buf,"(%d)",cfp->rp->index);
2686 ConfigPrint(fp,cfp);
2689 SetPrint(fp,cfp->fws,lemp);
2690 PlinkPrint(fp,cfp->fplp,"To ");
2691 PlinkPrint(fp,cfp->bplp,"From");
2693 if( lemp->basisflag ) cfp=cfp->bp;
2694 else cfp=cfp->next;