Tool demo composition of executable languages

Post on 14-Apr-2017

183 views 0 download

Transcript of Tool demo composition of executable languages

Leveraging Software Product Lines Engineering in the construction of

Domain-Specific Languages

David Méndez Acuña Benoît Combemale

VaryMDE

DiverSE Coffe – 23th April 2015

Problem statement

UML state machines diagrams

Rhapsody

Classical statecharts

States and simple transitions (triggers, conditions, etc.)

Example: A family of languages for Finite State Machines A   B  

event[condition]  

Academic example: Crane, M., Dingel, J., UML vs. classical vs. Rhapsody statecharts: not all models are created equal. Software & Systems Modeling. Vol. 6 No. 4. Springer-Verlag 2007.

Semantic and syntactic variation points in languages for FSM

Example: A family of languages for Finite State Machines

Family of Languages

Feature A

Feature B Feature B

F. D F. D F. D F. D F. D F. D

Language Product Line

Software Languages are Software too!

Software Engineering Techniques … Software Product Lines Engineering

Méndez-Acuña’s PhD

Jean-Marie Favre, Dragan Gasevic, Ralf Lmmel, and Ekaterina Pek. Empirical Language Analysis in Software Linguistics. In Software Language Engineering. Springer. 2011

Steffen Zschaler, Pablo Sánchez, Joo Santos, Mauricio Alférez, Awais Rashid, Lidia Fuentes, Ana Moreira, Joo Arajo, and Uir Kulesza. VML* A Family of Languages for Variability Management in Software

Product Lines. In Software Language Engineering. Springer. 2010.

Challenges

Language Units

Family of DSLs

Variability Models & Configuration

Feature A

Feature B Feature B

F. D F. D F. D F. D F. D F. D

Multi-dimensional & staged variability modeling

Configured DSL

Language Units Composition

Modular Languages Design

Let’s get fun! Tool DEMO

The citizen watch

Initial

displays

alarm 1

alarm 2

start  

T1  

a  

a  

T2  

David Harel. 1987. Statecharts: A visual formalism for complex systems. Sci. Comput. Program. 8, 3 (June 1987), 231-274.

Button a

Display

The citizen watch

Initial

displays

alarm 1

alarm 2

start  

T1  

a  

a  

T2  

David Harel. 1987. Statecharts: A visual formalism for complex systems. Sci. Comput. Program. 8, 3 (June 1987), 231-274.

while(alarm1.active){ println(‘(1) beep’) }

while(alarm1.active){ println(‘(2) beep’) }

doActivity

doActivity

Core FSM: State Machine, States, Transitions, Triggers

Imperative Language: Program, Loop, Conditions, …

The citizen watch

Core FSM: State Machine, States, Transitions, Triggers

Imperative Language: Program, Loop, Conditions, … Required

Interface

Provided Interface

aggregation

The citizen watch

Initial

displays

alarm 1

alarm 2

start  

T1  

a  

T2  

David Harel. 1987. Statecharts: A visual formalism for complex systems. Sci. Comput. Program. 8, 3 (June 1987), 231-274.

Core FSM: State Machine, States, Transitions, Triggers CompositeStates:

CompositeState, … +

Initial

displays

alarm 1

alarm 2

start  

T1  

a  

a  

T2  

The citizen watch

Initial

displays

alarm 1

alarm 2

start  

T1  

a  

T2  

David Harel. 1987. Statecharts: A visual formalism for complex systems. Sci. Comput. Program. 8, 3 (June 1987), 231-274.

while(alarm1.active){ println(‘(1) beep’) }

while(alarm1.active){ println(‘(2) beep’) }

doActivity

doActivity

Core FSM: State Machine, States, Transitions, Triggers CompositeStates:

CompositeState, … +

The citizen watch

Core FSM: State Machine, States, Transitions, Triggers

Imperative Language: Program, Loop, Conditions, … Required

Interface

Provided Interface

CompositeStates: CompositeState, …

Extension Point

Extension

aggregation

extension

Melange

Some cool features coming…

From Variability Models to Software Languages Engineering in the Large

Some cool features coming…

Program

+exec() : void

Statement

+eval() : void

Condition

+eval() : void

Loop

+eval() : void

VarDecl

+eval() : void

StatementListContainer

+exec() : void

Statement

+eval() : void

Method

+exec() : void

statements

0 .. *

statements 0 .. *

Condition

+eval() : void

ForLoop

+eval() : void

LocalVariableStatement

+eval() : void

Statement

+eval() : void

Block

+eval() : void

IfStatement

+eval() : void

ForStatement

+eval() : void

VariableDeclaration

+eval() : void

statements

0 .. * Constraint

+eval(context : Map) : boolean

Provided Interface: Java Provided Interface: C#

Required Interface:

Finite State Machines Binding

Java <-> FiniteStateMachines Binding

C# <-> FiniteStateMachines

Structural heterogeneities

FOR YOUR ATTENTION, THANK YOU!

QUESTIONS, COMMENTS,

FEEDBACK?