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

scan() Instance Public methods Extracts the classes, modules, methods, attributes

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

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

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

parse_require(context, comment) Instance Public methods Parses an

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

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

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

handle_class_module(var_name, type, class_name, parent, in_module) Instance Public methods

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

peek_read() Instance Public methods Peek equivalent for

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

do_includes() Instance Public methods Scans content for rb_include_module

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