public StillOneScriptCore.EntityModel.LngObjectsModel.Support.Internal._P_CustomFunction Clone(StillOneScriptCore.Engine.IEnvironment engineEnvironment) { var tmpCustomFun = new StillOneScriptCore.EntityModel.LngObjectsModel.Support.Internal._P_CustomFunction(engineEnvironment); if(mStatement != null) { tmpCustomFun.Statement = mStatement.Clone(tmpCustomFun.FunctionContext); } return tmpCustomFun; }
private static void TSTCustomFunction() { var tmpEnvironment = new StillOneScriptCore.Engine.EngineEnvironment(); tmpEnvironment.Init(); var tmpCustomFun = new StillOneScriptCore.EntityModel.LngObjectsModel.Support.Internal._P_CustomFunction(tmpEnvironment); var tmpExprStatement = new StillOneScriptCore.EntityModel.CustomFunctionModel.Statements.ExpressionStatement(tmpCustomFun.FunctionContext); var tmpCodeBlock = new StillOneScriptCore.EntityModel.CustomFunctionModel.Statements.CodeBlockStatement(tmpCustomFun.FunctionContext); tmpCustomFun.Statement = tmpCodeBlock; tmpCodeBlock.FirstStatement = tmpExprStatement; var tmpObjRef = new StillOneScriptCore.EntityModel.CustomFunctionModel.Operators.VariableReference(tmpCustomFun.FunctionContext, "Console"); var tmpStringRef = new StillOneScriptCore.EntityModel.CustomFunctionModel.Operators.StringLiteralReference(tmpCustomFun.FunctionContext, "The Beatles"); var tmpCallOperator = new StillOneScriptCore.EntityModel.CustomFunctionModel.Operators.CallMethodOperator(tmpCustomFun.FunctionContext, "Log"); tmpCallOperator.Left = tmpObjRef; var tmpParam = new StillOneScriptCore.EntityModel.CustomFunctionModel.Operators.FunctionParameter(); tmpParam.Name = "text"; tmpParam.Operator = tmpStringRef; tmpCallOperator.AddParameter(tmpParam); tmpExprStatement.Expression = tmpCallOperator; //tmpCustomFun.Call(); var tmpCustomFunObj = tmpEnvironment.ConvertMember(tmpCustomFun); NLog.LogManager.GetCurrentClassLogger().Info(StillOneScriptCore.Common.TypeHelpers.ObjectHelper._ToString(tmpCustomFunObj, "tmpCustomFunObj")); var tmpRez = tmpCustomFunObj.Call(); NLog.LogManager.GetCurrentClassLogger().Info(StillOneScriptCore.Common.TypeHelpers.ObjectHelper._ToString(tmpRez, "tmpRez")); }
public void Load(StillOneScriptCore.Parser.ScriptCodeDom.Skeletons.Function source) { mResult = source.Clone(mEngineEnvironment); }