[antlr-interest] Tree rewrite bug in Actionscript

Des Hartman des at deshartman.com
Wed Mar 18 13:58:25 PDT 2009


George,

I decided to go and learn how Tree rewrite works and followed the examplae
Terrence gives at http://www.antlr.org/wiki/display/ANTLR3/Tree+construction.
I compiled and tested the Java version without any hassles and then I took
just the first grammar and tree rewrite to test with. I rewrote it in
actionscript and I have attached the two .g files.

When testing I hit a few errors:

1) When I do not have   "rewrite=true;" in the Tree file, all compiles fine
without errors (See PolyDifferentiator - works.as file)
2) When I have   "rewrite=true;" I get a heap of extra bracket errors and
also a type mismatch. See PolyDifferentiator.as file). I have commented the
lines where I get the extra bracket errors and finally the mismatch types.

It seems there is a problem with rewrite in AS. When I remove the rewrite, I
can compile the tree file and the example works fine.

Thanks
Des
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090319/35ecdff0/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Poly.g
Type: application/octet-stream
Size: 468 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20090319/35ecdff0/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PolyDifferentiator.g
Type: application/octet-stream
Size: 863 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20090319/35ecdff0/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PolyDifferentiator - works.as
Type: application/octet-stream
Size: 22313 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20090319/35ecdff0/attachment-0002.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PolyDifferentiator.as
Type: application/octet-stream
Size: 24676 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20090319/35ecdff0/attachment-0003.obj 


More information about the antlr-interest mailing list