Class: RLTK::StreamPosition
Overview
The StreamPosition class is used to indicate the position of a token or other text inside a stream.
Instance Attribute Summary collapse
- #file_name ⇒ String
- #length ⇒ Integer
- #line_number ⇒ Integer
- #line_offset ⇒ Integer (also: #start)
- #stream_offset ⇒ Integer
Instance Method Summary collapse
-
#initialize(stream_offset = 0, line_number = 0, line_offset = 0, length = 0, file_name = nil) ⇒ StreamPosition
constructor
Instantiates a new StreamPosition object with the values specified.
Constructor Details
#initialize(stream_offset = 0, line_number = 0, line_offset = 0, length = 0, file_name = nil) ⇒ StreamPosition
Instantiates a new StreamPosition object with the values specified.
39 40 41 42 43 44 45 |
# File 'lib/rltk/token.rb', line 39 def initialize(stream_offset = 0, line_number = 0, line_offset = 0, length = 0, file_name = nil) @stream_offset = stream_offset @line_number = line_number @line_offset = line_offset @length = length @file_name = file_name end |
Instance Attribute Details
#file_name ⇒ String
28 29 30 |
# File 'lib/rltk/token.rb', line 28 def file_name @file_name end |
#line_number ⇒ Integer
19 20 21 |
# File 'lib/rltk/token.rb', line 19 def line_number @line_number end |
#line_offset ⇒ Integer Also known as: start
22 23 24 |
# File 'lib/rltk/token.rb', line 22 def line_offset @line_offset end |
#stream_offset ⇒ Integer
16 17 18 |
# File 'lib/rltk/token.rb', line 16 def stream_offset @stream_offset end |