using the meta-environment for model-driven engineering
DESCRIPTION
Using the Meta-Environment for Model-Driven Engineering. Tijs van der Storm. ESUG 2008, AmsterdamTRANSCRIPT
Using the Meta-Environment for Model-Driven Engineering
Tijs van der Storm, Ph.D.Centrum voor Wiskunde en [email protected]://homepages.cwi.nl/~storm
26th August 2008 Using the Meta-Environment for MDE 2
Introduction
Me: Tijs van der Storm Researcher (CWI) / teacher (UvA) Interests:
Software evolution Programming languages
Today: Using the Meta-Environment... for Model Driven Engineering (MDE)
26th August 2008 Using the Meta-Environment for MDE 3
The Meta-Environment
a programming environment for languages
26th August 2008 Using the Meta-Environment for MDE 4
ASF+SDF Meta-Environment
ASF+SDF
ASF: Algebraic Specification FormalismSDF: Syntax Definition Formalism
26th August 2008 Using the Meta-Environment for MDE 5
Introducing the Meta-Environment
...in counterpoint with Smalltalk
26th August 2008 Using the Meta-Environment for MDE 6
Smalltalk
Everything is an object
26th August 2008 Using the Meta-Environment for MDE 7
ASF+SDF Meta-Environment
Everything is (parsed) “source code”(also called “terms”)
26th August 2008 Using the Meta-Environment for MDE 8
Terms are trees
...parse trees ASTs with layout
26th August 2008 Using the Meta-Environment for MDE 9
Smalltalk
Every object has a class
26th August 2008 Using the Meta-Environment for MDE 10
ASF+SDF Meta-Environment
All source code has syntax(defined by context-free grammars)
26th August 2008 Using the Meta-Environment for MDE 11
SDF: Syntax Definition Formalism Similar to EBNF Modular Arbitrary CFGs
GLR parsing Scannerless Disambiguation
26th August 2008 Using the Meta-Environment for MDE 12
Smalltalk
All computation occurs through messages
26th August 2008 Using the Meta-Environment for MDE 13
ASF+SDF Meta-Environment
All computation is transformation(described using rewrite rules)
26th August 2008 Using the Meta-Environment for MDE 14
ASF: Algebraic Specification Formalism Concrete syntax
Match Construct
Term rewriting Purely functional Automatic traversal
traversal functions
x + 0 = xx * 1 = xx * (y + z) = x * y + x * z
if !x then S1 else S2 = if x then S2 else S1
compile(while x do S) = LOOP: load x; jz END; compile(S); jmp LOOP; END:
26th August 2008 Using the Meta-Environment for MDE 15
Smalltalk
The language = the environment
26th August 2008 Using the Meta-Environment for MDE 16
ASF+SDF Meta-Environment
Languages are environment contracts(environment knows about some languages)
26th August 2008 Using the Meta-Environment for MDE 17
Integration in the environment
Little languages Errors Facts Formatting ...
Easily extended Define a language + GUI plugin
26th August 2008 Using the Meta-Environment for MDE 18
ASF+SDF Meta-Environment
What does it have to do with MDE?
26th August 2008 Using the Meta-Environment for MDE 19
What is MDE anyway?
OMeta
Magritte
Fame
MBA Smalltalk
26th August 2008 Using the Meta-Environment for MDE 20
Model driven engineering
Domain specific notations graphical textual
Transformation code generation model-to-model “compilation”
26th August 2008 Using the Meta-Environment for MDE 21
MDE & the Meta-Environment
MetaModel
Model
System
represented by
conforms to
Meta MetaModel Grammar
Source code
System
Grammar of Grammars
Adapted from: Jean Bézivin, On the Unification Power of Models, UML 2003
26th August 2008 Using the Meta-Environment for MDE 22
A little language for Markup
Markaby programmatic HTML
26th August 2008 Using the Meta-Environment for MDE 23
A simple example
26th August 2008 Using the Meta-Environment for MDE 24
Recursive menus
26th August 2008 Using the Meta-Environment for MDE 25
Waebric tool architecture
Waebricgrammar Evaluator
Compiler
Formatter
Importer Checker
XMLgrammar
Javagrammar
Factextractor
XMLformatter
= dependency
26th August 2008 Using the Meta-Environment for MDE 26
Demo
26th August 2008 Using the Meta-Environment for MDE 27
Results: Source Lines of Code
Component SDF ASF Total SLOCJava grammar 1583 0 1583XML grammar (w/o DTDs) 109 0 109
248 0 248Evaluator 348 685 1033Compiler 277 611 888Import resolver 106 87 193Checker 131 174 305Fact extractor 84 119 203
129 43 172XHTML formatter 50 100 150
3065 1819 4884
Waebric grammar
Waebric formatter
26th August 2008 Using the Meta-Environment for MDE 28
Summary
Meta-Environment All data has syntax All computation is transformation Languages are environment contracts
MDE = DSL engineering (a.o.) Waebric case-study
26th August 2008 Using the Meta-Environment for MDE 29
Thank you!
Questions? More info:
http://meta-environment.org [email protected]
to be released soon...
26th August 2008 Using the Meta-Environment for MDE 30
END