code: void traverseWithScope(Node root, AbstractScope<?, ?> s) {
      checkState(s.isGlobal() || s.isModuleScope(), s);
      try {
        initTraversal(root);
        curNode = root;
        pushScope(s);
        traverseBranch(root, null);
        popScope();
      } catch (Error | Exception unexpectedException) {
        throwUnexpectedException(unexpectedException);
      }
    }
docs: Traverses a parse tree recursively with a scope, starting with the given
  root. This should only be used in the global scope or module scopes. Otherwise, use
  {@link #traverseAtScope}.