123456789_123456789_123456789_123456789_123456789_

Class: Racc::SourceText

Relationships & Source Files
Inherits: Object
Defined in: lib/racc/sourcetext.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(text, filename, lineno) ⇒ SourceText

[ GitHub ]

  
# File 'lib/racc/sourcetext.rb', line 16

def initialize(text, filename, lineno)
  @text = text
  @filename = filename
  @lineno = lineno
end

Instance Attribute Details

#filename (readonly)

[ GitHub ]

  
# File 'lib/racc/sourcetext.rb', line 23

attr_reader :filename

#lineno (readonly)

[ GitHub ]

  
# File 'lib/racc/sourcetext.rb', line 24

attr_reader :lineno

#text (readonly)

[ GitHub ]

  
# File 'lib/racc/sourcetext.rb', line 22

attr_reader :text

Instance Method Details

#location

[ GitHub ]

  
# File 'lib/racc/sourcetext.rb', line 30

def location
  "#{@filename}:#{@lineno}"
end

#to_s

[ GitHub ]

  
# File 'lib/racc/sourcetext.rb', line 26

def to_s
  "#<SourceText #{location()}>"
end