"Build your own Interpreter" Challenge.
Following the book Crafting Interpreters by Robert Nystrom.
$> cat test.lox
var hello = "Hello";
{
var hello = "Guten Tag";
print hello + ", Reader!";
}
print hello + ", Reader!";
$> ./your_program.sh run test.lox
Guten Tag, Reader!
Hello, Reader!
Alternatively to running you can:
tokenize
to see the list of tokens in the source file
- Lexer: OK
- Recursive descent parser: OK
- Expression evaluator: OK
- Statements & Expression statements & Scope: OK
- Control flow: TODO