Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-lcc!ames!ll-xn!mit-eddie!uw-beaver!tektronix!sequent!mntgfx!rreed From: rreed@mntgfx.mentor.com (Robert Reed) Newsgroups: comp.lang.c++ Subject: Re: .h-file extractor from c++ source file available? Message-ID: <1988Aug8.180524.3167@mntgfx.mentor.com> Date: 9 Aug 88 01:05:18 GMT References: <2192@hplabsz.HPL.HP.COM> <1988Aug7.005251.7548@utzoo.uucp> Reply-To: rreed@mntgfx.UUCP (Robert Reed) Organization: Mentor Graphics Corp., Beaverton OR Lines: 26 In article <1988Aug7.005251.7548@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes: In article <2192@hplabsz.HPL.HP.COM> collins@hplabsz.HPL.HP.COM (Patricia Collins) writes: >Do you know of a utility for extracting include files from c++ source >files? It's probably doable with a straightforward awk script... Some of this may be sensitive to the details of my own programming style, but I'd be skeptical of claims that automatic extraction without marking worked well. But that is NOT to say that automatic extraction does not work well. In the last project upon which I worked, we had a tool called autohdr which relied on a marking scheme we deeveloped for C. This method used special declarations to mark exported structures, including defines, typedefs and structs, and generated a temporary header file which was then compared against the current header file. If the files were different, the old file was replaced, and make would automatically recompile those targets depending on the header. The scheme still required the same amount of work for editing, and required more overhead for the generation and checking process. However, the editing process was simplified by having a single "module" which contained both internal and external declarations. Revision control is simplified by the commonality of unified header/code files. The syntax of C++ complicates the process, but it should be possible to accommodate the extensions. Special care and more detailed analysis will be required to support things like inline declarations, which need to be completely copied to the header file. It would be a useful tool, though.