An interpreter for a dynamic language.
Any variable can have any type, determined at runtime. Several types are supported: interger, real, boolean, string (basic types), array, tuple (user-defined types), function. All functions are anonymous, but can be assigned to variables.
The project is for educational purpose mainly, but many basic algorithms can be implemented using this language (see example/* folder).
The grammar of language defined here: https://hackmd.io/@rVcuiUEATqOC-eoEZx_mmQ/rk4NYwfb9
- Lexical analyzer
- Syntax analyzer
- Semantics analyzer
- Interpreter
Split each symbol to token. Checks the validity of keywords, literals, identifiers
Constructs AST from the tokens
Checks validity of identifier assignment
Interprets the program represented as an AST tree
- Java 17
- Gradle
- JUnit 5
- Download SDK 17 on your machine
- Clone the project
- Use terminal or any GUI to run the project
One way to run the interpretation is using gradle:
gradle run --args YOUR_PROGRAM_FILE
Example:
gradle run --args example/binary_search.txt