Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-04

Generating code form xmi files

25 messages · 13 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jonas Maebe
to Unknown author
Do you know if some code allready exist to generate Pascal code form xmi files ?

What do you mean by generating Pascal code from xml files? Pascal code describes an algorithm, while xml files usually describe data.

Jonas

Reply by email

Tomas Hajny
to Jonas Maebe
Jonas Maebe wrote 8 lines
On 02 Apr 2009, at 15:56, wrote: > Do you know if some code allready exist to generate Pascal code form > xmi > files ? What do you mean by generating Pascal code from xml files? Pascal code describes an algorithm, while xml files usually describe data.

Well, XMI files, i.e. files used for exporting/storing various UML diagrams, are often supported by code generators. As an example, you could certainly generate Object Pascal classes from a UML class diagram. However, most generators only support Java and C++, that's probably the reason of this question. I cannot answer the question myself though.

Tomas

Reply by email

Philippe Martinole
to Jonas Maebe: What do you mean by generating Pascal code from xml files? Pascal code describes an…
Show quoted text 5 lines
> Do you know if some code allready exist to generate Pascal code form xmi > files ? What do you mean by generating Pascal code from xml files? Pascal code describes an algorithm, while xml files usually describe data.

xmi files (not xml) are used to save uml models :
http://en.wikipedia.org/wiki/XML_Metadata_Interchange and I want to gererate my data structures from my uml diagrams I would be suprised if nothing already exists

Philippe

Reply by email

Graeme Geldenhuys
to Philippe Martinole: xmi files (not xml) are used to save uml models :…
Philippe Martinole wrote 5 lines
xmi files (not xml) are used to save uml models : http://en.wikipedia.org/wiki/XML_Metadata_Interchange and I want to gererate my data structures from my uml diagrams I would be suprised if nothing already exists

I've been looking for something like this for a long time and haven't fond anything for Free Pascal / Lazarus. You can obviously use Model Maker and simply tweak the generated object pascal code to make sure they are compilable with FPC. But I believe Model Maker is quite pricey.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 13 lines
On Thu, Apr 2, 2009 at 10:05 PM, Philippe Martinole wrote: > > xmi files (not xml) are used to save uml models : > http://en.wikipedia.org/wiki/XML_Metadata_Interchange > and I want to gererate my data structures from my uml diagrams > I would be suprised if nothing already exists I've been looking for something like this for a long time and haven't fond anything for Free Pascal / Lazarus. You can obviously use Model Maker and simply tweak the generated object pascal code to make sure they are compilable with FPC. But I believe Model Maker is quite pricey.

Well, Umbrello (Open source, comes with KDE) can generate code from XMI for various languages (C,C++,PHP, Java) except pascal. All you need to do is write an output engine for pascal.

It is on my todo list, item no. 132.458 :-)

Michael.

Reply by email

Michael Van Canneyt
to Michael Van Canneyt
Michael Van Canneyt wrote 21 lines
On Fri, 3 Apr 2009, Graeme Geldenhuys wrote: > On Thu, Apr 2, 2009 at 10:05 PM, Philippe Martinole > wrote: > > > > xmi files (not xml) are used to save uml models : > > http://en.wikipedia.org/wiki/XML_Metadata_Interchange > > and I want to gererate my data structures from my uml diagrams > > I would be suprised if nothing already exists > > I've been looking for something like this for a long time and haven't > fond anything for Free Pascal / Lazarus. You can obviously use Model > Maker and simply tweak the generated object pascal code to make sure > they are compilable with FPC. But I believe Model Maker is quite > pricey. Well, Umbrello (Open source, comes with KDE) can generate code from XMI for various languages (C,C++,PHP, Java) except pascal. All you need to do is write an output engine for pascal.

Correction. It seems to have been implemented...
I must urgently upgrade my KDE :-)

Michael.

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt: Well, Umbrello (Open source, comes with KDE) can generate code from XMI for various…
Michael Van Canneyt wrote 6 lines
Well, Umbrello (Open source, comes with KDE) can generate code from XMI for various languages (C,C++,PHP, Java) except pascal. All you need to do is write an output engine for pascal. It is on my todo list, item no. 132.458 :-)

I currently use "Dia Diagram editor" to design UML diagrams, but as far as I know it does generate any code. :-( I haven't tried Umbrello in years. I'll give that another try and see how things have improved over the last few years.

Do you *only* have 132 todo items - lucky you ! :-)

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Michael Van Canneyt
to Michael Van Canneyt: Correction. It seems to have been implemented... I must urgently upgrade my KDE :-)…
Michael Van Canneyt wrote 28 lines
On Fri, 3 Apr 2009, Michael Van Canneyt wrote: > > > On Fri, 3 Apr 2009, Graeme Geldenhuys wrote: > > > On Thu, Apr 2, 2009 at 10:05 PM, Philippe Martinole > > wrote: > > > > > > xmi files (not xml) are used to save uml models : > > > http://en.wikipedia.org/wiki/XML_Metadata_Interchange > > > and I want to gererate my data structures from my uml diagrams > > > I would be suprised if nothing already exists > > > > I've been looking for something like this for a long time and haven't > > fond anything for Free Pascal / Lazarus. You can obviously use Model > > Maker and simply tweak the generated object pascal code to make sure > > they are compilable with FPC. But I believe Model Maker is quite > > pricey. > > Well, Umbrello (Open source, comes with KDE) can generate code from XMI > for various languages (C,C++,PHP, Java) except pascal. All you need to > do is write an output engine for pascal. Correction. It seems to have been implemented... I must urgently upgrade my KDE :-)

Bummer. It writes old TP-Style object class definitions.

Michael.

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt: Correction. It seems to have been implemented... I must urgently upgrade my KDE :-)…
Michael Van Canneyt wrote
Correction. It seems to have been implemented... I must urgently upgrade my KDE :-)

Wow, the new KDE 4.x looks pretty cool, especially with the new Oxygen theme. Really wow!! I'm using Ubuntu 9.04 beta with Qt+KDE libs installed.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Frank Peelo
Frank Peelo wrote 7 lines
>> It is on my todo list, item no. 132.458 :-) > Do you *only* have 132 todo items - lucky you !  :-) In /his/ locale, he writes '.'

I know - my smiley face has a double meaning.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Mattias Gärtner
to Michael Van Canneyt: Well, Umbrello (Open source, comes with KDE) can generate code from XMI for various…

Zitat von Michael Van Canneyt :

Show quoted text 23 lines
On Fri, 3 Apr 2009, Graeme Geldenhuys wrote: > On Thu, Apr 2, 2009 at 10:05 PM, Philippe Martinole > wrote: > > > > xmi files (not xml) are used to save uml models : > > http://en.wikipedia.org/wiki/XML_Metadata_Interchange > > and I want to gererate my data structures from my uml diagrams > > I would be suprised if nothing already exists > > I've been looking for something like this for a long time and haven't > fond anything for Free Pascal / Lazarus. You can obviously use Model > Maker and simply tweak the generated object pascal code to make sure > they are compilable with FPC. But I believe Model Maker is quite > pricey. Well, Umbrello (Open source, comes with KDE) can generate code from XMI for various languages (C,C++,PHP, Java) except pascal. All you need to do is write an output engine for pascal. It is on my todo list, item no. 132.458 :-)

I just tested Umbrello and I got the impression it is very C++-centric - the dialogs, the options, the code. For example I don't see how to setup free pascal properties - it seems to have only basic variables as attributes. Is this a shortcoming of UML in general?

Mattias

Reply by email

Michael Van Canneyt
to Mattias Gärtner
Mattias Gärtner wrote 30 lines
Zitat von Michael Van Canneyt : > > > On Fri, 3 Apr 2009, Graeme Geldenhuys wrote: > > > On Thu, Apr 2, 2009 at 10:05 PM, Philippe Martinole > > wrote: > > > > > > xmi files (not xml) are used to save uml models : > > > http://en.wikipedia.org/wiki/XML_Metadata_Interchange > > > and I want to gererate my data structures from my uml diagrams > > > I would be suprised if nothing already exists > > > > I've been looking for something like this for a long time and haven't > > fond anything for Free Pascal / Lazarus. You can obviously use Model > > Maker and simply tweak the generated object pascal code to make sure > > they are compilable with FPC. But I believe Model Maker is quite > > pricey. > > Well, Umbrello (Open source, comes with KDE) can generate code from XMI > for various languages (C,C++,PHP, Java) except pascal. All you need to > do is write an output engine for pascal. > > It is on my todo list, item no. 132.458 :-) I just tested Umbrello and I got the impression it is very C++-centric - the dialogs, the options, the code. For example I don't see how to setup free pascal properties - it seems to have only basic variables as attributes. Is this a shortcoming of UML in general?

No, I don't think so; But the 'pascal' implementation is very rudimentary, for instance there is no 'published' visibility. if you look at the language specific options, you'll see that the pascal language has no options yet. I would expect that one could put some pascal-specific things there.

I expect it'll be up to us to provide this :(

I use umbrello extensively for the diagrams till now, it would of course be nice to have it import/export pascal code as well.

So, it remains on my todo list. But maybe if interest is raised enough, someone with more time/pressing needs will do it before me :-)

Michael.

Reply by email

Osvaldo Filho
to Michael Van Canneyt

We could work on it.

Perhaps any one cold start a project for that. And others help.

My English and my knowledge in C++ is very pour. But i help any one do it.

2009/4/3 Michael Van Canneyt

Show quoted text 55 lines
On Fri, 3 Apr 2009, Mattias Gärtner wrote: > Zitat von Michael Van Canneyt : > > > > > > > On Fri, 3 Apr 2009, Graeme Geldenhuys wrote: > > > > > On Thu, Apr 2, 2009 at 10:05 PM, Philippe Martinole > > > wrote: > > > > > > > > xmi files (not xml) are used to save uml models : > > > > http://en.wikipedia.org/wiki/XML_Metadata_Interchange > > > > and I want to gererate my data structures from my uml diagrams > > > > I would be suprised if nothing already exists > > > > > > I've been looking for something like this for a long time and haven't > > > fond anything for Free Pascal / Lazarus. You can obviously use Model > > > Maker and simply tweak the generated object pascal code to make sure > > > they are compilable with FPC. But I believe Model Maker is quite > > > pricey. > > > > Well, Umbrello (Open source, comes with KDE) can generate code from XMI > > for various languages (C,C++,PHP, Java) except pascal. All you need to > > do is write an output engine for pascal. > > > > It is on my todo list, item no. 132.458 :-) > > I just tested Umbrello and I got the impression it is very C++-centric - the > dialogs, the options, the code. For example I don't see how to setup free > pascal properties - it seems to have only basic variables as attributes. > Is this a shortcoming of UML in general? No, I don't think so; But the 'pascal' implementation is very rudimentary, for instance there is no 'published' visibility. if you look at the language specific options, you'll see that the pascal language has no options yet. I would expect that one could put some pascal-specific things there. I expect it'll be up to us to provide this :( I use umbrello extensively for the diagrams till now, it would of course be nice to have it import/export pascal code as well. So, it remains on my todo list. But maybe if interest is raised enough, someone with more time/pressing needs will do it before me :-) Michael. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

leledumbo
to Johann Glaser

Err... how to use this codegen thing? Do I need to run it over Dia generated diagrams or what? Sorry, I don't understand Python.

Johann Glaser wrote 18 lines
Hi! Am Sonntag, den 05.04.2009, 11:24 -0300 schrieb Osvaldo Filho: > The current version is available at http://k7103.svn.sourceforge.net/viewvc/k7103/branch/ng/dia-codegen/ Bye Hansi _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
View this message in context: http://www.nabble.com/Generating-code-form-xmi-files-tp22848439p22902133.html Sent from the Free Pascal - General mailing list .

Reply by email

Johann Glaser
to leledumbo

Hi!

leledumbo wrote
Err... how to use this codegen thing? Do I need to run it over Dia generated diagrams or what? Sorry, I don't understand Python.

Replace the installed codegen.py file by the one at the mentioned URL below. Then delete codegen.pyc (its "compiled"). You can run "py_compilefiles codegen.py" to create a new compiled version.

If you restart Dia with the new file, in the File->Export menu you get an additional export type "Pascal".

Bye
Hansi

Reply by email