[antlr-interest] funny things with the generated C target

Gavin Lambert antlr at mirality.co.nz
Thu Jul 17 01:23:43 PDT 2008


At 19:53 17/07/2008, Davyd Madeley wrote:
 >My first problem was that I was unable to have a lexer rule
 >named LT (?), so I renamed it.

This is because "LT" is the name of an internal function 
(specifically, one that gets a specific Lookahead token Type).

 >Program received signal SIGSEGV, Segmentation fault.
 >0x00fd6e42 in fillBuffer () from
 >/home/davyd/install/lib/libantlr3c.so

Problems in there are probably either due to recursive or 
zero-consuming token definitions, although I didn't spot any of 
those in the grammar you attached.

 >#0  0x00fd6e42 in fillBuffer ()
 >from /home/davyd/install/lib/libantlr3c.so
 >#1  0x00fd721a in tokLT () from
 >/home/davyd/install/lib/libantlr3c.so
 >#2  0x0804ac04 in phaseBlock (ctx=0x8fc19e8) at
 >UniseisPhaseParser.c:527
 >#3  0x080489a0 in main (argc=1457883477, argv=0xb0ec8153)
 >    at SemanticChecker.c:56

I'm not sure what the problem would be here.  Have you tried 
compiling the library in debug mode so that you can step through 
the code and work out what it's doing?

And which version of ANTLR and the runtime are you using?  Are you 
sure the versions match?



More information about the antlr-interest mailing list