class
RDoc::Parser
v1_9_3_392 -
Show latest stable
- Superclass: Object
A parser is a class that subclasses RDoc::Parser and implements
#initialize top_level, file_name, body, options, stats
and
#scan
The initialize method takes a file name to be used, the body of the file, and an RDoc::Options object. The scan method is then called to return an appropriately parsed TopLevel code object.
RDoc::Parser::for is a factory that creates the correct parser for a given filename extension. Parsers have to register themselves RDoc::Parser using parse_files_matching as when they are loaded:
require "rdoc/parser" class RDoc::Parser::Xyz < RDoc::Parser parse_files_matching /\.xyz$/ # <<<< def initialize top_level, file_name, body, options, stats ... end def scan ... end end
If a plain text file is detected, RDoc also looks for a shebang line in case the file is a shell script.
Attributes
| [R] | parsers |
Files
- lib/rdoc/parser.rb