[Uml-devel] mmgen import
Andrew Sutton
ansutton at kent.edu
Mon Feb 17 10:59:54 UTC 2003
quick update...
well, in the last 12 hours, i've managed to write a very, very superficial
implementation of some of the MOF and tied it into an XMI parser. it's been a
quick, dirty, ugly and inefficient hack, but its working so far. my basic
premise was that i would reduce the MOF implementation to its most basic
concepts and implement a parser for it. here's what i've done:
- parsing of package constructs and containment of classes, primitive types,
enumeration types, and structure types
- parsing of classes and contained attributes and references (operations are
partially done).
- parsing of multiplicity for atts and references
- type resolution for atts and references
- labels for enumerations
- fields and field types for structures
basically, if you configure, build and run mmgen, you have to open an XMI file
(in the xmi directory). it works for both mof-1.4.xmi and primitive-1.4.xmi.
i tried it on uml-1.4.xmi, but there's some differences in the way that that
particular file is constructed. i'll pick it apart and harmonize the
differences after i build a little bit more of my MOF-lite.
after opening the XMI file, watch stdout. it basically constructs a little
object tree and dumps it to stdout. nifty.
its definitely a good start though. with this i hope to autogenerate both the
MOF and UML metamodel implementations. my hope is that by having the UML
metamodel implemented (before, say, anything else), other people will be able
to pick up and start working with the GUI and other modeling capabilities.
oh. there's probably an ass-load of bugs in this. i'm not being to picky with
it. for one, i don't ever free any memory - it leaks like a sieve. for
another, i may have to rewrite my collection methods for XML elements. i'm
using elementsByTagName(), but i can't remember if that applies to direct
descendants or all descendants. hopefully just immediate descendants.
back to the hack. contributions welcome - especially if somebody wants to
start writing a code generator :)
andy
More information about the umbrello-devel
mailing list