[antlr-interest] Tree Pattern Matching with Rewrite Rules

Bart Kiers bkiers at gmail.com
Tue Mar 8 12:46:32 PST 2011


On Tue, Mar 8, 2011 at 6:36 PM, Matt Fowles <matt.fowles at gmail.com> wrote:

> All~
>
> I have a trivial antlr grammar for expressions like `a.b.c + d.e.f`
> (Test.g).  Now I want to define a pattern matcher over this grammar
> that turns `a.b.c` into `0.1.2`, so I define a Tree Pattern Matcher
> (TestWalker.g) and put together a small test program (Main.java).
>
> When I run this program with basic input, I see surprising results:
> `a.b.c` -> `0.b.c`
> `a.b + d.e` -> `0.b + 0.e`
> and so on.
> ...


FYI:
http://stackoverflow.com/questions/5236089/antlr-tree-pattern-matching-with-rewrite-rules/5237962#5237962

Regards,

Bart.


More information about the antlr-interest mailing list