switch (tok)
{
case ID:
/* <statement> ::= ID := <expression> ; */
target = ident();
match(ASSIGNOP);
expression();
assign(target, source);
match(SEMICOLON);
break;
case READ:
/* <statement> ::= READ ( <id list> ) ; */
match(READ);
match(LPAREN);
id_list();
match(RPAREN);
match(SEMICOLON);
break;
case WRITE:
/* <statement> ::= WRITE ( <expr list> ) ;
*/
match(WRITE);
match(LPAREN);
expr_list();
match(RPAREN);
match(SEMICOLON);
break;
default:
syntax_error(tok);
break;
}
}