Page History
Panel | ||||
---|---|---|---|---|
| ||||
Responsible: Formerly Responsible / Previous Projects:
Related Theses: |
...
SCCharts are typically modeled using the textual SCT language defined as an Xtext grammar in KIELER. Generally, if you do not know which elements can be placed at a certain cursor position you are assisted by a content-assist that can be called pressing <Ctrl>+<Space>. It will display all possible valid elements also considering scoping of variables.
...
[1] R. von Hanxleden, B. Duderstadt, C. Motika, S. Smyth, M. Mendler, J. Aguado, S. Mercer, and O. O’Brien. SCCharts: Sequentially Constructive Statecharts for Safety-Critical Applications. In Proc. ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’14), Edinburgh, UK, June 2014. (pdf)
ABRO Example
In the following we will describe some basic elements using the famous ABRO example:
...
- In the first line you see how an SCChart is defined using the scchart keyword where the ID of the SCChart will be ABRO. An optional label can be inserted after ABRO using "<LABEL>".
- In the next three lines variables are declared, namely, A, B, R and O, where O is initialized with the value false. A, B, and R are inputs which must not be initialized and get there valued from the environment.
- An SCChart typically contains concurrent regions which are introduced with the keyword region as shown in Line 9.
- Every region must at least have one state, and every region must exactly have one initial state. An initial state ABO is defined for region Main in Line 6.
- Every state is terminated by a ; as shown in line 11 for state HandleA.
- If you like to specify internal behavior of a state, you can add concurrent regions to a state in { <regions> } as done for state ABO or state WaitAB.
- Transitions outgoing from a state must be declared right before a state is terminated with ;. For example a transition from state wA to state dA is declared in Line 11.
- Transitions can have triggers and effects which are separated by a dash: <trigger>/<effects>. Multiple sequential effects are separated by a ;. The transition in Line 11 declares just a trigger A (a dash is not necessary in this case), while the transition from line 18 declares only an effect O = true (here the dash is mandatory).
- There are three types of transitions: 1. normal/weak abort transitions -->, 2. strong abort transitions o-> and 3. termination/join transitions >->.
...
Detailed SCT Syntax of SCCharts Elements
...
Column | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Column | ||
---|---|---|
| ||
|
...
Variable
Column | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
...
Column | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Column | ||
---|---|---|
| ||
|
Annotations
The textual SCCharts language supports several annotations to influence the visual representation of the model.
Annotation are processed in sequential order.
...
...
Hostcode
You can also use you host language directly.
Function Calls
Call host code functions with dependency analysis.
Column | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Column | ||
---|---|---|
| ||
|
Hostcode (inline)
Inline hostcode just as it is. Use the @hostcode annotation to add hostcode line before the tick function. Also use hostcode in single quotes as hostcode effects.
Important: Inline hostcode is not type-safe. Be careful.
Column | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Column | ||
---|---|---|
| ||
|
Annotations
The textual SCCharts language supports several annotations to influence the visual representation of the model.
Annotation are processed in sequential order.
Pattern | Usage | Description | Example | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| Sets the synthesis option identified by <key> to the given value. The available synthesis options for a diagram are displayed in the sidebar of the diagram view. The values from the sidebar will be ignored if a corresponding annotation is present. |
| ||||||||||||||||||||||||||||||||
|
| Sets the layout property identified by <key> to the given value on the annotated element. The available layout options are documented here. Layout options will only affect the annotated element and no underlying hierarchy levels. If a layout direction is specified with this annotation it overrides the layout direction set by HV-/VH-Layout in any parent element for this element. Special case: If the direction is set on the scchart element (top level) it overrides the default alternating layout.
|
| ||||||||||||||||||||||||||||||||
|
| Defines the order of the alternating layout directions. The annotation can be mixed and nested in the SCChart and will only affect succeeding hierarchy levels. The default is an implicit HVLayout starting at the top level state. |
| ||||||||||||||||||||||||||||||||
|
| The annotated region will be initially collapse or expanded. |
| ||||||||||||||||||||||||||||||||
|
| The annotated element will be excluded from the diagram. Transitions with a hidden source or target state will be hidden as well. |
|
...
Overview of Operators
The following briefly describes the operators that can be used in expressions.
...