[antlr-interest] V3.0b Internal Error...

David Holroyd dave at badgers-in-foil.co.uk
Mon Oct 9 14:53:48 PDT 2006


Hi,

On Mon, Oct 09, 2006 at 09:41:44PM +0100, Robert Hill wrote:
> I have a rule in my grammar:
> 
> sqlTransfer[Service s]
> 	:   ( Select |  Update | Insert | Delete )
> 		param=Identifier Using mapping=Identifier Semi 	
> 	{
> 			//some Java Code...
> 	}  
> 	-> ^(SQLCODE )
> 
> Which generates the following
> 
> ANTLR Parser Generator   Early Access Version 3.0b4 (??, 2006)  1989-2006
> internal error: D:\ActiveProjects\IdeaProjects\Jtest1\src\SGenParser.g :
> java.lang.IllegalArgumentException: Can't find template matchSetTrack.st
> org.antlr.stringtemplate.StringTemplateGroup.lookupTemplate(StringTemplateGr
> oup.java:485)
> ......
> 
> however if I remove the brackets round the first set (select..Delete) the
> error goes away.
> I'm just trying to get it to emit a branch for this rule, it doesn't matter
> what I put in the re-write, I still get the error if the brackets are there.
> Also, if I remove the rewrite , the error goes away.

Ter has said something about this in the past...

  http://www.antlr.org/pipermail/antlr-interest/2006-August/017341.html

...seems it's something unfinished in current the v3 releases.

You may be able to work around it by putting Select|Update|Insert|Delete
into a subrule (I've not tried it, so sorry if it doesn't actually work).


ta,
dave

-- 
http://david.holroyd.me.uk/


More information about the antlr-interest mailing list