Esempio n. 1
0
        private SoqlExpression ParseMultiplicativeException()
        {
            SoqlExpression e = ParseLiteralExpression();

            while (true)
            {
                if (tokenizer.IsToken(SoqlTokenType.Mul))
                {
                    tokenizer.GetNextToken();
                    e = new SoqlBinaryExpression(e, ParseLiteralExpression(), SoqlBinaryOperator.Mul);
                }
                else if (tokenizer.IsToken(SoqlTokenType.Div))
                {
                    tokenizer.GetNextToken();
                    e = new SoqlBinaryExpression(e, ParseLiteralExpression(), SoqlBinaryOperator.Div);
                }
                else if (tokenizer.IsToken(SoqlTokenType.Mod))
                {
                    tokenizer.GetNextToken();
                    e = new SoqlBinaryExpression(e, ParseLiteralExpression(), SoqlBinaryOperator.Mod);
                }
                else
                {
                    break;
                }
            }
            return(e);
        }
 public virtual void Visit(SoqlBinaryExpression v)
 {
     Output.Write('(');
     v.par1.Accept(this);
     Output.Write(' ');
     Write(v.op);
     Output.Write(' ');
     v.par2.Accept(this);
     Output.Write(')');
 }
Esempio n. 3
0
        private SoqlExpression ParseAdditiveExpression()
        {
            SoqlExpression e = ParseMultiplicativeException();

            while (true)
            {
                if (tokenizer.IsToken(SoqlTokenType.Add))
                {
                    tokenizer.GetNextToken();
                    e = new SoqlBinaryExpression(e, ParseMultiplicativeException(), SoqlBinaryOperator.Add);
                }
                else if (tokenizer.IsToken(SoqlTokenType.Sub))
                {
                    tokenizer.GetNextToken();
                    e = new SoqlBinaryExpression(e, ParseMultiplicativeException(), SoqlBinaryOperator.Sub);
                }
                else
                    break;
            }
            return e;
        }
 public virtual void Visit(SoqlBinaryExpression v)
 {
     Output.Write('(');
     v.par1.Accept(this);
     Output.Write(' ');
     Write(v.op);
     Output.Write(' ');
     v.par2.Accept(this);
     Output.Write(')');
 }
 void Sooda.QL.ISoqlVisitor.Visit(SoqlBinaryExpression v)
 {
     v.par1.Accept(this);
     v.par2.Accept(this);
 }
 void Sooda.QL.ISoqlVisitor.Visit(SoqlBinaryExpression v)
 {
     v.par1.Accept(this);
     v.par2.Accept(this);
 }