This project contains a tiny interpreter/compiler for Tigress, a subset of Tiger language (reference). The interpreter and the compiler are written in Rust, whereas in the original project they are written in Haskell.
This depends on nightly rustc
and cargo
. Nightly features are needed because of rust-peg
and docopt_macros
.
If you want to avoid using docopt_macros
because it does not compile, you can work around it by
cargo run --features no-docopt-macros --no-default-features
. In this mode command-line arguments are simply ignored.
The grammar of Tigress is similar to Tiger, but there are some modifications. There are some features that are not supported in Tigress.
item | status (interpreter) |
---|---|
1 Lexical Aspects | ok |
2.1 Lvalues | ok |
2.2 Return values | not supported |
2.3 Record and Array Literals | not supported |
2.4 Function Calls | ok (environment for closure is not supported) |
2.5 Operators | ok |
2.6 Assignment | ok |
2.7 nil | ok |
2.8 Flow control | for and do are supported |
2.9 Let | var, function are supported |
3 Declarations | not supported |
4 Standard Library | not supported |