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

get_tk() Instance Public methods Fetches the next token from the scanner

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

remove_coding_comment(text) Instance Public methods Removes the encoding magic

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

do_define_module() Instance Public methods Scans content for rb_define_module

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
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
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