News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Editing Structograms with the NassiShneiderman plugin

Started by danselmi, December 23, 2008, 04:51:40 PM

Previous topic - Next topic

danselmi

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]
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

danselmi

Hi

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

regards, danselmi

[attachment deleted by admin]
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

MortenMacFly

Quote from: danselmi on December 25, 2008, 08:12:56 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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

stefanos_

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.

danselmi

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.
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

stefanos_


danselmi

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
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

daplan

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 :/.

danselmi

spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

daplan

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.

danselmi

spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

scarphin

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:


oBFusCATed

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!]

scarphin

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.