[antlr-interest] Turning TreeParsers on their ears(?)

Bryan Ewbank ewbank at gmail.com
Wed Apr 13 17:08:23 PDT 2005


I'm working thru a refactoring/reshaping of my AST, and am (of course)
hitting pretty much every pass.  It struck me that I'm making the same
ANTLR changes most everywhere, but the actions are different.

    //before
    expr_unary : #(ROOT lhs extra rhs ) { ... };

    //after
    expr_unary : #(ROOT id lhs rhs extra) { ... };

Has anyone explored turning ANTLR inside-out so that a tree parser
/production/ is the major object, with distinct actions on a per-pass
basis?

Not sure if this makes any sense to anyone else, but if it does, lemme
hear, okay.

Thanks,
- B


More information about the antlr-interest mailing list