[antlr-interest] Rewrite rule question

Jamie Penney jpen054 at ec.auckland.ac.nz
Mon Feb 18 13:31:52 PST 2008


Hi All,

I have a set of rewrite rules like so:
primary_expression :
        (literal | simple_name | ... )
        (DOT IDENTIFIER some_rule -> ^(PRIMARY_EXPRESSION 
$primary_expression DOT IDENTIFIER type_argument_list_handler)
            |    ... )*

If there are none of the last group, then no rewrite rule is triggered. 
If I specify a rewrite rule on the first group, will the rewrite rules 
in the second group overwrite the ones from the first if they are 
triggered (this is the behaviour I want)? Is there a way of doing this? 
There are quite a lot of alternatives in both groups, and they are all 
quite different, so I'm not sure what I should be doing here.

Thanks,
Jamie


More information about the antlr-interest mailing list