Exemplo n.º 1
0
        public UstNode VisitComparisonExpression([NotNull] DslParser.ComparisonExpressionContext context)
        {
            var left      = (Expression)VisitExpression(context.expression(0));
            var right     = (Expression)VisitExpression(context.expression(1));
            var opLiteral = new BinaryOperatorLiteral(BinaryOperatorLiteral.TextBinaryOperator[context.op.Text],
                                                      context.op.GetTextSpan(), null);
            var result = new BinaryOperatorExpression(left, opLiteral, right, context.GetTextSpan(), null);

            return(result);
        }
Exemplo n.º 2
0
        public PatternUst VisitComparisonExpression([NotNull] DslParser.ComparisonExpressionContext context)
        {
            PatternUst left      = VisitExpression(context.expression(0));
            PatternUst right     = VisitExpression(context.expression(1));
            var        opLiteral = new PatternBinaryOperatorLiteral(context.op.Text, context.op.GetTextSpan());
            var        result    = new PatternBinaryOperatorExpression(left, opLiteral, right, context.GetTextSpan());

            return(result);
        }