[antlr-interest] Offtopic - Re: Autiomatic header file generation for C/C++??

Ivan Brezina ibre5041 at ibrezina.net
Thu Mar 22 02:11:46 PDT 2012


Hi,
I have to warn you, that generally your request is nonsense and no tool
can fulfill it.
1. header file is something like an interface, you usually design is before
the .cpp file
2. the header file and .cpp file both include other headers and in most cases
the header's headers are only subset on the .cpp ones. This is  
fundamental problem.
You do not want mix "interface" dependencies with "implementation"  
dependencies.
3. You usually do not want all the implementation internals to be  
exported the header.
The tool would have to support some kind of blacklisting.
4. It is very hard to guarantee that the generated headers are  
"correct" and compileable.
For example imagine two classes cyclically dependent. Implementation  
of class A depends
on B.hpp and viceversa. The tool can simply generate headers with the  
infinite inclusion recursion.
5. It is also not easy to order the content of the header file.  
Imagine that you have
some types declared via preprocessor macros.

Ivan


Quoting "Voelkel, Andy" <andy.voelkel at plantronics.com>:

> Hi,
>
> I took a look a more detailed look at that and lzz. I prefer the   
> approach of makeheaders - unfortunately it is old enough that it   
> does not understand namespaces. Still, for a project that does not   
> need namespaces, it might just work.
>
> I find it AMAZING that C/C++ programmers put up with the hassle of   
> manual header file maintenance, and that no other tool seems to be   
> in widespread use.  Last time I checked it was 2012, not 1985.
>
>
> -          Andy
>
> From: Eric [mailto:researcher0x00 at gmail.com]
> Sent: Tuesday, March 20, 2012 5:00 PM
> To: Voelkel, Andy
> Cc: antlr-interest at antlr.org
> Subject: Re: [antlr-interest] Autiomatic header file generation for C/C++??
>
> Hi Andy,
>
> FWIW I did a quick search and found makeheaders.
>
> Eric
> On Tue, Mar 20, 2012 at 7:49 PM, Voelkel, Andy   
> <andy.voelkel at plantronics.com<mailto:andy.voelkel at plantronics.com>>   
> wrote:
> Hi,
>
> Does anyone know of any tools for generating C/C++ header files   
> automatically from an annotated version of the C/C++ source files? I  
>  really hate writing and maintaining header files in C/C++.
>
> This isn't strictly related to Antlr, other than the fact that Antlr  
>  would be a logical front end for such a tool. But I thought that  
> the  same types that hang out in Antlr-land might know about such  
> things.
>
>
> -          Andy
>
> ________________________________
>
> CONFIDENTIALITY NOTICE: This e-mail transmission, and any documents,  
>  files or previous e-mail messages attached to it, may contain   
> information that is confidential and/or legally privileged. If you   
> are not the intended recipient, or a person responsible for   
> delivering it to the intended recipient, please DO NOT disclose the   
> contents to another person, store or copy the information in any   
> medium, or use any of the information contained in or attached to   
> this transmission for any purpose. If you have received this   
> transmission in error, please immediately notify the sender by reply  
>  email or at  
> privacy at plantronics.com<mailto:privacy at plantronics.com>,  and  
> destroy the original transmission and its attachments without   
> reading or saving in any manner.
>
> For further information about Plantronics - the Company, its   
> products, brands, partners, please visit our website   
> www.plantronics.com<http://www.plantronics.com>.
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:   
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>
>
> ________________________________
>
> CONFIDENTIALITY NOTICE: This e-mail transmission, and any documents,  
>  files or previous e-mail messages attached to it, may contain   
> information that is confidential and/or legally privileged. If you   
> are not the intended recipient, or a person responsible for   
> delivering it to the intended recipient, please DO NOT disclose the   
> contents to another person, store or copy the information in any   
> medium, or use any of the information contained in or attached to   
> this transmission for any purpose. If you have received this   
> transmission in error, please immediately notify the sender by reply  
>  email or at privacy at plantronics.com, and destroy the original   
> transmission and its attachments without reading or saving in any   
> manner.
>
> For further information about Plantronics - the Company, its   
> products, brands, partners, please visit our website   
> www.plantronics.com.
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:   
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the antlr-interest mailing list