关于Basic程序解释器及编译原理的简单化(1)--词法分析和代数式求值(4) case NUMBER: *result = atoi(token); get_token(); return; default: serror(0); }}
/* perform the specified arithmetic */void arith(char o,int *r,int *h){ register int t,ex; switch (o) { case '-': *r = *r-*h; break; case '+': *r = *r+*h; break; case '*': *r = *r**h; break; case '/': *r = (*r)/(*h); break; case '%': *r = (*r)%(*h); break; case '^': ex = *r; if (*h==0) { *r = 1;