# File lib/gerbil/rdoc.rb, line 47
  def self.gen_method_infos *aParseTrees
    meths = aParseTrees.map do |i|
      [i, i.classes, i.modules].flatten.map {|j| j.method_list }
    end.flatten.uniq

    meths.map do |m|
      # determine full path to method (Module::Class::...::method)
      hier = []
      root = m.parent
      while root && root.parent
        hier.unshift root
        root = root.parent
      end

      if hier.empty?
        path = m.name
      else
        path = hier.map {|n| n.name}.join('::')
        path = [path, m.name].join(m.singleton ? '::' : '#')
      end

      # determine argument string for method
      args = m.params
      if m.block_params
        args.sub! %r/\#.*(?=.$)/, ''
        args << " { |#{m.block_params}| ... }"
      end

      {
        :file => root.file_absolute_name,
        :name => path,
        :args => args,
        :decl => path + args,
        :docs => m.comment,
        :docs_html => DummyMarkup.new.markup(m.comment),

        # nodes in the parse tree
        :node => m,
        :root => root,
        # for top level methods, info.parent == root
        # for class methods, info.singleton == true
      }
    end
  end