Mike Benzinger saw Don Retzlaff's C/C++-to-HTML converter in CUJ ("C/C++ Source to HTML Converter," October 1996) and decided to improve on the idea. The result is cpptohtm.cpp and, lo and behold, we got color. Mike writes:
Don and CUJ,
I read with interest your article on converting C/C++ to HMTL. Since I have just started a rather large C++ project at my office and we are using a local web site to distribute information to our entire project team, this article was rather timely. Now instead of printing copies of code for distribution to the entire team, I can post the code for code walk-throughs and reference consultation. In this way, anyone who wants a hard copy can print it. While I liked your initial idea, I took it and ran a little farther.
You will find an attachment that has some enhancements to your initial idea. I have added a touch of color. C/C++ keywords are bolded and blue; comments are italic and green. The code also lets you add hypertext links for include files.
The only caveat is that I used Rogue Wave classes in developing the code, since the C++ Standard has not been finalized and all compilers do not provide STL. Please give me any comments you have and feel free to distribute and modify the code as you see fit. Note also that the code was written with a tilt towards Microsoft Visual C++ 4.2.
Mike Benzinger <mbenz19@idt.net>.
Figure 2 is a browser shot of cpptohtm.cpp after processing by cpptocpm.exe. Figure 1, for comparison, is the same source code run through the Retzlaff filter. The source and executable are available in this month's source archives (see p. 3 for details). Thanks to Mike for sharing the code with us and, of course, thanks to Don Retzlaff for the original idea. mb