Notes |
|
(0002672)
|
maxime
|
2016-09-02 07:49
|
|
How do you see it in practice?
SDL has the ALTERNATIVE construct, that is similar to DECISIONS - syntax wise, but used to drive the generated code (equivalent to #ifdef, to disable branches). Is that what you have in mind?
Single elements like TASKS and DECISIONs can be commented (by surrounding the content with quotes) - in which case no code is generated for them. That does not work for OUTPUTs. |
|
|
|
Not sure if ALTERNATIVE construct can work:
- can it be applied to any construct?
- can you provide an example?
Another approach would be to extend the parser and the generator and use some special markup comment that opengeode can recognize, to show the elements someout (e.g. grayed out), although they won't be effectively get compiled. |
|
|
(0002675)
|
maxime
|
2016-09-02 09:14
|
|
I've uploaded an image to show how alternatives look like in SDL - it's similar to DECISIONs, except that the unselected branches would not be generated in the code.
The good thing is that you can use the same condition at different places of your model and have a single place where you define the value of the constant, so that you can enable/disable branches everywhere at the same time.
Advantages:
- you define your alternative branches only once, and you have a single place where you enable/disable them
- it is standard SDL
Drawback: It pollutes a bit the graphical model and it takes a bit more time to do than just right-click->Disable
There are two other options:
- As you suggest, add an SDL extension to enable/disable elements
(this would be done via a CIF comment to remain compatible with textual SDL)
- Use alternative as described above but with a tool option to hide the non-selected branches so that the model would look the same as now but would internally and in the .pr file use the right SDL syntax.
I will evaluate the impact of all these options, let me know if you have a strong preference. |
|
|
(0003820)
|
maxime
|
2022-12-06 09:35
|
|
Done, the alternative symbol is now supported in the editor and code generator.
There is a test case in opengeode/tests/testsuite/test-alternative |
|