simpleparse.common.numbers | index /home/mcfletch/pylive/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 | ||
_p = <simpleparse.parser.Parser instance> c = {'binary_number': LibraryElement( production = 'binary_number'...enerator.Generator instance at 0x2aaaad5f69e0>, ), 'float': LibraryElement( production = 'float', ge...enerator.Generator instance at 0x2aaaad5f69e0>, ), 'float_floatexp': LibraryElement( production = 'float_floatexp...enerator.Generator instance at 0x2aaaad5f69e0>, ), 'hex': LibraryElement( production = 'hex', gene...enerator.Generator instance at 0x2aaaad5f69e0>, ), 'imaginary_number': LibraryElement( production = 'imaginary_numb...enerator.Generator instance at 0x2aaaad5f69e0>, ), 'int': LibraryElement( production = 'int', gene...enerator.Generator instance at 0x2aaaad5f69e0>, ), 'int_unsigned': LibraryElement( production = 'int_unsigned',...enerator.Generator instance at 0x2aaaad5f69e0>, ), 'number': LibraryElement( production = 'number', g...enerator.Generator instance at 0x2aaaad5f69e0>, ), 'number_full': LibraryElement( production = 'number_full', ...enerator.Generator instance at 0x2aaaad5f69e0>, )} declaration = '\n# sample for parsing integer and float numbers\n... := binary_number/imaginary_number/hex/float/int\n' name = 'number_full' |