void ISmalltalkNameScopeVisitor.Visit(GlobalConstantBinding binding) { if (this.IgnoreSmalltalk && (binding.Name.Value == "Smalltalk")) { return; } this.Generators.Add(new GlobalConstantGenerator(this.Compiler, binding)); }
/// <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))); }
/// <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))); }
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); }
void IInstallerContext.AddGlobalConstantBinding(GlobalConstantBinding binding) { this.NameScope.GlobalConstants.Add(binding); }
void IDefinitionInstallerContext.AddGlobalConstantBinding(GlobalConstantBinding binding) { this.NameScope.GlobalConstants.Add(binding); }