top of page

Unity Interpreter

  • GitHub

Engine: Unity

Project Type: Masters

To create a code teaching game, I created a domain specific language that gets interpreted into C# which is then ran inside of unity all during runtime. This project is intended to be a pedagogical tool, using gameification to teach the logic of very basic programming.

​

How This is Done

  1. Lexical Analysis - Converting the users text into a list of tokens while getting rid of whitespace.​

  2. Recursive Descent Parser - A top-down parser that transforms tokens into an AST, while validating syntax.​

  3. Abstract Syntax Tree (AST) - A representation of the users code which allows for correct execution.

  4. Tree-walk Interpreter - Traverses the AST line-by-line, executing the code inside of unity, in C#.

Screenshot 2026-02-26 162633.png

Abstracted Functions

Unity_BKfjsAVXnG.gif

Line-by-line Execution

Screenshot 2026-03-13 124959.png

Loops

bottom of page