Hide last authors
Alexander Schulz-Rosengarten 70.1 1 [[~[~[image:attach:SCCharts (pre 1.0)@onlinecompiler.png~]~]>>url:http://www.sccharts.com||shape="rect"]] (% class="confluence-link" %)[[image:attach:KIELER.Command Line Compiler.WebHome@commandlinecompiler2.png]][[doc:KIELER.SCCharts (DeprecatedHistorical Documentation & Features).SCCharts (pre 1\.0).Command Line Compiler.WebHome]](%%) [[image:attach:SCCharts (pre 1.0)@quickstart.png]][[doc:KIELER.SCCharts (DeprecatedHistorical Documentation & Features).SCCharts (pre 1\.0).Quick Start Guide (pre 0\.13).WebHome]]
cmot 35.1 2
3
cmot 34.1 4 [[An~[~[image:attach:450px-Xtext_logo.png~]~]>>url:http://www.eclipse.org/Xtext/||shape="rect"]] [[-based Project.>>url:http://www.eclipse.org/Xtext/||shape="rect"]]
cmot 3.1 5
cmot 4.1 6
Richard Kreissig 72.1 7 == Project Overview ==
Richard Kreissig 73.1 8
cmot 4.1 9 Responsible:
10
11 * [[Christian Motika>>url:http://www.informatik.uni-kiel.de/rtsys/kontakt/cmot/||shape="rect"]], [[Steven Smyth>>url:http://www.informatik.uni-kiel.de/rtsys/kontakt/ssm/||shape="rect"]]
12
13 Formerly Responsible / Previous Projects:
14
15 * [[Christian Schneider>>url:http://www.informatik.uni-kiel.de/rtsys/kontakt/christian-schneider/||shape="rect"]] (Textual SyncCharts (KITS))
16
17 Related Theses:
18
19 * Mirko Wischer, //Textuelle Darstellung und strukturbasiertes Editieren von Statecharts//, February 2006 ([[pdf>>url:http://rtsys.informatik.uni-kiel.de/%7Ebiblio/downloads/theses/miwi-dt.pdf||shape="rect"]])
20 * Özgün Bayramoglu, //KIELER Infrastructure for Textual Modeling//, December 2009 ([[pdf>>url:http://rtsys.informatik.uni-kiel.de/%7Ebiblio/downloads/theses/oba-dt.pdf||shape="rect"]])
21 * Christian Schneider, //Integrating Graphical and Textual Modeling//, February 2011 ([[pdf>>url:http://rtsys.informatik.uni-kiel.de/%7Ebiblio/downloads/theses/chsch-dt.pdf||shape="rect"]])
22
cmot 22.1 23 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.
cmot 5.1 24
cmot 24.1 25 In the following we will demonstrate SCT using the famous ABRO example (the hello world of synchronous programming/modelling). We will then give details for modelling other SCCharts language constructs with SCT. For details on their semantics please be referred to  our PLDI paper [1].
cmot 7.1 26
cmot 25.1 27
28
29 {{toc/}}
30
Richard Kreissig 72.1 31 [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 (% class="cmti-10" %)Proc. ACM SIGPLAN Conference on Programming Language Design(%%) (% class="cmti-10" %)and Implementation (PLDI’14)(%%), Edinburgh, UK, June 2014. ([[pdf>>url:http://rtsys.informatik.uni-kiel.de/%7Ebiblio/downloads/papers/pldi14.pdf||shape="rect"]])
cmot 17.1 32
cmot 23.1 33
cmot 17.1 34 = ABRO Example =
35
cmot 32.1 36 In the following we will describe some basic elements using the famous ABRO example:
cmot 7.1 37
Richard Kreissig 72.1 38
nbw 49.1 39 {{code language="sct" linenumbers="true"}}
cmot 37.1 40 @HVLayout
cmot 5.1 41 scchart ABRO {
cmot 37.1 42 input bool A, B, R;
aas2 48.1 43 output bool O = false;
cmot 5.1 44 region Main:
cmot 37.1 45 initial state ABO "ABthenO" {
46 entry / O = false;
47 initial state WaitAandB {
48 region HandleA:
49 initial state wA
50 --> dA with A;
51 final state dA;
cmot 5.1 52 region HandleB:
cmot 37.1 53 initial state wB
54 --> dB with B;
55 final state dB;
cmot 5.1 56 }
cmot 37.1 57 >-> done with / O = true;
58 final state done;
cmot 5.1 59 }
60 o-> ABO with R;
cmot 37.1 61 }
cmot 5.1 62 {{/code}}
cmot 7.1 63
Richard Kreissig 72.1 64
cmot 20.1 65 [[image:attach:abro.png]]
66
cmot 7.1 67 1. 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>".
Richard Kreissig 72.1 68 1. 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.
aas2 48.1 69 1. An SCChart typically contains concurrent regions which are introduced with the keyword //region// as shown in Line 9.
70 1. 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.
cmot 9.1 71 1. Every state is terminated by a //;// as shown in line 11 for state //HandleA//.
Richard Kreissig 72.1 72 1. 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//.
73 1. 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.
74 1. 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).
75 1. There are three types of transitions: 1. normal/weak abort transitions //~-~->//,  2. strong abort transitions //o->// and 3. termination/join transitions// >->//.
cmot 11.1 76
cmot 28.1 77 = Detailed SCT Syntax of SCCharts Elements =
cmot 11.1 78
ssm 53.1 79 [[image:attach:SCCharts (pre 1.0)@sccharts-features.jpg]]
cmot 27.1 80
cmot 18.1 81 == SCChart, Initial State, State, Transition and Immediate Transition ==
cmot 11.1 82
Richard Kreissig 72.1 83
Alexander Schulz-Rosengarten 43.1 84 {{code language="sct" linenumbers="true"}}
cmot 13.1 85  scchart StateTransition {
86 initial state A
87 --> B;
88 state B
89 --> C;
90 state C
91 --> A immediate;
92 }
93 {{/code}}
94
Richard Kreissig 72.1 95
96
cmot 13.1 97 [[image:attach:01statetransition.png]]
98
99
cmot 14.1 100 == Variable ==
101
Richard Kreissig 72.1 102
Alexander Schulz-Rosengarten 43.1 103 {{code language="sct" linenumbers="true"}}
cmot 14.1 104 scchart Variable {
105 int var1;
106 bool var2;
107 int var3 = 3;
108 bool var4 = false;
109 input int var5;
110 output float var6;
111 input output bool var7;
112 initial state A
113 --> B;
114 state B;
115 }
116 {{/code}}
117
Richard Kreissig 72.1 118
119
cmot 14.1 120 [[image:attach:02variable.png]]
121
Richard Kreissig 72.1 122
cmot 14.1 123 == Transition: Trigger & Effect ==
124
Richard Kreissig 72.1 125
Alexander Schulz-Rosengarten 43.1 126 {{code language="sct" linenumbers="true"}}
cmot 14.1 127 scchart TriggerEffect {
128 input int var1;
129 output bool var2;
130 initial state A
131 --> B with var1 == 3 / var2 = true;
132 state B;
133 }
134 {{/code}}
135
Richard Kreissig 72.1 136
137
cmot 14.1 138 [[image:attach:03triggereffect.png]]
139
Richard Kreissig 72.1 140
cmot 14.1 141 == Super State ==
142
Alexander Schulz-Rosengarten 43.1 143 {{code language="sct" linenumbers="true"}}
cmot 14.1 144 scchart SuperState {
145 initial state A
146 --> B;
147 state B {
148 initial state B1
149 --> B2;
150 state B2;
151 };
152 }
153 {{/code}}
154
Richard Kreissig 72.1 155
156
cmot 14.1 157 [[image:attach:04superstate.png]]
158
Richard Kreissig 72.1 159
cmot 15.1 160 == Super State: Final States & Termination Transition ==
cmot 14.1 161
Richard Kreissig 72.1 162
Alexander Schulz-Rosengarten 43.1 163 {{code language="sct" linenumbers="true"}}
cmot 15.1 164 scchart FinalStateTermination {
cmot 14.1 165 initial state A
166 --> B;
cmot 15.1 167 state B {
168 initial state B1
169 --> B2;
170 final state B2;
171 }
172 >-> C;
173 state C;
cmot 14.1 174 }
175 {{/code}}
176
Richard Kreissig 72.1 177
178
cmot 15.1 179 [[image:attach:05finalstatetermination.png]]
cmot 14.1 180
Richard Kreissig 72.1 181
cmot 15.1 182 == Super State: Weak Abort Transition ==
cmot 14.1 183
Richard Kreissig 72.1 184
Alexander Schulz-Rosengarten 43.1 185 {{code language="sct" linenumbers="true"}}
cmot 15.1 186 scchart WeakAbort {
187 input bool W;
cmot 14.1 188 initial state A
189 --> B;
cmot 15.1 190 state B {
191 initial state B1
192 --> B2;
193 state B2;
194 }
195 --> C with W;
196 state C;
cmot 14.1 197 }
198 {{/code}}
199
Richard Kreissig 72.1 200
201
cmot 15.1 202 [[image:attach:06weakabort.png]]
cmot 14.1 203
Richard Kreissig 72.1 204
cmot 15.1 205 == Super State: Strong Abort Transition ==
cmot 14.1 206
Richard Kreissig 72.1 207
Alexander Schulz-Rosengarten 43.1 208 {{code language="sct" linenumbers="true"}}
cmot 15.1 209 scchart StrongAbort {
210 input bool S;
cmot 14.1 211 initial state A
212 --> B;
cmot 15.1 213 state B {
214 initial state B1
215 --> B2;
216 state B2;
217 }
218 o-> C with S;
219
220 state C;
cmot 14.1 221 }
222 {{/code}}
223
Richard Kreissig 72.1 224
225
cmot 15.1 226 [[image:attach:07strongabort.png]]
cmot 14.1 227
Richard Kreissig 72.1 228
cmot 15.1 229 == Concurrent Regions (inside a Super State) ==
cmot 14.1 230
Richard Kreissig 72.1 231
Alexander Schulz-Rosengarten 43.1 232 {{code language="sct" linenumbers="true"}}
cmot 15.1 233 scchart Regions {
234 input bool S;
cmot 14.1 235 initial state A
236 --> B;
cmot 15.1 237 state B {
238 region Region1 :
239 initial state B1
240 --> B2;
241 state B2; region Region2 :
242 initial state B3;
243 };
cmot 14.1 244 }
245 {{/code}}
246
Richard Kreissig 72.1 247
248
cmot 15.1 249 [[image:attach:08regions.png]]
cmot 14.1 250
Richard Kreissig 72.1 251
cmot 15.1 252 == Entry Action, During Action, Exit Action ==
cmot 14.1 253
Richard Kreissig 72.1 254
Alexander Schulz-Rosengarten 43.1 255 {{code language="sct" linenumbers="true"}}
cmot 15.1 256 scchart Actions {
257 input bool var1;
258 output bool var2;
cmot 14.1 259 initial state A
260 --> B;
cmot 15.1 261 state B {
262 entry var1 / var2 = true;
263 during var1 / var2 = true;
264 immediate during var1 / var2 = true;
265 exit var1 / var2 = true;
266 initial state B1
267 --> B2;
268 state B2;
269 };
cmot 14.1 270 }
271 {{/code}}
272
Richard Kreissig 72.1 273
Richard Kreissig 73.1 274
cmot 15.1 275 [[image:attach:09actions.png]]
cmot 14.1 276
Richard Kreissig 72.1 277
cmot 15.1 278 == Shallow History Transition ==
cmot 14.1 279
Richard Kreissig 72.1 280
Alexander Schulz-Rosengarten 43.1 281 {{code language="sct" linenumbers="true"}}
cmot 15.1 282 scchart HistoryShallow {
283 input bool var1;
284 output bool var2;
cmot 14.1 285 initial state A
cmot 15.1 286 --> B shallow history with var1;
287 state B {
288 initial state B1
289 --> B2;
290 state B2;
291 }
292 --> A with var1;
cmot 14.1 293 }
294 {{/code}}
295
Richard Kreissig 72.1 296
297
cmot 15.1 298 [[image:attach:10historyshallow.png]]
cmot 14.1 299
Richard Kreissig 72.1 300
cmot 15.1 301 == Deep History Transition ==
cmot 14.1 302
Richard Kreissig 72.1 303
Alexander Schulz-Rosengarten 43.1 304 {{code language="sct" linenumbers="true"}}
cmot 15.1 305 scchart HistoryDeep {
306 input bool var1;
307 output bool var2;
cmot 14.1 308 initial state A
cmot 15.1 309 --> B history with var1;
310 state B {
311 initial state B1
312 --> B2;
313 state B2;
314 }
315 --> A with var1;
cmot 14.1 316 }
317 {{/code}}
318
Richard Kreissig 72.1 319
320
cmot 15.1 321 [[image:attach:11historydeep.png]]
cmot 14.1 322
Richard Kreissig 72.1 323
cmot 15.1 324 == Deferred Transition ==
cmot 14.1 325
Richard Kreissig 72.1 326
Alexander Schulz-Rosengarten 43.1 327 {{code language="sct" linenumbers="true"}}
cmot 15.1 328 scchart Deferred {
329 input bool var1;
330 output bool var2;
cmot 14.1 331 initial state A
cmot 15.1 332 --> B deferred with var1;
333 state B {
334 entry var1 / var2 = true;
335 }
336 --> A with var1;
cmot 14.1 337 }
338 {{/code}}
339
Richard Kreissig 72.1 340
341
cmot 15.1 342 [[image:attach:12deferred.png]]
cmot 14.1 343
Richard Kreissig 72.1 344
cmot 15.1 345 == Transition with Count Delay ==
cmot 14.1 346
Richard Kreissig 72.1 347
Alexander Schulz-Rosengarten 43.1 348 {{code language="sct" linenumbers="true"}}
cmot 15.1 349 scchart CountDelay {
350 input bool var1;
351 output bool var2;
cmot 14.1 352 initial state A
cmot 15.1 353 --> B with 4 var1;
cmot 14.1 354 state B
cmot 15.1 355 --> A with var1;
cmot 14.1 356 }
357 {{/code}}
358
Richard Kreissig 72.1 359
360
cmot 15.1 361 [[image:attach:13countdelay.png]]
cmot 14.1 362
Richard Kreissig 72.1 363
cmot 15.1 364 == Array ==
cmot 14.1 365
Richard Kreissig 72.1 366
Alexander Schulz-Rosengarten 43.1 367 {{code language="sct" linenumbers="true"}}
cmot 15.1 368 scchart Array {
369 int myArray[10][2];
370 initial state init
371 --> done with myArray[1][0] == 1 / myArray[2][1] = 2;
372 final state done;
373 }
cmot 14.1 374 {{/code}}
375
Richard Kreissig 72.1 376
377
cmot 15.1 378 [[image:attach:14array.png]]
cmot 14.1 379
Richard Kreissig 72.1 380
cmot 15.1 381 == Signal ==
382
Richard Kreissig 72.1 383
Alexander Schulz-Rosengarten 43.1 384 {{code language="sct" linenumbers="true"}}
cmot 15.1 385 scchart Signal {
386 input signal i;
387 output signal o
388 initial state init
389 --> done with i / o;
390 final state done;
391 }
392 {{/code}}
393
Richard Kreissig 72.1 394
cmot 15.1 395 [[image:attach:15signal.png]]
cmot 38.1 396
Richard Kreissig 72.1 397
cmot 38.1 398 == Reference States ==
399
ssm 39.1 400 **Important: To use the referenced SCCharts feature, activate the Xtext nature for your project!**
401
Richard Kreissig 72.1 402
Alexander Schulz-Rosengarten 43.1 403 {{code language="sct" linenumbers="true"}}
cmot 38.1 404 scchart MainSCChart {
405 bool A[3];
406
407 initial state S1 references InnerSCChart;
408 }
409
410 scchart InnerSCChart {
411 input bool A[3];
412
413 initial state S1
414 --> S2 with A[0];
415
416 final state S2;
417
418 {{/code}}
419
Richard Kreissig 72.1 420
421
cmot 38.1 422 [[image:attach:MainSCChart.png]][[image:attach:InnerSCChart.png]]
ssm 39.1 423
424
Richard Kreissig 72.1 425
ssm 51.1 426 = Hostcode =
427
428 You can also use you host language directly.
429
430 == Function Calls ==
431
ssm 53.1 432 Call host code functions with dependency analysis. Use angle brackets to point to an extern function. You can also declare extern variables.
ssm 51.1 433
Richard Kreissig 72.1 434
ssm 51.1 435 {{code language="sct" linenumbers="true"}}
ssm 53.1 436 @hostcode "#include <stdio.h>"
437 @hostcode "#include <stdlib.h>"
438 scchart functionCall {
439 output int i;
440 extern int stdout;
441
442 initial state getChar {
443 entry / <printf("Enter an integer: ")>;
444 entry / <fflush( stdout )>;
445 entry / <scanf("%d", &i)>;
446 }
447 --> print with / <printf("The interger you entered: %d\\n", i)>;
Richard Kreissig 72.1 448 <fflush( stdout )>;
ssm 53.1 449
450 state print
451 --> getChar;
ssm 51.1 452
453 {{/code}}
454
Richard Kreissig 72.1 455
456
ssm 53.1 457 [[image:attach:functionCalls.png]]
ssm 51.1 458
459
Richard Kreissig 72.1 460
ssm 51.1 461 == Hostcode (inline) ==
462
463 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.
464
465 **Important: Inline hostcode is not type-safe. Be careful.**
466
Richard Kreissig 72.1 467
ssm 51.1 468 {{code language="sct" linenumbers="true"}}
469 @hostcode "#include <stdio.h>"
470 @hostcode "#include <stdlib.h>"
471 @hostcode "#include <unistd.h>"
472 @hostcode "#include <sys/time.h>"
473 @hostcode "struct timeval val;"
474 scchart hostcode {
475 output int ms;
476
477 initial state getChar {
478 entry / 'gettimeofday(&val, NULL)';
Richard Kreissig 72.1 479 ms = 'val.tv_sec'
ssm 51.1 480 }
481 --> print with / 'printf("Second: %d\\n", ms); fflush( stdout )';
482
483 state print
484 --> getChar;
485 }
486 {{/code}}
487
Richard Kreissig 72.1 488
489
ssm 51.1 490
491 [[image:attach:hostcode.png]]
492
Richard Kreissig 72.1 493
Alexander Schulz-Rosengarten 40.1 494 = Annotations =
495
496 The textual SCCharts language supports several annotations to influence the visual representation of the model.
497
Alexander Schulz-Rosengarten 41.1 498 Annotation are processed in sequential order.
499
nbw 49.1 500 (% class="wrapped" %)
Alexander Schulz-Rosengarten 40.1 501 |=(((
502 Pattern
503 )))|=(% colspan="1" %)(% colspan="1" %)
504 (((
505 Usage
506 )))|=(((
507 Description
508 )))|=(((
509 Example
510 )))
511 |(((
nbw 49.1 512 (% class="content-wrapper" %)
513 (((
Richard Kreissig 74.1 514 {{code nopanel="true"}}
Alexander Schulz-Rosengarten 50.1 515 @diagram[<key>] <value>
Richard Kreissig 74.1 516 {{/code}}
nbw 49.1 517 )))
Alexander Schulz-Rosengarten 40.1 518 )))|(% colspan="1" %)(% colspan="1" %)
519 (((
nbw 49.1 520 (% class="wrapped" %)
Alexander Schulz-Rosengarten 40.1 521 |=(((
522 Location:
523 )))|(((
524 scchart
525 )))
526 |=(((
527 <key>
528 )))|(((
Alexander Schulz-Rosengarten 41.1 529 The name of the synthesis option. The given name is evaluated case-insensitive and whitespace-ignoring. The options are searched for the first matching **prefix**.
Alexander Schulz-Rosengarten 40.1 530 )))
531 |=(((
532 <value>
533 )))|(((
Alexander Schulz-Rosengarten 41.1 534 The value type depends on the option type:
535
536 CheckBox: //true// or //false//
537
538 Choice: Name of choice item
539
540 Slider: Float value
Alexander Schulz-Rosengarten 40.1 541 )))
542 )))|(((
543 Sets the synthesis option identified by <key> to the given value.
544
545 The available synthesis options for a diagram are displayed in the sidebar of the diagram view.
Alexander Schulz-Rosengarten 41.1 546
547 The values from the sidebar will be ignored if a corresponding annotation is present.
Alexander Schulz-Rosengarten 40.1 548 )))|(((
nbw 49.1 549 (% class="content-wrapper" %)
550 (((
Alexander Schulz-Rosengarten 40.1 551 {{code language="sct"}}
552 @diagram[paper] true
553 scchart Testing {
554 initial state A
555 --> B;
556 final state B;
557 }
558 {{/code}}
559 )))
nbw 49.1 560 )))
Alexander Schulz-Rosengarten 40.1 561 |(((
nbw 49.1 562 (% class="content-wrapper" %)
563 (((
Richard Kreissig 74.1 564 {{code nopanel="true"}}
Alexander Schulz-Rosengarten 40.1 565 @layout[<key>] <value>
Richard Kreissig 74.1 566 {{/code}}
nbw 49.1 567 )))
Alexander Schulz-Rosengarten 40.1 568 )))|(% colspan="1" %)(% colspan="1" %)
569 (((
nbw 49.1 570 (% class="wrapped" %)
Alexander Schulz-Rosengarten 40.1 571 |=(((
572 Location:
573 )))|(((
574 scchart, state, region, transition
575 )))
576 |=(((
577 <key>
578 )))|(((
Alexander Schulz-Rosengarten 41.1 579 The ID of the layout option. The options are searched for the first matching **postfix**.
Alexander Schulz-Rosengarten 40.1 580 )))
581 |=(((
582 <value>
583 )))|(((
Alexander Schulz-Rosengarten 41.1 584 The value type depends on the option type. The value is parsed case-sensitive.
Alexander Schulz-Rosengarten 40.1 585 )))
586 )))|(((
nbw 49.1 587 (% class="content-wrapper" %)
588 (((
Alexander Schulz-Rosengarten 40.1 589 Sets the layout property identified by <key> to the given value on the annotated element.
590
Alexander Schulz-Rosengarten 62.1 591 The available layout options are documented [[here>>doc:KIELER.Discontinued Projects.Infrastructure for Meta Layout (KIML).KIML Layout Options.WebHome]].
Alexander Schulz-Rosengarten 41.1 592
Alexander Schulz-Rosengarten 40.1 593 Layout options will only affect the annotated element and no underlying hierarchy levels.
Alexander Schulz-Rosengarten 42.1 594
595 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.
Alexander Schulz-Rosengarten 43.1 596
597 Special case: If the direction is set on the scchart element (top level) it overrides the default alternating layout.
Alexander Schulz-Rosengarten 44.1 598
599 {{expand title="Commonly Used"}}
nbw 49.1 600 (% class="wrapped" %)
Alexander Schulz-Rosengarten 44.1 601 |(((
602 {{{direction}}}
Alexander Schulz-Rosengarten 40.1 603 )))|(((
Alexander Schulz-Rosengarten 44.1 604 Layout direction
605 )))
606 |(((
607 priority
608 )))|(((
609 Can influence the order of regions
610 )))
611 {{/expand}}
nbw 49.1 612 )))
Alexander Schulz-Rosengarten 44.1 613 )))|(((
nbw 49.1 614 (% class="content-wrapper" %)
615 (((
Alexander Schulz-Rosengarten 40.1 616 {{code language="sct"}}
617 scchart Testing {
Alexander Schulz-Rosengarten 41.1 618 @layout[algorithm] de.cau.cs.kieler.graphviz.circo
619 region:
620 initial final state A
621 --> B;
622 state B
623 --> C;
624 state C
625 --> A;
Alexander Schulz-Rosengarten 40.1 626 }
627 {{/code}}
Alexander Schulz-Rosengarten 41.1 628
629
Alexander Schulz-Rosengarten 42.1 630
631 {{code language="sct"}}
632 scchart Testing {
633 @layout[direction] UP
634 region "up":
635 initial state A
636 --> B;
637 final state B;
638 @layout[direction] LEFT
639 region "left":
640 initial state A
641 --> B;
642 final state B;
643 }
644 {{/code}}
645
646
Richard Kreissig 72.1 647
Alexander Schulz-Rosengarten 40.1 648 )))
nbw 49.1 649 )))
Alexander Schulz-Rosengarten 40.1 650 |(((
nbw 49.1 651 (% class="content-wrapper" %)
652 (((
Richard Kreissig 74.1 653 {{code nopanel="true"}}
Alexander Schulz-Rosengarten 40.1 654 @HVLayout
655 @VHLayout
Richard Kreissig 74.1 656 {{/code}}
nbw 49.1 657 )))
Alexander Schulz-Rosengarten 40.1 658 )))|(% colspan="1" %)(% colspan="1" %)
659 (((
nbw 49.1 660 (% class="wrapped" %)
Alexander Schulz-Rosengarten 40.1 661 |=(((
662 Location:
663 )))|(((
664 scchart, state, region
665 )))
666 )))|(((
Alexander Schulz-Rosengarten 42.1 667 Defines the order of the alternating layout directions.
668
669 The annotation can be mixed and nested in the SCChart and will only affect succeeding hierarchy levels.
670
671 The default is an implicit HVLayout starting at the top level state.
Alexander Schulz-Rosengarten 40.1 672 )))|(((
nbw 49.1 673 (% class="content-wrapper" %)
674 (((
Alexander Schulz-Rosengarten 40.1 675 {{code language="sct"}}
676 @VHLayout
677 scchart Testing {
678 initial state A
679 --> B;
680 final state B;
681 }
682 {{/code}}
683 )))
nbw 49.1 684 )))
Alexander Schulz-Rosengarten 40.1 685 |(% colspan="1" %)(% colspan="1" %)
686 (((
nbw 49.1 687 (% class="content-wrapper" %)
688 (((
Richard Kreissig 74.1 689 {{code nopanel="true"}}
Alexander Schulz-Rosengarten 40.1 690 @collapse
691 @expand
Richard Kreissig 74.1 692 {{/code}}
nbw 49.1 693 )))
Alexander Schulz-Rosengarten 40.1 694 )))|(% colspan="1" %)(% colspan="1" %)
695 (((
nbw 49.1 696 (% class="wrapped" %)
Alexander Schulz-Rosengarten 40.1 697 |=(((
698 Location:
699 )))|(((
Alexander Schulz-Rosengarten 42.1 700 region
Alexander Schulz-Rosengarten 40.1 701 )))
702 )))|(% colspan="1" %)(% colspan="1" %)
703 (((
Alexander Schulz-Rosengarten 42.1 704 The annotated region will be initially collapse or expanded.
Alexander Schulz-Rosengarten 40.1 705 )))|(% colspan="1" %)(% colspan="1" %)
706 (((
nbw 49.1 707 (% class="content-wrapper" %)
708 (((
Alexander Schulz-Rosengarten 40.1 709 {{code language="sct"}}
710 scchart Testing {
Alexander Schulz-Rosengarten 50.1 711 @collapse
Alexander Schulz-Rosengarten 42.1 712 region:
713  initial state A
Alexander Schulz-Rosengarten 40.1 714 --> B;
715 final state B;
716 }
717 {{/code}}
718 )))
nbw 49.1 719 )))
Alexander Schulz-Rosengarten 40.1 720 |(% colspan="1" %)(% colspan="1" %)
721 (((
nbw 49.1 722 (% class="content-wrapper" %)
723 (((
Richard Kreissig 74.1 724 {{code nopanel="true"}}
Alexander Schulz-Rosengarten 40.1 725 @hide
Richard Kreissig 74.1 726 {{/code}}
nbw 49.1 727 )))
Alexander Schulz-Rosengarten 40.1 728 )))|(% colspan="1" %)(% colspan="1" %)
729 (((
nbw 49.1 730 (% class="wrapped" %)
Alexander Schulz-Rosengarten 40.1 731 |=(((
732 Location:
733 )))|(((
734 scchart, state, region, transition
735 )))
736 )))|(% colspan="1" %)(% colspan="1" %)
737 (((
Alexander Schulz-Rosengarten 42.1 738 The annotated element will be excluded from the diagram.
739
740 Transitions with a hidden source or target state will be hidden as well.
Alexander Schulz-Rosengarten 40.1 741 )))|(% colspan="1" %)(% colspan="1" %)
742 (((
nbw 49.1 743 (% class="content-wrapper" %)
744 (((
Alexander Schulz-Rosengarten 40.1 745 {{code language="sct"}}
746 scchart Testing {
747 initial state A
748 --> B;
749 @hide
750 final state B;
751 }
752 {{/code}}
753 )))
nbw 49.1 754 )))
aas2 45.1 755
aas2 47.1 756 = Overview of Operators =
aas2 45.1 757
aas2 47.1 758 The following briefly describes the operators that can be used in expressions.
aas2 45.1 759
nbw 49.1 760 (% class="wrapped" %)
aas2 45.1 761 |=(((
762 Assignment Operator
763 )))|=(((
764 Description
765 )))|=(((
766 Example
767 )))
768 |(% colspan="1" %)(% colspan="1" %)
769 (((
770 ~=
771 )))|(% colspan="1" %)(% colspan="1" %)
772 (((
773 Assignment operator
774 )))|(% colspan="1" %)(% colspan="1" %)
775 (((
776 x = 42
777 )))
778
nbw 49.1 779 (% class="wrapped" %)
aas2 45.1 780 |=(((
781 Arithmetic Operators
782 )))|=(((
783 Description
784 )))|=(% colspan="1" %)(% colspan="1" %)
785 (((
786 Example
787 )))
788 |(((
789 +
790 )))|(((
791 Addition
792 )))|(% colspan="1" %)(% colspan="1" %)
793 (((
794 2 + 1
795 )))
796 |(((
797 -
798 )))|(((
799 Subtraction
800 )))|(% colspan="1" %)(% colspan="1" %)
801 (((
802 2 - 1
803 )))
804 |(((
805 *
806 )))|(((
807 Multiplication
808 )))|(% colspan="1" %)(% colspan="1" %)
809 (((
810 3 * 2
811 )))
812 |(((
813 :
814 )))|(((
815 Division
816 )))|(% colspan="1" %)(% colspan="1" %)
817 (((
aas2 46.1 818 6 : 2
aas2 45.1 819 )))
820
nbw 49.1 821 (% class="wrapped" %)
aas2 45.1 822 |=(((
823 Unary Operator
824 )))|=(((
825 Description
826 )))|=(((
827 Example
828 )))
829 |(((
830 +
831 )))|(((
832 Indicate a positive number
833 )))|(((
834 +2
835 )))
836 |(((
837 -
838 )))|(((
839 Negate a number
840 )))|(((
841 -2
842 )))
843 |(((
844 ++
845 )))|(((
846 {{{Increment}}}
847 )))|(((
848 x++
849 )))
850 |(% colspan="1" %)(% colspan="1" %)
851 (((
852 ~-~-
853 )))|(% colspan="1" %)(% colspan="1" %)
854 (((
855 Decrement
856 )))|(% colspan="1" %)(% colspan="1" %)
857 (((
aas2 46.1 858 x~-~-
aas2 45.1 859 )))
860
nbw 49.1 861 (% class="wrapped" %)
aas2 45.1 862 |=(((
863 Boolean Operator
864 )))|=(((
865 Description
866 )))|=(((
867 Example
868 )))
aas2 46.1 869 |(% colspan="1" %)(% colspan="1" %)
870 (((
871 ~==
872 )))|(% colspan="1" %)(% colspan="1" %)
873 (((
874 Equal to
875 )))|(% colspan="1" %)(% colspan="1" %)
876 (((
877 x == 2
878 )))
aas2 45.1 879 |(((
880 !
881 )))|(((
882 Negate a boolean value
883 )))|(((
884 ! (x == 2)
885 )))
886 |(((
887 ~!=
888 )))|(((
889 Not equal to
890 )))|(((
891 x != 2
892 )))
893 |(((
894 ~>
895 )))|(((
896 Greater than
897 )))|(((
898 x > 2
899 )))
900 |(((
901 ~>=
902 )))|(((
903 Greather than or equal to
904 )))|(((
905 x >= 2
906 )))
907 |(((
908 <
909 )))|(((
910 Less than
911 )))|(((
912 x < 2
913 )))
914 |(((
915 <=
916 )))|(((
917 Less than or equal to
918 )))|(((
919 x <= 2
920 )))
921 |(% colspan="1" %)(% colspan="1" %)
922 (((
923 &&
924 )))|(% colspan="1" %)(% colspan="1" %)
925 (((
926 Conditional-AND
927 )))|(% colspan="1" %)(% colspan="1" %)
928 (((
929 x > 0 && x < 9
930 )))
931 |(% colspan="1" %)(% colspan="1" %)
932 (((
933 ~||
934 )))|(% colspan="1" %)(% colspan="1" %)
935 (((
936 Conditional-OR
937 )))|(% colspan="1" %)(% colspan="1" %)
938 (((
939 x < 0 || x > 9
Richard Kreissig 74.1 940 )))~{~{/column}}