fesch / Structorizer.Desktop

Structorizer is a little tool which you can use to create Nassi-Schneiderman Diagrams (NSD).
https://structorizer.fisch.lu
GNU General Public License v3.0
65 stars 20 forks source link

Enhancement - Code export from Arranger #160

Closed reks99 closed 7 years ago

reks99 commented 8 years ago

Hi,

It would be great, if one can put together all subfunctions and a (main) program which calls this function in arranger. Than export the code (best out of arranger) in either an all in one file (with functions inside) or separate files with include options in the (main) program.

Fine regards Rolf

codemanyak commented 8 years ago

Interesting idea. I had already thought about a slightly different approach that would have a similar effect: An export option (in Structorizer) which recursively involves all reachable subroutines in the export of an algorithm. The advantage is that it would not require a second export environment (on the Arranger). Instead, it would only be necessary to detect all call instructions and have a look whether the matching subroutine is available in (e.g.) Arranger. If so and the hypothetical export option is enabled then the subroutine would be exported as well. And so on. Whether the subroutine export would be integrated in the main target file or be exported into a separate file should certainly depend on the target language. I'll think about how to do it.

reks99 commented 8 years ago

@codemanyak Hi Kay.

Perhaps in the export-settings a flag can be set for direct include or linked include. Perhaps also a flag can be used to ask for including.

The arranger may be connected with a structorizer - via pinning - so perhaps structorizer can export the pinned elements inline or linked, depending on the flags in export settings.

Fine regards Rolf

codemanyak commented 7 years ago

New export option "Involve called subroutines" implemented. If activated then Structorizer tries to find all subroutine diagrams recursively referred to by Call elements and includes them in the code export. Tested for all export languages. In this first implementation accomplished for version 3.24-13 all subroutines will be involved in topological order in the single output file.

They may be realised later.

codemanyak commented 7 years ago

The new export option "Involve called subroutines" has to be corrected for StrukTeX (i.e. the fix came too late for version 3.24-13). There is no urgency, though, because with disabled subroutine option (the default) the StrukTeX export works as before.

codemanyak commented 7 years ago

StrukTeX export with involved subrotines now formally implemented (version 3.24-14).

codemanyak commented 7 years ago

I decided that the requested direct code export from Arranger would be too vague and will not be implemented. The possibilities to export connected code from Structorizer are good enough, particularly with the Arranger index introduced with versions 3.25-10/3.25-11. What's still worth to be done are the options to distribute the functions to different source files and to produce file headers with C/C++ export, which is to be pursued with #29.

codemanyak commented 4 years ago

A direct export from Arranger is still not possible, but the arrangement groups introduced with #657 facilitate at least the consistent saving / archiving of related diagrams a lot.

codemanyak commented 4 years ago

Issue #828 being currently prepared will be a further advancement to the aims formulated above.