Ejemplo n.º 1
0
 void ISmalltalkNameScopeVisitor.Visit(GlobalConstantBinding binding)
 {
     if (this.IgnoreSmalltalk && (binding.Name.Value == "Smalltalk"))
     {
         return;
     }
     this.Generators.Add(new GlobalConstantGenerator(this.Compiler, binding));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Create a new Smalltalk Runtime.
 /// </summary>
 public SmalltalkRuntime()
 {
     this.SymbolTable = new SymbolTable(this);
     this.NativeTypeClassMap = new NativeTypeClassMap(this);
     this.ExtensionScope = new SmalltalkNameScope(this);
     GlobalConstantBinding smalltalk = new GlobalConstantBinding(this.GetSymbol("Smalltalk"));
     smalltalk.SetValue(this);
     this.ExtensionScope.GlobalConstants.Add(smalltalk);
     this.ExtensionScope.WriteProtect();
     this.GlobalScope = new SmalltalkNameScope(this, this.ExtensionScope);
     this.GlobalScope.WriteProtect();
     this.ServicesCache = new Dictionary<object, object>();
     this.ExtensionScope.ProtectedNames.AddRange(new string[] {
         "nil", "true", "false", "self", "super", "Object", "Smalltalk" }
             .Select(str => this.GetSymbol(str)));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Create a new Smalltalk Runtime.
        /// </summary>
        public SmalltalkRuntime()
        {
            this.SymbolTable        = new SymbolTable(this);
            this.NativeTypeClassMap = new NativeTypeClassMap(this);
            this.ExtensionScope     = new SmalltalkNameScope(this);
            GlobalConstantBinding smalltalk = new GlobalConstantBinding(this.GetSymbol("Smalltalk"));

            smalltalk.SetValue(this);
            this.ExtensionScope.GlobalConstants.Add(smalltalk);
            this.ExtensionScope.WriteProtect();
            this.GlobalScope = new SmalltalkNameScope(this, this.ExtensionScope);
            this.GlobalScope.WriteProtect();
            this.ServicesCache = new Dictionary <object, object>();
            this.ExtensionScope.ProtectedNames.AddRange(new string[] {
                "nil", "true", "false", "self", "super", "Object", "Smalltalk"
            }
                                                        .Select(str => this.GetSymbol(str)));
        }
Ejemplo n.º 4
0
        public static GlobalConstantBinding AddGlobalConstantBinding(SmalltalkRuntime runtime, SmalltalkNameScope scope, string name)
        {
            if (runtime == null)
            {
                throw new ArgumentNullException("runtime");
            }
            if (scope == null)
            {
                throw new ArgumentNullException("scope");
            }
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            Symbol symbol = runtime.GetSymbol(name);

            GlobalConstantBinding binding = new GlobalConstantBinding(symbol);

            scope.GlobalConstants.Add(binding);
            return(binding);
        }
Ejemplo n.º 5
0
 void IInstallerContext.AddGlobalConstantBinding(GlobalConstantBinding binding)
 {
     this.NameScope.GlobalConstants.Add(binding);
 }
 void IDefinitionInstallerContext.AddGlobalConstantBinding(GlobalConstantBinding binding)
 {
     this.NameScope.GlobalConstants.Add(binding);
 }