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
parse_extend
  • References/Ruby on Rails/Ruby/Classes/RDoc/RDoc::Parser/RDoc::Parser::Ruby

parse_extend(context, comment) Instance Public methods Parses an extend

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

parse_yield(context, single, tk, method) Instance Public methods Determines

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

parse_alias(context, single, tk, comment) Instance Public methods Parses an

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

parse_comment(container, tk, comment) Instance Public methods Generates an RDoc::Method

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

parse_statements(container, single = NORMAL, current_method = nil, comment = new_comment('')) Instance Public methods

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

error(msg) Instance Public methods Aborts with msg

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

do_attrs() Instance Public methods Scans content for rb_attr and rb_define_attr

2025-01-10 15:47:30