Class: RLTK::StreamPosition
- Inherits:
-
Object
- Object
- RLTK::StreamPosition
- Defined in:
- lib/rltk/token.rb
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.
38 39 40 41 42 43 44 |
# File 'lib/rltk/token.rb', line 38 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
27 28 29 |
# File 'lib/rltk/token.rb', line 27 def file_name @file_name end |
#length ⇒ Integer
24 25 26 |
# File 'lib/rltk/token.rb', line 24 def length @length end |
#line_number ⇒ Integer
18 19 20 |
# File 'lib/rltk/token.rb', line 18 def line_number @line_number end |
#line_offset ⇒ Integer Also known as: start
21 22 23 |
# File 'lib/rltk/token.rb', line 21 def line_offset @line_offset end |
#stream_offset ⇒ Integer
15 16 17 |
# File 'lib/rltk/token.rb', line 15 def stream_offset @stream_offset end |