parse_tree (RawParseTree)

    # File lib/parse_tree.rb, line 99
      def parse_tree(*klasses)
        result = []
        klasses.each do |klass|
          klassname = klass.name rescue '' # HACK klass.name should never be nil
                                       # Tempfile's DelegateClass(File) seems to
                                       # cause this
          klassname = "UnnamedClass_#{klass.object_id}" if klassname.empty?
          klassname = klassname.to_sym

          code = if Class === klass then
                   sc = klass.superclass
                   sc_name = ((sc.nil? or sc.name.empty?) ? "nil" : sc.name).intern
                   [:class, klassname, [:const, sc_name]]
                 else
                   [:module, klassname]
                 end

          method_names = []
          method_names += klass.instance_methods false
          method_names += klass.private_instance_methods false
          # protected methods are included in instance_methods, go figure!

          method_names.sort.each do |m|
            r = parse_tree_for_method(klass, m.to_sym)
            code << r
          end

          klass.modules.each do |mod| # TODO: add a test for this damnit
            mod.instance_methods.each do |m|
              r = parse_tree_for_method(mod, m.to_sym)
              code << r
            end
          end

          klass.singleton_methods(false).sort.each do |m|
            code << parse_tree_for_method(klass, m.to_sym, true)
          end

          result << code
        end
        return result
      end