[antlr-interest] Question on aborting rule based on pattern

Rajeev Bharadhwaj rajeevb2 at yahoo.com
Sat Jul 22 00:21:27 PDT 2006


How do I stop matching so it can reduce the rule?

aaa : "AAAA" SPACE bbb ccc ;

bbb : ( ddd )+ ;

ddd : ha:ATOM ":" SPACE eee SPACE ; // Rule 1

eee : hva:ATOM (":" hvap:ATOM)* ;

ccc : "XXX" ":" SPACE ((cccentry)+ ; // Rule 2

I would like Rule 1 to stop matching when
ha.getText()==XXX, so aaa can shift to Rule 2 (ccc).

ATOM matches alphabets and numbers to create strings.

R B

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the antlr-interest mailing list