Hi,

I'd like to recognize '2/3/2008' as date, while anything else like '2/3
/ 2008' as division. The following lex code recognizes date fine, but it
messes up division...

I'm fairly new to ANTLR. I'm wondering if someone can point me a
direction for this problem?

DATE
        : DATENUM '/' DATENUM '/' YEARNUM
        ;

fragment
DATENUM
        :       ('0'..'9') ('0'..'9')?
        ;
        
fragment        
YEARNUM
        :       ('19'|'20') ('0'..'9')('0'..'9')
        ;


Thanks,

Jack




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