| Skip to content. |
Lehrstuhl Systemanalyse |
| Language Modelling HomeA MOF 2.0 for JavaTextual Editing FrameworkModel Pattern | |
This site is about a model driven approach for language development. It presents a series of tools to describe different aspects of languages and to derive automatic tools support for your languages. Our tools for language development are:
Computer languages are pieces of software. Language aspects, like structure, notations, and semantics, determine the development of this software. Like in regular software development, these different language aspects can be modelled. Languages already have to be specified, so that language users have a common understanding, and really use the same language. Furthermore, all language aspects already have to be realised in tools, so that language users can edit, analyse, share, and execute what ever they want to express in the used language. Language modelling reduces language development to modelling each language aspect and automatically derives specifications and tools from the resulting models.
The figure on the left side shows the language aspects
structure, notations, static constraints, and operational
semantics. The figure also assigns structure a dedicated
role. Structure, defining all the concepts of language, is
the basis for the definition of all other aspects. Static
constraints, for example, constrain instances of the
concepts defined in the language structure. Notations, as
another example, are defined for each element in the
language structure. Structure should be defined in object
oriented models. This allows a flexible design and embraces
reuse. A MOF 2.0 for
Java is a modelling framework based on the OMG MOF 2.0
standard. It can be used to define language structures
based on the MOF language CMOF. Such structure definitions,
called meta-models, can be used to create, modify, and
maintain the models of a meta-model within A MOF 2.0 for Java.
The other language aspects are defined based on a meta-model for the language. For each meta-model element (concept) an aspect description provides additional information about how this element is treated in a certain aspect. E.g., how a concept is notated (notation), what are the constraints for an element (static constraints), or what is its meaning (semantics). The figure below visualised this relation between structure element and aspect description. Based on an aspect description, a generic language tool provides a realisation of this aspect. For example: when you have modelled the notation of each meta-model element and put this description into a generic editor, you are automatically provided with a specific editor.
The Textual Editing Framework (TEF) is a framework, which provides model editors based on a meta-model and a template based textual syntax description. In contrast to similar tools, such as XText or the notations facility of kermeta, TEF allows you to edit a model based on the model view controller pattern. This means each editing step is immediately reflected in model changes, and the displayed notations are immediately reacting to all model changes from the outside. This separation of views from model allows multiple editors, with multiple notations, used by multiple users for one and the same model at the same time. TEF is based on eclipse and offers automatic support for features like syntax highlight, semantic sensitive code assist, etc.
Static analysis includes two things: checking static semantics constraints and resolving advanced concepts with simpler replacement constructs. This is originated in languages with extensive feature sets, which have to be stripped down for an easier description of the operational semantics or for model transformations. Examples are name resolution, or replacement of syntactic sugar. The modelling framework A MOF 2.0 for Java comes with an OCL interpreter, which can be used to verify the static constraints defined in the meta-model. With the Model Pattern (MOPA) model transformation language, you can describe and execute simple transformation tasks for your models.
Many languages describe dynamic processes. In order to execute, interpret, or simulate models is such languages, their execution semantics has to be defined. In this site we describe a method to define execution semantics by modelling static structure (language concepts) and dynamic structure (runtime states) independently. You can augment both models static structure and dynamic structure with operations. These operations can be used to describe the behaviour of a model in the defined language. A MOF 2.0 for Java provides a framework for using such semantics descriptions to derive simulators and interpreters.
There is a trend leading from all covering mammoth modelling languages towards languages that are specially designed for a specific purpose or intention. This can be done by extending an established language with "flexible" semantics with concepts tailored for special need. This is known as language profiling. Another possibility is the emerging paradigm language oriented programming, where the programming environments (modelling and programming languages) are no longer static, given tools; the programming or modelling environment itself is adapted to the specific needs of the developer.
The key to both approaches is an easy and fast development of specific languages or language extensions that were designed to fit the special needs of a concrete software engineering problem. There are two things needed for such a fast and easy language development: A technique to model a language, rather than just to build tools that represent the language; and the possibility to reuse and modify existing libraries of language models, rather than implement common language concepts over and over again. Therefore language development has to be model driven.
We need short development cycles and we need to adapt to changes fast, we need to abstract from complex systems, using models and we need model centric development. What is true for software development is also true for the development of languages. And most importantly, the development of software is no longer independent from the development of the languages used to build the software. Therefore language development has to be model driven.
References and Sources:
[1] Interviews on codegeneration.net about intentional programming. www.codegeneration.net
[2] Tony Clark, Andy Evans, Paul Sammut, James Willans; Applied Metamodelling: A Foundation for Language Driven Development. www.xactium.com, 2004
[3] Sergey Dmitriev; Language Oriented Programming: The Next Programming Paradigm. JetBrains, 2004.
Dear user, developer, and fellow researcher; if you have any remarks, comments, suggestions, or questions about the contents, tools, and ideas presented on this site, please do not hesitate to contact me: Markus Scheidgen.
If you want to stay updated about what happens on this site, send me an email with "subscribe" in its header and body.