Presentation is loading. Please wait.

Presentation is loading. Please wait.

Implementing Language Extensions with Model Transformations

Similar presentations


Presentation on theme: "Implementing Language Extensions with Model Transformations"— Presentation transcript:

1 Implementing Language Extensions with Model Transformations
Ivan Kurtev Software Engineering Group University of Twente the Netherlands

2 Outline The Role of Languages in MDE; Language Elements;
Language Extensions; Examples: Language composition; Abstract syntax extension; Conclusions;

3 Use of Languages in MDE Languages for expressing models:
Meta-modeling: modeling of languages; Transformation languages: Can we use MDE techniques to solve language design problems?

4 Language Elements Concrete Syntax Abstract Syntax (L) Semantics:
Related to parsing; Textual, visual; Abstract Syntax (L) Defines the structures represented by the concrete syntax; Semantics: Semantic Domain (D); Semantic Mapping (M) M: L -> D

5 Language Extensions Syntax Extensions: Semantic Extensions:
Extensible grammars; Extensible parsers; Macro definitions; Semantic Extensions: Modular attribute grammars; Monads; Action semantics; Language Composition: Involves syntax and semantic extensions;

6 Language Elements in MDA Terms (1)
Concrete Syntax: ? Abstract Syntax (L) Defined as a meta-model; Semantics: Semantic Domain (D): a model Semantic Mapping (M): a model transformation; M: L -> D

7 Language Elements in MDA Terms (2)
How can MDA techniques be used for language design tasks? What do we gain (do we do better than the current techniques) ? How are traditional problems solved in MDA? Language reuse; Language composition; Language extension;

8 Example 1: Composing XML Languages
Application-specific XML processing: XML Document DOM Parser Processing Code DOM Tree Application Objects Transformation Transformation from XML document to application objects; XML Language Composition: Concrete syntax composition is solved; Semantic mapping: composition of transformations; Semantic domain: software composition; Application: hybrid XML languages and compound documents;

9 Transformation Pattern for XML Processing
Schema-less processing: based on DOM; Schema-based processing: an XML schema and DOM are available;

10 Structure of XML Applications
Separation of concerns: Syntax (schema); Processing logic (transformation specification); Application classes (semantic domain);

11 Example (1) Processing of a subset of SMIL timing module;
Source schema: <attribute name=’begin’ type=’string’/> <attribute name=’end’ type=’string’/> <attribute name=’dur’ type=’string’/> <attribute name=’timeContainer’ type=’string’/> Example of a timed document: <a timeContainer=’seq’ begin=’1’ dur=’20’> <b timeContainer=’par’ dur=’10’> <c timeContainer=’none’ dur=’10’/> <d timeContainer=’none’ dur=’10’/> </b> <e timeContainer=’none’ dur=’10’/> </a> SMIL – Synchronized Multimedia Integration Language

12 Example (2) Target Application Classes:

13 Composition of XML Languages
A new language may be composed with the timing module: New processor is obtained via: Composing target application classes (software composition); Composing transformation definitions (based on the transformation language constructs);

14 Example 2: Abstract Syntax Extensions
Problem: what if a transformation language does not support required compositional operators? Possible Solutions: Compose transformation definitions by applying a transformation; Extend the transformation language with new constructs; Example: Extending the abstract syntax of a language;

15 Example 2: Implementation
Extended syntax is transformed to the initial syntax:

16 Sequential Composition of Extensions

17 Conclusions Examples of applicability of MDA techniques:
Composition of XML languages; Abstract syntax extension; Open Questions: Are model transformations suitable for defining semantic mappings? For which type of languages? Scalability in case of language composition? Comparison to other techniques (attribute grammars, action semantics,…)


Download ppt "Implementing Language Extensions with Model Transformations"

Similar presentations


Ads by Google