private AST fromMinToMaxArrayCreation()
{
#if WRITE_DEBUG_INFO
Console.WriteLine("fromMinToMaxArrayCreation");
#endif
try {
Token fromToken = match(Token.TokenType.FROM);
AST minValue = expression();
if(minValue == null) { throw new Error("Missing expression after 'from'",
Error.ErrorType.SYNTAX,
fromToken.LineNr, fromToken.LinePosition + 5 ); }
match(Token.TokenType.TO);
AST maxValue = expression();
if(maxValue == null) { throw new Error("Missing expression after 'to'",
Error.ErrorType.SYNTAX,
fromToken.LineNr, fromToken.LinePosition + 3 ); }
AST_FunctionCall callRangeFunction = new AST_FunctionCall(new Token(Token.TokenType.FUNCTION_CALL, "Range"));
AST argumentList = new AST(new Token(Token.TokenType.NODE_GROUP, "<ARGUMENT_LIST>"));
argumentList.addChild(minValue);
argumentList.addChild(maxValue);
callRangeFunction.addChild(argumentList);
return callRangeFunction;
}
catch(Error e) {
m_errorHandler.errorOccured(e);
return null;
}
}