I just had exactly the same problem. I have an Eclipse project with an Ant build.xml to reproduce the error. Should I send it in a ZIP file?
On Jan 14, 10:35 am, "Chen Hongjun-R66092" <[email protected]> wrote: > No, I didn't modify anything in this example. > > Best Regards, > Hongjun > > > > > -----Original Message----- > > From: Terence Parr [mailto:[email protected]] > > Sent: Thursday, January 14, 2010 3:07 AM > > To: Chen Hongjun-R66092 > > Cc: [email protected] > > Subject: Re: [antlr-interest] An error occurs in template example > > > weird. and youdidn't alter the software at all? > > Ter > > On Jan 12, 2010, at 7:12 PM, Chen Hongjun-R66092 wrote: > > > > Hi Terence, > > > > Thanks for your response. For the example > > 'templates/generator/2pass', > > > I used the following commands to try it out: > > > > # java org.antlr.Tool *.g > > > # javac *.java > > > # java Test < input > > > > Do I miss anything? What is the "init" parameter needed by > > template? > > > How to provide this "init" parameter for template? > > > > Thanks again, > > > Hongjun > > > >> -----Original Message----- > > >> From: Terence Parr [mailto:[email protected]] > > >> Sent: Wednesday, January 13, 2010 10:52 AM > > >> To: Chen Hongjun-R66092 > > >> Cc: [email protected] > > >> Subject: Re: [antlr-interest] An error occurs in template example > > > >> the error says you don't have an "init" parameter to the > > template. do > > >> you have one? > > >> Ter > > >> On Jan 12, 2010, at 6:35 PM, Chen Hongjun-R66092 wrote: > > > >>> Hi, > > > >>> I am new to ANTLR, and am reading the book The Definitive ANTLR > > >>> Reference. When I tried the template example > > >> 'template/generator/2pass' > > >>> without any modification, and met an error as below: > > > >>> Exception in thread "main" > > java.util.NoSuchElementException: no such > > >>> attribute: init in template context [jasminFile] > > >>> at > > > org.antlr.stringtemplate.StringTemplate.checkNullAttributeAgainstForm > > >> a > > >>> lA > > >>> rguments(StringTemplate.java:1311) > > >>> at > > > org.antlr.stringtemplate.StringTemplate.getAttribute(StringTemplate.j > > >> a > > >>> va > > >>> :684) > > >>> at > > > org.antlr.stringtemplate.language.ActionEvaluator.attribute(ActionEva > > >> l > > >>> ua > > >>> tor.java:360) > > >>> at > > > org.antlr.stringtemplate.language.ActionEvaluator.expr(ActionEvaluato > > >> r > > >>> .j > > >>> ava:136) > > >>> at > > > org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvalua > > >> t > > >>> or > > >>> .java:84) > > >>> at > > >>> org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:149) > > >>> at > > > org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:705 > > >> ) > > >>> at > > > org.antlr.stringtemplate.StringTemplate.toString(StringTemplate.java: > > >> 1 > > >>> 67 > > >>> 0) > > >>> at > > > org.antlr.stringtemplate.StringTemplate.toString(StringTemplate.java: > > >> 1 > > >>> 66 > > >>> 1) > > >>> at Test.main(Test.java:45) > > > >>> I appreciate your any suggestions or ideas! > > > >>> Thanks, > > >>> Hongjun > > > >>> List:http://www.antlr.org/mailman/listinfo/antlr-interest > > >>> Unsubscribe: > > >http://www.antlr.org/mailman/options/antlr-interest/your-email-addres > > >> s > > List:http://www.antlr.org/mailman/listinfo/antlr-interest > Unsubscribe:http://www.antlr.org/mailman/options/antlr-interest/your-email-address
-- You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.
