class Axal::Lexer

Defined in:

lang/lexer.cr

Constant Summary

KEYWORD = ["and", "else", "end", "false", "fn", "if", "nil", "or", "return", "true", "while", "mod", "fget", "describe", "it"]
ONE_CHAR_LEX = ["(", ")", ":", ",", ".", "-", "+", "/", "*", "[", "]", "{", "}"]
ONE_OR_TWO_CHAR_LEX = ["!", "=", ">", "<"]
WHITESPACE = [" ", "\r", "\t"]

Constructors

Instance Method Summary

Constructor Detail

def self.new(source : String) #

[View source]

Instance Method Detail

def after_source_end_location #

[View source]
def alpha?(c : String) #

[View source]
def alpha_numeric?(c : String) #

[View source]
def consume : String #

[View source]
def consume_digits #

[View source]
def current_location #

[View source]
def digit?(c : String) #

[View source]
def external_code #

[View source]
def identifier #

[View source]
def ignore_comment_line #

[View source]
def lookahead(offset = 1) : String #

[View source]
def number #

[View source]
def source : String #

[View source]
def source_completed? #

[View source]
def source_uncompleted? #

[View source]
def start_tokenization #

[View source]
def string #

[View source]
def token_from_one_char_lex(lexeme) #

[View source]
def token_from_one_or_two_char_lex(lexeme) #

[View source]
def tokenize #

ameba:disable Metrics/CyclomaticComplexity


[View source]
def tokens : Array(Token) #

[View source]
def triangle #

[View source]