public final S getGlobalScope() {
    S result = thisScope();
    while (result.getParent() != null) {
      result = result.getParent();
    }
    return result;
  }
public final S getGlobalScope ( ) { S result = thisScope ( ) ; while ( result . getParent ( ) != null ) { result = result . getParent ( ) ; } return result ; }
Walks up the tree to find the global scope.