Class of grammar for parsing expressions.
More...
#include <func_sketch/parser/expression_grammar.h>
|
| using | IteratorType = std::string::const_iterator |
| | Type of iterator.
|
|
|
| ExpressionGrammar () |
| | Constructor.
|
| const std::string & | error_message () const noexcept |
| | Get the error message from the last parse attempt.
|
|
void | clear_error_message () noexcept |
| | Clear the error message.
|
| ParsedExpression | parse (const std::string &str) |
| | Parse with error handling.
|
|
| template<typename T> |
| using | Rule |
| | Type of rules.
|
Class of grammar for parsing expressions.
Definition at line 34 of file expression_grammar.h.
◆ IteratorType
◆ Rule
Initial value:
boost::spirit::ascii::space_type>
std::string::const_iterator IteratorType
Type of iterator.
Type of rules.
- Template Parameters
-
| T | Type of the value of the rule. |
Definition at line 75 of file expression_grammar.h.
◆ error_message()
| const std::string & func_sketch::parser::ExpressionGrammar::error_message |
( |
| ) |
const |
|
nodiscardnoexcept |
Get the error message from the last parse attempt.
- Returns
- Error message if parsing failed, empty string otherwise.
◆ parse()
| ParsedExpression func_sketch::parser::ExpressionGrammar::parse |
( |
const std::string & | str | ) |
|
|
nodiscard |
Parse with error handling.
- Parameters
-
- Returns
- Parsed expression.
- Exceptions
-
◆ imaginary_number_rule_
| Rule<Complex> func_sketch::parser::ExpressionGrammar::imaginary_number_rule_ |
|
private |
◆ literal_rule_
◆ identifier_rule_
◆ function_call_expr_rule_
◆ atomic_value_expr_rule_
◆ value_expr_rule_
◆ factor_expr_rule_
◆ unary_expr_rule_
◆ term_expr_rule_
◆ sum_expr_rule_
◆ expr_rule_
◆ error_message_
| std::string func_sketch::parser::ExpressionGrammar::error_message_ |
|
private |
The documentation for this class was generated from the following file: