class

Parser

Inherits Lexer < Reference < Object

Instance methods

accept(type : TokenType)

Check if the current token matches the given type and return truthy if it does. Additionally, if the type matches, automatically advance to the next significant token.

Source
advance

Advance through the token stream until a significant token is encountered. This abstraction allows the rest of the parser to quietly ignore whitespace and other insignificant tokens.

Source
expect(type : TokenType)

Similar to accept, but raise an error if the type does not match.

Source
instructions

The list of instructions parsed from the source code. This is what will be fed to the interpreter.

Source
instructions=(instructions : Array(Instruction))

The list of instructions parsed from the source code. This is what will be fed to the interpreter.

Source
parse_assignment
Source
parse_expr
Source
parse_factor
Source
parse_program
Source
parse_statement
Source
parse_term
Source