A full-featured scripting language interpreter based on Crafting Interpreters. This interpreter handles scripts written in the Lox language, a high-level scripting language based on the ECMA specifications of JavaScript.
This project is at the forefront of an open-source serious game (currently in pre-production). The goal is to write a scripting language interpreter that can perform runtime behaviour in game engines like Unity.
This interpreter performs a few steps when receiving input:
- Lexical analysis
- Parsing
- Static analysis
- Intermediate representation
- Optimization
- Code generation
- Runtime representation
Lox is similair to high-level scripting languages like JavaScript and Lua. Two of the main aspects are:
- Dynamic typing
- Automatic memory management
Besides those aspects Lox can handle:
- Data types
- Expressions
- Statements
- Variables
- Control flows
- Functions
- Classes
An example of Lox code:
// This is a test
var test = 5;
for (var i = 0; i < test; i = i + 1)
{
print i;
}