[antlr-interest] ArrayIndexOutOfBoundsException while generating code in v3

Kay Roepke kroepke at classdump.org
Mon Sep 25 03:47:46 PDT 2006


John,

On 25. Sep 2006, at 12:35 Uhr, John Goering wrote:

> OK, thanks!
> That's right, I wanted ';' to be optional for the last statement. I  
> changed
> that now to:
>
> statement? (SEMI statement)* SEMI?
>
> which seems to work well. Is there an easier way than that?

This is the common way to do it. Be aware that the form above allows:
1)	;		// a lone semicolon
2)			// nothing at all!

That's probably acceptable input, just wanted to point that out ;)

-k
-- 
Kay Röpke <kroepke at classdump.org>
classdump Software
Key fingerprint = A849 0F2C C322 4022 379E  8661 7E1B FE0D 4CD2 A6D0





More information about the antlr-interest mailing list