MennoP / freedfd

Automatically exported from code.google.com/p/freedfd
0 stars 0 forks source link

.dfd format documentation? #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I am trying to do a .dfd file interpreter in PHP-GTK2 but I couldn't
understand how you store the information in the file. Could you please help
me? Is there any documentation available?

I was also looking on SVN but I couldn't find the file where you parse
.dfd's contents or save them

Yours Sincerely,

Original issue reported on code.google.com by buhitoes...@gmail.com on 2 Apr 2008 at 10:15

GoogleCodeExporter commented 8 years ago
Hi.

This is the relevant file:

http://freedfd.googlecode.com/svn/trunk/deprecated-owl/src/Editor.cpp

And this is the relevant function:

void ListaHojas::Guardar( char *A ){
        ofstream ArchivoG( A );
        if( !ArchivoG ){
               VentanaPrincipal->MessageBox("No fue posible guardar el
archivo.",NOMBREPROGRAMA ,
                                         MB_OK | MB_ICONEXCLAMATION);
               return;
        }
   ArchivoG << CLAVE_ARCHIVO_DFD << endl;
        ArchivoG << 1 << endl; //Versión
        ArchivoG << Estado.AngulosEnGrados <<endl;
        ArchivoG << NHojas << endl;
        for( NodoHoja *Hoja= Inicio; Hoja; Hoja= Hoja->Sig )
               GuardarObjeto( ArchivoG, Hoja->Inicio  );
        Estado.EsNuevo= Estado.SeModifico= false;
 }

Regards.

Original comment by nelson...@gmail.com on 2 Apr 2008 at 10:47

GoogleCodeExporter commented 8 years ago
Hi. Did you manage to read the file? This file format is braindead, and I'd 
like to
change it for a plain text format easier to read.

Original comment by nelson...@gmail.com on 22 Apr 2008 at 6:15

GoogleCodeExporter commented 8 years ago
No, I currently couldn't read it. It would be great if it was changed to 
something
based on XML, what do you think?

Original comment by buhitoes...@gmail.com on 22 Apr 2008 at 10:34

GoogleCodeExporter commented 8 years ago
Well, XML is easier to parse. That would be good. I was planning to write a
"pseudocode" export option. That would generate algorithms like this:

BEGIN
READ A, B
C = sqrt(A^2 + B^2)
WRITE C
END

This is easier to parse than the current format, but it is hard to
retrieve algorithms that are not correct, so I guess we should default
to XML.

To do it in the old version we would need to embed some code for
XML parsing, since the compiler is quite old.

Original comment by nelson...@gmail.com on 22 Apr 2008 at 10:42

GoogleCodeExporter commented 8 years ago
Does it have a compiler? :O

XML would be the best option as a bad DFD would result in invalid XML. Or you 
could
also do pseudocode, but that would be harder to implement, as While and For 
loops
would need special treatment, for example.

Also XML is easily parseable in most languajes, with already-built 
methods/functions
or classes.

Original comment by buhitoes...@gmail.com on 22 Apr 2008 at 10:48

GoogleCodeExporter commented 8 years ago
> Does it have a compiler? :O

No, I meant that the current Windows version is built with an old
compiler (Borland C++). It's a real pain having to develop in Linux
and having to switch to a virtual machine to compile. That's why I
am (slowly) porting the code to GCC (now the evaluator compiles with GCC).

Until the code is in shape, compiling with a recent non-windows-only compiler,
things are rather slow to implement.

Original comment by nelson...@gmail.com on 22 Apr 2008 at 10:52

GoogleCodeExporter commented 8 years ago
Great! A linux version is coming :D Although current version runs in Wine 
without
hassle it'd be great if there was a native version.

I don't know any C/C++ so I can't currently help you, but if you need something 
in
PHP for the app (eg: an old-to-new-xml-based format converter online) do not 
hesiate
to ask me. I'll be glad to help you.

Original comment by buhitoes...@gmail.com on 22 Apr 2008 at 10:59

GoogleCodeExporter commented 8 years ago
I'm sorry about this bug. I did not have Internet access when we wrote this. I 
know the format is horrible. There is no reason for using a binary format.

I'll tag this as wontfix.

Original comment by nelson...@gmail.com on 13 Mar 2014 at 6:46