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

create_items(items) Instance Public methods Returns an

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

do_struct_define_without_accessor() Instance Public methods Scans content for

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

add_token_listener(obj) Instance Public methods Adds a token listener obj

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

do_define_module_under() Instance Public methods Scans content for rb_define_module_under

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

do_define_class() Instance Public methods Scans content for rb_define_class

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

skip_tkspace_comment(skip_nl = true) Instance Public methods Skip spaces until

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

remove_private_comment(comment) Instance Public methods Removes private comments

2025-01-10 15:47:30