class CLTK::Token
- CLTK::Token
- Reference
- Object
Defined in:
cltk/token.crClass Method Summary
-
.new(type : String | Symbol, value : TokenValue = nil, position : StreamPosition? = nil)
Instantiates a new Token object with the values specified.
Instance Method Summary
-
#==(other)
Compares one token to another.
- #clone
-
#position : CLTK::StreamPosition?
@return [StreamPosition] StreamPosition object associated with this token.
-
#to_s
@return [String] String representing the tokens type and value.
-
#type : String | Symbol
@return [Symbol]
-
#value : String?
@return [Symbol]
Instance methods inherited from class Object
in?(collection : Array | Set)
in?
Class Method Detail
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.
Instance Method Detail
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]
@return [StreamPosition] StreamPosition object associated with this token.