Proof of concept: automatically import C header files

Walter Bright newshound2 at digitalmars.com
Wed Jul 17 18:00:11 PDT 2013


On 7/17/2013 5:31 PM, deadalnix wrote:
> On Wednesday, 17 July 2013 at 19:46:54 UTC, Walter Bright wrote:
>> On 7/17/2013 9:48 AM, deadalnix wrote:
>>> My understanding is that we only want to convert declaration to D. Can you give
>>> me an example of such corner case that would require the full frontend ?
>>
>> One example:
>>
>> --------------------------------
>> //**************************Header**********************\\
>>
>> int x;
>> --------------------------------
>>
>> Yes, this POS is real C code I got a bug report on. Note the trailing \\. Is
>> that one line splice or two? You have to get the hairy details right. I've
>> seen similar nonsense with trigraphs. I've seen metaprogramming tricks with
>> token pasting. You can't dismiss this stuff.
>
> This do not require semantic analysis.

Semantic analysis for C is trivial. The real problems are the phases of 
translation and the preprocessor.


More information about the Digitalmars-d mailing list