Author Topic: Editing Structograms with the NassiShneiderman plugin  (Read 13589 times)

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 202
Editing Structograms with the NassiShneiderman plugin
« on: December 23, 2008, 04:51:40 pm »
Hi

I have built a Structogram editor, the NassiShneiderman Plugin.
Some features:
  • Edit the diagram with the mouse (dnd), copy/cut/paste
  • export to StrukTeX, PNG(or just copy and paste as bitmap (into bitmap editor)) and svg
  • export to source code

To edit a diagram, choose the brick from the toolbar and move the mouse over the diagram. A red Line
or Grid will indicate where the brick gets inserted.



To disable SVG export remove the USE_SVG define from the build options.
To get SVG export, you need to compile the SVG lib from WxWidgets contrib dir. Don't forget to
copy wxmsw28u_svg_....dll where it can be found.

There is the file "lexer_nassi.xml" in the archive, copy it to the other lexer configutation files and
Code::Blocks knows the nsd files in it's file open dialog. (it is not really a lexer configuration...)

"Save As" and "Select All" will work after applying patch ID 002606.

If you have any questions, don't hesitate to ask.



Now the NassiShneiderman Plugin is only an editor plugin. I like to integrate it more into Code::Blocks.
The question is: How would you (as a user) expect the behavior of such a plugin?
I have prepared a parser (with boost::spirit) which is able to read c sources and generate
the diagram. When should the parser get called and over which part of a source file? When should
the plugin generate sourcecode from the structogram and replace the previously parsed code?
Thanks for your help in advance.


Regards danselmi


[attachment deleted by admin]

[attachment deleted by admin]
« Last Edit: September 03, 2009, 11:04:37 am by danselmi »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6996
    • My Best Post
Re: Editing Structograms with the NassiShneiderman plugin
« Reply #1 on: December 25, 2008, 12:33:45 am »
I had no idea this diagram existed
Link to what it is http://en.wikipedia.org/wiki/Structogram

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 202
Re: Editing Structograms with the NassiShneiderman plugin
« Reply #2 on: December 25, 2008, 08:12:56 pm »
Hi

Some had problems to build this plugin. I hope this helps.
(missing postscript support on wxMSW).

regards, danselmi

[attachment deleted by admin]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9603
Re: Editing Structograms with the NassiShneiderman plugin
« Reply #3 on: December 25, 2008, 09:39:22 pm »
Some had problems to build this plugin. I hope this helps.
...probably that was not the reason. I had issues, too. The reaosn was that you include the resources via "../rc/[resource_file]". Changing all the occurrences to "rc/[resource_file]"" got me rid of a lot of compiler errors.
in addition since we use wx28 you should prefer "wxFD_SAVE" over "wxSAVE" and alike for file constants. People not having the wx_compatibility flag set will get errors otherwise.

Besides this and to make myself clear: EXCELLENT contribution! Great work!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

stefanos_

  • Guest
Re: Editing Structograms with the NassiShneiderman plugin
« Reply #4 on: June 28, 2010, 10:07:27 am »
Currently updated my svn revision from 6370 to 6376 and breaks on your plugin. The rest of plugins compile just fine.

The exact error message is ld.exe||cannot find -lwxmsw28u_svg|

I use TDM's GCC 4.5.0 with wxMSW-2.8.10, under Windows XP Professional SP3.

Please advice.

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 202
Re: Editing Structograms with the NassiShneiderman plugin
« Reply #5 on: June 28, 2010, 10:38:58 am »
The dependency can be removed by removing the define USE_SVG in the build options and "wxmsw28u_svg" from the link libraries. The export to svg is not available then.

stefanos_

  • Guest
Re: Editing Structograms with the NassiShneiderman plugin
« Reply #6 on: June 28, 2010, 11:43:48 am »
Cheers buddy, that would do.

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 202
Re: Editing Structograms with the NassiShneiderman plugin
« Reply #7 on: September 10, 2010, 01:02:25 am »
I have just written some documentation about the usage of this plugin but it is not finished yet:
http://wiki.codeblocks.org/index.php?title=NassiShneiderman

Offline daplan

  • Single posting newcomer
  • *
  • Posts: 2
Re: Editing Structograms with the NassiShneiderman plugin
« Reply #8 on: December 23, 2014, 12:00:04 pm »
Is this plugin still available? I would very much like to use it. I've been searching trough duckduckgo now over a hour without any luck. The wiki page is nice and all, but there is no link to a download for said plugin. Anyway I can get my hands on it? The link to nassiplugin.berlios.de does not seem to work anymore :/.

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 202
Re: Editing Structograms with the NassiShneiderman plugin
« Reply #9 on: December 23, 2014, 12:08:44 pm »
It's part of the contrib plugins.

Offline daplan

  • Single posting newcomer
  • *
  • Posts: 2
Re: Editing Structograms with the NassiShneiderman plugin
« Reply #10 on: December 28, 2014, 09:10:18 am »
Thank you Danselmi for your quick reply. Does that mean that it should be included in current version of Code::Blocks? Is it also included in the 64bit version? Becuase I cant find it nowhere. Installed Code:Blocks via a packet manager on Mint Linux 17.

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 202
Re: Editing Structograms with the NassiShneiderman plugin
« Reply #11 on: December 28, 2014, 07:26:40 pm »
You need to install the contrib plugins too.

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Editing Structograms with the NassiShneiderman plugin
« Reply #12 on: January 04, 2015, 07:02:58 pm »
If anyone's interested, I've submitted 3 patches for this plugin:

1- This patch allows the usage of editor colors instead of hardcoded colors to create the diagram. Thanks to Alpha for pointing me out how to get the actual editor colors. Unfortunately I couldn't pinpoint the piece of code responsible for editing the comments/sources on the diagram itself. So editing colors are still hardcoded. Please see screenshots below.
patch here -> https://sourceforge.net/p/codeblocks/tickets/124/
2- This patch enhances the Cparser to allow for more comments at various different places. Please see screenshots below.
patch here -> https://sourceforge.net/p/codeblocks/tickets/125/
3- A simple patch to insert a menu item for 'Create diagram' so that a shortcut can be assigned. Unfortunately I don't know how to disable the menu item if there is no code selected but it must be implemented as cb crashes when the menu item is activated with no selection.
patch here -> https://sourceforge.net/p/codeblocks/tickets/126/

Sample code:


Diagram:


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12828
    • Travis build status
Re: Editing Structograms with the NassiShneiderman plugin
« Reply #13 on: January 04, 2015, 07:57:49 pm »
1. I've posted a comment on the sf.net about this.
2. Can you post a screenshot without this patch?
3. If you've set a menu id, then you can register an UpdateUI event which can be used to enable/disable the menu item.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: Editing Structograms with the NassiShneiderman plugin
« Reply #14 on: January 04, 2015, 10:46:03 pm »
Thanks for the feedback.
1- I've posted a new patch with some comments on sf.net.
2- I can't because the Cparser won't even parse it without the patch (because of some of the comments) and even if it could, the true condition comments won't be at the correct place. I forgot to say; the parser enhancements is not only limited to if/else if/else blocks but to all other structures the plugin can parse.
3- If you can point me to the exact location in cb's source where I can register an UpdateUI event, I'll see what I can do.