[antlr-interest] Re: Resolving ambiguity with dates and division operations
oneway_111
oneway_111 at yahoo.com
Wed Apr 16 04:05:18 PDT 2003
--- In antlr-interest at yahoogroups.com, "Matthew Ford" >
...
> // a numeric literal date, time, int, float, hex or oct
> DATE_TIME_INT_FLOAT
> : (DIGIT DIGIT DIGIT DIGIT '/') => DATE {_ttype = DATE;}
> | (DIGIT (DIGIT)? ':') => TIME {_ttype = TIME;}
> | (INT '.') => FLOAT {_ttype = FLOAT;}
> | INT {_ttype = INT;}
> | ('0' 'x')=> HEX {_ttype = HEX;}
> ;
...
Thanks, that was helpful.
I'm concerned though that
(DIGIT DIGIT DIGIT DIGIT '/') => DATE {_ttype = DATE;}
will not work when, say, you want 2002 divided by 4 (2002/4), will it?
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list