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