[antlr-interest] StringTemplate Expr example, Test.java fails to compile

Ted Villalba tedv at esrconsulting.com
Mon May 21 10:26:34 PDT 2007


Here is the simple fix for the compile error in Test.java:

StringTemplate output = (StringTemplate)r2.getTemplate();


-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Ted Villalba
Sent: Sunday, May 20, 2007 3:38 PM
To: antlr-interest at antlr.org
Subject: [antlr-interest] StringTemplate Expr example,Test.java fails to
compile

Working my way through the book, I'm trying to compile the ByteCode
Generator example given in Chapter 9 - Generating Structured Text with
Templates and Grammars. 
The example uses a version of the Expr grammar. 
I receive an error when I try to compile the test rig.
Has anyone else encountered this compilation err, and if so, what did you do
to address it?

Test.java:43: incompatible types
found   : java.lang.Object
required: org.antlr.stringtemplate.StringTemplate
        StringTemplate output = r2.getTemplate();


Thank you,
Ted






More information about the antlr-interest mailing list