struct CLTK::StreamPosition

Overview

The StreamPosition class is used to indicate the position of a token or other text inside a stream.

Defined in:

cltk/streamposition.cr

Constructors

Instance Method Summary

Instance methods inherited from class Object

in?(collection : Array | Set) in?

Constructor Detail

def self.new(stream_offset : Int32 = 0, line_number : Int32 = 0, line_offset : Int32 = 0, length : Int32 = 0, file_name : String | Nil = nil) #

Instantiates a new StreamPosition object with the values specified.

@param [Integer] stream_offset The position from the beginning of the stream. @param [Integer] line_number The number of newlines since the beginning of the file. @param [Integer] line_offset The offset of this token from the beginning of the current line. @param [Integer] length The length of the text of the token. @param [String, nil] file_name The name of the file being lexed.


[View source]

Instance Method Detail

def file_name : String? #

@return [String]


[View source]
def length : Int32 #

@return [Integer]


[View source]
def length=(length : Int32) #

@return [Integer]


[View source]
def line_number : Int32 #

@return [Integer]


[View source]
def line_offset : Int32 #

@return [Integer]


[View source]
def line_offset=(line_offset : Int32) #

@return [Integer]


[View source]
def start : Int32 #

[View source]
def stream_offset : Int32 #

@return [Integer]


[View source]
def stream_offset=(stream_offset : Int32) #

@return [Integer]


[View source]