Ejemplo n.º 1
0
void Parser::VarList()
{
	ExprRec var, index;
	/* Listen to the first variable */
	Variable(var, index);
	code.ProcessVar(var, index); /*** CODE ***/
	code.Listen(var, index); /*** CODE ***/
	/* Listen for the next variables */
	VarListTail(var, index);
}
Ejemplo n.º 2
0
void Parser::VarListTail(ExprRec& var, ExprRec& index) {
	switch (NextToken()) {
	case COMMA:
		Match(COMMA);
		Variable(var, index);
		code.ProcessVar(var, index); /*** CODE ***/
		code.Listen(var, index); /*** CODE ***/
		/* Recursion for other variables */
		VarListTail(var, index);
		break;
	case SEMICOLON:
		break;
	default:
		SyntaxError(NextToken(), "VarListTail");
	}
}