[antlr-interest] C target: problems with setCharStream

Marc klists at saphor.de
Fri Jun 8 11:34:07 PDT 2007


Jim Idle wrote:
> I'll take a look at it, but perhaps that example is wrong? 
that is perfectly possible...
> Please try
> with the official examples for the C target if you would - I suspect
> that the use of the C objects is not correct in that example..
>
> I am aware of those warnings but have not had time to deal with them
> this week. A bug fixing session will happen this weekend.
>   
Many thanks!

I've now finally spotted the examples under
http://www.antlr.org/download/examples-v3.tar.gz --- the unfortunate
link name "ANTLR v3 sample grammars using Java target" on
http://www.antlr.org/download.html unfortunately kept me from even
looking at that file. I'll see how I get along with those examples.

Best regards,

Marc

>   
>> -----Original Message-----
>> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
>> bounces at antlr.org] On Behalf Of Marc
>> Sent: Friday, June 08, 2007 11:01 AM
>> To: antlr-interest at antlr.org
>> Subject: [antlr-interest] C target: problems with setCharStream
>>
>> Hello!
>>
>> Using the C target (libantlr3c-3.0.0-rc8), antlr 3.0 and the
>>     
> SimpleCalc
>   
>> grammar from
>>
>>     
> http://www.antlr.org/wiki/display/ANTLR3/Five+minute+introduction+to+AN
>   
>> TLR+3
>> I keep getting a core dump both under Mac OS X (PPC) and Debian Linux
>> (Intel):
>>
>> This is the dump on gdb under Mac OS X, the one under Linux is
>> according:
>>
>> -------
>> Starting program: calc 1+1
>>
>> Program received signal EXC_BAD_ACCESS, Could not access memory.
>> Reason: KERN_PROTECTION_FAILURE at address: 0x0000000e
>> 0x0001cf04 in setCharStream ()
>> --------
>>
>> On both systems I have compiled the program with:
>>
>> gcc -I IncludePath -I. simplecalcLexer.c simplecalcParser.c -LLibPath
>> -lantlr3c -o calc
>>
>> (having renamed the grammar from SimpleCalc to simplecalc)
>>
>> Compiling the program with gcc 4.0 (Mac) and 4.1.2 (Linux) gives me
>>     
> the
>   
>> following warnings:
>>
>> simplecalcLexer.c:190: warning: 'mPLUS' declared inline after being
>> called
>> simplecalcLexer.c:190: warning: previous declaration of 'mPLUS' was
>> here
>> simplecalcLexer.c:191: warning: 'mMINUS' declared inline after being
>> called
>> simplecalcLexer.c:191: warning: previous declaration of 'mMINUS' was
>> here
>> simplecalcLexer.c:192: warning: 'mMULT' declared inline after being
>> called
>> simplecalcLexer.c:192: warning: previous declaration of 'mMULT' was
>> here
>> simplecalcLexer.c:193: warning: 'mDIV' declared inline after being
>> called
>> simplecalcLexer.c:193: warning: previous declaration of 'mDIV' was
>>     
> here
>   
>> simplecalcLexer.c:194: warning: 'mNUMBER' declared inline after being
>> called
>> simplecalcLexer.c:194: warning: previous declaration of 'mNUMBER' was
>> here
>> simplecalcLexer.c:195: warning: 'mWHITESPACE' declared inline after
>> being called
>> simplecalcLexer.c:195: warning: previous declaration of 'mWHITESPACE'
>> was here
>> simplecalcLexer.c:196: warning: 'mDIGIT' declared inline after being
>> called
>> simplecalcLexer.c:196: warning: previous declaration of 'mDIGIT' was
>> here
>> simplecalcParser.c: In function 'main':
>> simplecalcParser.c:290: warning: pointer targets in passing argument 1
>> of 'antlr3AsciiFileStreamNew' differ in signedness
>>
>> (the last two warnings only under Mac)
>>
>> Any ideas? Thanks in advance for any tips!
>>
>> Best regards,
>>
>> Marc
>>
>>
>>
>>
>>     
>
>
>
>   



More information about the antlr-interest mailing list