Lines Matching refs:stp

324   struct state *stp;       /* Pointer to state which contains this */  member
349 struct state *stp; /* The new state, if a shift */ member
556 newaction->x.stp = (struct state *)arg; in Action_add()
968 struct state *stp; in getstate() local
976 stp = State_find(bp); in getstate()
977 if( stp ){ in getstate()
982 for(x=bp, y=stp->bp; x && y; x=x->bp, y=y->bp){ in getstate()
994 stp = State_new(); /* A new state structure */ in getstate()
995 MemoryCheck(stp); in getstate()
996 stp->bp = bp; /* Remember the configuration basis */ in getstate()
997 stp->cfp = cfp; /* Remember the configuration closure */ in getstate()
998 stp->statenum = lemp->nstate++; /* Every state gets a sequence number */ in getstate()
999 stp->ap = 0; /* No actions, yet. */ in getstate()
1000 State_insert(stp,stp->bp); /* Add to the state table */ in getstate()
1001 buildshifts(lemp,stp); /* Recursively compute successor states */ in getstate()
1003 return stp; in getstate()
1025 PRIVATE void buildshifts(struct lemon *lemp, struct state *stp) in buildshifts() argument
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()
1067 Action_add(&stp->ap,SHIFT,sp->subsym[i],(char*)newstp); in buildshifts()
1070 Action_add(&stp->ap,SHIFT,sp,(char *)newstp); in buildshifts()
1082 struct state *stp; in FindLinks() local
1089 stp = lemp->sorted[i]; in FindLinks()
1090 for(cfp=stp?stp->cfp:0; cfp; cfp=cfp->next){ in FindLinks()
1091 cfp->stp = stp; in FindLinks()
1098 stp = lemp->sorted[i]; in FindLinks()
1099 for(cfp=stp?stp->cfp:0; cfp; cfp=cfp->next){ in FindLinks()
1155 struct state *stp; in FindActions() local
1164 stp = lemp->sorted[i]; in FindActions()
1165 for(cfp=stp->cfp; cfp; cfp=cfp->next){ /* Loop over all configurations */ in FindActions()
1171 Action_add(&stp->ap,REDUCE,lemp->symbols[j],(char *)cfp->rp); in FindActions()
1200 stp = lemp->sorted[i]; in FindActions()
1202 stp->ap = Action_sort(stp->ap); in FindActions()
1203 for(ap=stp->ap; ap && ap->next; ap=ap->next){ in FindActions()
1361 cfp->stp = 0; in Configlist_add()
1387 cfp->stp = 0; in Configlist_addbasis()
3343 fprintf(out,"%12s%s (state %2d) ","",tag,plp->cfp->stp->statenum);
3362 struct state *stp = ap->x.stp; in PrintAction() local
3363 fprintf(fp,"%*s shift %-7d",indent,ap->sp->name,stp->statenum); in PrintAction()
3391 indent,ap->sp->name,ap->x.stp->statenum); in PrintAction()
3396 indent,ap->sp->name,ap->x.stp->statenum); in PrintAction()
3423 struct state *stp; in ReportOutput() local
3432 stp = lemp->sorted[i]; in ReportOutput()
3433 fprintf(fp,"State %d:\n",stp->statenum); in ReportOutput()
3434 if( lemp->basisflag ) cfp=stp->bp; in ReportOutput()
3435 else cfp=stp->cfp; in ReportOutput()
3455 for(ap=stp->ap; ap; ap=ap->next){ in ReportOutput()
3572 case SHIFT: act = ap->x.stp->statenum; break; in compute_action()
4245 struct state *stp; /* A pointer to a state */ member
4295 struct state *stp; in ReportTable() local
4520 stp = lemp->sorted[i]; in ReportTable()
4521 ax[i*2].stp = stp; in ReportTable()
4523 ax[i*2].nAction = stp->nTknAct; in ReportTable()
4524 ax[i*2+1].stp = stp; in ReportTable()
4526 ax[i*2+1].nAction = stp->nNtAct; in ReportTable()
4536 stp = ax[i].stp; in ReportTable()
4538 for(ap=stp->ap; ap; ap=ap->next){ in ReportTable()
4545 stp->iTknOfst = acttab_insert(pActtab, 1); in ReportTable()
4546 if( stp->iTknOfst<mnTknOfst ) mnTknOfst = stp->iTknOfst; in ReportTable()
4547 if( stp->iTknOfst>mxTknOfst ) mxTknOfst = stp->iTknOfst; in ReportTable()
4549 for(ap=stp->ap; ap; ap=ap->next){ in ReportTable()
4557 stp->iNtOfst = acttab_insert(pActtab, 0); in ReportTable()
4558 if( stp->iNtOfst<mnNtOfst ) mnNtOfst = stp->iNtOfst; in ReportTable()
4559 if( stp->iNtOfst>mxNtOfst ) mxNtOfst = stp->iNtOfst; in ReportTable()
4567 i, stp->statenum, ax[i].isTkn ? "Token" : "Var ", in ReportTable()
4683 stp = lemp->sorted[i]; in ReportTable()
4684 ofst = stp->iTknOfst; in ReportTable()
4708 stp = lemp->sorted[i]; in ReportTable()
4709 ofst = stp->iNtOfst; in ReportTable()
4727 stp = lemp->sorted[i]; in ReportTable()
4729 if( stp->iDfltReduce<0 ){ in ReportTable()
4732 fprintf(out, " %4d,", stp->iDfltReduce + lemp->minReduce); in ReportTable()
4990 struct state *stp; in CompressTables() local
4998 stp = lemp->sorted[i]; in CompressTables()
5003 for(ap=stp->ap; ap; ap=ap->next){ in CompressTables()
5032 for(ap=stp->ap; ap; ap=ap->next){ in CompressTables()
5040 stp->ap = Action_sort(stp->ap); in CompressTables()
5042 for(ap=stp->ap; ap; ap=ap->next){ in CompressTables()
5047 stp->autoReduce = 1; in CompressTables()
5048 stp->pDfltReduce = rbest; in CompressTables()
5057 stp = lemp->sorted[i]; in CompressTables()
5058 for(ap=stp->ap; ap; ap=ap->next){ in CompressTables()
5061 pNextState = ap->x.stp; in CompressTables()
5076 stp = lemp->sorted[i]; in CompressTables()
5077 for(ap=stp->ap; ap; ap=nextap){ in CompressTables()
5091 for(ap2=stp->ap; ap2 && (ap2==ap || ap2->sp!=rp->lhs); ap2=ap2->next){} in CompressTables()
5131 struct state *stp; in ResortStates() local
5135 stp = lemp->sorted[i]; in ResortStates()
5136 stp->nTknAct = stp->nNtAct = 0; in ResortStates()
5137 stp->iDfltReduce = -1; /* Init dflt action to "syntax error" */ in ResortStates()
5138 stp->iTknOfst = NO_OFFSET; in ResortStates()
5139 stp->iNtOfst = NO_OFFSET; in ResortStates()
5140 for(ap=stp->ap; ap; ap=ap->next){ in ResortStates()
5144 stp->nTknAct++; in ResortStates()
5146 stp->nNtAct++; in ResortStates()
5148 assert( stp->autoReduce==0 || stp->pDfltReduce==ap->x.rp ); in ResortStates()
5149 stp->iDfltReduce = iAction; in ResortStates()