Lines Matching refs:stp

174   struct state *stp;       /* Pointer to state which contains this */  member
197 struct state *stp; /* The new state, if a shift */ member
386 new->x.stp = (struct state *)arg;
724 struct state *stp; local
732 stp = State_find(bp);
733 if( stp ){
738 for(x=bp, y=stp->bp; x && y; x=x->bp, y=y->bp){
750 stp = State_new(); /* A new state structure */
751 MemoryCheck(stp);
752 stp->bp = bp; /* Remember the configuration basis */
753 stp->cfp = cfp; /* Remember the configuration closure */
754 stp->index = lemp->nstate++; /* Every state gets a sequence number */
755 stp->ap = 0; /* No actions, yet. */
756 State_insert(stp,stp->bp); /* Add to the state table */
757 buildshifts(lemp,stp); /* Recursively compute successor states */
759 return stp;
765 PRIVATE void buildshifts(lemp,stp) in buildshifts() argument
767 struct state *stp; /* The state from which successors are computed */
778 for(cfp=stp->cfp; cfp; cfp=cfp->next) cfp->status = INCOMPLETE;
781 for(cfp=stp->cfp; cfp; cfp=cfp->next){
806 Action_add(&stp->ap,SHIFT,sp,(char *)newstp);
818 struct state *stp; local
825 stp = lemp->sorted[i];
826 for(cfp=stp->cfp; cfp; cfp=cfp->next){
827 cfp->stp = stp;
834 stp = lemp->sorted[i];
835 for(cfp=stp->cfp; cfp; cfp=cfp->next){
891 struct state *stp; local
900 stp = lemp->sorted[i];
901 for(cfp=stp->cfp; cfp; cfp=cfp->next){ /* Loop over all configurations */
907 Action_add(&stp->ap,REDUCE,lemp->symbols[j],(char *)cfp->rp);
929 struct state *stp; local
930 stp = lemp->sorted[i];
931 assert( stp->ap );
932 stp->ap = Action_sort(stp->ap);
933 for(ap=stp->ap; ap && ap->next; ap=ap->next){
1100 cfp->stp = 0;
1128 cfp->stp = 0;
2618 fprintf(out,"%12s%s (state %2d) ","",tag,plp->cfp->stp->index);
2633 fprintf(fp,"%*s shift %d",indent,ap->sp->name,ap->x.stp->index); in PrintAction()
2662 struct state *stp; local
2671 stp = lemp->sorted[i];
2672 fprintf(fp,"State %d:\n",stp->index);
2673 if( lemp->basisflag ) cfp=stp->bp;
2674 else cfp=stp->cfp;
2694 for(ap=stp->ap; ap; ap=ap->next){
2758 case SHIFT: act = ap->x.stp->index; break;
3141 struct state *stp; /* A pointer to a state */ member
3163 struct state *stp; local
3278 stp = lemp->sorted[i];
3279 stp->nTknAct = stp->nNtAct = 0;
3280 stp->iDflt = lemp->nstate + lemp->nrule;
3281 stp->iTknOfst = NO_OFFSET;
3282 stp->iNtOfst = NO_OFFSET;
3283 for(ap=stp->ap; ap; ap=ap->next){
3286 stp->nTknAct++;
3288 stp->nNtAct++;
3290 stp->iDflt = compute_action(lemp, ap);
3294 ax[i*2].stp = stp;
3296 ax[i*2].nAction = stp->nTknAct;
3297 ax[i*2+1].stp = stp;
3299 ax[i*2+1].nAction = stp->nNtAct;
3311 stp = ax[i].stp;
3313 for(ap=stp->ap; ap; ap=ap->next){
3320 stp->iTknOfst = acttab_insert(pActtab);
3321 if( stp->iTknOfst<mnTknOfst ) mnTknOfst = stp->iTknOfst;
3322 if( stp->iTknOfst>mxTknOfst ) mxTknOfst = stp->iTknOfst;
3324 for(ap=stp->ap; ap; ap=ap->next){
3332 stp->iNtOfst = acttab_insert(pActtab);
3333 if( stp->iNtOfst<mnNtOfst ) mnNtOfst = stp->iNtOfst;
3334 if( stp->iNtOfst>mxNtOfst ) mxNtOfst = stp->iNtOfst;
3379 stp = lemp->sorted[i];
3380 ofst = stp->iTknOfst;
3400 stp = lemp->sorted[i];
3401 ofst = stp->iNtOfst;
3418 stp = lemp->sorted[i];
3420 fprintf(out, " %4d,", stp->iDflt);
3593 struct state *stp; local
3600 stp = lemp->sorted[i];
3604 for(ap=stp->ap; ap; ap=ap->next){
3627 for(ap=stp->ap; ap; ap=ap->next){
3635 stp->ap = Action_sort(stp->ap);