if (isalpha(c)) {
Symbol *s;
char sbuf[100], *p = sbuf;
do {
if (p >= sbuf + sizeof(sbuf) - 1) {
*p = '\0';
execerror("name too long", sbuf);
}
*p++ = c;
} while ((c=getc(fin)) != EOF && isalnum(c));
ungetc(c, fin);
*p = '\0';
if ((s=lookup(sbuf)) == 0)
s = install(sbuf, UNDEF, 0.0);
yylval.sym = s;
return s->type == UNDEF ? VAR : s->type;
}
if (c == '$') { /* argument? */
int n = 0;
while (isdigit(c=getc(fin)))
n=10*n+c- '0';
ungetc(c, fin);
if (n == 0)
execerror("strange $...", (char*)0);
yylval.narg = n;
return ARG;
}
if (c == '"') { /* quoted string */
char sbuf[100], *p, *emalloc();
for (p = sbuf; (c=getc(fin)) != '"'; p++) {