[antlr-interest] Can't find template tokenRefRuleRoot.st

Jim Idle jimi at temporal-wave.com
Thu Apr 26 10:10:33 PDT 2007


I think that this is fixed now, but if you are using the latest antlr
works you are using a newer version of ANTLR3 and should try your
grammar with that version of the jara and not the b7 one you have.
Antlrworks contains antlr, so issue the same command but instead of
antlr-3.0b7, use the antlrworks jar. If that has a fixed version of
antlr, then it will work for you.

 

That said, you may find that it is ok in interpreting mode in Antlr
Works, but not when you try to code gen. I no longer remember exactly
what construct in the grammar triggers this, but it is something like
having output=AST; then using ^ on a rule reference rather than a token.
Again, I believe that Ter's new tree re-writing changes have fixed all
that. But if you use -> instead of ^ then it will go away I think.

 

Jim

 

From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Ivo Jimenez
Sent: Thursday, April 26, 2007 2:28 AM
To: antlr-interest at antlr.org
Subject: [antlr-interest] Can't find template tokenRefRuleRoot.st

 

Hi all,

First of all, let me say that ANTLR rules the whole universe (at least
the parser generator one).

I'm writing the grammar for a superset of a subset of the SQL language,
everything works fine in ANTLRWorks ( 1.0b11)  but when calling ANTLR
from the command line with:

java -cp antlr-2.7.7.jar:antlr-3.0b7.jar:stringtemplate-3.0.jar
org.antlr.Tool SqlV3.g


I get the following:

error(10):  internal error: examples-v3/SqlV3.g :
java.lang.IllegalArgumentException: Can't find template
tokenRefRuleRoot.st
org.antlr.stringtemplate.StringTemplateGroup.lookupTemplate
(StringTemplateGroup.java:485)
org.antlr.stringtemplate.StringTemplateGroup.getInstanceOf(StringTemplat
eGroup.java:372)
org.antlr.stringtemplate.StringTemplateGroup.getInstanceOf(StringTemplat
eGroup.java:384)
org.antlr.codegen.CodeGenTreeWalker.getTokenElementST
(CodeGenTreeWalker.java:160)
org.antlr.codegen.CodeGenTreeWalker.atom(CodeGenTreeWalker.java:1970)
org.antlr.codegen.CodeGenTreeWalker.element(CodeGenTreeWalker.java:1599)
org.antlr.codegen.CodeGenTreeWalker.element
(CodeGenTreeWalker.java:1434)
org.antlr.codegen.CodeGenTreeWalker.alternative(CodeGenTreeWalker.java:1
224)
org.antlr.codegen.CodeGenTreeWalker.block(CodeGenTreeWalker.java:1009)
org.antlr.codegen.CodeGenTreeWalker.rule (CodeGenTreeWalker.java:725)
org.antlr.codegen.CodeGenTreeWalker.rules(CodeGenTreeWalker.java:516)
org.antlr.codegen.CodeGenTreeWalker.grammarSpec(CodeGenTreeWalker.java:4
58)
org.antlr.codegen.CodeGenTreeWalker.grammar (CodeGenTreeWalker.java:305)
org.antlr.codegen.CodeGenerator.genRecognizer(CodeGenerator.java:409)
org.antlr.Tool.processGrammar(Tool.java:347)
org.antlr.Tool.process(Tool.java:268)
org.antlr.Tool.main(Tool.java :70)

So you know how can I fix this? This happens also if I run the Debug
feature of the ANTLRWorks IDE.

Thanks.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070426/f1bd9e4f/attachment-0001.html 


More information about the antlr-interest mailing list