[antlr-interest] funny things with the generated C target

Davyd Madeley davyd at fugro-fsi.com.au
Thu Jul 17 01:33:36 PDT 2008


On Thu, 2008-07-17 at 01:24 -0700, Jim Idle wrote:
> On Thu, 2008-07-17 at 15:53 +0800, Davyd Madeley wrote:
> >         tokens = antlr3CommonTokenStreamSourceNew (ANTLR3_SIZE_HINT,
> >                         lexer);
> >         if (!tokens)
> >         {
> >                 fprintf (stderr, "ERROR: could not generate token
> > stream\n");
> >                 exit (1);
> >         }
> 
> Please consult the examples and API documentation and turn up the
> warning levels on your compiler. The input to the token stream is not
> the lexer, but the lexer token set.
> 
> tokens = antlr3CommonTokenStreamSourceNew (ANTLR3_SIZE_HINT,
> TOKENSOURCE(lexer));
> 
> (Note that TOKENSOURCE is for Antlr 3.1 and above, which you should
> probably use now.

Aah, I'm using version 3.0.1 of the C runtime, which explains why this
symbol wasn't present. I thought that was strange, but took it out and
then forgot to chase up what I should be using instead.

I can't locate the 3.1 runtime. Where should I be looking?

> I am really surprised that your C compiler didn't give you a warning
> about this - what compiler is it?

GCC. Actually now I look, I did get a warning for that. I'm clearly
still jetlagged.

Thanks for your help so far.

--d

-- 
Davyd Madeley        Software Engineer
Fugro Seismic Imaging, Perth Australia



More information about the antlr-interest mailing list