Lines Matching refs:vp
90 #define getchr(vp) (*(vp)->nextchr++) argument
91 #define peekchr(vp) (*(vp)->nextchr) argument
92 #define ungetchr(vp) ((vp)->nextchr--) argument
111 #define ERROR(vp,msg) return(seterror((vp),msg)) argument
116 static int _seterror(struct vars *vp,const char *msg) in _seterror() argument
118 if(!vp->errmsg.value) in _seterror()
119 vp->errmsg.value = (char*)msg; in _seterror()
120 vp->errchr = vp->nextchr; in _seterror()
121 vp->nextchr = ""; in _seterror()
427 static int gettok(register struct vars *vp) in gettok() argument
430 vp->errchr = vp->nextchr; in gettok()
433 c = getchr(vp); in gettok()
437 vp->errchr = vp->nextchr; in gettok()
440 vp->nextchr--; in gettok()
443 if(sh.decomma && (c=peekchr(vp))>='0' && c<='9') in gettok()
450 if((c=peekchr(vp))>='0' && c<='9') in gettok()
457 ungetchr(vp); in gettok()
460 if(peekchr(vp)==':') in gettok()
462 getchr(vp); in gettok()
467 if(peekchr(vp)==c) in gettok()
469 getchr(vp); in gettok()
481 if(peekchr(vp)==c) in gettok()
483 getchr(vp); in gettok()
495 static int expr(register struct vars *vp,register int precedence) in expr() argument
506 op = gettok(vp); in expr()
514 ERROR(vp,e_moretokens); in expr()
532 if(!expr(vp,c)) in expr()
537 vp->nextchr = vp->errchr; in expr()
544 op = gettok(vp); in expr()
548 ERROR(vp,e_synbad); in expr()
552 ERROR(vp,e_synbad); in expr()
554 if(peekchr(vp)== '=' && !(strval_precedence[op]&NOASSIGN)) in expr()
557 ERROR(vp,e_notlvalue); in expr()
561 getchr(vp); in expr()
574 if(vp->staksize++>=vp->stakmaxsize) in expr()
575 vp->stakmaxsize = vp->staksize; in expr()
577 stakpush(vp,lvalue.value,char*); in expr()
580 stakpush(vp,lvalue.flag,short); in expr()
581 if(vp->nextchr==0) in expr()
582 ERROR(vp,e_badnum); in expr()
588 ERROR(vp,e_notlvalue); in expr()
590 ERROR(vp,e_synbad); in expr()
598 if(!expr(vp,c)) in expr()
604 if(!vp->paren) in expr()
605 ERROR(vp,e_paren); in expr()
607 ERROR(vp,e_synbad); in expr()
612 if(vp->infun) in expr()
613 vp->infun++; in expr()
617 vp->staksize--; in expr()
619 if(!expr(vp,c)) in expr()
629 int infun = vp->infun; in expr()
636 if(vp->staksize++>=vp->stakmaxsize) in expr()
637 vp->stakmaxsize = vp->staksize; in expr()
638 vp->infun=1; in expr()
640 stakpush(vp,fun,Math_f); in expr()
644 vp->infun = 0; in expr()
646 ERROR(vp,e_synbad); in expr()
647 vp->paren++; in expr()
648 if(!expr(vp,1)) in expr()
650 vp->paren--; in expr()
655 if(vp->infun != nargs) in expr()
656 ERROR(vp,e_argcount); in expr()
657 if(vp->staksize+=nargs>=vp->stakmaxsize) in expr()
658 vp->stakmaxsize = vp->staksize+nargs; in expr()
660 vp->staksize -= nargs; in expr()
662 vp->infun = infun; in expr()
663 if (gettok(vp) != A_RPAR) in expr()
664 ERROR(vp,e_paren); in expr()
675 ERROR(vp,e_notlvalue); in expr()
679 stakpush(vp,lvalue.value,char*); in expr()
680 stakpush(vp,lvalue.flag,short); in expr()
681 vp->staksize--; in expr()
692 offset1 = stakpush(vp,0,short); in expr()
694 if(!expr(vp,1)) in expr()
696 if(gettok(vp)!=A_COLON) in expr()
697 ERROR(vp,e_questcolon); in expr()
699 offset2 = stakpush(vp,0,short); in expr()
702 if(!expr(vp,3)) in expr()
711 ERROR(vp,e_badcolon); in expr()
724 offset = stakpush(vp,0,short); in expr()
726 if(!expr(vp,c)) in expr()
743 vp->staksize--; in expr()
747 ERROR(vp,e_synbad); in expr()
750 if(*vp->nextchr=='L' && vp->nextchr[1]=='\'') in expr()
752 vp->nextchr++; in expr()
755 pos = vp->nextchr; in expr()
757 lvalue.expr = vp->expr; in expr()
758 lvalue.emode = vp->emode; in expr()
765 vp->nextchr +=2; in expr()
768 d = chresc(pos+1,(char**)&vp->nextchr); in expr()
770 if(*vp->nextchr=='\'') in expr()
771 vp->nextchr++; in expr()
774 d = (*vp->convert)(&vp->nextchr, &lvalue, LOOKUP, 0); in expr()
775 if (vp->nextchr == pos) in expr()
777 if(vp->errmsg.value = lvalue.value) in expr()
778 vp->errstr = pos; in expr()
779 ERROR(vp,op==A_LIT?e_charconst:e_synbad); in expr()
784 if(vp->staksize++>=vp->stakmaxsize) in expr()
785 vp->stakmaxsize = vp->staksize; in expr()
786 stakpush(vp,d,Sfdouble_t); in expr()
798 if(vp->staksize++>=vp->stakmaxsize) in expr()
799 vp->stakmaxsize = vp->staksize; in expr()
803 stakpush(vp,assignop.value,char*); in expr()
804 stakpush(vp,assignop.flag,short); in expr()
808 vp->nextchr = vp->errchr; in expr()