Пример #1
0
        public override Tree VisitPrimary(PrimaryContext primary)
        {
            var expressionContext = primary.parenthesized;

            if (expressionContext != null)
            {
                return((Expression)VisitExpression(expressionContext));
            }
            LiteralContext literal = primary.literal();

            if (literal != null)
            {
                return((Expression)VisitLiteral(literal));
            }
            ITerminalNode identifier = primary.Identifier();

            if (identifier != null)
            {
                return(makeIdentifier(identifier));
            }
            return(new This(primary.start.Line, primary.start.Column, primary.stop.Line, primary.stop.Column));
        }