views:

123

answers:

4

Hello,

I was wondering if there is a library for editing program flow. I refer to conditions if, loops (do, while, for) and other elements that can exist inside a program.

What I would like to have is some sort of a CAD application (similar to an UML editor) from where I can take some elements and edit their properties, make connections between them.

Do you know similar software that does this, or resembles a little what I'm trying to achieve?

Thanks,

Iulian

PS: It is something that should resemble this image.

PS2: I want to write code for doing this, I was wondering if such things exist.

+4  A: 

You might consider LabView.

James McNellis
+1 It is possible for Labview to invoke C functions in a shared library. This allows you to use Labview as a graphically programmed "front end" that can interface to an existing codebase that has a C API. Labview is popular in scientific and engineering disciplines.
Emile Cormier
I believe it is also possible for C/C++ applications to invoke Labview VI's (virtual instruments), but I forgot what this feature is called.
Emile Cormier
LabVIEW has an ActiveX interface to call LabVIEW code from other languages
Ton
+1  A: 

Not quite the right thing, so I'm doubtful you will accept this answer, but there is JBPM for Java which has a graphical editor. It's more for editing business processes than anything else, but it might be precisely what you're looking for.

Rich
A: 

Is this the sort of thing you are looking for? Flowchart4j looks like something that can convert Java into flowcharts, and I think it even has an Eclipse plugin.

Disclaimer: I found these in about 3 minutes searching Google. I haven't actually used them so I can't speak from user experience. I have used PL/SQL Developer which has a feature called "Code Outline" which displays a hierarchical tree based on program pieces in the current code editor: branch statements (if, else, case, when, etc...), loops, exceptions, and high level structures such as procedures and functions, cursors, types. For non-trivial files (large > 200 lines, with structures nested more than 2 or 3 levels deep) this feature is pretty worthless.

FrustratedWithFormsDesigner
+3  A: 

A short advice.

Programming languages were actually invented to describe program flows...

It is possible to draw flows, but as the notation is much less powerfull, you will find that it will become easy to design trivial or simple flows, and impossible to design even moderatly complex flows.

Phrased in another way; A complex* problem will not become less complex because you are using a tool with limited functionality.

(Which is exactly the wishful thinking thats makes BPEL [JBMP et al] utter boulderdash.)

KarlP
* complex = anything that resembles a real problem.
KarlP
you are right; unfortunately for me the client wants to have a visual editor of a in-house language (it's legacy...). The code is simple but we're dealing with non-technical persons for whom editing in a visual way is *better* (...not my decision, the client's needs).
Iulian Şerbănoiu
@Iulian Şerbănoiu: Will they be able to do EVERYthing in this visual editor? It sounds like they are working in a specific business domain and a full-blown flowchar-to-code tool might give them *too much* power. If you code your own solution, you could use something like Graphviz for the visual display, then write code to turn that into something executable withing the business domain.
FrustratedWithFormsDesigner
The requirements are specifying that this visual editor will make their job easier. My personal belief is that there is no *real* checker for the code written and this is the reason that the customer wants this visual tool. I believe it is better to have a code checker ...
Iulian Şerbănoiu
I think FrustratedWithFormsDesigner is right. What they would like to have is ordinary users configuring something in a really complex way. I am starting to smell "telecoms" here, so lets assume that they would like to design their own interactive voice response menu.In that case, it makes more sense to create a "IVR-builder" rather than a full-blown graphical programming language. The first might actually become usable, and the latter will lead to eternal lamentation.See if you can persuade them to simplify and modularise their requirements.
KarlP
... unless - of course - You are a consultant and want a really long assignment.
KarlP