Richard Osborn wrote:
I'm trying to use ANTLR's C target to generate a parser, but I have having trouble setting up the token stream. I started with copying the code from http://www.antlr.org/api/C/buildrec.html, and attempting to get it to work, but I can't figure out line 36 (here). I get this error: 'struct ANTLR3_LEXER_struct' has no member named 'tokSource'.
I haven't found a way in the source code to generate a pANTLR3_TOKEN_SOURCE from a pExprLexer.
I am curious how to do this, as I've looked all over the source files for answers.
Download the examples tar/zip from the download page and follow the examples there in the C directory. You need the TOKENSOURCE macro:

tstream = antlr3CommonTokenStreamSourceNew(ANTLR3_SIZE_HINT, TOKENSOURCE(lxr));

I thought I had updated the docs, but obviously I missed a piece.

Jim


_______________________________________________
antlr-dev mailing list
[email protected]
http://www.antlr.org/mailman/listinfo/antlr-dev

Reply via email to