/// <summary> /// Visits the specified unit set namespace. /// </summary> public virtual void Visit(IUnitSetNamespace unitSetNamespace) { //IUnitSetNamespace is a base interface that should never be implemented directly. //Get unitSetNamespace to call the most type specific visitor. unitSetNamespace.Dispatch(this); }
//^ ensures this.path.Count == old(this.path.Count); /// <summary> /// Visits the specified unit set namespace. /// </summary> /// <param name="unitSetNamespace">The unit set namespace.</param> public virtual void Visit(IUnitSetNamespace unitSetNamespace) { if (this.stopTraversal) return; //^ int oldCount = this.path.Count; this.path.Push(unitSetNamespace); this.Visit(unitSetNamespace.Members); //^ assume this.path.Count == oldCount+1; //True because all of the virtual methods of this class promise not decrease this.path.Count. this.path.Pop(); unitSetNamespace.Dispatch(this); }