コード例 #1
0
        private StillOneScriptCore.EntityModel.CustomFunctionModel.ExecutedCustomFunction CreateExecuted()
        {
            var tmpExecutedFunctionContext = new StillOneScriptCore.EntityModel.CustomFunctionModel.Support.ExecutedFunctionContext(this.Environment);

            var tmpExecutedCustomFunction = new StillOneScriptCore.EntityModel.CustomFunctionModel.ExecutedCustomFunction(tmpExecutedFunctionContext);

            tmpExecutedCustomFunction.Statement = this.Statement.CreateExecuted(tmpExecutedFunctionContext);

            return tmpExecutedCustomFunction;
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: metatypeman/stillOneScript
        private static void TSTCustomOperators()
        {
            var tmpEnvironment = new StillOneScriptCore.Engine.EngineEnvironment();

            tmpEnvironment.Init();

            var tmpPClass = new StillOneScriptCore.EntityModel.LngObjectsModel.Support.Internal._P_NativeClass(typeof(WrappedClass), StillOneScriptCore.EntityModel.LngObjectsModel.Support.Internal.MappingOption.ByLNGMap, tmpEnvironment);

            var tmpClass = new StillOneScriptCore.EntityModel.LngObjectsModel._Class();

            tmpClass.Environment = tmpEnvironment;

            tmpClass.AddName("dog");

            tmpClass.ClassBoxingObject = tmpPClass;

            tmpClass.Environment.AddConvertor(tmpClass);

            NLog.LogManager.GetCurrentClassLogger().Info(tmpClass.ToString());

            NLog.LogManager.GetCurrentClassLogger().Info("tmpClass.Name = {0}", tmpClass.Name);

            var tmpExecutedFunctionContext = new StillOneScriptCore.EntityModel.CustomFunctionModel.Support.ExecutedFunctionContext(tmpEnvironment);

            tmpExecutedFunctionContext.AddScope();

            tmpExecutedFunctionContext.AddScope();

            //tmpExecutedFunctionContext.RemoveScope();

            /*var tmpObjVar = new StillOneScriptCore.EntityModel.WorkedObjectsModel._VariableObjectRef("dog");

            tmpObjVar.Environment = tmpEnvironment;

            NLog.LogManager.GetCurrentClassLogger().Info(StillOneScriptCore.Common.TypeHelpers.ObjectHelper._ToString(tmpObjVar.Value, "tmpObjVar.Value"));*/

            //var tmpObjRef = new StillOneScriptCore.EntityModel.CustomFunctionModel.Operators.Executed.VariableReference(tmpExecutedFunctionContext, "Console");

            //tmpObjRef.Run();

            //var tmpRez = tmpObjRef.Result;

            //NLog.LogManager.GetCurrentClassLogger().Info(StillOneScriptCore.Common.TypeHelpers.ObjectHelper._ToString(tmpRez, "tmpRez"));

            //var tmpStringRef = new StillOneScriptCore.EntityModel.CustomFunctionModel.Operators.Executed.StringLiteralReference(tmpExecutedFunctionContext, "The Beatles");

            //tmpStringRef.Run();

            //var tmpStrRez = tmpStringRef.Result;

            //NLog.LogManager.GetCurrentClassLogger().Info(StillOneScriptCore.Common.TypeHelpers.ObjectHelper._ToString(tmpStrRez, "tmpStrRez"));

            //var tmpCallOperator = new StillOneScriptCore.EntityModel.CustomFunctionModel.Operators.Executed.CallMethodOperator(tmpExecutedFunctionContext, "Log");

            //tmpCallOperator.Left = tmpObjRef;

            //var tmpParam = new StillOneScriptCore.EntityModel.CustomFunctionModel.Operators.Executed.FunctionParameter();

            //tmpParam.Name = "text";

            //tmpParam.Operator = tmpStringRef;

            //tmpCallOperator.AddParameter(tmpParam);

            //tmpCallOperator.Run();

            //var tmpCallResult = tmpCallOperator.Result;

            //NLog.LogManager.GetCurrentClassLogger().Info(StillOneScriptCore.Common.TypeHelpers.ObjectHelper._ToString(tmpCallResult, "tmpCallResult"));

            //var tmpStatement = new StillOneScriptCore.EntityModel.CustomFunctionModel.Statements.Executed.ExpressionStatement(tmpExecutedFunctionContext);

            //tmpStatement.Expression = tmpCallOperator;

            //tmpStatement.Call();

            //var tmpCodeBlock = new StillOneScriptCore.EntityModel.CustomFunctionModel.Statements.Executed.CodeBlockStatement(tmpExecutedFunctionContext);

            //tmpCodeBlock.FirstStatement = tmpStatement;

            //var tmpExecutedCustomFunction = new StillOneScriptCore.EntityModel.CustomFunctionModel.ExecutedCustomFunction(tmpExecutedFunctionContext);

            //tmpExecutedCustomFunction.Statement = tmpCodeBlock;

            //var tmpExecutedCustomFunctionRez = tmpExecutedCustomFunction.Call();

            //NLog.LogManager.GetCurrentClassLogger().Info(StillOneScriptCore.Common.TypeHelpers.ObjectHelper._ToString(tmpExecutedCustomFunctionRez, "tmpExecutedCustomFunctionRez"));

            //var tmpCaller = new StillOneScriptCore.EntityModel.CustomFunctionModel.Statements.Executed.StatementsCaller();

            //tmpCaller.Call(tmpStatement);

            //tmpObjRef

            /*var tmpCallFunctionOperator = new StillOneScriptCore.EntityModel.CustomFunctionModel.Operators.CallMethodOperator();

            tmpCallFunctionOperator.Environment = tmpEnvironment;

            tmpCallFunctionOperator.Left = tmpObjRef;

            tmpCallFunctionOperator.Run();*/
        }