private CallExpressionNode Call(IdentifierNode ident) { CallExpressionNode itsAST; SourceCodePosition itsPos = _currentToken.SourcePosition; Accept(Token.TokenType.LeftParen); ArgumentSequenceNode itsArgs = Arguments(); Accept(Token.TokenType.RightParen); itsAST = new CallExpressionNode(ident, itsArgs, itsPos); return(itsAST); }
private ArgumentSequenceNode ParseArguments() { ArgumentSequenceNode itsAST; SourceCodePosition itsPos = _currentToken.SourcePosition; ExpressionArgumentNode itsArg = ParseArgument(); if (_currentToken.Type == Token.TokenType.Comma) { Accept(Token.TokenType.Comma); ArgumentSequenceNode itsNextArgs = ParseArguments(); itsAST = new MultipleArgumentSequenceNode(itsArg, itsNextArgs, itsPos); } else { itsAST = new SingleArgumentSequenceNode(itsArg, itsPos); } return(itsAST); }
public CallExpressionNode(IdentifierNode ident, ArgumentSequenceNode args, SourceCodePosition pos) : base(pos) { Identifier = ident; Arguments = args; }