institute for computer science chair iv: software & systems engineering1 how to represent...
Post on 18-Jan-2018
214 Views
Preview:
DESCRIPTION
TRANSCRIPT
Institute for Computer Science
Chair IV: Software & Systems Engineering 1
How to represent Models, Languages and Transformations?
Martin Feilkas
Workshop on Domain-Specific Modeling
Oct. 22nd, 2006
Institute for Computer Science
Chair IV: Software & Systems Engineering 2
What‘s the difference?
Respresentation:
Usage:
Defined by:
textualgraphical
parsingsyntax-driven construction
grammardata model
Institute for Computer Science
Chair IV: Software & Systems Engineering 3
BNF ER
Identifier Identifier IdentifierIdentifierIdentifier
Declaration DeclarationDeclaration Expression
Statement_Block
Context-sensitive Rules
Declaration Expression
1
Identifier
n n
1
Identifier
Statement_Block
11
n n
Identifier Expressionn mDeclaration
n1
The same entity
Institute for Computer Science
Chair IV: Software & Systems Engineering 4
Consequences
• Elimination of redundant information
• ER-modeling is more expressive than context-free grammars– But still not expressive enough, so constraints are still
needed
• ER-models are easier to modify by ”ordinary” developers
• Merging: Database synchronisation instead of pattern matching
Institute for Computer Science
Chair IV: Software & Systems Engineering 5
Transformation
Transformation is a way of to specify semantic for DSLs (translational semantics)
• Nowadays:– Template-based code-generation– Weak syntax highlighting– No syntax-respecting code generation (~testing)
• Why? Generator-Backends only know that the target language is textual.
Institute for Computer Science
Chair IV: Software & Systems Engineering 6
Transformation
• Translate to the abstract and not to the concrete syntax
• No more differentiation between model-to-model and model-to-code transformation
• Syntax-driven template specification Component c insert Java-Class(Name = k.Name, Visibility="public") jk { insert Constructor(Name = jk.Name); Port (Type == "sender") p insert Method(Name = c.Name+"_"+p.Name){…}; Port (Type == "receiver") p insert Method(Name = c.Name+"_"+p.Name){…}, insert Method(Name = "CS"+c.Name+"_"+p.Name){…},
insert Attribute(Name = p.Name, Type=bool);
DataElement d GenAttr;}
GenAttr : DataElement d insert Attribute(Name = d.Name, Type=string);
top related