class Drizzle::Token
- Drizzle::Token
- Reference
- Object
Overview
A Token is generated by the Lexer as it reads in Drizzle source code.
Tokens are then used to generate an Abstract Syntax Tree (AST) which can then be used to actually make the language do things.
Defined in:
drizzle/token.crConstructors
-
.new(token_type : TokenType, literal : String, file_name : String = "<stdin>", line_num : Int32 = 0, char_num : Int32 = 0)
Create an instance of a Token.
Instance Method Summary
-
#char_num : Int32
The number of the initial character in the string that generated this Token
-
#file_name : String
The name of the file this Token was generated from
-
#line_num : Int32
The number of the line in the file that this Token was generated from
-
#literal : String
The literal value that was used to generate this Token instance
-
#to_s : String
Convert the Token instance into a String representation.
-
#token_type : Drizzle::TokenType
The
TokenTypethat represents the type of this Token instance
Constructor Detail
def self.new(token_type : TokenType, literal : String, file_name : String = "<stdin>", line_num : Int32 = 0, char_num : Int32 = 0)
#
Create an instance of a Token.