Transformation patterns

From Event-B
Revision as of 20:55, 27 June 2011 by imported>Ilya.lopatkin (New page: The ''Transformation patterns plugin'' allows users to write transformation scripts in [http://www.eclipse.org/gmt/epsilon/doc/eol/ EOL] (simple object-based imperative language) and easil...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The Transformation patterns plugin allows users to write transformation scripts in EOL (simple object-based imperative language) and easily run them over models within the same project.

Editing is done in a simple text editor with syntax coloring. No compilation is needed to run transformations.

What it is

The plugin is essentially a wrapper around the Epsilon framework of interoperatable programming languages which are used to operate over the given EMF models (Event-B in our case). The plugin performs the necessary setup for running the transformations, provides simple user interface for choosing Event-B elements such as machines, events, variables etc, and caches the user input (see later).

User input cache

The plugin provides a cache of objects that user enters (Event-B EMF elements and strings), and can be used as a means to pass the objects between different transformations without them knowing the actual source of input. Thus, the input can be extended to other domain-specific EMF models.

A cache is a map from keys to values where a key consists of a type of object and its identifier, and the value is the actual cached object. The types of objects are handled by the utility library, while the identifiers must be supplied by script developer.

The operations which request input from the user without caching it all start with enter, such as in enterString(..), enterEvent(..). The operations starting with input do the following:

  1. check the cache for existing objects, and return if the object is in the cache
  2. if there is no object with a given id, then ask user to enter the object
  3. put the entered object into the cache

The parameter id is optional. If id=null then an input operation degenerates into enter.

Full list of provided operations

  • enterString
  • inputString
  • enter