class CLTK::Token

Defined in:

cltk/token.cr

Class Method Summary

Instance Method Summary

Instance methods inherited from class Object

in?(collection : Array | Set) in?

Class Method Detail

def self.new(type : String | Symbol, value : TokenValue = nil, position : StreamPosition? = nil) #

Instantiates a new Token object with the values specified.

@param [Symbol] type A symbol representing the type of this Token. @param [Object, nil] value A value associated with this token. @param [StreamPosition, nil] position The position of the token in a stream.


[View source]

Instance Method Detail

def ==(other) #

Compares one token to another. This only tests the token's type and value and not the location of the token in its source.

@param [Token] other Another Token to compare to.

@return [Boolean]


[View source]
def clone #

[View source]
def position : CLTK::StreamPosition? #

@return [StreamPosition] StreamPosition object associated with this token.


[View source]
def to_s #

@return [String] String representing the tokens type and value.


[View source]
def type : String | Symbol #

@return [Symbol]


[View source]
def value : String? #

@return [Symbol]


[View source]