RosettaCodeData/Task/Literals-Floating-point/Python/literals-floating-point-1.py

12 lines
212 B
Python

FLOAT
: '.' DIGITS (Exponent)?
| DIGITS '.' Exponent
| DIGITS ('.' (DIGITS (Exponent)?)? | Exponent)
;
DIGITS : ( '0' .. '9' )+ ;
Exponent
: ('e' | 'E') ( '+' | '-' )? DIGITS
;