class Lexer

Defined in:

lexer.cr

Constant Summary

SIMPLE_TOKENS = {'.' => "dot", '*' => "star", ']' => "rbracket", ',' => "comma", ':' => "colon", '@' => "current", '(' => "lparen", ')' => "rparen", '{' => "lbrace", '}' => "rbrace"}
START_IDENTIFIER = ((Set.new('a'..'z')) + (Set.new('A'..'Z'))) + Set {'_'}
VALID_IDENTIFIER = START_IDENTIFIER + (Set.new('0'..'9'))
VALID_NUMBER = Set.new('0'..'9')
WHITESPACE = Set {' ', '\t', '\n', '\r'}

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def chars : Array(Char) #

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

[View source]
def current : Char | Nil #

[View source]
def current=(current : Char | Nil) #

[View source]
def expression : String #

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

[View source]
def length : Int32 #

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

[View source]
def position : Int32 #

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

[View source]
def tokenize(expression : String) : Array(Token) #

[View source]