public void clear() {
	    if(hasClassDefinitions()) {
	        this.classDefinitions.clearDefinitions();	        
	    }
	    
	    if(hasNamespaceDefinitions()) {
	        this.namespaceDefinitions.clearDefinitions();
	    }
	    
	    if(hasParent()) {
	        this.parent.clear();
	    }
	    	    
	    if(hasObjects()) {
	        /* Create a new Set here so that we don't get caught in an infinite recursive loop if
	         * the scopes are self referencing
	         */
	        Set<Map.Entry<LeoObject, LeoObject>> entrySet = new HashSet<Map.Entry<LeoObject,LeoObject>>(this.values.entrySet());
	        this.values.clear();
	        
	        for(Map.Entry<LeoObject, LeoObject> entry : entrySet) {
	            Scope keyScope = entry.getKey().getScope();
	            if(keyScope != null) {
	                keyScope.clear();
	            }
	            
	            Scope valueScope = entry.getValue().getScope();
	            if(valueScope != null) {
	                valueScope.clear();
	            }
	        }
	    }
	}