Lox interpreter written i Go.
| .vscode | ||
| tests | ||
| .gitignore | ||
| ast_string.go | ||
| callable.go | ||
| class.go | ||
| env.go | ||
| expr.go | ||
| function.go | ||
| globals.go | ||
| glox.go | ||
| go.mod | ||
| go.sum | ||
| interpreter.go | ||
| parser.go | ||
| parser_test.go | ||
| README.md | ||
| resolver.go | ||
| scanner.go | ||
| stack.go | ||
| stmt.go | ||
| tokentype_string.go | ||
GLOX
Lox interpreter written i Go.
This is ongoing project where I try to recreate "JLOX" language in Go instead of Java. It completly based on instructions from Bob Nystrom's book "Crafting interpretters".
Currently supported:
- REPL
- variables
- functions
- functions as values
- closures
- exceptions
- classes
- scoped blocks
- conditions
- loops
- basic arithmetic
- AST printing
- error recovery
TODO:
- Virtual Machine
- Intermediate representaion
Run
Simply compile and run binary. By default you will get REPL session.
go build
./glox
> print 1 + 1;
If you want to run script - just pass script path as an argument:
go build
./glox ./tests/functions.lox
Testing
TODO