code: public Scope getEnclosingScope() {
          AstNode parent = this.getParent();
          while (parent != null && !(parent instanceof Scope)) {
              parent = parent.getParent();
          }
          return (Scope)parent;
      }
docs: Returns the innermost enclosing {@link Scope} node, or {@code null}
  if we're not nested in a scope.  Begins the search with this node's parent.
  Note that this is not the same as the defining scope for a {@link Name}.
  
  @return the {@link Scope} enclosing this node, else {@code null}