automata based method for domain specific languages definition ulyana tikhonova phd student at st....
TRANSCRIPT
Automata Based Method for Domain Specific Languages Definition
Ulyana TikhonovaPhD student at St. Petersburg State Politechnical University,
supervised by Fedor NovikovGuest at TU/e, SET supervised by Mark van den Brand
2
Motivation
• Domain Specific Languages– Both graphical and textual notations– Dynamic semantics of the language
• In the context of MDE– Models drive execution
• Using UML as description formalism– UML is considered to be more intelligible to
ordinary programmers
01.12.2010
3
The proposed solution
01.12.2010
UML class diagrams
UML state machine diagrams
• UML as description formalism• Executable UML to implement DSL
are interpreted by Automata Virtual Machine
Algorithm of interpretation
Parsing algorithm
4
Use case model
01.12.2010
5
Outline
• Automata model• DSL definition (example: mini language for
manipulations with sets)– Metamodel– Operational semantics– Concrete syntax
• Some conclusions on the method• Plan
01.12.2010
6
Automata model
01.12.2010
7
Notation
01.12.2010
Name of state machine with declaration of local variables
Source of events: triggers
Controlled object: effects and guard conditions
Composite state: substitution of state machine
Exit point: output of submachine
Weaving DSL
9
Definition of DSL metamodel with UML class diagram
01.12.2010
Contextual constraints
10
Operational semantics of the mini language for manipulations with sets
01.12.2010
a, cA = ?
11
Semantics of the Program concept
01.12.2010
Input Output
Queries to model
Invocation ofcomponents
12
Semantics of the Expression concept: Set Representation case
01.12.2010
Queries to model
Output: yield next element
13
Semantics of the Expression concept: Set Id case
01.12.2010
14
Semantics of the Expression concept: Operation() case
01.12.2010
15
Semantics of the Expression concept: Operation() case
01.12.2010
16
How should it work?
01.12.2010
17
Applying interaction model: instance of the interaction
01.12.2010
18
Interfaces specification
01.12.2010
1901.12.2010
Second type of automata composition
20
Concrete syntax = set of constructors of language concepts
01.12.2010
substitution
Concrete syntax of expression
01.12.2010 21
Setting and checkingcontextual constraints
22
Concrete syntax of Set Representation
01.12.2010
Usage of previously stored information
23
Conclusion: advantages of the proposed method
• The same description formalism for definition of different notations (graphical, textual, etc.)– Events based generalization
• The same description formalism for concrete syntax definition and for semantics definition might simplify the process of new DSL creation– UML state machines diagrams
• Specification of new DSL should be sufficient for receiving its implementation automatically– Automata programming virtual machine
01.12.2010
24
Plan• Implementation of the method = implementation
of the automata programming virtual machine– Specification of the method using M-SOS formalism– Programming
• Assessment of the proposed method– Specification of some DSL using this method
• Definition of the scope of the proposed method– Analysis of the kind of languages that could be defined
as instances of the proposed DSL meta-metamodel– Analysis of the kind of languages notations that are
convenient to be defined through automata01.12.2010
25
Overview of the related work
• Theoretical approach– denotational semantics, action semantics, SOS
• Model transformation ± code generation– MPS, MetaEdit+, AMMA, …
• Source code of a translator/compiler – The most popular one
01.12.2010
26
Why automata?
• DSL = metamodel + behavior + notation• Modeling behavior in UML– State machine diagrams– Activity diagrams
• Events based specification of the concrete syntax: events are considered to be captured by automata
01.12.2010
27
DSL meta-metamodel
01.12.2010