Skip to main content
CrystalDocs
Search documentation
Search
Browse Docs
CrystalShards
About
class
CPU::Scanner
Inherits
Reference
<
Object
The scanner for parsing
Constructors
new
(source :
String
, line :
Int32
, labels :
Array
(
Tuple
(
String
,
UInt16
|
UInt8
,
Bool
)))
Instance methods
add_token
(type :
TokenType
, literal :
Int32
|
Nil
= nil)
advance
binary
hex
identifier
is_alpha
(c :
Char
)
is_alpha_numeric
(c :
Char
)
is_at_end
labels
labels=
(labels :
Array
(
Tuple
(
String
,
UInt8
|
UInt16
,
Bool
)))
match
(expected :
Char
)
number
peek
peek_next
scan_token
(just_labels :
Bool
)
scan_tokens
(just_labels :
Bool
= false)
tokens
tokens=
(tokens :
Array
(
Token
))