[antlr-interest] Antlrworks 1.3.1 and string template

Terence Parr parrt at cs.usfca.edu
Tue Nov 24 12:02:34 PST 2009


no doubt this is a class path issue; Java only likes to look in the jar it started up a program in for resources and classes. If assign.st isn't in that jar, Java won't see it.
Ter
On Nov 24, 2009, at 8:04 AM, <pfa at isep.ipp.pt> <pfa at isep.ipp.pt> wrote:

> Hi,
> 
> I'm trying, without sucess, to run in antlrworks a simple string template example, from the tpantlr-bundle. The following error occur:
> 
> 
> Exception in thread "main" java.lang.IllegalArgumentException: Can't find template assign.st; group hierarchy is [TParserTemplates]
> 
>  at org.antlr.stringtemplate.StringTemplateGroup.lookupTemplate(StringTemplateGroup.java:507)
> 
>  at org.antlr.stringtemplate.StringTemplateGroup.getInstanceOf(StringTemplateGroup.java:392)
> 
>  at org.antlr.stringtemplate.StringTemplateGroup.getInstanceOf(StringTemplateGroup.java:404)
> 
>  at org.antlr.stringtemplate.StringTemplateGroup.getInstanceOf(StringTemplateGroup.java:412)
> 
>  at TParser.s(TParser.java:125)
> 
>  at __Test__.main(__Test__.java:14)
> 
> The assign rule belongs to the T group (T.stg file), which is in the project root dir (with T.g grammar). The settings are the defaults ones: output directory, for the java files, and output\classes directory for the classes.
> 
> Pursuing this problem I tried 2 differents approaches:
> 
> 1. changing the generated  __Test__.java code
> 
> 2. replacing the generated __Test__.java with the "hand made" Test.java (from the bundle)
> 
> In both cases I was unable to solve the problem. Meantime I collected some more questions:
> 
> 1. In antlrworks can I use a specific test rig? I know about the "Edit *.g Test Rig for Java" of the Run menu, and also the "Test Rig" from the Preferences toolbox. But, what is suppose to write there, a template? java code? I'm in the dark!
> 
> 2. How can I disable the remote debugging? In some of my tests the reported error was timeout from port 49153! But as far as I understood this is only used for remote testing. My scenario is standalone.
> 
> I did searched for an answer in the email repository and also in the antlrworks/antlr site. But didn't find anything.
> 
> Comments are welcome.
> 
> Pedro
> 
>  
>  
> 
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list