Book a Demo

Author Topic: Code generation of doxygen comments  (Read 5231 times)

Adria

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Code generation of doxygen comments
« on: December 15, 2008, 05:22:37 pm »
When adding a description of a code element after the item such as
Code: [Select]
#define SOME_DEFINE 42  /**< This is a great define */
When importing the code, the comments are associated with the member, however when generating the code the standard C-template always wants to re-arrange the comment as follows:
Code: [Select]
/**
  * < This is a great define
 */
#define SOME_DEFINE 42

This may seem ok (apart from the "<" that's left over from the conversion) in this example, but imagine a 200 element enumeration definition.

Is there some smart cookie out there who could add a tagged value to indicate the required documentation for each element, then adjust the c_template to use this info to decide where to put the notes in the code?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8089
  • Karma: +118/-20
    • View Profile
Re: Code generation of doxygen comments
« Reply #1 on: December 16, 2008, 09:03:56 am »
EA doesn't support doxygen comments (although you get most of the functionality by telling EA they are javadoc.)  There are multiple issues that need be resolved before it can.  These are also the same issues you may face if you try to use EA with doxygen comments.

Firstly, that the '<' character is doxygen telling the parser that this comment applies to the previous code element.  EA is obviously able to guess which element it was documenting in this case, but in general EA will not observe that mark or the other markings used by doxygen to specify what the comment is documenting.

Fairly trivially once support for the above is done, would be trimming out the necessary information.

Finally, EA needs to know where the comments should actually be generated to.  I don't have a good way of doing this yet.

If you want to submit a feature request using the link at the bottom of this page, then you can add your voice to the people wanting doxygen support and encourage us to tackle these issues.

Adria

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Code generation of doxygen comments
« Reply #2 on: December 16, 2008, 11:58:58 am »
Thanks Simon

I've just tried out the java doc using the magic function:
Code: [Select]
%JAVADOC_COMMENT(genOptWrapComment)%Instead of:
Code: [Select]
$wrapLen = %genOptWrapComment%
%CSTYLE_COMMENT($wrapLen)%

This generates code perfectly.

However when this code is then syncronised back to the model, the javadocs end up in the notes.
Then if I do another code generation I end up with two lots of javadocs??

Any clues?