Book a Demo

Author Topic: Synchronizing Comments from Code  (Read 2759 times)

StefanR

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Synchronizing Comments from Code
« on: July 19, 2004, 06:32:30 am »
Hi,

I've problems while reverse engineering a Delphi-class from a source-code file. It seems, as if recognition of the class-descriptions doesn't work properly as always the complete header instead of the pure text is added to the notes-field of my class if I start reverse engineering.

This is how my template (class notes) looks like:
Code: [Select]
{ ============================================================================
 Classname:      %className%
 Author:         %classAuthor%
 Date:           %eaDateTime%
 Description:    
%WRAP_COMMENT(classNotes, "60", "", "                  ")%
}


This even happens, if a generate code for a class and use the same class for reverse-enginieering. The notes-field then contains the following:
Code: [Select]
============================================================================ Classname:      ClassWithProps Author:         Stefan Röck Date:           19-Jul-2004 15:18:12 Description:   This is a comment.


Any suggestion?
Regards,
Stefan Röck.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8098
  • Karma: +118/-20
    • View Profile
Re: Synchronizing Comments from Code
« Reply #1 on: July 19, 2004, 08:34:29 pm »
Hi Stefan,

The parser doesn't have any way of knowing that you don't want all of that to go in the note field.  What I suggest is that you modify your template to look something like this.

Code: [Select]
{ ============================================================================
 Classname: %className%
 Author:    %classAuthor%
 Date:      %eaDateTime%
 Description: }
{    
%WRAP_COMMENT(classNotes, "60", "", "   ")%
}


That will import the way you want it.  Even if it isn't quite as nice to look at what it produces.

Simon

StefanR

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Synchronizing Comments from Code
« Reply #2 on: July 19, 2004, 11:42:08 pm »
Hi Simon,
thanks for your response. I'm afraid, your solution does not satisfy our needs, because we have plenty of documented source code and want to generate diagrams from that (and generate a RTF-documentation in a 2nd step).

Can you imagine of another template which parses the comments correctly (generating code isn't that important for the moment)? How does the parser work - does it only accept '{' or '}' as delimiters between "fields" or can one define other symbols?

A perfect solution would be if one defined the keyword "Description:" as a beginning tag so that the parser know where to start copying text for the class notes. Is that possible?

Thanks again,
Regards,
Stefan Röck.