public void replaceWith(Scope newScope){
  if (childScopes != null) {
    for (    Scope kid : childScopes) {
      newScope.addChildScope(kid);
    }
    childScopes.clear();
    childScopes=null;
  }
  if (symbolTable != null && !symbolTable.isEmpty()) {
    joinScopes(this,newScope);
  }
}

public void replaceWith ( Scope newScope ) { if ( childScopes != null ) { for ( Scope kid : childScopes ) { newScope . addChildScope ( kid ) ; } childScopes . clear ( ) ; childScopes = null ; } if ( symbolTable != null && ! symbolTable . isEmpty ( ) ) { joinScopes ( this , newScope ) ; } }
used by the parser ; not intended for typical use . changes the parent - scope links for this scope ' s child scopes to the specified new scope . copies symbols from this scope into new scope .
