classbrainfuck::Lexer

sys::Obj
  brainfuck::Lexer

Transform the sourcecode in a list of Token ready to be interpreted.

addLastToken

Source

Void addLastToken()

advance

Source

Void advance()

Advance the reader to the next character

column

Source

Int column := 1 { private set }

Current column number in source code

currentChar

Source

Int currentChar()

Current char in source code

index

Source

Int index := 0 { private set }

Current char in source code

instruction

Source

Instruction? instruction { private set }

Last instruction read.

isRunning

Source

Bool isRunning()

true if finished reading the source code

line

Source

Int line := 1 { private set }

Current line number in source code

make

Source

new make(Str source)

Creates the lexer

readInstruction

Source

Void readInstruction()

readToken

Source

Void readToken()

source

Source

Str source { private set }

Source code

token

Source

Token? token { private set }

Last token readed

tokenize

Source

This tokenize()

tokens

Source

Token[] tokens := Token[,] { private set }

Tokens readed