示例#1
0
        private void ResetAll(Options options)
        {
            Heap = new Heap();
            //Rmem = new RuntimeMemory(Heap);
            Configurations = new Dictionary <string, object>();

            ResetRuntimeCore();

            Validity.AssertExpiry();
            Options = options;

            Compilers  = new Dictionary <Language, Compiler>();
            ClassIndex = Constants.kInvalidIndex;

            FunctionTable = new FunctionTable();
            Langverify    = new LangVerify();


            watchFunctionScope = Constants.kInvalidIndex;
            watchSymbolList    = new List <SymbolNode>();
            watchBaseOffset    = 0;


            GlobOffset            = 0;
            GlobHeapOffset        = 0;
            BaseOffset            = 0;
            GraphNodeUID          = 0;
            CodeBlockIndex        = 0;
            RuntimeTableIndex     = 0;
            CodeBlockList         = new List <CodeBlock>();
            CompleteCodeBlockList = new List <CodeBlock>();
            DSExecutable          = new Executable();

            AssocNode = null;

            // TODO Jun/Luke type system refactoring
            // Initialize the globalClass table and type system
            ClassTable = new ClassTable();
            TypeSystem = new TypeSystem();
            TypeSystem.SetClassTable(ClassTable);
            ProcNode  = null;
            ProcTable = new ProcedureTable(Constants.kGlobalScope);

            //Initialize the function pointer table
            FunctionPointerTable = new FunctionPointerTable();

            //Initialize the dynamic string table and dynamic function table
            DynamicVariableTable = new DynamicVariableTable();
            DynamicFunctionTable = new DynamicFunctionTable();

            startPC = Constants.kInvalidIndex;

            deltaCompileStartPC = Constants.kInvalidIndex;

            if (options.SuppressBuildOutput)
            {
                //  don't log any of the build related messages
                //  just accumulate them in relevant containers with
                //  BuildStatus object
                //
                BuildStatus = new BuildStatus(this, false, false, false);
            }
            else
            {
                BuildStatus = new BuildStatus(this, Options.BuildOptWarningAsError, null, Options.BuildOptErrorAsWarning);
            }

            SSASubscript           = 0;
            SSASubscript_GUID      = Guid.NewGuid();
            ExpressionUID          = 0;
            ModifierBlockUID       = 0;
            ModifierStateSubscript = 0;

            ExprInterpreterExe = null;
            Options.RunMode    = InterpreterMode.kNormal;

            assocCodegen = null;

            // Default execution log is Console.Out.
            ExecutionLog = Console.Out;

            DebuggerProperties = new DebugProperties();


            ParsingMode = ParseMode.Normal;

            IsParsingPreloadedAssembly = false;
            IsParsingCodeBlockNode     = false;
            ImportHandler = null;

            deltaCompileStartPC = 0;
            builtInsLoaded      = false;


            ForLoopBlockIndex = Constants.kInvalidIndex;

            GraphNodeCallList = new List <GraphNode>();

            newEntryPoint = Constants.kInvalidIndex;
        }
示例#2
0
文件: Core.cs 项目: rafatahmed/Dynamo
        private void ResetAll(Options options)
        {
            Heap = new Heap();
            //Rmem = new RuntimeMemory(Heap);
            Configurations = new Dictionary<string, object>();
            DllTypesToLoad = new List<System.Type>();

            Validity.AssertExpiry();
            Options = options;
            
            Compilers = new Dictionary<Language, Compiler>();
            ClassIndex = Constants.kInvalidIndex;

            FunctionTable = new FunctionTable(); 
            Langverify = new LangVerify();


            watchFunctionScope = Constants.kInvalidIndex;
            watchSymbolList = new List<SymbolNode>();
            watchBaseOffset = 0;


            GlobOffset = 0;
            GlobHeapOffset = 0;
            BaseOffset = 0;
            GraphNodeUID = 0;
            CodeBlockIndex = 0;
            RuntimeTableIndex = 0;
            CodeBlockList = new List<CodeBlock>();
            CompleteCodeBlockList = new List<CodeBlock>();
            CallsiteGuidMap = new Dictionary<Guid, int>();

            AssocNode = null;

            // TODO Jun/Luke type system refactoring
            // Initialize the globalClass table and type system
            ClassTable = new ClassTable();
            TypeSystem = new TypeSystem();
            TypeSystem.SetClassTable(ClassTable);
            ProcNode = null;
            ProcTable = new ProcedureTable(Constants.kGlobalScope);

            //Initialize the function pointer table
            FunctionPointerTable = new FunctionPointerTable();

            //Initialize the dynamic string table and dynamic function table
            DynamicVariableTable = new DynamicVariableTable();
            DynamicFunctionTable = new DynamicFunctionTable();

            watchStartPC = Constants.kInvalidIndex;

            deltaCompileStartPC = Constants.kInvalidIndex;

            if (options.SuppressBuildOutput)
            {
                //  don't log any of the build related messages
                //  just accumulate them in relevant containers with
                //  BuildStatus object
                //
                BuildStatus = new BuildStatus(this, false, false, false);
            }
            else
            {
                BuildStatus = new BuildStatus(this, Options.BuildOptWarningAsError, null, Options.BuildOptErrorAsWarning);
            }

            SSAExpressionUID = 0;
            SSASubscript = 0;
            SSASubscript_GUID = Guid.NewGuid();
            SSAExprUID = 0;
            ExpressionUID = 0;
            ModifierBlockUID = 0;
            ModifierStateSubscript = 0;

            ExprInterpreterExe = null;
            Options.RunMode = InterpreterMode.kNormal;

            assocCodegen = null;

            // Default execution log is Console.Out.
            ExecutionLog = Console.Out;

            DebuggerProperties = new DebugProperties();


            ParsingMode = ParseMode.Normal;
            
            IsParsingPreloadedAssembly = false;
            IsParsingCodeBlockNode = false;
            ImportHandler = null;

            deltaCompileStartPC = 0;
            builtInsLoaded = false;


            ForLoopBlockIndex = Constants.kInvalidIndex;

            GraphNodeCallList = new List<GraphNode>();
            InlineConditionalBodyGraphNodes = new Stack<List<GraphNode>>();

            newEntryPoint = Constants.kInvalidIndex;
        }