コード例 #1
0
 public ClassBuilder(string superClassName)
 {
     this.superClassName  = superClassName;
     variables            = new List <string>();
     initializedVariables = new Hash <string, Value>();
     methods      = new Hash <string, Closure>();
     multiMethods = new Hash <string, MultiClosure>
     {
         NewValue       = m => new MultiClosure(),
         AutoAddDefault = true
     };
     scope = new Hash <string, Class.ScopeType>
     {
         DefaultValue = Class.ScopeType.Object
     };
     objectVisibility = new Hash <string, Class.VisibilityType>
     {
         DefaultValue = Class.VisibilityType.Public
     };
     classVisibility = new Hash <string, Class.VisibilityType>
     {
         DefaultValue = Class.VisibilityType.Public
     };
     currentScope     = Class.ScopeType.Object;
     currentVisiblity = new Stack <Class.VisibilityType>();
     currentVisiblity.Push(Class.VisibilityType.Public);
     delegates        = new Hash <string, string>();
     abstractMessages = new Hash <string, bool>();
     variableCases    = new Hash <string, Block>();
 }
コード例 #2
0
 public void SetToObjectScope()
 {
     currentScope = Class.ScopeType.Object;
 }
コード例 #3
0
 public void SetToClassScope()
 {
     currentScope = Class.ScopeType.Class;
 }
コード例 #4
0
 public void ToggleScope()
 {
     currentScope = currentScope == Class.ScopeType.Object ? Class.ScopeType.Class : Class.ScopeType.Object;
 }