Hi Michael,

I have great news for you.  ANTLR does this for you.  Here's an example:

//
// Parser rules

statement: pos | neg ;

pos: ID 'is' ID ;

neg: 'not' ID ;

//
// Lexer rules

ID: ('A'..'Z' | 'a'..'z')+ ;

This example works because ANTLR tests tokens produced by ID against 
literal values used in the parser.  Try it out.

Cheers
./m

Michael Moore wrote:
> Hi guys,
> 
>  
> 
> This is probably a bit of a newbie question, but I'm trying to write a rule
> that basically says "match any 'foo' that also does not match any 'bar'"
> where 'foo' is a basic rule (matches all letters and numbers) and 'bar' is a
> list of keywords. Is there a way to produce this kind of logic in ANTLR or
> does the logic need to be approached from a different direction to solve
> this one?
> 
>  
> 
> Thanks,
> 
> Mike
> 
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: 
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
> 

This email and any attachments are intended for the sole use of the named 
recipient(s) and contain(s) confidential information that may be proprietary, 
privileged or copyrighted under applicable law. If you are not the intended 
recipient, do not read, copy, or forward this email message or any attachments. 
Delete this email message and any attachments immediately.



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