[antlr-interest] Anyone built the example C grammar successfully?

Paul Johnson gt54-antlr at cyconix.com
Tue May 24 10:56:34 PDT 2005


John D. Mitchell wrote:
>>>>>>"Paul" == Paul Johnson <gt54-antlr at cyconix.com> writes:
>>
>>Has anyone managed to build John Mitchell's/Monty Zukowski's C grammar
>>(http://www.antlr.org/grammar/cgram)? I've tried this on gcj 3.3, gcj
>>3.4.3, and javac 1.5.0_03, and none of them can compile more than a few
>>files. I don't know any Java, which doesn't help, but it looks it may be
>>like an import or compilation order problem:
> 
> I've been working with it using Java v1.4.x recently without problem.
> But, I haven't tried it with either Java v1.5.x or GCJ.
> 
>>./TNode.java:9: '.' expected import CToken; ^
>  
> Hmm... Is that a clash with the new "static" imports in Java v1.5?

Don't think so - I found a backwards-compatibility flag for javac, and 
it's not making any difference:

 > javac -source 1.4 -classpath .:/eda/antlr/antlr-2.7.5/lib/antlr.jar 
StdCParser.java

   ./TNode.java:9: '.' expected
   import CToken;
                ^

The error message produced by gcj is different - it complains about an 
ambiguous class definition (see 
<http://www.antlr.org/pipermail/antlr-interest/2005-May/012212.html>, 
also related to CToken). The fact that both gcj and javac point to the 
same import does seem to imply a problem with the code, at least to 
someone who knows as little Java as I do.

Thanks -

Paul



More information about the antlr-interest mailing list