class Myst::Lexer
- Myst::Lexer
- Reference
- Object
Direct Known Subclasses
Defined in:
myst/syntax/lexer.crConstructors
Instance Method Summary
-
#advance_token
Move to a new token with a new buffer.
-
#check_for_keyword
Attempt to lex the current buffer as a keyword.
-
#col : Int32
Current column number in the source.
-
#col=(col : Int32)
Current column number in the source.
- #consume_comment
- #consume_constant
- #consume_identifier
- #consume_numeric
- #consume_string
- #consume_symbol_or_colon
- #consume_whitespace
- #current_char : Char
- #current_location
-
#current_token : Token
Token currently being parsed.
-
#current_token=(current_token : Token)
Token currently being parsed.
-
#finalize_token
Assign the tokens final value and add it to the consumed tokens list.
- #finished? : Bool
-
#last_char : Char
Current character in the source.
-
#last_char=(last_char : Char)
Current character in the source.
- #lex_all
- #peek_char : Char
-
#read_char : Char
Consume a single character from the source.
-
#read_token : Token
Consume and store a single token from the source.
-
#reader : Reader
Source code being lexed.
-
#reader=(reader : Reader)
Source code being lexed.
-
#row : Int32
Current line number in the source.
-
#row=(row : Int32)
Current line number in the source.
-
#source_file : String
Full path to the source file used by this lexer.
-
#source_file=(source_file : String)
Full path to the source file used by this lexer.
-
#tokens : Array(Token)
List of tokens already parsed.
-
#tokens=(tokens : Array(Token))
List of tokens already parsed.
Constructor Detail
Instance Method Detail
Attempt to lex the current buffer as a keyword. If one is found, the token type will be set appropriately. If not, the token type will not be changed.
Full path to the source file used by this lexer. For STDIN and other
non-local input methods, this will be nil
.
Full path to the source file used by this lexer. For STDIN and other
non-local input methods, this will be nil
.