[antlr-interest] GNU-C grammar problem/needed enhancement (anyone got a fix?)

Bryan Ewbank ewbank at gmail.com
Fri May 27 02:35:39 PDT 2005


To determine if it's __attribute__, can you add the following to simple.c:
   #define __attribute__(x) /* i.e., make it go away */
and get a clean parse?

On 5/27/05, Lloyd Dupont <lloyd at nova-mind.com> wrote:
> that would be nice if it could parse a precompiled <stdlib.h> (on windows
> with GCC).
> 
> I have a very simple program like
> --- simple.c --
> #include <stdlib.h>
> 
> main() { printf("done\n"); }
> --------------
> I precompile it with
> gcc -E simple.c > simple.p.c
> 
> Then I try to run the cgram's test demo on it:
> java -classpath  $(CLASSPATH)  Test simple.p.c
> 
> I get a huge number of error.
> fortunately I have the feeling it's all due only to incorrect __attribute__
> parsing (not so easy as they could sprout almost everywhere).
> 
> Does anyone have a version parsing a preprocessed stdlib? (or if not tested,
> seemingly supporting __attribute__)
> 
>


More information about the antlr-interest mailing list