classbrainfuck::Lexer
sys::Obj brainfuck::Lexer
Transform the sourcecode in a list of Token ready to be interpreted.
- addLastToken
Void addLastToken()- advance
Void advance()Advance the reader to the next character
- column
Int column := 1 { private set }Current column number in source code
- currentChar
Int currentChar()Current char in source code
- index
Int index := 0 { private set }Current char in source code
- instruction
Instruction? instruction { private set }Last instruction read.
- isRunning
Bool isRunning()trueif finished reading the source code- line
Int line := 1 { private set }Current line number in source code
- make
new make(Str source)Creates the lexer
- readInstruction
Void readInstruction()- readToken
Void readToken()- source
Str source { private set }Source code
- token
Token? token { private set }Last token readed
- tokenize
This tokenize()- tokens
Token[] tokens := Token[,] { private set }Tokens readed