This solution describes an implemented interpreter for the functional-logic language Verse, proposed by Epic Games.
The application call needs command-line arguments according to the following pattern:
{renderMode} {resultMode} {command}
{renderMode}: -default | -silent | -debug
{resultMode}: -one | -all
{command}: -code "your code here" | -interactive | -file "your file path here"
For detailed information about the supported expressions take a quick look into the "Verse.g4" file. Some of them are:
- Comments are supported beginning with a '#'.
- Assignment using "x := e"
- Choice as "e1 | e2"
- Failing choice as "false?"
- Choice as range expressions using "Integer..Integer" can be used to create choices with all numbers between the range.
- Recursion is not working.
- ForDo uses flatMap instead of map, therefore not behaving entirely correct.
- Type system is missing.
- Strings support only lower case characters without special characters and only support concatenation via addition and comparison by its length.
Visit the Verse-Interpreter.Test project for samples with expected results.
- Rule Exi-Swap is implemented but not used because the execution strategy infinite-loops when using it.
- one{} equivalent to for{} can be used to wrap expressions for retrieving a single value.
- Functions are not implemented as they are only syntactical sugar for lambdas.