Public interface for the expression parsing facility.
More...
#include <SelectionExprParser.h>
Public interface for the expression parsing facility.
Definition at line 80 of file SelectionExprParser.h.
◆ SelectionExprParser()
Constructor for the parser which accepts a Lecer
.
- Parameters
-
lexer | The lexer to use for parsing |
- Note
Lexer
can be auto-constructed from a string, so you can pass one directly.
- Parameters
-
defaultToChar | Assume "as_char" as default encoding |
Definition at line 90 of file SelectionExprParser.cxx.
◆ build()
Triggers the actual parsing of the expression.
- Parameters
-
[out] | accessor | Unique pointer the resulting accessor will be written to. |
- Returns
- StatusCode noting whether the operation succeeded.
Definition at line 93 of file SelectionExprParser.cxx.
95 std::unique_ptr<ISelectionReadAccessor>
root{
nullptr};
99 throw std::runtime_error(
100 "Not all symbols in expression were consumed. Check your expression.");
104 return StatusCode::SUCCESS;
◆ expression()
Definition at line 107 of file SelectionExprParser.cxx.
111 std::unique_ptr<ISelectionReadAccessor> left = std::move(
root);
113 std::unique_ptr<ISelectionReadAccessor> right = std::move(
root);
114 root = std::make_unique<SelectionAccessorExprOr>(std::move(left),
117 return StatusCode::SUCCESS;
◆ factor()
Definition at line 139 of file SelectionExprParser.cxx.
143 root = std::make_unique<SelectionReadAccessorNull>(
true);
146 root = std::make_unique<SelectionReadAccessorNull>(
false);
150 std::unique_ptr<ISelectionReadAccessor> notEx =
151 std::make_unique<SelectionAccessorExprNot>(std::move(
root));
152 root = std::move(notEx);
156 throw std::runtime_error(
157 "Missing closing bracket, check your expression.");
165 throw std::runtime_error(
"Malformed expression.");
168 return StatusCode::SUCCESS;
◆ term()
Definition at line 120 of file SelectionExprParser.cxx.
123 std::vector<std::unique_ptr<ISelectionReadAccessor>> factors;
124 factors.push_back(std::move(
root));
128 factors.push_back(std::move(
root));
131 if (factors.size() == 1) {
132 root = std::move(factors[0]);
134 root = std::make_unique<SelectionAccessorList>(std::move(factors));
136 return StatusCode::SUCCESS;
◆ m_defaultToChar
bool CP::SelectionExprParser::m_defaultToChar {} |
|
private |
◆ m_lexer
◆ m_symbol
The documentation for this class was generated from the following files:
StatusCode makeSelectionReadAccessorVar(const std::string &name, std::unique_ptr< ISelectionReadAccessor > &accessor, bool defaultToChar)
Produces a simple ISelectionReadAccessor accessing the given decoration.