void statement(void)
{
expr_rec source, target;
switch (next_token) {
case ID:
/* <statement> -> <ident> := <expression> #assign; */
target = ident();
match(ASSIGNOP);
expression(&source);
assign(target, source);
break;
case READ:
/* <statement> -> read ( <id list> ); */
match(READ);
match(LPAREN);
id_list();
match(RPAREN);
break;
case WRITE:
/* <statement -> write ( <expr list> ); */
match(WRITE);
match(LPAREN);
expr_list();
match(RPAREN);
break;
default:
syntax_error(next_token());
}
match(SEMICOLON);
}
Author:
Ming-I Hsieh
(Powered by
FreeBSD,
c2html,
gimp,
vim,
gmake)