views:

182

answers:

1

Has anyone tried embedding Doxygen comments within Lazy C++ source files? Any problems? Where do the Doxygen comments go after generating the header/source files?

+1  A: 

I went ahead and downloaded Lazy C++ to try it out, and it seems that it does not play nice with Doxygen. My Doxygen comments did not appear at all in the generated header/source files.

I then tried making Doxygen parse my lzz file, which had a special #hdr preprocessor command. Doxygen simply ignored that special preprocessor command and the generated documentation seems fine.

So the moral of the story is to simply make Doxygen parse the *.lzz files and not the generated *.h / *.cpp files. :-)

Emile Cormier
Another question remains: Will I remember to make changes to the *.lzz files (and not the generated files) when fixing errors/bugs? :-P
Emile Cormier
"Will I remember to make changes to the *.lzz files" - this is the general problem with generated code. If you are going to edit the generated files, put the comments in there and just stop using the preprocessor. Otherwise, only edit the .lzz files and have your own non-generated .cpp and .h files for the things you do not want to autogenerate.
Justin Smith
What I generally do is make deleting the generated files, and then re-generating them, part of the build process - this renders editing the generated file futile.
Justin Smith
@Emile: 'lzz' reduces your overall coding effort by automatically splitting declarations into header/sources. Furthermore, between optimisation (ie. lzz adding the macro LZZ_INLINE) and debugging (lzz adding lots of #line directives) you really don't want to be editing the generated header/source. In my emacs environment, I have some lisp that marks generated header and source file buffers as read-only. In case you're interested here's how to do that: http://stackoverflow.com/questions/943760/how-can-i-check-if-a-file-exists-using-emacs-lisp
Richard Corden
@Justin: If you delete the generated files like that, wouldn't it defeat incremental compilation and result in "recompiling the world"?
Emile Cormier
@Richard: The read-only thing seems like a great idea. I don't use emacs, but I'm sure I could hack something together in a makefile or shell script.
Emile Cormier
@Emile yes, that would cause a full recompile, I forgot we were talking specifically about c++ when making that suggestion.
Justin Smith
@Richard: lzz now supports the # symbol for special commands. See the documentation. I rolled back your edit.
Emile Cormier
@Emile: Ha - that's a change! I've been using 'lzz' from its very first version (I worked with the author), and originally he used '$' as the special directive character.
Richard Corden