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

read_directive(allowed) Instance Public methods Directives are modifier comments

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

scan() Instance Public methods Creates an Markdown-format TopLevel for the given

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

scan() Instance Public methods Scans this ruby file for ruby constructs

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

skip_tkspace(skip_nl = true) Instance Public methods Skips whitespace tokens

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

alias_extension(old_ext, new_ext) Class Public methods Alias an extension to

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

new_comment(comment) Instance Public methods Creates a comment with the correct

2025-01-10 15:47:30
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_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
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