Hello all,

Is there a way to force 'match first' among a group of tokens? In the code
below, if 'undef(' or 'undef ' is found, it matches DIR_MACRO regardless of
the predicate. I can see why it would do this, but I'm trying to find a way
to match the DIR_UNDEF rule without resorting to combining the two rules and
manually modify the token type.


DIR_UNDEF :
  '`undef'
  SLSpace+ var0=SimpleIdent;

DIR_MACRO :
  '`' var0=SimpleIdent
  (
    {cond1(var0) == true}? =>
  | {cond2(var0) == true}? => Args
  | //Both conditionals false
  );

fragment Args : ' '* '(' ;

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

-- 
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