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

check_modeline(file_name) Class Public methods Returns the file type from the

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

look_for_directives_in(context, comment) Instance Public methods Look for directives

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

parse_symbol_in_arg() Instance Public methods Returns symbol text from the next

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

zip?(file) Class Public methods Checks if file is a zip file in

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

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

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

collect_first_comment() Instance Public methods Look for the first comment in

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

skip_optional_do_after_expression() Instance Public methods while, until, and

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

look_for_directives_in(context, comment) Instance Public methods Look for directives

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

handle_ifdefs_in(body) Instance Public methods Removes ifdefs that would otherwise

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

parse_method_parameters(method) Instance Public methods Capture the method's

2025-01-10 15:47:30