Esempio n. 1
0
 public override Net.Vpc.Upa.Types.DataTypeTransform GetEffectiveDataType()
 {
     Net.Vpc.Upa.Types.DataTypeTransform d = GetTypeTransform();
     Net.Vpc.Upa.Impl.Uql.Compiledexpression.DefaultCompiledExpression p = GetParentExpression();
     if (p is Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarVal)
     {
         Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarOrMethod v = ((Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarVal)p).GetVar();
         v = ((Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarOrMethod)v).GetFinest();
         object r = v.GetReferrer();
         if (r is Net.Vpc.Upa.Field)
         {
             return(Net.Vpc.Upa.Impl.Util.UPAUtils.GetTypeTransformOrIdentity((Net.Vpc.Upa.Field)r));
         }
     }
     else if ((p is Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledEquals) || (p is Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledDifferent))
     {
         Net.Vpc.Upa.Impl.Uql.Compiledexpression.DefaultCompiledExpression o = ((Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledBinaryOperatorExpression)p).GetOther(this);
         if (o is Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarOrMethod)
         {
             o = ((Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarOrMethod)o).GetFinest();
             object r = ((Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarOrMethod)o).GetReferrer();
             if (r is Net.Vpc.Upa.Field)
             {
                 return(Net.Vpc.Upa.Impl.Util.UPAUtils.GetTypeTransformOrIdentity((Net.Vpc.Upa.Field)r));
             }
         }
     }
     return(d);
 }
Esempio n. 2
0
 public static Net.Vpc.Upa.Impl.Util.ExprTypeInfo ResolveExprTypeInfo(Net.Vpc.Upa.Impl.Uql.Compiledexpression.DefaultCompiledExpression e, bool byBrother)
 {
     if (e is Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarOrMethod)
     {
         e = ((Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarOrMethod)e).GetFinest();
         object r = ((Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarOrMethod)e).GetReferrer();
         if (r is Net.Vpc.Upa.Field)
         {
             Net.Vpc.Upa.Types.DataTypeTransform tr = GetTypeTransformOrIdentity(((Net.Vpc.Upa.Field)r));
             Net.Vpc.Upa.Impl.Util.ExprTypeInfo  i  = new Net.Vpc.Upa.Impl.Util.ExprTypeInfo();
             i.SetReferrer(r);
             i.SetTransform(tr);
             if (e is Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVar)
             {
                 Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVar cv = (Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVar)e;
                 i.SetOldReferrer(cv.GetOldReferrer());
             }
             return(i);
         }
     }
     if (e is Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarVal)
     {
         Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarOrMethod v = ((Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarVal)e).GetVar();
         return(ResolveExprTypeInfo(v));
     }
     Net.Vpc.Upa.Types.DataTypeTransform typeTransform = e.GetTypeTransform();
     if (e is Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledParam || e is Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledLiteral)
     {
         Net.Vpc.Upa.Impl.Uql.Compiledexpression.DefaultCompiledExpression p = e.GetParentExpression();
         if (p is Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarVal)
         {
             return(ResolveExprTypeInfo(p));
         }
         else
         {
             object @object = (e is Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledParam) ? ((Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledParam)e).GetValue() : ((Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledLiteral)e).GetValue();
             Net.Vpc.Upa.Types.DataType          sourceType = typeTransform.GetSourceType();
             Net.Vpc.Upa.Types.DataTypeTransform bestType   = typeTransform;
             if ((p is Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledBinaryOperatorExpression) && (((Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledBinaryOperatorExpression)p).IsSameOperandsType()))
             {
                 Net.Vpc.Upa.Impl.Uql.Compiledexpression.DefaultCompiledExpression o = ((Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledBinaryOperatorExpression)p).GetOther(e);
                 if (byBrother)
                 {
                     return(ResolveExprTypeInfo(o, false));
                 }
             }
             if (@object != null && (typeTransform.Equals(Net.Vpc.Upa.Impl.Transform.IdentityDataTypeTransform.OBJECT) || !sourceType.IsInstance(@object)))
             {
                 bestType = Net.Vpc.Upa.Impl.Transform.IdentityDataTypeTransform.ForNativeType(@object.GetType());
             }
             Net.Vpc.Upa.Impl.Util.ExprTypeInfo typeInfo1 = new Net.Vpc.Upa.Impl.Util.ExprTypeInfo();
             typeInfo1.SetTransform(bestType);
             return(typeInfo1);
         }
     }
     Net.Vpc.Upa.Impl.Util.ExprTypeInfo typeInfo2 = new Net.Vpc.Upa.Impl.Util.ExprTypeInfo();
     typeInfo2.SetTransform(typeTransform);
     return(typeInfo2);
 }
Esempio n. 3
0
 public virtual Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarOrMethod GetFinest()
 {
     Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarOrMethod c = GetDeepChild();
     if (c == null)
     {
         return(this);
     }
     return(c);
 }
Esempio n. 4
0
 public override Net.Vpc.Upa.Types.DataTypeTransform GetEffectiveDataType()
 {
     Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarOrMethod c = GetChild();
     if (c != null)
     {
         return(c.GetEffectiveDataType());
     }
     return(GetTypeTransform());
 }
Esempio n. 5
0
 public virtual Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarOrMethod GetDeepChild()
 {
     Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarOrMethod c = GetChild();
     if (c == null)
     {
         return(null);
     }
     if (c.GetChild() == null)
     {
         return(c);
     }
     return(c.GetDeepChild());
 }
Esempio n. 6
0
 private static string ResolveName(string alias, Net.Vpc.Upa.Impl.Uql.Compiledexpression.DefaultCompiledExpression expression)
 {
     if (alias != null)
     {
         return(alias);
     }
     if (expression is Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVar)
     {
         Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVar         cv = (Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVar)expression;
         Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarOrMethod dc = cv.GetDeepChild();
         return((dc == null ? ((Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarOrMethod)(cv)) : dc).GetName());
     }
     return(null);
 }
Esempio n. 7
0
 public override Net.Vpc.Upa.Impl.Uql.Compiledexpression.DefaultCompiledExpression Copy()
 {
     Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVar         o = new Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVar(GetName(), GetReferrer());
     Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarOrMethod c = GetChild();
     if (c != null)
     {
         c = (Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarOrMethod)c.Copy();
     }
     o.SetChild(c);
     o.SetBinding(GetBinding());
     o.SetDescription(GetDescription());
     o.SetOldReferrer(GetOldReferrer());
     o.GetClientParameters().SetAll(GetClientParameters());
     return(o);
 }
Esempio n. 8
0
 private static string ResolveBinding(Net.Vpc.Upa.Impl.Uql.Compiledexpression.DefaultCompiledExpression expression)
 {
     if (expression is Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVar)
     {
         Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVar         cv  = (Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVar)expression;
         Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarOrMethod cv1 = cv.GetDeepChild();
         if (cv1 != null && cv1 is Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVar)
         {
             Net.Vpc.Upa.Impl.Uql.Compiledexpression.DefaultCompiledExpression cv2 = cv1.GetParentExpression();
             if (cv2 != null && cv2 is Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVar)
             {
                 return(((Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVar)cv2).GetChildlessPath());
             }
         }
     }
     return(null);
 }
Esempio n. 9
0
 public virtual void SetChild(Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVarOrMethod child)
 {
     this.child = child;
     PrepareChildren(child);
 }