C like syntax for activity diagrams

+1 vote
asked Apr 27, 2016 in Wanted features by t (140 points)
It would be great if activity diagrams could be a C-like syntax so that little or no editing would be required to get a flowchart of existing code.

Just recognizing basic blocks {}, if else, while, do while, and return syntax and assuming everything else is a basic block would go a long way towards this goal (break, continue, switch and exceptions could be put off for consideration at a later time).

Ideally, if there is a condition without a comment, then that condition would appear, but some tagged comments would allow overriding it with descriptive text. Similar for blocks of code

//@flowchart

{

    if (a==b) { // @then same values

        while (flag) {

                flag = f(x);

        }

    } else {

        //@otherwise special case handling

        ...

    }

}

//@end flowchart

would produce something like

@startuml
start
    if (same values) then (yes)
        while (flag)
            :f(x);
        endwhile
    else
        :special case handling;
    endif
    end
@enduml

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...