예제 #1
0
        protected LiteralNode FindCoercionType(int index, bool nested)
        {
            if (index != 0 && index != 2)
            {
                return(null);
            }

            LiteralNode node = FindChild <LiteralNode>(OppositeSide(index)); // look at what the child operand is being compared to

            if (node == null && (Index == 0 || Index == 2))
            {
                node = Parent.FindChild <LiteralNode>(OppositeSide(this.Index)); // look at what the whole expression is being compared to
            }
            // if we don't find any literals in the area look, for a predicate expression that can drive the type coercion
            if (node == null)
            {
                PredicateNode predicate = FindChild <PredicateNode>(OppositeSide(index)); // look at what the child operand is being compared to
                if (predicate == null && (Index == 0 || Index == 2))
                {
                    predicate = Parent.FindChild <PredicateNode>(OppositeSide(this.Index)); // look at what the whole expression is being compared to
                }
                if (predicate != null && !nested)
                {
                    node = predicate.GetExpressionType(true);
                }
            }

            return(node);
        }
예제 #2
0
        internal override LiteralNode GetExpressionType()
        {
            PredicateNode p = FindChild <PredicateNode>(1);

            if (p != null)
            {
                return(p.GetExpressionType());
            }

            return(base.GetExpressionType());
        }