Expression parser.
More...
#include <base/math/ExpressionParser.h>
Inherits Object.
Expression parser.
Arithmetic expression parser.
- See also
- ExpressionProvider
-
ExpressionEvaluator
- Version
- 1.0
- Examples
- testsuite/eval.cpp.
◆ ExpressionParser()
Initializes an expression parser.
- Parameters
-
expression | The string representation of the expression to be parsed (e.g. "4+5*x/7"). |
provider | The expression provider. |
◆ ~ExpressionParser()
ExpressionParser::~ExpressionParser |
( |
| ) |
|
|
noexcept |
Destroys the expression parser.
◆ getAutoRegister()
bool ExpressionParser::getAutoRegister |
( |
| ) |
const |
|
inlinenoexcept |
Returns the auto-register mode.
◆ getExpression()
const List<Node>& ExpressionParser::getExpression |
( |
| ) |
const |
|
inlinenoexcept |
◆ getString()
String ExpressionParser::getString |
( |
| ) |
const |
◆ getUnknowns()
◆ hasUnknowns()
bool ExpressionParser::hasUnknowns |
( |
| ) |
const |
|
inlinenoexcept |
◆ parse()
void ExpressionParser::parse |
( |
| ) |
|
◆ pop()
void ExpressionParser::pop |
( |
| ) |
|
|
protected |
Pops one operation from the stack.
◆ push()
void ExpressionParser::push |
( |
Operation |
operation | ) |
|
|
protected |
Pushed the specified operation onto the stack.
◆ readIdentifier()
void ExpressionParser::readIdentifier |
( |
| ) |
|
|
protected |
Reads an identifier from the representation.
◆ readValue()
void ExpressionParser::readValue |
( |
| ) |
|
|
protected |
Reads a number from the representation.
◆ setAutoRegister()
void ExpressionParser::setAutoRegister |
( |
bool |
value | ) |
|
|
inlinenoexcept |
◆ autoRegister
bool ExpressionParser::autoRegister = false |
|
protected |
The auto-register mode. Default is disabled.
◆ expression
String ExpressionParser::expression |
|
protected |
The expression representation.
◆ index
unsigned int ExpressionParser::index = 0 |
|
protected |
The current position in the representation.
◆ length
unsigned int ExpressionParser::length = 0 |
|
protected |
The length of the expression.
◆ nodes
List holding the parsed expression.
◆ operands
unsigned int ExpressionParser::operands = 0 |
|
protected |
Specifies the current number of operands.
◆ provider
◆ stack
Stack holding operations.
◆ unary
bool ExpressionParser::unary = false |
|
protected |
Specifies that an unary expression is expected.
◆ unknowns
◆ unknownsId
Lookup of the unknowns by id.