Try this one: class NUMLexer extends Lexer; options { k = 2; } NUMBER : N ( '.' (N)? )? (EXPONENT)? | '.' N (EXPONENT)? | '.' {$setType(DOT);} ; protected EXPONENT : 'e' ( '+' | '-' )? N ; protected N : ( '0' .. '9' )+ ; HTH, Lubos Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/