[cfe-dev] Translate C includes to Java-like imports

Jacob Carlborg doob at me.com
Sat Oct 9 05:07:38 PDT 2010


On 2010-10-09 13:53, Frits van Bommel wrote:
> Forgot to send to the list...
>
> On Sat, Oct 9, 2010 at 1:51 PM, Frits van Bommel
> <fvbommel at gmail.com
> <mailto:fvbommel at gmail.com>> wrote:
>
>     On Sat, Oct 9, 2010 at 11:26 AM, Jacob Carlborg
>     <doob at me.com
>     <mailto: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?
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

I guess I could but I would rather not.

-- 
/Jacob Carlborg




More information about the cfe-dev mailing list