public void Push(object item) { ScopeLink link; link = (_links == null) ? new ScopeLink(item) : new ScopeLink(item, _links); _depth += 1; _links = link; }
public object Pop() { if (_links == null) { throw new MergeException("cannot 'Pop' scope link, the chain is empty."); } object item = _links.Item; _links = _links.Parent; _depth -= 1; return(item); }
public ScopeLink(object item, ScopeLink parent) { _item = item; _children = parent; _variables = new VariableBag(); }
public void Clear() { _links = null; }