This document discusses leveraging software product lines engineering techniques to construct domain-specific languages (DSLs). It presents an example of a family of languages for finite state machines that demonstrates variability points both syntactically and semantically. Challenges in developing language product lines like modeling variability, composing modular languages, and providing interfaces are discussed. The document demonstrates a tool for developing DSLs that supports variability modeling, configurable DSLs from language units, and extensions. Future work on program structure, constraints, and structural heterogeneity between platforms is also mentioned.
2. 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
4. 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
6. 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
7. 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, …
8. The citizen watch
Core FSM: State Machine,
States,Transitions,Triggers
Imperative Language:
Program, Loop, Conditions, …Required
Interface
Provided
Interface
aggregation
9. 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
Â
10. 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, …+
11. 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
12. Melange
Some cool features coming…
From Variability Models to Software Languages
Engineering in the Large