public override LessNode VisitCondition(LessParser.ConditionContext context)
        {
            bool negate = context.NOT() != null;

            var conditionStatement = context.conditionStatement();
            var comparison         = conditionStatement.comparison();

            if (comparison != null)
            {
                var    lhs = (Expression)comparison.expression(0).Accept(this);
                string op  = comparison.comparisonOperator().GetText();
                var    rhs = (Expression)comparison.expression(1).Accept(this);

                return(new ComparisonCondition(negate, lhs, op, rhs));
            }

            return(new BooleanExpressionCondition(negate, (Expression)conditionStatement.expression().Accept(this)));
        }
예제 #2
0
 public virtual LessNode VisitCondition(LessParser.ConditionContext context)
 {
     throw new System.NotImplementedException();
 }