예제 #1
0
        private IASTNode CreatePredicateRightValue(SqlServerCommandParser.BooleanPrimaryContext context)
        {
            if (null != context.subquery())
            {
                new SubQuerySegment(context.Start.StartIndex, context.Stop.StopIndex, (SelectCommand)Visit(context.subquery()));
            }

            IASTNode rightValue = Visit(context.predicate());

            return(CreatePredicateRightValue(context, rightValue));
        }
예제 #2
0
        public override IASTNode VisitBooleanPrimary(SqlServerCommandParser.BooleanPrimaryContext context)
        {
            if (null != context.comparisonOperator() || null != context.SAFE_EQ_())
            {
                return(CreateCompareSegment(context));
            }

            if (null != context.predicate())
            {
                return(Visit(context.predicate()));
            }

            if (null != context.subquery())
            {
                return(new SubQuerySegment(context.Start.StartIndex, context.Stop.StopIndex, (SelectCommand)Visit(context.subquery())));
            }

            //TODO deal with IS NOT? (TRUE | FALSE | UNKNOWN | NULL)
            return(new CommonExpressionSegment(context.Start.StartIndex, context.Stop.StopIndex, context.GetText()));
        }