Quandary Interpreter
Sole developer, January to April 2025
JavaJFlexJava CUPGit
Problem
Quandary is a teaching language from a programming-languages course at Ohio State. It has immutable and mutable data, recursion, and concurrent execution. The assignment was to build a working interpreter for all of it, from raw source text through to evaluated results, including memory management.
Approach
- Extended a JFlex lexer to tokenize the full language.
- Wrote a context-free grammar in Java CUP that parses token streams into ASTs.
- Built the AST node hierarchy around the visitor pattern, keeping traversal separate from the node structure.
- Implemented the evaluator with recursive functions and concurrent execution.
- Wrote a mark-sweep garbage collector to reclaim unreachable heap objects during interpretation.
Outcome
A full interpreter covering the language spec. This is the deepest computer-science work I've done, and the garbage collector and the visitor-pattern evaluator were the two pieces I learned the most from.