[antlr-interest] C target: problems with setCharStream

Jim Idle jimi at temporal-wave.com
Fri Jun 8 11:08:15 PDT 2007


I'll take a look at it, but perhaps that example is wrong? 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.

Jim

> -----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