class Drizzle::Token

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.cr

Constructors

Instance Method Summary

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.


[View source]

Instance Method Detail

def char_num : Int32 #

The number of the initial character in the string that generated this Token


[View source]
def file_name : String #

The name of the file this Token was generated from


[View source]
def line_num : Int32 #

The number of the line in the file that this Token was generated from


[View source]
def literal : String #

The literal value that was used to generate this Token instance


[View source]
def to_s : String #

Convert the Token instance into a String representation.


[View source]
def token_type : Drizzle::TokenType #

The TokenType that represents the type of this Token instance


[View source]