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

            var node = new EqualsExpressionNode(context);

            node.Left  = Sequence.FindExpressionByAntlrContext(context.left);
            node.Right = Sequence.FindExpressionByAntlrContext(context.right);

            if ([email protected] == DoshikParser.EQUAL)
            {
                node.Operator = EqualsExpressionNode.OperatorOption.Equals;
            }
            else if ([email protected] == DoshikParser.NOTEQUAL)
            {
                node.Operator = EqualsExpressionNode.OperatorOption.NotEquals;
            }
            else
            {
                throw new System.NotImplementedException();
            }

            Sequence.Sequence.Add(node);

            return(null);
        }
Ejemplo n.º 2
0
        private IExpression HandleEqualsExpressionNode(EqualsExpressionNode node)
        {
            switch (node.Operator)
            {
            case EqualsExpressionNode.OperatorOption.Equals:
                return(CreateStaticMethodCallExpressionForBinaryOperator("op_Equality", node.Left, node.Right));

            case EqualsExpressionNode.OperatorOption.NotEquals:
                return(CreateStaticMethodCallExpressionForBinaryOperator("op_Inequality", node.Left, node.Right));

            default:
                throw new NotImplementedException();
            }
        }