public override SoqlExpression Simplify()
        {
            if (this.Right.Count == 0)
            {
                return(SoqlBooleanLiteralExpression.False);
            }

            SoqlExpression        lhsExpression = this.Left.Simplify();
            SoqlBooleanExpression retVal        = null;

            for (int i = 0; i < this.Right.Count; ++i)
            {
                SoqlExpression e = (SoqlExpression)this.Right[i];
                SoqlBooleanRelationalExpression bre =
                    new SoqlBooleanRelationalExpression(lhsExpression, e, SoqlRelationalOperator.Equal);

                if (retVal == null)
                {
                    retVal = bre;
                }
                else
                {
                    retVal = new SoqlBooleanOrExpression(retVal, bre);
                }
            }

            return(retVal.Simplify());
        }
 public virtual void Visit(SoqlBooleanOrExpression v)
 {
     Output.Write('(');
     v.par1.Accept(this);
     Output.Write(" OR ");
     v.par2.Accept(this);
     Output.Write(')');
 }
        private SoqlExpression ParseBooleanOr()
        {
            SoqlExpression e = ParseBooleanAnd();

            while (tokenizer.IsKeyword("or") || tokenizer.IsToken(SoqlTokenType.Or))
            {
                tokenizer.GetNextToken();
                e = new SoqlBooleanOrExpression((SoqlBooleanExpression)e, (SoqlBooleanExpression)ParseBooleanAnd());
            }
            return(e);
        }
        private SoqlExpression ParseBooleanOr()
        {
            SoqlExpression e = ParseBooleanAnd();

            while (tokenizer.IsKeyword("or") || tokenizer.IsToken(SoqlTokenType.Or))
            {
                tokenizer.GetNextToken();
                e = new SoqlBooleanOrExpression((SoqlBooleanExpression)e, (SoqlBooleanExpression)ParseBooleanAnd());
            }
            return e;
        }
        public override SoqlExpression Simplify()
        {
            if (this.Right.Count == 0)
                return SoqlBooleanLiteralExpression.False;

            SoqlExpression lhsExpression = this.Left.Simplify();
            SoqlBooleanExpression retVal = null;

            for (int i = 0; i < this.Right.Count; ++i)
            {
                SoqlExpression e = (SoqlExpression)this.Right[i];
                SoqlBooleanRelationalExpression bre =
                    new SoqlBooleanRelationalExpression(lhsExpression, e, SoqlRelationalOperator.Equal);

                if (retVal == null)
                    retVal = bre;
                else
                    retVal = new SoqlBooleanOrExpression(retVal, bre);
            }

            return retVal.Simplify();
        }
 public virtual void Visit(SoqlBooleanOrExpression v)
 {
     Output.Write('(');
     v.par1.Accept(this);
     Output.Write(" OR ");
     v.par2.Accept(this);
     Output.Write(')');
 }
 void Sooda.QL.ISoqlVisitor.Visit(SoqlBooleanOrExpression v)
 {
     v.par1.Accept(this);
     v.par2.Accept(this);
 }
 void Sooda.QL.ISoqlVisitor.Visit(SoqlBooleanOrExpression v)
 {
     v.par1.Accept(this);
     v.par2.Accept(this);
 }