Robot control DSL
A JavaCC grammar and interpreter for a Karel-style robot language with variables, functions, conditionals, loops, and direct execution.
This project implements a self-contained robot-control language. The grammar does more than validate tokens: it manages scope, stores functions, evaluates control flow, and dispatches commands into a simulated robot world.
| Concern | Implementation | Signal |
|---|---|---|
| Lexing and parsing | JavaCC grammar | Formal language structure |
| Scope | Stack of scope maps | Static-name validation |
| Functions | Stored source fragments | Re-entrant execution |
| Control flow | Conditionals, loops, repeat | Executable semantics |
The interesting part is the design constraint: a compact teaching language where the grammar itself carries the interpreter. That makes the tradeoffs visible.
Repository: robot-control-dsl.