[antlr-interest] 3.1 TokenSource

Christian Schladetsch christian.schladetsch at gmail.com
Thu Apr 10 02:34:04 PDT 2008


Hello [Jim],

First off, huge kudos to Jim for the C codegen for ANTLR. I've read 80% of
it, and it is a thing of beauty. I've not seen better C code in my 15 years
as a professional C/C++ developer.

Secondly, now that I finally have a build of 3.1 ANTLR, i get the followng
error:

    error C2039: 'tokSource' : is not a member of 'ANTLR3_LEXER_struct'

from C++ source:

    pPiLexer lxr = PiLexerNew(input);
    pANTLR3_COMMON_TOKEN_STREAM tstream =
antlr3CommonTokenStreamSourceNew(ANTLR3_SIZE_HINT, *lxr->pLexer->tokSource*
);

PiLexer is generated from Pi.g using custom build rules in VS2008:

1>ANTLR Parser Generator  Version 3.1b1 (??)  1989-2007
1>Generating PiParser.c
1>Generating PiParser.h
1>Generating PiLexer.c
1>Generating PiLexer.h
1>Compiling...
1>Main.cpp
1>[obscured]\rhocompiler\main.cpp(11) : error C2039: 'tokSource' : is not a
member of 'ANTLR3_LEXER_struct'
1>
e:\dev\antlr\antlr-2008-04-09.10\runtime\c\include\antlr3lexer.h(48) : see
declaration of 'ANTLR3_LEXER_struct'
1>Build Time 0:02
1>Build log was saved at
"file://c:\Users\user\Desktop\MabPrefix\Projects\RhoCompiler\Debug\BuildLog.htm"
1>RhoCompiler - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I have spent some time investigating this. It is clear that that the lexer
should indeed supply a source of tokens. But I see no way for PiLexer (which
is auto-generated) to return a token source.

Regards,
Christian.

PS. What's with the Java thing. When will Terr move to C++ and make? ;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080410/4951f71d/attachment.html 


More information about the antlr-interest mailing list