Inheritance: PolyadicOperatorExpression
 public virtual void Visit(LogicalOrExpression node)
 {
     Visit((PolyadicOperatorExpression)node);
 }
Example #2
0
        /// <summary>
        ///     <code>higherPRJExpr ( ( '||' | 'OR' ) higherPRJExpr )*</code>
        /// </summary>
        /// <exception cref="System.SqlSyntaxErrorException" />
        private IExpression LogicalOrExpression()
        {
            LogicalOrExpression or = null;
            for (var expr = LogicalXORExpression();;)
            {
                switch (lexer.Token())
                {
                    case MySqlToken.OpLogicalOr:
                    case MySqlToken.KwOr:
                    {
                        lexer.NextToken();
                        if (or == null)
                        {
                            or = new LogicalOrExpression();
                            or.SetCacheEvalRst(cacheEvalRst);
                            or.AppendOperand(expr);
                            expr = or;
                        }
                        var newExpr = LogicalXORExpression();
                        or.AppendOperand(newExpr);
                        break;
                    }

                    default:
                    {
                        return expr;
                    }
                }
            }
        }