Type:
Class

A parser is simple a class that subclasses RDoc::Parser and implements scan to fill in an RDoc::TopLevel with parsed data.

The initialize method takes an RDoc::TopLevel to fill with parsed content, the name of the file to be parsed, the content of the file, an RDoc::Options object and an RDoc::Stats object to inform the user of parsed items. The scan method is then called to parse the file and must return the RDoc::TopLevel object. By calling super these items will be set for you.

In order to be used by RDoc the parser needs to register the file extensions it can parse. Use ::parse_files_matching to register extensions.

require 'rdoc'

class RDoc::Parser::Xyz < RDoc::Parser
  parse_files_matching /\.xyz$/

  def initialize top_level, file_name, content, options, stats
    super

    # extra initialization if needed
  end

  def scan
    # parse file and fill in @top_level
  end
end
handle_tab_width
  • References/Ruby on Rails/Ruby/Classes/RDoc/RDoc::Parser/RDoc::Parser::C

handle_tab_width(body) Instance Public methods Normalizes tabs in body

2025-01-10 15:47:30
do_classes
  • References/Ruby on Rails/Ruby/Classes/RDoc/RDoc::Parser/RDoc::Parser::C

do_classes() Instance Public methods Scans content for rb_define_class, boot_defclass

2025-01-10 15:47:30
scan
  • References/Ruby on Rails/Ruby/Classes/RDoc/RDoc::Parser/RDoc::Parser::ChangeLog

scan() Instance Public methods Converts the

2025-01-10 15:47:30
parse_module
  • References/Ruby on Rails/Ruby/Classes/RDoc/RDoc::Parser/RDoc::Parser::Ruby

parse_module(container, single, tk, comment) Instance Public methods Parses

2025-01-10 15:47:30
parse_comment_tomdoc
  • References/Ruby on Rails/Ruby/Classes/RDoc/RDoc::Parser/RDoc::Parser::Ruby

parse_comment_tomdoc(container, tk, comment) Instance Public methods Creates

2025-01-10 15:47:30
find_const_comment
  • References/Ruby on Rails/Ruby/Classes/RDoc/RDoc::Parser/RDoc::Parser::C

find_const_comment(type, const_name, class_name = nil) Instance Public methods Finds

2025-01-10 15:47:30
find_attr_comment
  • References/Ruby on Rails/Ruby/Classes/RDoc/RDoc::Parser/RDoc::Parser::C

find_attr_comment(var_name, attr_name, read = nil, write = nil) Instance Public methods Finds

2025-01-10 15:47:30
create_entries
  • References/Ruby on Rails/Ruby/Classes/RDoc/RDoc::Parser/RDoc::Parser::ChangeLog

create_entries(entries) Instance Public methods Returns a list of

2025-01-10 15:47:30
group_entries
  • References/Ruby on Rails/Ruby/Classes/RDoc/RDoc::Parser/RDoc::Parser::ChangeLog

group_entries(entries) Instance Public methods Groups entries by

2025-01-10 15:47:30
new
  • References/Ruby on Rails/Ruby/Classes/RDoc/RDoc::Parser/RDoc::Parser::Ruby

new(top_level, file_name, content, options, stats) Class Public methods Creates

2025-01-10 15:47:30