Beispiel #1
0
 private void InitScopesByTree(ScopeTreeNode node, RuntimeScope parent)
 {
     foreach (var n in node.Children)
     {
         if (n.Scope == null)
         {
             continue;
         }
         InitScopesByTree(n, new RuntimeScope(parent, n.Scope));
     }
 }
Beispiel #2
0
        public RuntimeScope(RuntimeScope parent, Scope scope, bool lateInit)
        {
            Parent = parent;
            Scope  = scope;

            if (scope != null && !RuntimeScopeForScope.ContainsKey(scope))
            {
                RuntimeScopeForScope.Add(scope, this);
            }

            if (lateInit)
            {
                return;
            }
            Init(scope);
        }
Beispiel #3
0
 public Interpreter(Namespace global)
 {
     Global       = global;
     RuntimeScope = new RuntimeScope(null, Global.Scope, true);
 }
Beispiel #4
0
 public RuntimeScope(RuntimeScope parent, Scope scope) : this(parent, scope, false)
 {
 }