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.

It appears that the `(DOT qualifier_id)*` portion of my rule never
matches and I cannot figure out why.  I have tried adding my rules to
the topdown and the bottomup portions of the Tree Pattern Match.  If I
switch from a filter matcher to a whole tree matcher and add rules to
branch for the `'+'` case appropriately it works, but when the rewrite
is just a smaller fragment of a much larger grammar this becomes
untenable.  Any pointers would be greatly appreciated.

Thanks,
Matt
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Attachment: pattern-test.tgz
Description: GNU Zip compressed data

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to