Lines Matching defs:stp

221   struct state *stp;       /* Pointer to state which contains this */
245 struct state *stp; /* The new state, if a shift */
435 newaction->x.stp = (struct state *)arg;
811 struct state *stp;
819 stp = State_find(bp);
820 if( stp ){
825 for(x=bp, y=stp->bp; x && y; x=x->bp, y=y->bp){
837 stp = State_new(); /* A new state structure */
838 MemoryCheck(stp);
839 stp->bp = bp; /* Remember the configuration basis */
840 stp->cfp = cfp; /* Remember the configuration closure */
841 stp->statenum = lemp->nstate++; /* Every state gets a sequence number */
842 stp->ap = 0; /* No actions, yet. */
843 State_insert(stp,stp->bp); /* Add to the state table */
844 buildshifts(lemp,stp); /* Recursively compute successor states */
846 return stp;
868 PRIVATE void buildshifts(struct lemon *lemp, struct state *stp)
870 struct config *cfp; /* For looping thru the config closure of "stp" */
871 struct config *bcfp; /* For the inner loop on config closure of "stp" */
879 for(cfp=stp->cfp; cfp; cfp=cfp->next) cfp->status = INCOMPLETE;
881 /* Loop through all configurations of the state "stp" */
882 for(cfp=stp->cfp; cfp; cfp=cfp->next){
888 /* For every configuration in the state "stp" which has the symbol "sp"
905 /* The state "newstp" is reached from the state "stp" by a shift action
910 Action_add(&stp->ap,SHIFT,sp->subsym[i],(char*)newstp);
913 Action_add(&stp->ap,SHIFT,sp,(char *)newstp);
925 struct state *stp;
932 stp = lemp->sorted[i];
933 for(cfp=stp->cfp; cfp; cfp=cfp->next){
934 cfp->stp = stp;
941 stp = lemp->sorted[i];
942 for(cfp=stp->cfp; cfp; cfp=cfp->next){
996 struct state *stp;
1005 stp = lemp->sorted[i];
1006 for(cfp=stp->cfp; cfp; cfp=cfp->next){ /* Loop over all configurations */
1010 /* Add a reduce action to the state "stp" which will reduce by the
1012 Action_add(&stp->ap,REDUCE,lemp->symbols[j],(char *)cfp->rp);
1034 struct state *stp;
1035 stp = lemp->sorted[i];
1036 /* assert( stp->ap ); */
1037 stp->ap = Action_sort(stp->ap);
1038 for(ap=stp->ap; ap && ap->next; ap=ap->next){
1212 cfp->stp = 0;
1238 cfp->stp = 0;
2879 fprintf(out,"%12s%s (state %2d) ","",tag,plp->cfp->stp->statenum);
2894 fprintf(fp,"%*s shift %d",indent,ap->sp->name,ap->x.stp->statenum);
2912 indent,ap->sp->name,ap->x.stp->statenum);
2917 indent,ap->sp->name,ap->x.stp->statenum);
2941 struct state *stp;
2949 stp = lemp->sorted[i];
2950 fprintf(fp,"State %d:\n",stp->statenum);
2951 if( lemp->basisflag ) cfp=stp->bp;
2952 else cfp=stp->cfp;
2972 for(ap=stp->ap; ap; ap=ap->next){
3056 case SHIFT: act = ap->x.stp->statenum; break;
3560 struct state *stp; /* A pointer to a state */
3608 struct state *stp;
3723 stp = lemp->sorted[i];
3724 ax[i*2].stp = stp;
3726 ax[i*2].nAction = stp->nTknAct;
3727 ax[i*2+1].stp = stp;
3729 ax[i*2+1].nAction = stp->nNtAct;
3742 stp = ax[i].stp;
3744 for(ap=stp->ap; ap; ap=ap->next){
3751 stp->iTknOfst = acttab_insert(pActtab);
3752 if( stp->iTknOfst<mnTknOfst ) mnTknOfst = stp->iTknOfst;
3753 if( stp->iTknOfst>mxTknOfst ) mxTknOfst = stp->iTknOfst;
3755 for(ap=stp->ap; ap; ap=ap->next){
3763 stp->iNtOfst = acttab_insert(pActtab);
3764 if( stp->iNtOfst<mnNtOfst ) mnNtOfst = stp->iNtOfst;
3765 if( stp->iNtOfst>mxNtOfst ) mxNtOfst = stp->iNtOfst;
3815 stp = lemp->sorted[i];
3816 ofst = stp->iTknOfst;
3840 stp = lemp->sorted[i];
3841 ofst = stp->iNtOfst;
3858 stp = lemp->sorted[i];
3860 fprintf(out, " %4d,", stp->iDflt);
4086 struct state *stp;
4094 stp = lemp->sorted[i];
4099 for(ap=stp->ap; ap; ap=ap->next){
4128 for(ap=stp->ap; ap; ap=ap->next){
4136 stp->ap = Action_sort(stp->ap);
4171 struct state *stp;
4175 stp = lemp->sorted[i];
4176 stp->nTknAct = stp->nNtAct = 0;
4177 stp->iDflt = lemp->nstate + lemp->nrule;
4178 stp->iTknOfst = NO_OFFSET;
4179 stp->iNtOfst = NO_OFFSET;
4180 for(ap=stp->ap; ap; ap=ap->next){
4183 stp->nTknAct++;
4185 stp->nNtAct++;
4187 stp->iDflt = compute_action(lemp, ap);