public CLS_Content.Value ComputeValue(CLS_Content content) { content.InStack(this); var left = listParam[0].ComputeValue(content); var right = listParam[1].ComputeValue(content); ICLS_Type type = content.environment.GetType(left.type); //if (mathop == "+=") { CLType returntype; object value = type.Math2Value(content, mathop, left.value, right, out returntype); value = type.ConvertTo(content, value, left.type); left.value = value; //content.Set(value_name, value); } //操作变量之 //做数学计算 //从上下文取值 //_value = null; content.OutStack(this); return(null); }
public CLS_Content.Value ComputeValue(CLS_Content content) { content.InStack(this); var left = listParam[0].ComputeValue(content); var right = listParam[1].ComputeValue(content); ICLS_Type type = content.environment.GetType(left.type); //if (mathop == "+=") { CLType returntype; object value = type.Math2Value(content, mathop, left.value, right, out returntype); value = type.ConvertTo(content, value, left.type); left.value = value; Type t = right.type; //if(t.IsSubclassOf(typeof(MulticastDelegate))||t.IsSubclassOf(typeof(Delegate))) //{ //} ////content.Set(value_name, value); //else if (t == typeof(CSLE.DeleLambda) || t == typeof(CSLE.DeleFunction) || t == typeof(CSLE.DeleEvent)) //{ //} //else { if (listParam[0] is CLS_Expression_MemberFind) { CLS_Expression_MemberFind f = listParam[0] as CLS_Expression_MemberFind; var parent = f.listParam[0].ComputeValue(content); if (parent == null) { throw new Exception("调用空对象的方法:" + f.listParam[0].ToString() + ":" + ToString()); } var ptype = content.environment.GetType(parent.type); ptype.function.MemberValueSet(content, parent.value, f.membername, value); } if (listParam[0] is CLS_Expression_StaticFind) { CLS_Expression_StaticFind f = listParam[0] as CLS_Expression_StaticFind; f.type.function.StaticValueSet(content, f.staticmembername, value); } } } //操作变量之 //做数学计算 //从上下文取值 //_value = null; content.OutStack(this); return(null); }
public CLS_Content.Value ComputeValue(CLS_Content content) { content.InStack(this); CLS_Content.Value right = listParam[0].ComputeValue(content); ICLS_Type type = content.environment.GetType(right.type); CLS_Content.Value value = new CLS_Content.Value(); value.type = targettype; value.value = type.ConvertTo(content, right.value, targettype); content.OutStack(this); return(value); }
public CLS_Content.Value ComputeValue(CLS_Content content) { content.InStack(this); var right = listParam[0].ComputeValue(content); ICLS_Type type = content.environment.GetType(right.type); CLS_Content.Value value = new CLS_Content.Value(); value.type = typeof(bool); value.value = type.ConvertTo(content, right.value, targettype) != null; //操作变量之 //做数学计算 //从上下文取值 //_value = null; content.OutStack(this); return(value); }
public CLS_Content.Value ComputeValue(CLS_Content content) { content.InStack(this); var v = content.Get(value_name); ICLS_Type type = content.environment.GetType(v.type); CLType returntype; object value = type.Math2Value(content, mathop, v.value, CLS_Content.Value.One, out returntype); value = type.ConvertTo(content, value, v.type); content.Set(value_name, value); //操作变量之 //做数学计算 //从上下文取值 //_value = null; content.OutStack(this); return(null); }