Parser
#
- class pymeasurement.util.parser.Parser(string)[source]#
A class to parse strings.
- Parameters:
string (str) – The string to parse.
- Raises:
TypeError – If string is not a string.
- __repr__()[source]#
Get the string representation of the parser.
- Returns:
The string representation of the parser.
- Return type:
str
- __str__()[source]#
Get the string representation of the parser.
- Returns:
The string representation of the parser.
- Return type:
str
- __weakref__#
list of weak references to the object (if defined)
- readByCharacter(string, startSetup=None, endSetup=None, checks=None)[source]#
Read a string by character.
- Parameters:
string (str) – The string to read.
startSetup (function) – A function to run before reading the string.
endSetup (function) – A function to run after reading the string.
checks (function) – A function to run on each character.