protected void EncapsulateNoValue(LogicalExpression expression)
        {
            if (expression is ValueExpression)
            {
                expression.Accept(this);
            }
            else
            {
                Result.Append("(");
                expression.Accept(this);

                // trim spaces before adding a closing paren
                while (Result[Result.Length - 1] == ' ')
                {
                    Result.Remove(Result.Length - 1, 1);
                }

                Result.Append(") ");
            }
        }
 public override void Visit(LogicalExpression expression)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Example #3
0
 public BinaryExpression GreaterOrEqualThan(LogicalExpression operand)
 {
     return(new BinaryExpression(BinaryExpressionType.GreaterOrEqual, this, operand));
 }
Example #4
0
 public BinaryExpression DividedBy(LogicalExpression operand)
 {
     return(new BinaryExpression(BinaryExpressionType.Div, this, operand));
 }
Example #5
0
 public BinaryExpression EqualsTo(LogicalExpression operand)
 {
     return(new BinaryExpression(BinaryExpressionType.Equal, this, operand));
 }
Example #6
0
 public BinaryExpression RightShift(LogicalExpression operand)
 {
     return(new BinaryExpression(BinaryExpressionType.RightShift, this, operand));
 }
Example #7
0
 public BinaryExpression And(LogicalExpression operand)
 {
     return(new BinaryExpression(BinaryExpressionType.And, this, operand));
 }
Example #8
0
 public BinaryExpression Mult(LogicalExpression operand)
 {
     return(new BinaryExpression(BinaryExpressionType.Times, this, operand));
 }
Example #9
0
 public BinaryExpression BitwiseXOr(LogicalExpression operand)
 {
     return(new BinaryExpression(BinaryExpressionType.BitwiseXOr, this, operand));
 }
Example #10
0
 public BinaryExpression Plus(LogicalExpression operand)
 {
     return(new BinaryExpression(BinaryExpressionType.Plus, this, operand));
 }
Example #11
0
 public BinaryExpression NotEqual(LogicalExpression operand)
 {
     return(new BinaryExpression(BinaryExpressionType.NotEqual, this, operand));
 }
Example #12
0
 public BinaryExpression Modulo(LogicalExpression operand)
 {
     return(new BinaryExpression(BinaryExpressionType.Modulo, this, operand));
 }
Example #13
0
 public BinaryExpression LesserThan(LogicalExpression operand)
 {
     return(new BinaryExpression(BinaryExpressionType.Lesser, this, operand));
 }
 private object Evaluate(LogicalExpression expression)
 {
     expression.Accept(this);
     return(Result);
 }