Hmm - I wonder if that test fails anyway - there are currently some that we know fail. That attribute comes from the main template and I suspect that the reference context is no longer valid since the test was written. Perhaps the test is in fact no longer valid.
I am running the Java tests now (takes a while) so I will let you know if that test fails. JIm From: [email protected] [mailto:[email protected]] On Behalf Of Sam Harwell Sent: Monday, November 02, 2009 10:39 AM To: [email protected] Subject: [antlr-dev] Some of my unit tests are failing - where did I go wrong? I'm getting the following error when running the TestRuleLabelBeforeRefToPredefinedAttr unit test: TestRuleLabelBeforeRefToPredefinedAttr threw exception: System.ArgumentException: no such attribute: TREE_PARSER in template context [ruleLabelPropertyRef_text]. Is this unit test working correctly for you? If so, where is it resolving the TREE_PARSER attribute from? If you're interested, here's my stack trace, which should be directly translatable to the Java code: Antlr3.ST.StringTemplate.CheckNullAttributeAgainstFormalArguments(StringTemplate self, String attribute) in C:\dev\stringtemplate_main\antlrcs\main\Antlr3.StringTemplate\StringTemplate.cs: line 1688 Antlr3.ST.StringTemplate.GetAttribute(String name) in C:\dev\stringtemplate_main\antlrcs\main\Antlr3.StringTemplate\StringTemplate.cs: line 970 Antlr3.ST.Language.ActionEvaluator.attribute() in C:\dev\stringtemplate_main\antlrcs\main\Antlr3.StringTemplate\obj\Debug\ActionEvaluator.cs: line 1291 Antlr3.ST.Language.ActionEvaluator.expr() in C:\dev\stringtemplate_main\antlrcs\main\Antlr3.StringTemplate\obj\Debug\ActionEvaluator.cs: line 274 Antlr3.ST.Language.ActionEvaluator.ifAtom() in C:\dev\stringtemplate_main\antlrcs\main\Antlr3.StringTemplate\obj\Debug\ActionEvaluator.cs: line 1143 Antlr3.ST.Language.ActionEvaluator.ifCondition() in C:\dev\stringtemplate_main\antlrcs\main\Antlr3.StringTemplate\obj\Debug\ActionEvaluator.cs: line 1089 Antlr3.ST.Language.ConditionalExpr.Write(StringTemplate self, IStringTemplateWriter out) in C:\dev\stringtemplate_main\antlrcs\main\Antlr3.StringTemplate\Language\ConditionalExpr.cs: line 216 Antlr3.ST.StringTemplate.Write(IStringTemplateWriter writer) in C:\dev\stringtemplate_main\antlrcs\main\Antlr3.StringTemplate\StringTemplate.cs: line 997 Antlr3.ST.StringTemplate.ToString(Int32 lineWidth) in C:\dev\stringtemplate_main\antlrcs\main\Antlr3.StringTemplate\StringTemplate.cs: line 2071 Antlr3.ST.StringTemplate.ToString() in C:\dev\stringtemplate_main\antlrcs\main\Antlr3.StringTemplate\StringTemplate.cs: line 2060 System.Text.StringBuilder.Append(Object value) Antlr3.Grammars.ActionTranslator.Translate() in C:\dev\stringtemplate_main\antlrcs\main\Antlr3\Grammars\ActionTranslatorHelper.cs: line 108 AntlrUnitTests.TestAttributes.TestRuleLabelBeforeRefToPredefinedAttr() in C:\dev\stringtemplate_main\antlrcs\main\Antlr3.Test\TestAttributes.cs: line 482
_______________________________________________ antlr-dev mailing list [email protected] http://www.antlr.org/mailman/listinfo/antlr-dev
