Visual Specification of a DSL Processor Debugger Tamás Mészáros Budapest University of Technology and Economics Depart ment of Aut omat ion and Applied Inf ormat ics meszt am@aut .bme.hu Tihamér Levendovszky Budapest University of Technology and Economics Depart ment of Aut omat ion and Applied Inf ormat ics t ihamer@aut .bme.hu Abstract Graph rewriting-based model transformation is an essential tool to process graph-based visual models. If the execution of transfor- mations is not supported by the continuous presentation of the modifications performed on the model, the traceability and the debugging of transformations becomes difficult. Recent modeling tools usually support the definition of rewriting rules based trans- formations in a visual or textual way, and only a few of them sup- port visual debugging facilities. These debuggers are hand-coded at a price of a huge amount of work. This paper presents a model transformation debugger built on the top of the animation frame- work and the transformation engine of the Visual Modeling and Transformation System. The integration of the transformation engine and the animation of the user interface are described with visual modeling techniques. Categories and Subject Descriptors I.6.2., I.6.3. [Simulation and Modeling]: Simulation Languages, Applications General Terms Design, Languages Keywords Model transformation, Animation, VMTS 1. Introduction Domain-specific modeling is a powerful technique to describe complex systems in a precise but still understandable way. The strength of domain-specific modeling lies in the application of domain-specific languages to describe a system. Domain-specific languages are specialized to a concrete application domain; there- fore, they are particularly efficient in their problem area compared to general purpose languages. Models created with such languages usually need further au- tomated processing methods to utilize the information expressed by the models in real, end-user applications. The processing may be similar to the source code compilers which convert human- readable source code to byte-code or machine code executed by the hardware or a virtual machine, but various model-to-model transformations are also frequent. When developing a model processor for a language, it is im- portant to be able to efficiently trace and debug the operations performed by the processor. It is not negligible how much effort is required to develop a visual debugger either. The motivation of our work is to provide a model transformation debugger solution built with the help of visual modeling techniques. Visual Modeling and Transformation System (VMTS) [1] is a general purpose metamodeling environment supporting an arbi- trary number of metamodel levels. Models in VMTS are represented as directed, attributed graphs the edges of which are also attributed. The visualization of models is supported by the VMTS Presentation Framework (VPF) [2]. VPF is a highly cus- tomizable presentation layer built on domain-specific plugins which can be defined in a declarative manner. VMTS Animation Framework The VMTS Animation Framework (VAF) [3] is a flexible frame- work supporting the real-time animation of models both in their visualized and modeled properties. The architecture of VAF is illustrated in Figure 1. VAF separates the animation of the visualization from the dy- namic behavior (simulation) of the model. For instance, the dy- namic behavior of a graphically simulated statechart is really different from that of a simulated continuous control system mod- el. In our approach, the domain knowledge can be considered a black-box whose integration is supported with visual modeling techniques. Using this approach, we can integrate various simula- tion frameworks or self-written components with event-driven communication. The animation framework provides three visual languages to describe the dynamic behavior of a metamodeled model, and their processing via an event-driven concept. The key elements in our approach are the events. Events are parametrizable messages that connect the components in our environment. The services of the Presentation Framework, the domain-specific ex- tensions, possible external simulation engines (ENVIRONMENT block in Figure 1) are wrapped with event handlers, which pro- vide an event-based interface. Communication with event han- dlers can be established using events. The definition of event handlers is supported with a visual language. The visual language defines the event handler, its parameters, the possible events, and the parameters of them - called entities (Event handler model in the figure). The default implementation of an event handler is generated based on the model, but the event handler methods which interact with the wrapped object have to be written manual- ly (Implementation block). The animation logic can be described using an event-driven state machine, called Animator (Animator state machine block). We have designed another visual language to define these state machines. The state machine consumes and produces events. The transitions of the state machine are guarded by conditions (Guard property) testing the input events and fire other events after per- forming the transition (Action property). States also define an Action property, which describes an operation that is executed when the state becomes active. The input (output) events of the state machine are created in (sent to) another state machine or an event handler. The events produced by the event handlers and the state machines are scheduled and processed by a DEVS [4] based simulator engine (Animation Engine).