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

rb_scan_args(method_body) Instance Public methods Extracts parameters from the

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

continue_entry_body(entry_body, continuation) Instance Public methods Attaches

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

get_tk_until(*tokens) Instance Public methods Reads and returns all tokens up

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

find_modifiers(comment, meth_obj) Instance Public methods Handles modifiers

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

load_variable_map(map_name) Instance Public methods Loads the variable map with

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

create_document(groups) Instance Public methods Creates an

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

skip_for_variable() Instance Public methods skip the var [in] part of a 'for'

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

handle_singleton(sclass_var, class_var) Instance Public methods Registers a

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

parse_files_matching(regexp) Class Public methods Record which file types this

2025-01-10 15:47:30