[antlr-interest] ANTLR3 C Target Runtime Error

H S haiscai2003 at yahoo.com
Fri May 28 00:50:03 PDT 2010



The code I am using is the one in the documentation found here:
http://www.antlr.org/api/C/index.html

I have just changed these two lines, just to make it compile:

tstream = antlr3CommonTokenStreamSourceNew(ANTLR3_SIZE_HINT, lxr->pLexer->tokSource);

if (psr->pParser->rec->errorCount > 0)

For the first one, I had added the TOKENSOURCE macro and for the second one I changed errorCount to getNumberOfSyntaxErrors.

That's really it.

Thanks,
Hai

________________________________
From: Jim Idle <jimi at temporal-wave.com>
To: "antlr-interest at antlr.org" <antlr-interest at antlr.org>
Sent: Thu, May 27, 2010 2:52:53 PM
Subject: Re: [antlr-interest] ANTLR3 C Target Runtime Error

Correct function, but obviously you are doing something wrong because the hundreds of parsers out there already would not be there if there was a bug as fundamental as this one. Follow the C examples or post your driver code so we can see what you are doing wrong.

Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of H S
> Sent: Thursday, May 27, 2010 2:43 AM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] ANTLR3 C Target Runtime Error
> 
> Hi,
> 
> There seems to be a bug in the generated C sources (antlr3lexer.c): the
> state variable is NULL and dues to that it crashes later.
> It is NULL because LangParserNew passes NULL to LangParserNew SSD, etc.
> I have tried a few versions (3.1.3, 3.2,etc ) and all seem to have this
> problem.
> Am I calling the wrong function (LangParserNew)?
> 
> Thanks.
> Hai
> 
> 
> 
> 
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address




List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address


      


More information about the antlr-interest mailing list