[cfe-dev] Translate C includes to Java-like imports
Frits van Bommel
fvbommel at gmail.com
Sat Oct 9 04:53:28 PDT 2010
Forgot to send to the list...
On Sat, Oct 9, 2010 at 1:51 PM, Frits van Bommel <fvbommel at gmail.com> wrote:
> On Sat, Oct 9, 2010 at 11:26 AM, Jacob Carlborg <doob at me.com> wrote:
>
>> I'm working on source to source translator which translates
>> Objective-C/C header files to D files. I've encountered a problem and
>> that is how the include system works in the two languages. The import
>> system in D works more like it does in Java than in C. For example:
>>
>> If I have three files:
>>
>> * A.h, includes B.h
>> * B.h, includes C.h
>> * C.h
>>
>> In C (the language) A.h would have access to everything in B.h and C.h
>> as well. In D this is not the case, I would have to explicitly import
>> both B.h and C.h to access it from A.h. So I guess the question is: for
>> a given type, typedef or similar how can I determine where it's declared
>> and if the file that it's declared in are already included or not?
>>
>
> Couldn't you just translate it to D's "public import" instead of regular
> (implicitly private) import?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20101009/cc7af1c7/attachment.html>
More information about the cfe-dev
mailing list