Class RDoc::RubyParser
In: parsers/parse_rb.rb
Parent: Object

Methods

new   scan  

Included Modules

RubyToken TokenStream

Constants

NORMAL = "::"
SINGLE = "<<"

Public Class methods

[Source]

      # File parsers/parse_rb.rb, line 1388
1388:     def initialize(top_level, file_name, content, options, stats)
1389:       @options = options
1390:       @stats   = stats
1391:       @size = 0
1392:       @token_listeners = nil
1393:       @input_file_name = file_name
1394:       @scanner = RubyLex.new(content)
1395:       @scanner.exception_on_syntax_error = false
1396:       @top_level = top_level
1397:       @progress = $stderr unless options.quiet
1398:     end

Public Instance methods

[Source]

      # File parsers/parse_rb.rb, line 1400
1400:     def scan
1401:       @tokens = []
1402:       @unget_read = []
1403:       @read = []
1404:       catch(:eof) do
1405:         catch(:enddoc) do
1406:           begin
1407:             parse_toplevel_statements(@top_level)
1408:           rescue Exception => e
1409:             $stderr.puts "\n\n"
1410:             $stderr.puts "RDoc failure in #@input_file_name at or around " +
1411:                          "line #{@scanner.line_no} column #{@scanner.char_no}"
1412:             $stderr.puts 
1413:             $stderr.puts "Before reporting this, could you check that the file"
1414:             $stderr.puts "you're documenting compiles cleanly--RDoc is not a"
1415:             $stderr.puts "full Ruby parser, and gets confused easily if fed"
1416:             $stderr.puts "invalid programs."
1417:             $stderr.puts
1418:             $stderr.puts "The internal error was:\n\n"
1419:             
1420:             e.set_backtrace(e.backtrace[0,4])
1421:             raise
1422:           end
1423:         end
1424:       end
1425:       @top_level
1426:     end

[Validate]