class Call

Public Class Methods

convert_backtrace( trace ) click to toggle source
# File lib/antlr3/test/call-stack.rb, line 22
def self.convert_backtrace( trace )
  trace.map { |c| parse c }
end
parse( call_string ) click to toggle source
# File lib/antlr3/test/call-stack.rb, line 8
def self.parse( call_string )
  parts = call_string.split( ':', 3 )
  file = parts.shift
  line = parts.shift.to_i
  if parts.empty?
      return Call.new( file, line )
  else
      mstring = parts.shift
      match = mstring.match( /`(.+)'/ )
      method = match ? match[ 1 ] : nil
      return Call.new( file, line, method )
  end
end

Public Instance Methods

e_switch?() click to toggle source
# File lib/antlr3/test/call-stack.rb, line 30
def e_switch?
  self.file == '-e'
end
inspect() click to toggle source
# File lib/antlr3/test/call-stack.rb, line 40
def inspect
  to_s.inspect
end
irb?() click to toggle source
# File lib/antlr3/test/call-stack.rb, line 26
def irb?
  self.file == '(irb)'
end
to_s() click to toggle source
# File lib/antlr3/test/call-stack.rb, line 34
def to_s
  string = '%s:%i' % [ file, line ]
  method and string << ":in `%s'" % method
  return( string )
end