Proof of concept: automatically import C header files

Timothee Cour thelastmammoth at gmail.com
Wed Jul 17 00:16:57 PDT 2013


On Tue, Jul 16, 2013 at 11:01 PM, deadalnix <deadalnix at gmail.com> wrote:

> On Wednesday, 17 July 2013 at 05:12:00 UTC, Timothee Cour wrote:
>
>> what's a non-full C front end? If it's not a real C front end it's gonna
>> break with certain macros etc. Not good.
>>
>>
> Macro are processed before parsing? No need for a full C frontend to
> handle macros.
>
>
>  I see no point in re-implementing a C front end when we can simply use an
>> existing one to do the job (eg clang). This would also allow to parse C++
>> just as well.
>>
>
> When you only need a very limited part of the fronted, it make sense. Here
> we don't need to parse function body for instance, and we can skip most of
> semantic analysis (if not all ?).
>

you'd still need to parse C files recursively (textual inclusion...),
handle different C function calling conventions, different C standards,
you'd need a way to forward to dmd different C compiler options (include
paths to standard / custom libraries), and eventually people will want to
parse C++ as well anyways. That can be a lot of work. Whereas using
existing tools takes much less effort and is less error prone.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130717/21c83e85/attachment-0001.html>


More information about the Digitalmars-d mailing list