Commit e726276a authored by Bernhard Rumpe's avatar Bernhard Rumpe
Browse files


parent f428308f
<h1>Compositional Language Engineering using<br>Generated, Extensible, Static Type-Safe Visitors</h1>
<p>Robert Heim, Pedram Mir Seyed Nazari, Bernhard Rumpe, and Andreas Wortmann</p>
Language workbenches usually produce infrastructure to represent models
as abstract syntax trees (AST) and employ analysis, transformation,
and code generation techniques largely based on visitors. The visitor
pattern and its derivatives suffer from the expression problem when it
comes to extensibility and reuse. Current approaches either forsake
static type safety, require features unavailable in popular
object-oriented languages (e.g., open classes), or rely on procedural
abstraction and thereby give up the object-oriented data encapsulation
(the AST) itself. Our approach to visitors exploits knowledge about the
AST structure under development and generation of statically type-safe
external visitor interfaces that support extensibility in two
dimensions: defining new operations by implementing the interface and
extending the underlying data structure, usually without requiring
adaptation of existing implemented visitors. We present a concept of
visitor development for language engineering that enables an adaptable
traversal and provides hook points for implementing concrete visitors.
This approach is applicable to single DSL implementation and to
language composition. It thus enables a transparent, easy to use, and
static type-safe solution for the typical use cases of language
analysis and transformation.
<h2>Supporting materials</h2>
<p>The Maven project in <a href=""></a>
demonstrates usage of the visitor infrastructure of the language workbench
<a href="">MontiCore</a>.
It consists of three (simplified) languages:</p>
<li><b>Classdiagram with embedded automata</b><br>Grammar:;CDWithAutomaton.mc4</li>
<li>Java 8 SDK</li>
<li>Maven 3+</li>
<p>Extract the To build the project run <code>mvn clean install</code> from the visitor folder that contains the <code>pom.xml</code>. MontiCore generates files to folder <code>visitors/target/generated-sources/monticore/sourcecode</code>. Put this folder on the class path after building the project.</p>
<p>All languages define pretty printers:</p>
<p>The pretty printer for classdiagrams with automata is composed of the other ones.
The CDWithAutomatonTest [1] demonstrates its usage and usage of a method counter [2].<br>
$ROOT_PATH = "../../";
$TITLE = "SE@RWTH : Compositional Language Engineering using Generated, Extensible, Static Type-Safe Visitors";
include ($ROOT_PATH."layout/lib.php");
include ($ROOT_PATH."layout/header.php");
include ("content.php");
include ($ROOT_PATH."layout/footer.php");
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment