Abstract
The analysis of structured text, such as programs in programming languages or documents in domain-specific languages, is a fundamental task of computer science. Compiler
generators are tools that derive components for this analysis from an attribute gram
mar. These components are often generated as source code, which must be compiled
together with a main module, before being used to analyze text.
This thesis develops and evaluates a di!erent approach: An attribute grammar is used
to directly interpret text, without generating analysis components. This promises to
simplify the process of writing attribute grammars through immediate feedback.
The implemented interpreter is based on the specification language Cocol/R, used by
the compiler generator Coco/R. An additional User Interface simplifies the use of the
interpreter, and visualizes the actions performed by the interpreter. A debugger pauses
the interpreter and shows its current state after analyzing user-selected characters.
The interpreter is shown to be capable of handling a variety of use cases: It can analyze
Java 1.4 source code, execute programs in a simple programming language, parse JSON
like documents, and even host Coco/R itself. The interpreter with its additional features
is further shown to improve the process of writing an attribute grammar, and to provide
insight into runtime behavior. Benchmarks show that the interpreter is, as expected,
less e"cient than analysis components generated by Coco/R.
The thesis recommends using the interpreter when initially writing attribute grammars.
One can then use Coco/R to generate e"cient analysis components from the final at
tribute grammar.
| Date of Award | 2026 |
|---|---|
| Original language | English (American) |
| Awarding Institution |
|
| Supervisor | Josef Pichler (Supervisor) |
Studyprogram
- Software Engineering
Cite this
- Standard