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

parse_constant(container, tk, comment, ignore_constants = false) Instance Public methods

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

find_override_comment(class_name, meth_obj) Instance Public methods Finds a

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

unget_tk(tk) Instance Public methods Returns tk to the scanner

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

do_singleton_class() Instance Public methods Scans content for rb_singleton_class

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

do_aliases() Instance Public methods Scans content for rb_define_alias

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

get_symbol_or_name() Instance Public methods Extracts a name or symbol from

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

for(top_level, file_name, content, options, stats) Class Public methods Finds

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

token_listener(obj) Instance Public methods Has obj listen to tokens

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

binary?(file) Class Public methods Determines if the file is a âbinaryâ file

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

parse_symbol_arg(no = nil) Instance Public methods Parse up to no

2025-01-10 15:47:30