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

parse_visibility(container, single, tk) Instance Public methods Determines the

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

handle_constants(type, var_name, const_name, definition) Instance Public methods Adds

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

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

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

get_class_or_module(container, ignore_constants = false) Instance Public methods Look

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

can_parse(file_name) Class Public methods Return a parser that can handle a

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

skip_method(container) Instance Public methods Skips the next method in

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

remove_token_listener(obj) Instance Public methods Removes the token listener

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

read_documentation_modifiers(context, allowed) Instance Public methods Handles

2025-01-10 15:47:30