[antlr-interest] issue with 3.1 C-target

Jim Idle jimi at temporal-wave.com
Mon Sep 1 15:00:25 PDT 2008


On Sun, 2008-08-31 at 01:50 +0200, Corno Schraverus wrote:

> Hi All,
> 
> I've just migrated to the latest version of ANTLR (3.1) and I am using the C
> -target.
> The transition was smooth except for 1 minor issue;
> I create tokens with custom code and if I set the text (setText) to an empty
> string, something goes wrong. I get garbage back when I use getText.
> I've looked around a bit and commenting out line 450 of antlr3string.c seems
> to fix the issue;
> 	if	(size <= 0)
> 	{
> 		//return	string;
> 	}
> I don't know if that would break anything else.
> 

It was just that zero length strings were not being terminated with a
'\0'. This is now fixed in the source code - you can get the latest from
Fisheye.

Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080901/3fd191a2/attachment.html 


More information about the antlr-interest mailing list