Book a Demo

Author Topic: Code gen. - all referenced types to same file  (Read 2614 times)

cem

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Code gen. - all referenced types to same file
« on: January 30, 2009, 07:45:31 am »
Hi,

I have a language (actually not a programming language, a type definition language) that has no keyword or macro like #include in C/C++ or import in Java. That is, I have to give all related type definitions in the same file.

Let's say I have a enumeration E having value ev1, ev2, ev3. I have a type T which includes an integer field and a field of type E. The type definition file for T looks like:

//beginning of the type T definition file
Enum E
{
      e1,
      e2,
      e3
}

Type T
{
   E e,
   integer i
}
//end of the type T definition file

I wish to generate this type definition file from EA diagrams.
Enumeration E and Class T can be defined in class diagram but when it comes to code generation... These two definitions go to different files (which is so normal in other languages). However, I need to generate code for these to types into the same file. To generalize, I need to generate the codes for the classes into the same file in the correct order of type referencing, i.e. If A uses B which uses C, then the file contains first C, then B and last A.

Any clue that you may give me?

Thank you...