Lines Matching defs:stp

177   struct state *stp;       /* Pointer to state which contains this */
200 struct state *stp; /* The new state, if a shift */
389 new->x.stp = (struct state *)arg;
727 struct state *stp;
735 stp = State_find(bp);
736 if( stp ){
741 for(x=bp, y=stp->bp; x && y; x=x->bp, y=y->bp){
753 stp = State_new(); /* A new state structure */
754 MemoryCheck(stp);
755 stp->bp = bp; /* Remember the configuration basis */
756 stp->cfp = cfp; /* Remember the configuration closure */
757 stp->index = lemp->nstate++; /* Every state gets a sequence number */
758 stp->ap = 0; /* No actions, yet. */
759 State_insert(stp,stp->bp); /* Add to the state table */
760 buildshifts(lemp,stp); /* Recursively compute successor states */
762 return stp;
768 PRIVATE void buildshifts(lemp,stp)
770 struct state *stp; /* The state from which successors are computed */
772 struct config *cfp; /* For looping thru the config closure of "stp" */
773 struct config *bcfp; /* For the inner loop on config closure of "stp" */
781 for(cfp=stp->cfp; cfp; cfp=cfp->next) cfp->status = INCOMPLETE;
783 /* Loop through all configurations of the state "stp" */
784 for(cfp=stp->cfp; cfp; cfp=cfp->next){
790 /* For every configuration in the state "stp" which has the symbol "sp"
807 /* The state "newstp" is reached from the state "stp" by a shift action
809 Action_add(&stp->ap,SHIFT,sp,(char *)newstp);
821 struct state *stp;
828 stp = lemp->sorted[i];
829 for(cfp=stp->cfp; cfp; cfp=cfp->next){
830 cfp->stp = stp;
837 stp = lemp->sorted[i];
838 for(cfp=stp->cfp; cfp; cfp=cfp->next){
894 struct state *stp;
903 stp = lemp->sorted[i];
904 for(cfp=stp->cfp; cfp; cfp=cfp->next){ /* Loop over all configurations */
908 /* Add a reduce action to the state "stp" which will reduce by the
910 Action_add(&stp->ap,REDUCE,lemp->symbols[j],(char *)cfp->rp);
932 struct state *stp;
933 stp = lemp->sorted[i];
934 assert( stp->ap );
935 stp->ap = Action_sort(stp->ap);
936 for(ap=stp->ap; ap && ap->next; ap=ap->next){
1103 cfp->stp = 0;
1131 cfp->stp = 0;
2621 fprintf(out,"%12s%s (state %2d) ","",tag,plp->cfp->stp->index);
2636 fprintf(fp,"%*s shift %d",indent,ap->sp->name,ap->x.stp->index);
2665 struct state *stp;
2674 stp = lemp->sorted[i];
2675 fprintf(fp,"State %d:\n",stp->index);
2676 if( lemp->basisflag ) cfp=stp->bp;
2677 else cfp=stp->cfp;
2697 for(ap=stp->ap; ap; ap=ap->next){
2761 case SHIFT: act = ap->x.stp->index; break;
3144 struct state *stp; /* A pointer to a state */
3166 struct state *stp;
3281 stp = lemp->sorted[i];
3282 stp->nTknAct = stp->nNtAct = 0;
3283 stp->iDflt = lemp->nstate + lemp->nrule;
3284 stp->iTknOfst = NO_OFFSET;
3285 stp->iNtOfst = NO_OFFSET;
3286 for(ap=stp->ap; ap; ap=ap->next){
3289 stp->nTknAct++;
3291 stp->nNtAct++;
3293 stp->iDflt = compute_action(lemp, ap);
3297 ax[i*2].stp = stp;
3299 ax[i*2].nAction = stp->nTknAct;
3300 ax[i*2+1].stp = stp;
3302 ax[i*2+1].nAction = stp->nNtAct;
3314 stp = ax[i].stp;
3316 for(ap=stp->ap; ap; ap=ap->next){
3323 stp->iTknOfst = acttab_insert(pActtab);
3324 if( stp->iTknOfst<mnTknOfst ) mnTknOfst = stp->iTknOfst;
3325 if( stp->iTknOfst>mxTknOfst ) mxTknOfst = stp->iTknOfst;
3327 for(ap=stp->ap; ap; ap=ap->next){
3335 stp->iNtOfst = acttab_insert(pActtab);
3336 if( stp->iNtOfst<mnNtOfst ) mnNtOfst = stp->iNtOfst;
3337 if( stp->iNtOfst>mxNtOfst ) mxNtOfst = stp->iNtOfst;
3382 stp = lemp->sorted[i];
3383 ofst = stp->iTknOfst;
3403 stp = lemp->sorted[i];
3404 ofst = stp->iNtOfst;
3421 stp = lemp->sorted[i];
3423 fprintf(out, " %4d,", stp->iDflt);
3596 struct state *stp;
3603 stp = lemp->sorted[i];
3607 for(ap=stp->ap; ap; ap=ap->next){
3630 for(ap=stp->ap; ap; ap=ap->next){
3638 stp->ap = Action_sort(stp->ap);