Automata Based Method for Domain Specific Languages Definition Ulyana Tikhonova PhD student at St. Petersburg State Politechnical University, supervised by Fedor Novikov Guest at TU/e, SET supervised by Mark van den Brand
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
The proposed solution 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
Use case model
Outline Automata model DSL definition (example: mini language for manipulations with sets) – Metamodel – Operational semantics – Concrete syntax Some conclusions on the method Plan
Automata model
Notation 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
Definition of DSL metamodel with UML class diagram Contextual constraints
Operational semantics of the mini language for manipulations with sets a, cA = ?
Semantics of the Program concept Input Output Queries to model Invocation of components
Semantics of the Expression concept: Set Representation case Queries to model Output: yield next element
Semantics of the Expression concept: Set Id case
Semantics of the Expression concept: Operation( ) case
Semantics of the Expression concept: Operation( ) case
How should it work?
Applying interaction model: instance of the interaction
Interfaces specification
Second type of automata composition
Concrete syntax = set of constructors of language concepts substitution
Concrete syntax of expression Setting and checking contextual constraints
Concrete syntax of Set Representation Usage of previously stored information
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
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 automata
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
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
DSL meta-metamodel