Wiki source code of Textual SCCharts Language SCT
Last modified by Richard Kreissig on 2023/09/14 11:05
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
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]] |
| |
35.1 | 2 | |
| 3 | |||
| |
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"]] |
| |
3.1 | 5 | |
| |
4.1 | 6 | |
| |
72.1 | 7 | == Project Overview == |
| |
73.1 | 8 | |
| |
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 | |||
| |
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. |
| |
5.1 | 24 | |
| |
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]. |
| |
7.1 | 26 | |
| |
25.1 | 27 | |
| 28 | |||
| 29 | {{toc/}} | ||
| 30 | |||
| |
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"]]) |
| |
17.1 | 32 | |
| |
23.1 | 33 | |
| |
17.1 | 34 | = ABRO Example = |
| 35 | |||
| |
32.1 | 36 | In the following we will describe some basic elements using the famous ABRO example: |
| |
7.1 | 37 | |
| |
72.1 | 38 | |
| |
49.1 | 39 | {{code language="sct" linenumbers="true"}} |
| |
37.1 | 40 | @HVLayout |
| |
5.1 | 41 | scchart ABRO { |
| |
37.1 | 42 | input bool A, B, R; |
| |
48.1 | 43 | output bool O = false; |
| |
5.1 | 44 | region Main: |
| |
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; | ||
| |
5.1 | 52 | region HandleB: |
| |
37.1 | 53 | initial state wB |
| 54 | --> dB with B; | ||
| 55 | final state dB; | ||
| |
5.1 | 56 | } |
| |
37.1 | 57 | >-> done with / O = true; |
| 58 | final state done; | ||
| |
5.1 | 59 | } |
| 60 | o-> ABO with R; | ||
| |
37.1 | 61 | } |
| |
5.1 | 62 | {{/code}} |
| |
7.1 | 63 | |
| |
72.1 | 64 | |
| |
20.1 | 65 | [[image:attach:abro.png]] |
| 66 | |||
| |
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>". |
| |
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. |
| |
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. | ||
| |
9.1 | 71 | 1. Every state is terminated by a //;// as shown in line 11 for state //HandleA//. |
| |
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// >->//. | ||
| |
11.1 | 76 | |
| |
28.1 | 77 | = Detailed SCT Syntax of SCCharts Elements = |
| |
11.1 | 78 | |
| |
53.1 | 79 | [[image:attach:SCCharts (pre 1.0)@sccharts-features.jpg]] |
| |
27.1 | 80 | |
| |
18.1 | 81 | == SCChart, Initial State, State, Transition and Immediate Transition == |
| |
11.1 | 82 | |
| |
72.1 | 83 | |
| |
43.1 | 84 | {{code language="sct" linenumbers="true"}} |
| |
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 | |||
| |
72.1 | 95 | |
| 96 | |||
| |
13.1 | 97 | [[image:attach:01statetransition.png]] |
| 98 | |||
| 99 | |||
| |
14.1 | 100 | == Variable == |
| 101 | |||
| |
72.1 | 102 | |
| |
43.1 | 103 | {{code language="sct" linenumbers="true"}} |
| |
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 | |||
| |
72.1 | 118 | |
| 119 | |||
| |
14.1 | 120 | [[image:attach:02variable.png]] |
| 121 | |||
| |
72.1 | 122 | |
| |
14.1 | 123 | == Transition: Trigger & Effect == |
| 124 | |||
| |
72.1 | 125 | |
| |
43.1 | 126 | {{code language="sct" linenumbers="true"}} |
| |
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 | |||
| |
72.1 | 136 | |
| 137 | |||
| |
14.1 | 138 | [[image:attach:03triggereffect.png]] |
| 139 | |||
| |
72.1 | 140 | |
| |
14.1 | 141 | == Super State == |
| 142 | |||
| |
43.1 | 143 | {{code language="sct" linenumbers="true"}} |
| |
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 | |||
| |
72.1 | 155 | |
| 156 | |||
| |
14.1 | 157 | [[image:attach:04superstate.png]] |
| 158 | |||
| |
72.1 | 159 | |
| |
15.1 | 160 | == Super State: Final States & Termination Transition == |
| |
14.1 | 161 | |
| |
72.1 | 162 | |
| |
43.1 | 163 | {{code language="sct" linenumbers="true"}} |
| |
15.1 | 164 | scchart FinalStateTermination { |
| |
14.1 | 165 | initial state A |
| 166 | --> B; | ||
| |
15.1 | 167 | state B { |
| 168 | initial state B1 | ||
| 169 | --> B2; | ||
| 170 | final state B2; | ||
| 171 | } | ||
| 172 | >-> C; | ||
| 173 | state C; | ||
| |
14.1 | 174 | } |
| 175 | {{/code}} | ||
| 176 | |||
| |
72.1 | 177 | |
| 178 | |||
| |
15.1 | 179 | [[image:attach:05finalstatetermination.png]] |
| |
14.1 | 180 | |
| |
72.1 | 181 | |
| |
15.1 | 182 | == Super State: Weak Abort Transition == |
| |
14.1 | 183 | |
| |
72.1 | 184 | |
| |
43.1 | 185 | {{code language="sct" linenumbers="true"}} |
| |
15.1 | 186 | scchart WeakAbort { |
| 187 | input bool W; | ||
| |
14.1 | 188 | initial state A |
| 189 | --> B; | ||
| |
15.1 | 190 | state B { |
| 191 | initial state B1 | ||
| 192 | --> B2; | ||
| 193 | state B2; | ||
| 194 | } | ||
| 195 | --> C with W; | ||
| 196 | state C; | ||
| |
14.1 | 197 | } |
| 198 | {{/code}} | ||
| 199 | |||
| |
72.1 | 200 | |
| 201 | |||
| |
15.1 | 202 | [[image:attach:06weakabort.png]] |
| |
14.1 | 203 | |
| |
72.1 | 204 | |
| |
15.1 | 205 | == Super State: Strong Abort Transition == |
| |
14.1 | 206 | |
| |
72.1 | 207 | |
| |
43.1 | 208 | {{code language="sct" linenumbers="true"}} |
| |
15.1 | 209 | scchart StrongAbort { |
| 210 | input bool S; | ||
| |
14.1 | 211 | initial state A |
| 212 | --> B; | ||
| |
15.1 | 213 | state B { |
| 214 | initial state B1 | ||
| 215 | --> B2; | ||
| 216 | state B2; | ||
| 217 | } | ||
| 218 | o-> C with S; | ||
| 219 | |||
| 220 | state C; | ||
| |
14.1 | 221 | } |
| 222 | {{/code}} | ||
| 223 | |||
| |
72.1 | 224 | |
| 225 | |||
| |
15.1 | 226 | [[image:attach:07strongabort.png]] |
| |
14.1 | 227 | |
| |
72.1 | 228 | |
| |
15.1 | 229 | == Concurrent Regions (inside a Super State) == |
| |
14.1 | 230 | |
| |
72.1 | 231 | |
| |
43.1 | 232 | {{code language="sct" linenumbers="true"}} |
| |
15.1 | 233 | scchart Regions { |
| 234 | input bool S; | ||
| |
14.1 | 235 | initial state A |
| 236 | --> B; | ||
| |
15.1 | 237 | state B { |
| 238 | region Region1 : | ||
| 239 | initial state B1 | ||
| 240 | --> B2; | ||
| 241 | state B2; region Region2 : | ||
| 242 | initial state B3; | ||
| 243 | }; | ||
| |
14.1 | 244 | } |
| 245 | {{/code}} | ||
| 246 | |||
| |
72.1 | 247 | |
| 248 | |||
| |
15.1 | 249 | [[image:attach:08regions.png]] |
| |
14.1 | 250 | |
| |
72.1 | 251 | |
| |
15.1 | 252 | == Entry Action, During Action, Exit Action == |
| |
14.1 | 253 | |
| |
72.1 | 254 | |
| |
43.1 | 255 | {{code language="sct" linenumbers="true"}} |
| |
15.1 | 256 | scchart Actions { |
| 257 | input bool var1; | ||
| 258 | output bool var2; | ||
| |
14.1 | 259 | initial state A |
| 260 | --> B; | ||
| |
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 | }; | ||
| |
14.1 | 270 | } |
| 271 | {{/code}} | ||
| 272 | |||
| |
72.1 | 273 | |
| |
73.1 | 274 | |
| |
15.1 | 275 | [[image:attach:09actions.png]] |
| |
14.1 | 276 | |
| |
72.1 | 277 | |
| |
15.1 | 278 | == Shallow History Transition == |
| |
14.1 | 279 | |
| |
72.1 | 280 | |
| |
43.1 | 281 | {{code language="sct" linenumbers="true"}} |
| |
15.1 | 282 | scchart HistoryShallow { |
| 283 | input bool var1; | ||
| 284 | output bool var2; | ||
| |
14.1 | 285 | initial state A |
| |
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; | ||
| |
14.1 | 293 | } |
| 294 | {{/code}} | ||
| 295 | |||
| |
72.1 | 296 | |
| 297 | |||
| |
15.1 | 298 | [[image:attach:10historyshallow.png]] |
| |
14.1 | 299 | |
| |
72.1 | 300 | |
| |
15.1 | 301 | == Deep History Transition == |
| |
14.1 | 302 | |
| |
72.1 | 303 | |
| |
43.1 | 304 | {{code language="sct" linenumbers="true"}} |
| |
15.1 | 305 | scchart HistoryDeep { |
| 306 | input bool var1; | ||
| 307 | output bool var2; | ||
| |
14.1 | 308 | initial state A |
| |
15.1 | 309 | --> B history with var1; |
| 310 | state B { | ||
| 311 | initial state B1 | ||
| 312 | --> B2; | ||
| 313 | state B2; | ||
| 314 | } | ||
| 315 | --> A with var1; | ||
| |
14.1 | 316 | } |
| 317 | {{/code}} | ||
| 318 | |||
| |
72.1 | 319 | |
| 320 | |||
| |
15.1 | 321 | [[image:attach:11historydeep.png]] |
| |
14.1 | 322 | |
| |
72.1 | 323 | |
| |
15.1 | 324 | == Deferred Transition == |
| |
14.1 | 325 | |
| |
72.1 | 326 | |
| |
43.1 | 327 | {{code language="sct" linenumbers="true"}} |
| |
15.1 | 328 | scchart Deferred { |
| 329 | input bool var1; | ||
| 330 | output bool var2; | ||
| |
14.1 | 331 | initial state A |
| |
15.1 | 332 | --> B deferred with var1; |
| 333 | state B { | ||
| 334 | entry var1 / var2 = true; | ||
| 335 | } | ||
| 336 | --> A with var1; | ||
| |
14.1 | 337 | } |
| 338 | {{/code}} | ||
| 339 | |||
| |
72.1 | 340 | |
| 341 | |||
| |
15.1 | 342 | [[image:attach:12deferred.png]] |
| |
14.1 | 343 | |
| |
72.1 | 344 | |
| |
15.1 | 345 | == Transition with Count Delay == |
| |
14.1 | 346 | |
| |
72.1 | 347 | |
| |
43.1 | 348 | {{code language="sct" linenumbers="true"}} |
| |
15.1 | 349 | scchart CountDelay { |
| 350 | input bool var1; | ||
| 351 | output bool var2; | ||
| |
14.1 | 352 | initial state A |
| |
15.1 | 353 | --> B with 4 var1; |
| |
14.1 | 354 | state B |
| |
15.1 | 355 | --> A with var1; |
| |
14.1 | 356 | } |
| 357 | {{/code}} | ||
| 358 | |||
| |
72.1 | 359 | |
| 360 | |||
| |
15.1 | 361 | [[image:attach:13countdelay.png]] |
| |
14.1 | 362 | |
| |
72.1 | 363 | |
| |
15.1 | 364 | == Array == |
| |
14.1 | 365 | |
| |
72.1 | 366 | |
| |
43.1 | 367 | {{code language="sct" linenumbers="true"}} |
| |
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 | } | ||
| |
14.1 | 374 | {{/code}} |
| 375 | |||
| |
72.1 | 376 | |
| 377 | |||
| |
15.1 | 378 | [[image:attach:14array.png]] |
| |
14.1 | 379 | |
| |
72.1 | 380 | |
| |
15.1 | 381 | == Signal == |
| 382 | |||
| |
72.1 | 383 | |
| |
43.1 | 384 | {{code language="sct" linenumbers="true"}} |
| |
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 | |||
| |
72.1 | 394 | |
| |
15.1 | 395 | [[image:attach:15signal.png]] |
| |
38.1 | 396 | |
| |
72.1 | 397 | |
| |
38.1 | 398 | == Reference States == |
| 399 | |||
| |
39.1 | 400 | **Important: To use the referenced SCCharts feature, activate the Xtext nature for your project!** |
| 401 | |||
| |
72.1 | 402 | |
| |
43.1 | 403 | {{code language="sct" linenumbers="true"}} |
| |
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 | |||
| |
72.1 | 420 | |
| 421 | |||
| |
38.1 | 422 | [[image:attach:MainSCChart.png]][[image:attach:InnerSCChart.png]] |
| |
39.1 | 423 | |
| 424 | |||
| |
72.1 | 425 | |
| |
51.1 | 426 | = Hostcode = |
| 427 | |||
| 428 | You can also use you host language directly. | ||
| 429 | |||
| 430 | == Function Calls == | ||
| 431 | |||
| |
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. |
| |
51.1 | 433 | |
| |
72.1 | 434 | |
| |
51.1 | 435 | {{code language="sct" linenumbers="true"}} |
| |
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)>; | ||
| |
72.1 | 448 | <fflush( stdout )>; |
| |
53.1 | 449 | |
| 450 | state print | ||
| 451 | --> getChar; | ||
| |
51.1 | 452 | } |
| 453 | {{/code}} | ||
| 454 | |||
| |
72.1 | 455 | |
| 456 | |||
| |
53.1 | 457 | [[image:attach:functionCalls.png]] |
| |
51.1 | 458 | |
| 459 | |||
| |
72.1 | 460 | |
| |
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 | |||
| |
72.1 | 467 | |
| |
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)'; | ||
| |
72.1 | 479 | ms = 'val.tv_sec' |
| |
51.1 | 480 | } |
| 481 | --> print with / 'printf("Second: %d\\n", ms); fflush( stdout )'; | ||
| 482 | |||
| 483 | state print | ||
| 484 | --> getChar; | ||
| 485 | } | ||
| 486 | {{/code}} | ||
| 487 | |||
| |
72.1 | 488 | |
| 489 | |||
| |
51.1 | 490 | |
| 491 | [[image:attach:hostcode.png]] | ||
| 492 | |||
| |
72.1 | 493 | |
| |
40.1 | 494 | = Annotations = |
| 495 | |||
| 496 | The textual SCCharts language supports several annotations to influence the visual representation of the model. | ||
| 497 | |||
| |
41.1 | 498 | Annotation are processed in sequential order. |
| 499 | |||
| |
49.1 | 500 | (% class="wrapped" %) |
| |
40.1 | 501 | |=((( |
| 502 | Pattern | ||
| 503 | )))|=(% colspan="1" %)(% colspan="1" %) | ||
| 504 | ((( | ||
| 505 | Usage | ||
| 506 | )))|=((( | ||
| 507 | Description | ||
| 508 | )))|=((( | ||
| 509 | Example | ||
| 510 | ))) | ||
| 511 | |((( | ||
| |
49.1 | 512 | (% class="content-wrapper" %) |
| 513 | ((( | ||
| |
74.1 | 514 | {{code nopanel="true"}} |
| |
50.1 | 515 | @diagram[<key>] <value> |
| |
74.1 | 516 | {{/code}} |
| |
49.1 | 517 | ))) |
| |
40.1 | 518 | )))|(% colspan="1" %)(% colspan="1" %) |
| 519 | ((( | ||
| |
49.1 | 520 | (% class="wrapped" %) |
| |
40.1 | 521 | |=((( |
| 522 | Location: | ||
| 523 | )))|((( | ||
| 524 | scchart | ||
| 525 | ))) | ||
| 526 | |=((( | ||
| 527 | <key> | ||
| 528 | )))|((( | ||
| |
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**. |
| |
40.1 | 530 | ))) |
| 531 | |=((( | ||
| 532 | <value> | ||
| 533 | )))|((( | ||
| |
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 | ||
| |
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. | ||
| |
41.1 | 546 | |
| 547 | The values from the sidebar will be ignored if a corresponding annotation is present. | ||
| |
40.1 | 548 | )))|((( |
| |
49.1 | 549 | (% class="content-wrapper" %) |
| 550 | ((( | ||
| |
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 | ))) | ||
| |
49.1 | 560 | ))) |
| |
40.1 | 561 | |((( |
| |
49.1 | 562 | (% class="content-wrapper" %) |
| 563 | ((( | ||
| |
74.1 | 564 | {{code nopanel="true"}} |
| |
40.1 | 565 | @layout[<key>] <value> |
| |
74.1 | 566 | {{/code}} |
| |
49.1 | 567 | ))) |
| |
40.1 | 568 | )))|(% colspan="1" %)(% colspan="1" %) |
| 569 | ((( | ||
| |
49.1 | 570 | (% class="wrapped" %) |
| |
40.1 | 571 | |=((( |
| 572 | Location: | ||
| 573 | )))|((( | ||
| 574 | scchart, state, region, transition | ||
| 575 | ))) | ||
| 576 | |=((( | ||
| 577 | <key> | ||
| 578 | )))|((( | ||
| |
41.1 | 579 | The ID of the layout option. The options are searched for the first matching **postfix**. |
| |
40.1 | 580 | ))) |
| 581 | |=((( | ||
| 582 | <value> | ||
| 583 | )))|((( | ||
| |
41.1 | 584 | The value type depends on the option type. The value is parsed case-sensitive. |
| |
40.1 | 585 | ))) |
| 586 | )))|((( | ||
| |
49.1 | 587 | (% class="content-wrapper" %) |
| 588 | ((( | ||
| |
40.1 | 589 | Sets the layout property identified by <key> to the given value on the annotated element. |
| 590 | |||
| |
62.1 | 591 | The available layout options are documented [[here>>doc:KIELER.Discontinued Projects.Infrastructure for Meta Layout (KIML).KIML Layout Options.WebHome]]. |
| |
41.1 | 592 | |
| |
40.1 | 593 | Layout options will only affect the annotated element and no underlying hierarchy levels. |
| |
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. | ||
| |
43.1 | 596 | |
| 597 | Special case: If the direction is set on the scchart element (top level) it overrides the default alternating layout. | ||
| |
44.1 | 598 | |
| 599 | {{expand title="Commonly Used"}} | ||
| |
49.1 | 600 | (% class="wrapped" %) |
| |
44.1 | 601 | |((( |
| 602 | {{{direction}}} | ||
| |
40.1 | 603 | )))|((( |
| |
44.1 | 604 | Layout direction |
| 605 | ))) | ||
| 606 | |((( | ||
| 607 | priority | ||
| 608 | )))|((( | ||
| 609 | Can influence the order of regions | ||
| 610 | ))) | ||
| 611 | {{/expand}} | ||
| |
49.1 | 612 | ))) |
| |
44.1 | 613 | )))|((( |
| |
49.1 | 614 | (% class="content-wrapper" %) |
| 615 | ((( | ||
| |
40.1 | 616 | {{code language="sct"}} |
| 617 | scchart Testing { | ||
| |
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; | ||
| |
40.1 | 626 | } |
| 627 | {{/code}} | ||
| |
41.1 | 628 | |
| 629 | |||
| |
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 | |||
| |
72.1 | 647 | |
| |
40.1 | 648 | ))) |
| |
49.1 | 649 | ))) |
| |
40.1 | 650 | |((( |
| |
49.1 | 651 | (% class="content-wrapper" %) |
| 652 | ((( | ||
| |
74.1 | 653 | {{code nopanel="true"}} |
| |
40.1 | 654 | @HVLayout |
| 655 | @VHLayout | ||
| |
74.1 | 656 | {{/code}} |
| |
49.1 | 657 | ))) |
| |
40.1 | 658 | )))|(% colspan="1" %)(% colspan="1" %) |
| 659 | ((( | ||
| |
49.1 | 660 | (% class="wrapped" %) |
| |
40.1 | 661 | |=((( |
| 662 | Location: | ||
| 663 | )))|((( | ||
| 664 | scchart, state, region | ||
| 665 | ))) | ||
| 666 | )))|((( | ||
| |
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. | ||
| |
40.1 | 672 | )))|((( |
| |
49.1 | 673 | (% class="content-wrapper" %) |
| 674 | ((( | ||
| |
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 | ))) | ||
| |
49.1 | 684 | ))) |
| |
40.1 | 685 | |(% colspan="1" %)(% colspan="1" %) |
| 686 | ((( | ||
| |
49.1 | 687 | (% class="content-wrapper" %) |
| 688 | ((( | ||
| |
74.1 | 689 | {{code nopanel="true"}} |
| |
40.1 | 690 | @collapse |
| 691 | @expand | ||
| |
74.1 | 692 | {{/code}} |
| |
49.1 | 693 | ))) |
| |
40.1 | 694 | )))|(% colspan="1" %)(% colspan="1" %) |
| 695 | ((( | ||
| |
49.1 | 696 | (% class="wrapped" %) |
| |
40.1 | 697 | |=((( |
| 698 | Location: | ||
| 699 | )))|((( | ||
| |
42.1 | 700 | region |
| |
40.1 | 701 | ))) |
| 702 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 703 | ((( | ||
| |
42.1 | 704 | The annotated region will be initially collapse or expanded. |
| |
40.1 | 705 | )))|(% colspan="1" %)(% colspan="1" %) |
| 706 | ((( | ||
| |
49.1 | 707 | (% class="content-wrapper" %) |
| 708 | ((( | ||
| |
40.1 | 709 | {{code language="sct"}} |
| 710 | scchart Testing { | ||
| |
50.1 | 711 | @collapse |
| |
42.1 | 712 | region: |
| 713 | initial state A | ||
| |
40.1 | 714 | --> B; |
| 715 | final state B; | ||
| 716 | } | ||
| 717 | {{/code}} | ||
| 718 | ))) | ||
| |
49.1 | 719 | ))) |
| |
40.1 | 720 | |(% colspan="1" %)(% colspan="1" %) |
| 721 | ((( | ||
| |
49.1 | 722 | (% class="content-wrapper" %) |
| 723 | ((( | ||
| |
74.1 | 724 | {{code nopanel="true"}} |
| |
40.1 | 725 | @hide |
| |
74.1 | 726 | {{/code}} |
| |
49.1 | 727 | ))) |
| |
40.1 | 728 | )))|(% colspan="1" %)(% colspan="1" %) |
| 729 | ((( | ||
| |
49.1 | 730 | (% class="wrapped" %) |
| |
40.1 | 731 | |=((( |
| 732 | Location: | ||
| 733 | )))|((( | ||
| 734 | scchart, state, region, transition | ||
| 735 | ))) | ||
| 736 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 737 | ((( | ||
| |
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. | ||
| |
40.1 | 741 | )))|(% colspan="1" %)(% colspan="1" %) |
| 742 | ((( | ||
| |
49.1 | 743 | (% class="content-wrapper" %) |
| 744 | ((( | ||
| |
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 | ))) | ||
| |
49.1 | 754 | ))) |
| |
45.1 | 755 | |
| |
47.1 | 756 | = Overview of Operators = |
| |
45.1 | 757 | |
| |
47.1 | 758 | The following briefly describes the operators that can be used in expressions. |
| |
45.1 | 759 | |
| |
49.1 | 760 | (% class="wrapped" %) |
| |
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 | |||
| |
49.1 | 779 | (% class="wrapped" %) |
| |
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 | ((( | ||
| |
46.1 | 818 | 6 : 2 |
| |
45.1 | 819 | ))) |
| 820 | |||
| |
49.1 | 821 | (% class="wrapped" %) |
| |
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 | ((( | ||
| |
46.1 | 858 | x~-~- |
| |
45.1 | 859 | ))) |
| 860 | |||
| |
49.1 | 861 | (% class="wrapped" %) |
| |
45.1 | 862 | |=((( |
| 863 | Boolean Operator | ||
| 864 | )))|=((( | ||
| 865 | Description | ||
| 866 | )))|=((( | ||
| 867 | Example | ||
| 868 | ))) | ||
| |
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 | ))) | ||
| |
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 | ||
| |
74.1 | 940 | )))~{~{/column}} |