This is a simpler version of Truffle's SimpleLanguage, showcasing fewer of Truffle's capabilities.
It is intended to show the absolute basics of Truffle.
- Only string and int literals allowed.
- No bools
- No function literals.
- No nulls.
- No suport for objects.
- Sum (+) is the only binary operation (works on both Strings and Ints, like in SimpleLanguage).
- No suport for local variables other than function arguments.
- Function definitions are only allowed at the top level.
- Functions can't be redefined.
- This makes
TLFunction
a bit simpler than SLFunction.- It receives the RootNode in the constructor itself.
- This makes
- Function bodies can only consist of single expressions.
- There aren't any statements or looping constructs.
- We don't have to catch control flow exceptions thrown by return nodes.
- There's no need of a SLFunctionBodyNode analogue for catching control flow exceptions