class 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

Class Method Summary

Instance Method Summary

Instance methods inherited from class Object

in?(collection : Array | Set) in?

Class Method Detail

def self.new(stream_offset = 0, line_number = 0, line_offset = 0, length = 0, file_name : String? = 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 clone #

Returns a copy of self with all instance variables cloned.


[View source]
def file_name : String? #

@return [String]


[View source]
def length : Int32 #

@return [Integer]


[View source]
def length=(length) #

@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) #

@return [Integer]


[View source]
def start : Int32 #

[View source]
def stream_offset : Int32 #

@return [Integer]


[View source]
def stream_offset=(stream_offset) #

@return [Integer]


[View source]