Exemple #1
0
        private void GenerateCustomLibrary()
        {
            // Visit the name scopes in the runtime.
            NameScopeGenerator extensionScope = null, globalScope = null;

            if (this.Parameters.ExtensionScopeInitializer == null)
            {
                extensionScope = new NameScopeGenerator(this, "ExtensionScope", true);
                this.Parameters.Runtime.ExtensionScope.Accept(extensionScope);
            }
            globalScope = new NameScopeGenerator(this, "GlobalScope", false);
            this.Parameters.Runtime.GlobalScope.Accept(globalScope);

            // Generate types from the result of the name scope visiting
            MethodInfo extensionScopeInitializer, globalScopeInitializer;

            if (this.Parameters.ExtensionScopeInitializer == null)
            {
                extensionScopeInitializer = extensionScope.GenerateNameScopeInitializerMethod();
            }
            else
            {
                extensionScopeInitializer = this.Parameters.ExtensionScopeInitializer;
            }
            globalScopeInitializer = globalScope.GenerateNameScopeInitializerMethod();
            // Generate the entry point class, the one that creates the new Smalltalk runtime.
            RuntimeGenerator runtime = new RuntimeGenerator(this, extensionScopeInitializer, globalScopeInitializer);

            runtime.GenerateCreateRuntimeMethods();
        }
Exemple #2
0
        private void GenerateStanradLibrary()
        {
            System.Diagnostics.Debug.Assert(this.Parameters.Runtime.GlobalScope.IsEmpty);

            // Visit the name scopes in the runtime.
            NameScopeGenerator scope = new NameScopeGenerator(this, "StandardScope", true);

            this.Parameters.Runtime.ExtensionScope.Accept(scope);

            // Generate types from the result of the name scope visiting
            MethodInfo scopeInitializer = scope.GenerateNameScopeInitializerMethod();
            // Generate the entry point class, the one that creates the new Smalltalk runtime.
            StandardLibraryGenerator library = new StandardLibraryGenerator(this, scopeInitializer);

            library.GenerateEntryMethod();
        }