code: public void printscopes(Scope s) {
          while (s != null) {
              if (s.owner != null)
                  System.err.print(s.owner + ": ");
              for (Scope.Entry e = s.elems; e != null; e = e.sibling) {
                  if ((e.sym.flags() & ABSTRACT) != 0)
                      System.err.print("abstract ");
                  System.err.print(e.sym + " ");
              }
              System.err.println();
              s = s.next;
          }
      }
docs: print all scopes starting with scope s and proceeding outwards.
  used for debugging.