[antlr-interest] Traversing a tree without rebuilding it

Bryan Ewbank ewbank at gmail.com
Wed Aug 30 08:51:14 PDT 2006


In v2 ANTLR, in the options section for the class extending
TreeParser, add the option:
    builtAST = false;
This will suppress the construction of the output tree (and greating
speed processing :-)

On 8/26/06, Oliver Fischer <obf at gmx.de> wrote:
> Hello,
>
> I am writing a small educational compiler, which should be able to
> perfom some optimisations as removing unused variables...
>
> Hence I have to perform some tests on the tree generated by my parser.
> It seems so, that a TreeParser can not traverse a tree without
> destroying the input tree.
>
> Is it possible only to traverse a given tree without rebuilding it? It
> is important to me to keep the input tree unmodified by the TreeParser.
>
> Regards,
>
> Oliver
>
>


More information about the antlr-interest mailing list