char *funcbuf [256];
void parse_funcdef ()
{
int n = *p++;
expect(’{’);
funcbuf[n] = p;
while (*p != ’\0’ && *p++ != ’}’)
;
}
41
Slide 44
Slide 44 text
int parse_funccall () {
// ... process of P()...
// then other functions
if (’A’ <= *p && *p <= ’Z’) {
int name = *p;
p++;
expect(’(’);
expect(’)’);
char *old_p = p;
p = funcbuf[name ];
int ival = parse_exprs ();
p = old_p;
return ival;
}
return parse_integer ();
}
42