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

Jim Idle jimi at temporal-wave.com
Thu Jul 17 01:24:31 PDT 2008


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.

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

Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080717/3f9d5b89/attachment.html 


More information about the antlr-interest mailing list