Author Topic: Moritz plugin  (Read 15930 times)

Offline eckard_klotz

  • Almost regular
  • **
  • Posts: 194
Moritz plugin
« on: June 21, 2013, 08:20:45 am »
Hello ToApolytoXaos.

I'm the developer behind the two sourceforge projects:

Moritz : http://sourceforge.net/projects/moritz/
MuLanPa : http://sourceforge.net/projects/mulanpa/

Both are open-source freeware-projects and should be used as an extension of Doxygen to create algorithm describing diagrams like nassi shneiderman or uml activity diagrams by analysing the existing source code.

I want to publish with the next snapshot my C::B project files also but until now the current snapshots may not fit your needs without the knowledge about the needed sources for one specific binary.

But the sources-container in the official distributions contain only those sources for one binary. Thus please download one of them and add all sources in there to one project.

Src_xml2abc_2013_03_26.zip ->
http://sourceforge.net/projects/moritz/files/Moritz_2.x/Moritz_1.9.07/


Src_abc2xml_2013_03_26.zip ->
http://sourceforge.net/projects/mulanpa/files/MuLanPa_0/MuLanPa_0_09_02/

Note this are only my C++ based hobby-projects. In my company I work still with C based projects and there you have really long lists of functions, variables, macros, ...
But I'm not allowed to provide them as an example. I hope you understand this.

Best regards,
                     Eckard.

PS.: Since my internet-resources may be limited at the week-end please accept my apologize if I respond to your next questions on Monday.

Edit: changed the title.
« Last Edit: June 22, 2013, 07:40:43 pm by MortenMacFly »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Moritz plugin
« Reply #1 on: June 21, 2013, 01:15:13 pm »
Moritz : http://sourceforge.net/projects/moritz/
Interesting! I am using this one myself. Great work! ;)

Edit: changed the title.
« Last Edit: June 22, 2013, 07:40:58 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline eckard_klotz

  • Almost regular
  • **
  • Posts: 194
Re: Moritz plugin
« Reply #2 on: June 21, 2013, 01:36:21 pm »
Hello Morten.

Currently I have still a lot to to finish my work for releasing Moritz 2.0.0. But since I do the development with C::B I asked my self it it would be also interesting to have a C::B Plugin for it.

What do you think?

Best regards,
                  Eckard.

Edit: changed the title.
« Last Edit: June 22, 2013, 07:41:14 pm by MortenMacFly »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Moritz plugin
« Reply #3 on: June 21, 2013, 03:51:13 pm »
I asked my self it it would be also interesting to have a C::B Plugin for it.
Depends on what it should do: We have a doxygen plugin as well as a nassi shneiderman plugin. So if you plan a plugin to help setting up the control files and inputs for moritz, look at the first one. If you think about visualisation, take a look at the second one. If you think of more: Integrating the parser, whats-o-ever... please explain. :-)

Edit: changed the title.
« Last Edit: June 22, 2013, 07:41:29 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline eckard_klotz

  • Almost regular
  • **
  • Posts: 194
Re: Moritz plugin
« Reply #4 on: June 22, 2013, 01:48:22 pm »
Hello Morten.

First of all thank you for your interest. Second if the content of this post is not really fitting to the forum I used please feel free to move it. But I wanted not to open a new plug-in topic without your agreement that the idea behind is worth to be discussed there.

I know that a nassi shneiderman diagram editor already exists as plug in as well as a plug in for Doxygen.  But first side I understand the existing nsd plug-in more as a tool to  describe what you want to implement while Moritz is a tool to describe what you have implemnted. And second side Moritz_2 is completely new developed and is not using Doxygen as parser any more, it has its own parser now (even the outputs of Moritz should still be usable with Doxygen).

Moritz_2 contains two binaries abc2xml and xml2abc. The first one is a parser that transfers a source-text into a xml-file. The second tool transfers the content of a xml-file into a text-file that normaly describes diagrams. Both tools are highly configurable. The binary abx2xml uses external text-files (attachment a2x) to learn how to parse the source. The binary xml2abc uses external text-files (attachment x2a) which contain text-snippets to learn how to build its textual output.

Both tools read this text-files while run time:
  • By changing of the a2x-files the parser-functionality can be changed. By providing new ones other programming-languages can be parsed.
    Currently python and c/c++ are nearly stable while matlab and pascal are available but still under development.
  • By changing the x2a-files the created text-files can be changed. By providing new ones other text-files can be added.
    Currently html-text are used to define nassi shneiderman diagrams as html-tables. But with the last development snapshot I provide x2a-files also which describe dot-snippets for enabling the generation of uml activity diagrams.
  • Additional to this special text files both binaries use xml-files where the user configures which files he wants to analyse and how.


Moritz_2 is much more powerful than Moritz_1 but unfortunately much more complex to configure also. Thus there is the need of a wizard tool that helps to use only those parts of the configuration the user really needs and that offers all other configurations on special expert tabs. The binaries them self should be still independent tools and the configuration-files created by the plug-in should be usable in a in independent batch-run without C::B too.

But more may be thinkable in the future:
  • C::B may provide the possibility to copy a single function into a temporary file. That will be than analysed by Moritz and displayed as html-based nassi shneiderman diagram in a C::B window. And perhaps it may be possible to establish a link-mechanism to  jump between the code and the diagram.
  • C::B may use the xml-output of the parser to provide another kind of editing mechanism. Since the xml-tree created by abc2xml describes the algorithm structure and not the document-structure it is possible to use this to show the code in a tree-view. And here the user may copy sub-trees to create code-templates, he may cut out sub trees or add some. Once he is ready xml2abc can be used to create the source-text again.
But note this are only possibilities we may think about later (from my perspective much later).

As I wrote before, currently I'm still busy with the final work on the binaries them self. I hope that I'm able to publish Moritz 2.0.0 in autumn 2013. This version will not contain everything I have planed but I think it is good enough to show the audience how the future of Moritz should look like. All main changes in the way of how to configure the tools should be done. This means than it is the right time to think about a graphical wizard.

Best Regards,
                  Eckard.

Edit: changed the title.
« Last Edit: June 22, 2013, 07:41:45 pm by MortenMacFly »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Moritz plugin
« Reply #5 on: June 22, 2013, 07:47:13 pm »
Ok - If you think of a plugin in terms of a graphical wizard its a new one. I don't know how flexible the interface of the Nassi Shneiderman plugin is, but maybe the MIME handler does allow opening these diagrams from another plugin. For running the Moritz tool from within the wizard I see no issue. For extracting functions... this might be different, cause CC has no public API you can query. This is a long-term discussion meanwhile because we see it would be nice, but I'm afraid it won't be implemented any time soon. that's why other plugin like Doxygen and/or the HeaderFixup plugin have their own parsers for functions you may be able to re-use.

In fact I have to admit that I am still sticking with Moritz1, so for me it was (is) still an extension to Doxygen. Maybe I should look into Moritz2 so that things getting clearer.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 203
Re: Moritz plugin
« Reply #6 on: June 23, 2013, 06:09:17 pm »
Hi

The  Nassi Shneiderman plugin is also able to generate a diagram from code. It uses boost::spirit to parse the code. It is able to parse parts of C language. It is possible to edit these diagrams and take back into code.

Sure, it is possible to change it's parser (it is not very good atm). So if you have some questions, don't hesitate to ask.

regards, danselmi

Offline eckard_klotz

  • Almost regular
  • **
  • Posts: 194
Re: Moritz plugin
« Reply #7 on: June 24, 2013, 08:04:23 am »
Hello Danselmi.

Please don't take me wrong. I don't want to replace your plug-in. The focus of Moritz is still to generate additional input for tools like Doxygen. But since it is using its own binaries to parse the code and to generate diagram describing text-files it is possible to use it for other purposes also. That's why I asked  if the C::B team would be interested.

But I see it like Morten:
Quote
This is a long-term discussion meanwhile
...
Quote
but I'm afraid it won't be implemented any time soon.

For me the most important functionality would be a plug-in that helps the user to configure the parser (abc2xml) and the generator (xml2abc) like C::B offers as preferences dialogue for Doxygen.  A toolbar to insert special commands (comments with special content) and to run the tools and to show its shell output may be nice.

Once I was able to implement this and you accept my work as usable plug-in we may discuss what may be possible and useful also.

Best regards,
                     Eckard.

Offline eckard_klotz

  • Almost regular
  • **
  • Posts: 194
Re: Moritz plugin
« Reply #8 on: September 16, 2013, 03:53:48 pm »
Hello Everybody.

After 4 years of refactoring the first milestone having the next major release is nearly reached. The completely new developed Moritz2 presents with the demo-version 8 its first release-candidate (under https://www.moritz.sourceforge.net or https://www.sourceforge.net/projects/moritz/ use “Browse All Files”).

Most of the features already known from the older Moritz1 are still available:
1. Generation of Nassi-Shneiderman diagrams based on HTML.
2. Control of the diagrams by using special commands inside of comments.
Furthermore new features are available:
1.Generation of uml-like activity-diagrams based on dot( http://www.graphviz.org ).
2.Support of more programming-languages (C/Cpp, Python, Matlab, Pascal)

Another new feature is an own parser. Thus Moritz can be used independently from other tools to generate its output. Furthermore the xml-output created by the parser represents the parser-tree of the source in other words the algorithm and not the document-structure.
The new release contains one windows-distribution and one linux-distribution together with documentation-files (please use “Browse All Files” and ignore the download-proposal).
To use Moritz for different source projects an user-project is available, that contains only the needed output-folders and templates for the basic configurations. It should be copied near to the source-project and combined with the distribution (please refer the page „User-Project “ of the documentation)
If you want to build the binaries (abc2xml and xml2abc) by your self, you will find the sources of xml2abc in the current release of Moritz and the sources of abc2xml in the current release of its partner-project MuLanPa (under https://www.mulanpa.sourceforge.net or https://www.sourceforge.net/projects/mulanpa/ )

If you have questions or doubts you will find in both projects forum-places:
Source-Parser:
Discussion: https://sourceforge.net/p/mulanpa/discussion/
Bugs: https://sourceforge.net/p/mulanpa/tickets/
Diagram-Generator:
Discussion: https://sourceforge.net/p/moritz/discussion/
Bugs: https://sourceforge.net/p/moritz/bugs/
Even the development has reached a nearly stable point this means not that it is perfect. Thus please don't hesitate to use the forum.

One of the next steps for me will be to start the development of the Code::Blocks plug-in to support the use of the simple user-project like promised before. But since I’m new in writing plug-ins for C::B and in parallel I still have to do some work in finishing the release please be patient.

Best Regards,
                   Eckard Klotz.