simpleparse.common.numbers | index s:\sp\simpleparse\common\numbers.py |
Samples showing the parsing of common programming-language constructs
numbers
integers
int
int_unsigned
hexidecimal integers
hex
floats (including exponents, requring a '.' in the literal)
float
floats, with optional integer-only exponents
float_floatexp
floats, with optional integer or float exponents
imaginary_number
(float/int),[jJ]
number
hex/float/int
number_full
binary_number/imaginary_number/hex/float/int
binary_number
signed binary number
1001001b or 1001001B bit-field format,
optional sign
can be used with number as (binary_number/number)
Interpreters:
IntInterpreter
int, int_unsigned
HexInterpreter
hex
FloatInterpreter
float
FloatFloatExpInterpreter
float_floatexp
BinaryInterpreter
binary_number
ImaginaryInterpreter
imaginary_number
Modules | ||||||
|
Classes | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Functions | ||
|
Data | ||
__file__ = r'S:\sp\simpleparse\common\numbers.pyc' __name__ = 'simpleparse.common.numbers' _p = <simpleparse.parser.Parser instance at 0x00B0BFE8> c = {'binary_number': LibraryElement( production = 'binary_number'...se.generator.Generator instance at 0x007D11A8>, ), 'float': LibraryElement( production = 'float', ge...se.generator.Generator instance at 0x007D11A8>, ), 'float_floatexp': LibraryElement( production = 'float_floatexp...se.generator.Generator instance at 0x007D11A8>, ), 'hex': LibraryElement( production = 'hex', gene...se.generator.Generator instance at 0x007D11A8>, ), 'imaginary_number': LibraryElement( production = 'imaginary_numb...se.generator.Generator instance at 0x007D11A8>, ), 'int': LibraryElement( production = 'int', gene...se.generator.Generator instance at 0x007D11A8>, ), 'int_unsigned': LibraryElement( production = 'int_unsigned',...se.generator.Generator instance at 0x007D11A8>, ), 'number': LibraryElement( production = 'number', g...se.generator.Generator instance at 0x007D11A8>, ), 'number_full': LibraryElement( production = 'number_full', ...se.generator.Generator instance at 0x007D11A8>, )} declaration = '\n# sample for parsing integer and float numbers\n... := binary_number/imaginary_number/hex/float/int\n' name = 'number_full' |