Yakindu SCT is a modular toolkit for model-based development of embedded systems using statecharts. It provides an integrated modeling environment for editing, validating, simulating, and generating code from statechart models. The toolkit includes the Yakindu Statechart language which is based on Harel statecharts but with a well-defined execution semantics. It supports both graphical and textual modeling of statecharts. The toolkit is extensible and customizable, allowing for the integration of domain-specific concepts to create domain-specific statechart languages and tools through specialization of the structural and declarative aspects. This enables improved expressiveness and semantic integration of statecharts with specific domains. The presentation demonstrates this approach using an example of integrating concepts from the
2. YAKINDU
is a modular toolkit
for model-based development
(of embedded systems)
Donnerstag, 29. März 12
3. language workbenches
➡ Reuse of
• modeling language
• tools
Donnerstag, 29. März 12
CoMo
CReMa
• open & extendable
• composable to (domain-specific)
Damos (Blocks)
• independent and self-contained
• not bound to a specific methodology
• usable on their own
SCT (Statecharts)
YAKINDU Modules
Eclipse Platform
5. YAKINDU Statechart
• Formalism
similar to state machines as defined by
David Harel, but:
• self-contained
• with
with a well defined interface
a cycle-based execution semantics
•
•
event-driven behavior can
be defined on top
•
Donnerstag, 29. März 12
allows processing
concurrent events
time control is delegated
to the environment
10. Yakindu SCT - Code Generation
• Yakindu
• All
comprises code generators for Java, C, C++
generators can be „customized“ by a generator model
• Custom
generators based on Xpand & Xtend2/Java can be
easily integrated
Donnerstag, 29. März 12
11. Yakindu SCT - Code Generation
• Yakindu
• All
comprises code generators for Java, C, C++
generators can be „customized“Flexible
by a generator model
Editor
Code Generation
SGraph
• Custom
SExec
Simulator
SGen
CodeGenerators
generators based on Xpand & Xtend2/Java can be
easily integrated
SText
Donnerstag, 29. März 12
13. Yakindu SCT - Extensibility
•
Recap: different models are used around the Statechart formalism
•
SGraph (EMF): specification of graphical structures
•
SText (Xtext): textual specification of declarations & expressions
•
SExec (EMF): sequentialized statechart execution
•
SGen (Xtext): code generator parameterization
Donnerstag, 29. März 12
14. Built-In Extensibility
• Restriction
of structural concepts (SGraph)
• Customization
of declarations & expressions (SText)
• Adoption
of the execution semantics (SExec)
• Adoption
of existing or integration of custom code generators
• Integration
of custom type system, augmentation by
application types
• Integration
Donnerstag, 29. März 12
of additional validation constraints
17. The Statechart Application Gap
State-based modeling
is useful
in many domains
Donnerstag, 29. März 12
Typically, statecharts
are independent
of any domain
18. The Statechart Application Gap
State-based modeling
is useful
in many domains
Typically, statecharts
are independent
of any domain
• How
can statecharts be adopted to a specific domain?
• How
can tools support this adoption?
Donnerstag, 29. März 12
25. Domain-Specific Statechart Approach
grammar org.yakindu.sct.model.stext.SText with org.eclipse.xtext.common.Terminals
/* ---- root rules ----
Structural Concepts
(SGraph)
Declarations &
Expressions
(SText)
These root rules are not relevant for the grammar integration
into a single grammar.
*/
extends
Root:
(roots+=DefRoot)*;
DefRoot:
StatechartRoot | StateRoot | TransitionRoot;
Scope returns sct::Scope:
(SimpleScope | StatechartScope);
// a SimpleScope is used for states and regions
SimpleScope returns sct::Scope:
{SimpleScope} (declarations+=Declaration)*;
// defines the poosible scopes for statecharts
StatechartScope returns sct::Scope:
InterfaceScope | InternalScope;
InterfaceScope returns sct::Scope:
Generic
Donnerstag, 29. März 12
26. Domain-Specific Statechart Approach
Domain-Specific
HMI Meta Model
grammar org.yakindu.sct.model.stext.SText with org.eclipse.xtext.common.Terminals
/* ---- root rules ----
Structural Concepts
(SGraph)
Declarations &
Expressions
(SText)
These root rules are not relevant for the grammar integration
into a single grammar.
*/
extends
Root:
(roots+=DefRoot)*;
DefRoot:
StatechartRoot | StateRoot | TransitionRoot;
Scope returns sct::Scope:
(SimpleScope | StatechartScope);
// a SimpleScope is used for states and regions
SimpleScope returns sct::Scope:
{SimpleScope} (declarations+=Declaration)*;
// defines the poosible scopes for statecharts
StatechartScope returns sct::Scope:
InterfaceScope | InternalScope;
InterfaceScope returns sct::Scope:
Generic
Donnerstag, 29. März 12
27. Domain-Specific Statechart Approach
Domain-Specific
specialization
HMI Meta Model
grammar org.yakindu.sct.model.stext.SText with org.eclipse.xtext.common.Terminals
/* ---- root rules ----
Structural Concepts
(SGraph)
Declarations &
Expressions
(SText)
These root rules are not relevant for the grammar integration
into a single grammar.
*/
extends
Root:
(roots+=DefRoot)*;
DefRoot:
StatechartRoot | StateRoot | TransitionRoot;
Scope returns sct::Scope:
(SimpleScope | StatechartScope);
// a SimpleScope is used for states and regions
SimpleScope returns sct::Scope:
{SimpleScope} (declarations+=Declaration)*;
// defines the poosible scopes for statecharts
StatechartScope returns sct::Scope:
InterfaceScope | InternalScope;
InterfaceScope returns sct::Scope:
Generic
Donnerstag, 29. März 12
28. Domain-Specific Statechart Approach
Domain-Specific
grammar com.yakindu.hmi.sctmodel.HMIText with
org.yakindu.sct.model.stext.SText
/* ---- root rules ---These root rules are not relevant for the
into a single grammar.
*/
Root:
HMI Meta Model
(roots+=DefRoot)*;
HMI Declarations
Declaration returns sct::Declaration:
EventDefinition | VariableDefinition | Clock | Operation
| LocalReaction | Entrypoint | Exitpoint | HMIDeclaration;
HMIDeclaration:
HmiScene | HmiPopup | HmiAnimation | HmiTransition;
HmiScene:
'scene' scene=[contract::Scene|QID];
specialization
HmiPopup:
'popup' popup=[contract::Popup|QID];
HmiAnimation:
'animation' animation=[contract::Animation|QID];
grammar org.yakindu.sct.model.stext.SText with org.eclipse.xtext.common.Terminals
/* ---- root rules ----
Structural Concepts
(SGraph)
Declarations &
Expressions
(SText)
These root rules are not relevant for the grammar integration
into a single grammar.
*/
extends
Root:
(roots+=DefRoot)*;
DefRoot:
StatechartRoot | StateRoot | TransitionRoot;
Scope returns sct::Scope:
(SimpleScope | StatechartScope);
// a SimpleScope is used for states and regions
SimpleScope returns sct::Scope:
{SimpleScope} (declarations+=Declaration)*;
// defines the poosible scopes for statecharts
StatechartScope returns sct::Scope:
InterfaceScope | InternalScope;
InterfaceScope returns sct::Scope:
Generic
Donnerstag, 29. März 12
29. Domain-Specific Statechart Approach
Domain-Specific
grammar com.yakindu.hmi.sctmodel.HMIText with
org.yakindu.sct.model.stext.SText
/* ---- root rules ---These root rules are not relevant for the
into a single grammar.
*/
Root:
HMI Meta Model
(roots+=DefRoot)*;
HMI Declarations
Declaration returns sct::Declaration:
EventDefinition | VariableDefinition | Clock | Operation
| LocalReaction | Entrypoint | Exitpoint | HMIDeclaration;
references
HMIDeclaration:
HmiScene | HmiPopup | HmiAnimation | HmiTransition;
HmiScene:
'scene' scene=[contract::Scene|QID];
HmiAnimation:
'animation' animation=[contract::Animation|QID];
extends
specialization
HmiPopup:
'popup' popup=[contract::Popup|QID];
grammar org.yakindu.sct.model.stext.SText with org.eclipse.xtext.common.Terminals
/* ---- root rules ----
Structural Concepts
(SGraph)
Declarations &
Expressions
(SText)
These root rules are not relevant for the grammar integration
into a single grammar.
*/
extends
Root:
(roots+=DefRoot)*;
DefRoot:
StatechartRoot | StateRoot | TransitionRoot;
Scope returns sct::Scope:
(SimpleScope | StatechartScope);
// a SimpleScope is used for states and regions
SimpleScope returns sct::Scope:
{SimpleScope} (declarations+=Declaration)*;
// defines the poosible scopes for statecharts
StatechartScope returns sct::Scope:
InterfaceScope | InternalScope;
InterfaceScope returns sct::Scope:
Generic
Donnerstag, 29. März 12
30. Domain-Specific Statechart Approach
Domain-Specific
grammar com.yakindu.hmi.sctmodel.HMIText with
org.yakindu.sct.model.stext.SText
/* ---- root rules ---These root rules are not relevant for the
into a single grammar.
*/
Root:
HMI Meta Model
(roots+=DefRoot)*;
HMI Declarations
Declaration returns sct::Declaration:
EventDefinition | VariableDefinition | Clock | Operation
| LocalReaction | Entrypoint | Exitpoint | HMIDeclaration;
references
HMIDeclaration:
HmiScene | HmiPopup | HmiAnimation | HmiTransition;
HmiScene:
'scene' scene=[contract::Scene|QID];
HmiAnimation:
'animation' animation=[contract::Animation|QID];
Domain Specific
Statechart
extends
specialization
HmiPopup:
'popup' popup=[contract::Popup|QID];
grammar org.yakindu.sct.model.stext.SText with org.eclipse.xtext.common.Terminals
/* ---- root rules ----
Structural Concepts
(SGraph)
Declarations &
Expressions
(SText)
These root rules are not relevant for the grammar integration
into a single grammar.
*/
extends
Root:
(roots+=DefRoot)*;
DefRoot:
StatechartRoot | StateRoot | TransitionRoot;
Scope returns sct::Scope:
(SimpleScope | StatechartScope);
// a SimpleScope is used for states and regions
SimpleScope returns sct::Scope:
{SimpleScope} (declarations+=Declaration)*;
// defines the poosible scopes for statecharts
StatechartScope returns sct::Scope:
InterfaceScope | InternalScope;
InterfaceScope returns sct::Scope:
Generic
Donnerstag, 29. März 12
31. Yakindu SCT
• Open
Source / EPL
• Hosted
at EclipseLabs
• Eclipse-Proposal
• Interested
• Important
planned for 2012
parties welcome!
Links:
• Project
Site: http://yakindu.org
• Eclipse
Labs Site: http://code.google.com/a/eclipselabs.org/p/yakindu/
• Update
Donnerstag, 29. März 12
Site: http://updates.yakindu.com/indigo/milestones/