class Taro::Compiler::Lexer

Direct Known Subclasses

Defined in:

compiler/lexer/lexer.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(source : IO, source_file : String, row_start : Int32 = 0, column_start : Int32 = 0) #

[View source]

Instance Method Detail

def advance_token #

Move to a new token with a new buffer.


[View source]
def analyzer : Analyzer #

[View source]
def analyzer=(analyzer : Analyzer) #

[View source]
def brace_stack : Array(Char) #

[View source]
def brace_stack=(brace_stack : Array(Char)) #

[View source]
def check_for_keyword #

[View source]
def column : Int32 #

[View source]
def column=(column : Int32) #

[View source]
def consume_identifier #

[View source]
def consume_identifier_u #

[View source]
def consume_numeric #

[View source]
def consume_single_line_comment #

[View source]
def consume_whitespace #

[View source]
def context_stack : Array(Context) #

[View source]
def context_stack=(context_stack : Array(Context)) #

[View source]
def current_brace : Char #

[View source]
def current_char : Char #

[View source]
def current_context #

[View source]
def current_location #

[View source]
def current_token : Token #

[View source]
def current_token=(current_token : Token) #

[View source]
def finalize_token #

[View source]
def finished? : Bool #

[View source]
def last_char : Char #

[View source]
def last_char=(last_char : Char) #

[View source]
def lex_all #

[View source]
def peek_char : Char #

[View source]
def pop_brace(type : Symbol) #

Attempts to pop the top bracing character from the stack, but only if it matches the given type. Returns false if the type does not match.


[View source]
def pop_context #

[View source]
def push_brace(type : Symbol) #

[View source]
def push_context(context : Context) #

[View source]
def read_char(save_in_buffer = true) : Char #

Consume a single character from the source.


[View source]
def read_char_literal_token #

[View source]
def read_normal_token #

[View source]
def read_string_token #

[View source]
def read_token #

[View source]
def replace_escape_characters(raw) #

[View source]
def row : Int32 #

[View source]
def row=(row : Int32) #

[View source]
def skip_char : Char #

[View source]
def source_file : String #

[View source]
def source_file=(source_file : String) #

[View source]
def token_is_empty? #

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

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

[View source]