Beispiel #1
0
        public void Push(object item)
        {
            ScopeLink link;

            link    = (_links == null) ? new ScopeLink(item) : new ScopeLink(item, _links);
            _depth += 1;
            _links  = link;
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 public ScopeLink(object item, ScopeLink parent)
 {
     _item      = item;
     _children  = parent;
     _variables = new VariableBag();
 }
Beispiel #4
0
 public void Clear()
 {
     _links = null;
 }