About MOFScript

Scope of the MOFScript subproject

MOFScript Logo

The MOFScript subproject aims at developing tools and frameworks for supporting model to text transformations, e.g., to support generation of implementation code or documentation from models. It should provide a metamodel-agnostic framework that allows usage of any kind of metamodel and its instances for text generation.

The MOFScript language was currently a candidate in the OMG RFP process on MOF Model to Text Transformation. The MOFScript subproject aims to support the MOFScript language in terms of editing, parsing, and execution.

The MOFScript subproject will cover the aspects needed in the context of text generation in software engineering, including:

  • Generation of text from MOF-based models: The ability to generate text from any MOF-based model, e.g., UML models or any kind of domain model.
  • Control mechanisms: The ability to specify basic control mechanism such as loops and conditional statements.
  • String manipulation: The ability to manipulate string values.
  • Output of expressions referencing model elements
  • Production of output resources (files): The ability to specify the target file for text generation.
  • Traceability between models and generated text: The ability to generate and utilize traceability between source models and generated text, e.g., to provide re-generation.
  • Ease of use: An easy-to-use interface

Reverse engineering is kept out of scope at this time, but may be included in the scope at a later point in time.

MOFScript code availability / initial contribution

At this time, code has been developed that supports parsing, checking, editing, and execution of MOFScript code. Currently, these are deployed as separate Eclipse plug-in components, which run within Eclipse. The parser and run-time may also be used independently of Eclipse.

The following code is ready for submission to an Eclipse MOFScript subproject:

  • MOFScript model module: The MOFScript model is an EMF/ecore model, which is the target of the parser and the subject of the runtime / execution engine.
  • Parser module: The parser reads MOFScript text and produces an instance of the MOFScript model, which is also semantically checked.
  • Runtime module: The runtime provides an execution environment for a MOFScript model. It handles all aspects of execution.
  • Editor module: The editor provides an Eclipse editor environment for the MOFScript language, including content assist, preferences, outliner, documentation, and more.

An initial user guide and examples will also be made available.

MOFScript Architecture Overview

The MOFScript tool is developed as two main logical architectural parts: tool components and service components (see Figure 1). The tool components are end user tools that provide the editing capabilities and interaction with the services. The services provide capabilities for parsing, checking, and executing the transformation language. The language is represented by a model (the MOFScript model), an Eclipse Modeling Framework (EMF) model populated by the parser. This model is the basis for semantic checking and execution. The MOFScript tool is implemented as an Eclipse plug-in using the EMF plug-in for handling of models and metamodels.

Figure 1 MOFScript components and tool architecture

The Service Components consist of these component parts: The Model Manager is an EMF-based component which handles management of MOFScript models. The Parser and Lexer are responsible for parsing textual definitions of MOFScript transformations, and populating a MOFScript model using the Model Manager. The parser is based on antlr. The Semantic Checker provides functionality for checking a transformation’s correctness with respect to validity of the rules called, references to metamodel elements, etc. The Execution Engine handles the execution of a transformation. It interprets a model and produces an output text, typically to a set of output files. The Text Synchroniser handles the traceability between generated text and the original model, aiming to be able to synchronize the text in response to model changes and vice versa.

The MOFScript binaries are available for download, please see the descriptions at http://www.modelbased.net/mofscript

MOFScript community

At this time, MOFScript is developed in a development community at SINTEF, supported and tested by the European Integrated Project MODELWARE (IST Project 511731). We will continue development of MOFScript in this context.

The MODELWARE project, and other successor projects will provide the necessary time and resources to ensure a continuity of development in the subproject.

We will encourage user communities to use the technology and contribute to improvement through feedback. We will also encourage user and external developers to contribute examples, reusable transformations, and code.

We aim to involve users and developers through publicity in publications, conferences, and presentations. We will also use and encourage usage of MOFScript in lecturing at University courses in model-driven development.