Beispiel #1
0
        private ExpressionBase Call()
        {
            var expression = Primary();

            while (true)
            {
                if (NextTokenMatches(TokenType.LeftParen))
                {
                    expression = FinishCall(expression);
                }
                else if (NextTokenMatches(TokenType.Dot))
                {
                    var name = Consume(TokenType.Identifier, "Expected identifier after '.'.");
                    expression = new GetExpression(expression, name);
                }
                else
                {
                    break;
                }
            }

            return(expression);
        }
Beispiel #2
0
 public object VisitGetExpression(GetExpression expression)
 {
     expression.Object.Accept(this);
     return(null);
 }
Beispiel #3
0
 public string VisitGetExpression(GetExpression expression)
 {
     throw new System.NotImplementedException();
 }