Prototype

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.

ConcernImplementationSignal
Lexing and parsingJavaCC grammarFormal language structure
ScopeStack of scope mapsStatic-name validation
FunctionsStored source fragmentsRe-entrant execution
Control flowConditionals, loops, repeatExecutable 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.

Built with

JavaJavaCCDSLParserInterpreter