ABSTRACT

Automaton Using a Visitor . . . . . . . . . . . . . . . . . . . . . . . . 140 7.4 Aspect Weaving with Static Introduction . . . . . . . . . . . . . . . . . 146

7.4.1 Approach Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 7.4.2 Illustrative Example: Operational Semantics for

Cellular Automaton Using Static Introduction . . . 147 7.4.3 Adding Runtime Data Using Static Introduction . 149 7.4.4 Modeling the Interpreter Runtime Data . . . . . . . . . . . 150

7.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151

This chapter discusses how to use model transformations toimplement an interpreter for a given DSML that supports the execution of the DSML models. After reading this chapter, you will be able to implement an interpreter based on the definition of the abstract syntax of the DSML according to state-of-the-art design practices (e.g., based on the visitor pattern in the case of an imperative model transformation language). The chapter is illustrated by the definition of an interpreter for cellular automata evolution rules. Several variants of the interpreter are provided in order to highlight the pros and cons of the possible designs.