/// <summary> /// Adds /// <paramref name="scope"/>and /// <paramref name="parent">it's parent</paramref> . If <see cref="CurrentParentScope"/> is /// equal to /// <paramref name="parent"/>then parent is not added. /// </summary> /// <param name="scope"></param> /// <param name="parent"></param> public void Push(IScope scope, IScope parent) { ScopeStack.Push(scope); if (parent != CurrentParentScope) { ParentScopeStack.Push(parent); } }
/// <summary> /// Removes the most recent scope from the scope stack and returns it. If intermediate /// scopes were inserted, it calls <see cref="RevertToNextParent()"/>. /// </summary> /// <returns>the most recent scope.</returns> public IScope Pop() { RevertToNextParent(); ParentScopeStack.Pop(); return(ScopeStack.Pop()); }