10 static long round(long, long);
23 while(quotchar()) /*discard chars to ending quote */
29 * read a floating point number
30 * the result must fit in a WORD
55 { /* term | term dyadic expr | */
64 switch ((int)readchar()) {
78 expv = round(lhs,expv);
110 error("unexpected `)'");
121 { /* item | monadic item | (expr) | */
124 switch ((int)readchar()) {
128 if (geta(cormap, expv, &e) < 0)
135 if (geta(symmap, expv, &e) < 0)
153 error("syntax error: `)' expected");
163 { /* name [ . local ] | number | . | ^ | <register | 'x | | */
168 char gsym[MAXSYM], lsym[MAXSYM];
173 rdc(); /* skip white space */
174 if (lastc == ':') { /* it better be */
175 rdc(); /* skip white space */
176 if (!getnum(readchar))
179 expv = 1; /* file begins at line 1 */
180 expv = file2pc(gsym, expv);
185 error("bad file location");
186 } else if (symchar(0)) {
189 readchar(); /* ugh */
194 } else if (symchar(0)) {
198 if (localaddr(cormap, gsym, lsym, &e, rget) < 0)
203 if (lookup(0, gsym, &s) == 0)
204 error("symbol not found");
208 } else if (getnum(readchar)) {
210 } else if (lastc=='.') {
212 if (!symchar(0) && lastc != '.') {
215 if (findsym(rget(cormap, mach->pc), CTEXT, &s) == 0)
216 error("no current function");
223 if (localaddr(cormap, s.name, lsym, &e, rget) < 0)
228 } else if (lastc=='"') {
230 } else if (lastc=='+') {
232 } else if (lastc=='^') {
233 expv=inkdot(-dotinc);
234 } else if (lastc=='<') {
236 base = regname(savc);
237 expv = rget(cormap, base);
239 else if (lastc=='\'')
242 error("address expected");
252 /* service routines for expression reading */
253 getnum(int (*rdf)(void))
266 if (convdig(lastc) >= MAXBASE)
295 for (cp = num, *cp = lastc; ;(*rdf)()) {
296 if ((d = convdig(lastc)) < base) {
301 else if (lastc == '.') {
315 readsym(char *isymbol)
322 if (p < &isymbol[MAXSYM-UTFmax-1]){
324 p += runetochar(p, &r);
327 } while (symchar(1));
332 readfname(char *filename)
337 /* snarf chars until un-escaped char in terminal char set */
340 if ((c = lastc) != '\\' && p < &filename[MAXSYM-UTFmax-1])
341 p += runetochar(p, &c);
343 } while (c == '\\' || strchr(CMD_VERBS, lastc) == 0);
352 else if (!isxdigit(c))
366 return(isalpha(lastc) || lastc>0x80 || lastc=='_' || dig && isdigit(lastc));
370 round(long a, long b)