Method: ANTLR3::Profile::Profiler#write_report

Defined in:
lib/antlr3/profile.rb

#write_reportObject



336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
# File 'lib/antlr3/profile.rb', line 336

def write_report
  @output << @profile.generate_report unless @output.nil?
rescue NoMethodError => error
  if error.name.to_s == '<<'
    warn( "      [%s @ %s]: failed to write report to %p as it does not respond to :<<\n    END\n  else raise\n  end\nrescue IOError => error\n  $stderr.puts( Util.tidy( <<-END ) % [ __FILE__, __LINE__, @output, error.class, error.message ] )\n  | [%s @ %s]: failed to write profile report to %p due to an IO Error:\n  |   %s: %s\n  END\n  $stderr.puts( error.backtrace.map { |call| \"  - \#{ call }\" }.join( \"\\n\" ) )\nend\n".strip! % [ __FILE__, __LINE__, @output ] )