i think i may have a really simple implementaiton using TreeWizard. search for ACTION and call delete on TokenRewriteStream :)
Ter On Feb 17, 2009, at 2:34 PM, Leon Su wrote: > On Tuesday, February 17, 2009, at 01:56PM, "Terence Parr" <[email protected] > > wrote: >> Ok,I'm trying to integrate a v3 ANTLR parser into the mainline. We >> need this eventually as the new front end to ANTLR itself but also I >> wanted to integrate Leon's cool Strip program that knows how to print >> grammars back out with lots of different things stripped: >> >> I have make sure that the grammar in org/antlr/grammar/v3 is the >> latest version we have. thanks to everyone including Leon gave me >> fixes. The problem I have is that I will need only ASTs out of the >> grammar but Leon's strip program needs parse trees, which requires - >> debug option. It uses the debug events to build parsers. I have the >> tree grammar that walks an ANTLR AST. I don't want to have two >> versions of the grammar; well, actually a single version but with two >> different builds: one with and one without debugging. >> >> So, perhaps I adapt Leon's tool to use the rewrite stream and ASTs >> with the tree grammar rather than the parse tree. I think I can get a >> lot of his logic into the tree grammar from a parse tree. that is the >> direction I'm going. > > Cool. Please let me know if I can do any help on the new strip tool :) > Leon > >> >> With luck, all future stuff can see directly off of a generic AST and >> the grammar can stay pristine. >> >> Ter _______________________________________________ antlr-dev mailing list [email protected] http://www.antlr.org/mailman/listinfo/antlr-dev
