public override object VisitTypeDotExpression([NotNull] DoshikParser.TypeDotExpressionContext context)
        {
            SetWholeExpression(context);
            VisitChildren(context);
            _compilationContext.SetParsingAntlrContext(context);

            var node = new TypeDotExpressionNode(context);

            var foundType = GetTypeNameVisitor.Apply(_compilationContext, context.left);

            foundType.ThrowIfNotFound(_compilationContext);

            node.LeftType = foundType.DataType;

            if (context.rightIdentifier != null)
            {
                node.RightIdentifier = context.rightIdentifier.Text;
            }
            else
            {
                node.RightMethodCallData = new MethodCallExpressionNodeData();
                GetMethodCallData(context.rightMethodCall, node.RightMethodCallData);
            }

            Sequence.Sequence.Add(node);

            return(null);
        }
Beispiel #2
0
        private IExpression HandleTypeDotExpressionNode(TypeDotExpressionNode node)
        {
            if (node.RightIdentifier != null)
            {
                throw _compilationContext.ThrowCompilationError("static properties are not supported yet");
            }

            return(CreateStaticMethodCallExpression(node.LeftType, node.RightMethodCallData));
        }