Hi,<br>I'm trying to build an Actionscript 3 to haxe <a href="http://haxe.org">http://haxe.org</a> translator, and I've been taking a closer look at metaas to see if I could reuse the AS3 and island grammars as the basis for it. I thought I might as well try to build something robust with ANTLR than hand code a translator, but I've into a couple snags with building the project.<br>
<br>I was hoping maybe David Holroyd or someone would give me some pointers on how to alter the grammar into a tree grammar for rewriting as I'm still learning how to use ANTLR.<br><br>Just as a side note, I setup Netbeans with a Maven plugin to build the metaas project but ran into some dependency issues with the maven-archiver, plexus-archiver and plexus-components. I stopped trying to resolve them at that point because I wanted to focus on the task of the tree grammar.<br>
<br>I've been reading through the docs and examples, but I don't know I would translate the certain parser rewrites into a tree grammar rule. For example:<br><br>classDefinition[LinkedListTree annos, LinkedListTree mods]<br>
: CLASS ident<br> classExtendsClause<br> implementsClause<br> typeBlock<br> -> ^(CLASS_DEF {$annos} {$mods} ident classExtendsClause implementsClause typeBlock)<br> ;<br><br>In The Definitive Guide to ANTLR, Terrence Parr says to copy the rules over like so:<br>
<br>classDefinition[LinkedListTree annos, LinkedListTree mods]<br>
: ^(CLASS_DEF {$annos} {$mods} ident classExtendsClause implementsClause typeBlock)<br>
;<br><br>But what would I do about the {$annos} and {$mods} elements in the rule? I figure the parameter clause should be removed, but what should I use to reference the annos and mods elements in the AST? <br><br>
Thanks,<br>Don<br>