Study on interpreters, featuring a complete dynamically-typed language. This work is based on the book Writing An Interpreter In Go, by Thorsten Ball. The project is fully unit-tested.
/astAll available data structures representing the evaluated program/evaluatorNavigates through the AST in order to evaluate its nodes/lexerProduces tokens from chars, it is responsible of syntax checking/objectData structures representing the execution results of the AST by the evaluator/parserThe role of the parser is to produce an AST of the program from tokens/replRead-Eval-Print Loop, which enables direct development in this language/tokenBase representation of the code: a collection of tokens
Execution flow of the interpreter:
string =[lexer]=> []token =[parser]=> ast =[evaluator]=> stream of objects
- Support UNICODE + UFT8 encoding instead of only ASCII. This requires switching from
bytetorunereading - Allow integers as part of a variable or function name (but only if not solely composed of int chars)
- Support ++, --, +=, -=, *=, /=, %=
- Support modulo
- Allow ternary operators
- indicate source line and col when reporting errors (impacts lexer)
- Support else if(...)