Ejemplo n.º 1
0
        private IASTNode CreatePredicateRightValue(MySqlCommandParser.BooleanPrimaryContext ctx)
        {
            if (null != ctx.subquery())
            {
                new SubQuerySegment(ctx.Start.StartIndex, ctx.Stop.StopIndex, (SelectCommand)Visit(ctx.subquery()));
            }
            IASTNode rightValue = Visit(ctx.predicate());

            return(CreatePredicateRightValue(ctx, rightValue));
        }
Ejemplo n.º 2
0
 public override IASTNode VisitBooleanPrimary(MySqlCommandParser.BooleanPrimaryContext ctx)
 {
     if (null != ctx.comparisonOperator() || null != ctx.SAFE_EQ_())
     {
         return(CreateCompareSegment(ctx));
     }
     if (null != ctx.predicate())
     {
         return(Visit(ctx.predicate()));
     }
     if (null != ctx.subquery())
     {
         return(new SubQuerySegment(ctx.Start.StartIndex, ctx.Stop.StopIndex, (SelectCommand)Visit(ctx.subquery())));
     }
     //TODO deal with IS NOT? (TRUE | FALSE | UNKNOWN | NULL)
     return(new CommonExpressionSegment(ctx.Start.StartIndex, ctx.Stop.StopIndex, ctx.GetText()));
 }