Parsers
build_operand_parser(number_parser)
Builds the operand parser by removing the = sign at the beginning of the formula
Parameters:
Name | Type | Description | Default |
---|---|---|---|
number_parser
|
Callable[[], ParserElement]
|
number parser like decimal_parser or regular_number_parser |
required |
Returns:
Type | Description |
---|---|
ParserElement
|
pp.ParserElement: full formula parser for pyparsing |
Source code in configcalc/parsers.py
88 89 90 91 92 93 94 95 96 97 98 99 100 |
|
decimal_parser()
Parse numbers as Decimal
Returns:
Type | Description |
---|---|
ParserElement
|
pp.ParserElement: Decimal ParserElement for pyparsing |
Source code in configcalc/parsers.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
operator_operand_expr(number_parser)
Parse an operator operand with priority. In order (most priority to least) the minus sign (-), exponent (^), multiply/divide (* /) and add/substract (+ -)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
number_parser
|
Callable[[], ParserElement]
|
number parser like decimal_parser or regular_number_parser |
required |
Returns:
Type | Description |
---|---|
ParserElement
|
pp.ParserElement: operand parser for pyparsing |
Source code in configcalc/parsers.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
|
regular_number_parser()
Parse numbers as default from pyparsing
Returns:
Type | Description |
---|---|
ParserElement
|
pp.ParserElement: Common number ParserElement for pyparsing |
Source code in configcalc/parsers.py
29 30 31 32 33 34 35 |
|
var_name_parser()
Parse a variable number composed of a base name and a tree like structure using dots (.) or a list like structure using square brackets ([]), or a combination of both.
Returns:
Type | Description |
---|---|
ParserElement
|
pp.ParserElement: var name ParserElement for pyparsing |
Source code in configcalc/parsers.py
44 45 46 47 48 49 50 51 52 53 54 |
|