[Kde-bindings] Re: Smokegen problem parsing stdio.h

Arno Rehn arno at arnorehn.de
Mon Nov 15 15:45:50 UTC 2010


(sorry for replying that late... didn't have that much time in the last weeks)

On Sunday 07 November 2010 04:59:23 Ryan Melton wrote:
> The following code from /usr/include/stdio.h on Mac OSX does not appear to
> be being parsed up correctly:
[snip]
> In the generated files, FILE* is being replaced with __sFILEX*.  I'm
> guessing that the declaration of struct __sFILEX; without a { } block is
> confusing the parser.  Placing the following code immediately after the
> struct __sFILEX line, causes the files to be generated correctly, (but
> obviously I don't want to be hacking stdio.h).
> 
> ...
> 
> struct __sFILEX;
> 
> typedef struct ryan {
>   int value;
> } ryan;
> 
> ...
> 
> I tried looking through your parser files, but there is a lot going on
> there and it will take me a long time to decipher where this kind of bug
> would live... Thanks in advance for the help.
Admittedly, the parser files are rather ugly. I really wanted to create 
something that's more easily maintainable than kalyptus, but it seems that I 
failed at that (at least with regard to the parser thing). Ideally it should 
be rewritten and use a proper visitor pattern.
Anyway, can you come up with a test case which doesn't include the whole 
stdio.h? Otherwise this could be quite hard to fix without having an OS X 
machine at hand.

-- 
Arno Rehn
arno at arnorehn.de



More information about the Kde-bindings mailing list