Hi.
I'm trying to develop a simple translator with ANTLR.
I thought "rewrite option" better for me, but gUnit raised
ClassCastException with it.
The following codes have the problem. I'm using ANTLR v3.2 and Java
1.6.0 on Mac OS 10.6.
Do you have any advice?
Thanks.
== T.g ==
{{{
grammar T;
options {output=template; rewrite=true;}
type: 'int' -> template() "Integer";
}}}
== T.gunit ==
{{{
gunit T;
type:
"int" -> "Integer"
}}}
Then, I executed following shell commands.
$ java org.antlr.Tool T.g
$ javac T{Lexer,Parser}.java
$ java org.antlr.gunit.Interp T.gunit
And, I got the following outputs.
{{{
-----------------------------------------------------------------------
executing testsuite for grammar:T with 1 tests
-----------------------------------------------------------------------
1 failures found:
test1 (type, line4) -
expected: Integer
actual: java.lang.ClassCastException:
org.antlr.runtime.CommonTokenStream cannot be cast to
org.antlr.runtime.TokenRewriteStream
Tests run: 1, Failures: 1
}}}
--
Eitarow Fukamachi
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.