Parser class for trigonometric functions.
More...
#include <function_parser.hpp>
|
| static bool | parseTokenAsTrigTerm (const std::string &raw_token, std::function< double(double)> &out_term) |
| | Helper static method to parse a token as a trigonometric term.
|
| |
|
| static std::function< double(double)> | parseFunction (const std::string &function_str) |
| | Static method to parse a function string and return a callable function.
|
| |
| static bool | isPolynomial (const std::string &expression) |
| | Static method to check if the expression is a polynomial.
|
| |
| static bool | isTrigonometric (const std::string &expression) |
| | Static method to check if the expression is a trigonometric function.
|
| |
| static bool | icontains (const std::string &hay, const std::string &needle) |
| | Helper static method to check if a string contains a substring (case-insensitive).
|
| |
| static std::string | removeSpaces (const std::string &function_str) |
| | Helper static method to remove all whitespace from a string.
|
| |
| static std::vector< std::string > | splitSignTokens (const std::string &expr_no_ws) |
| | Helper static method to split an expression into tokens based on sign characters.
|
| |
| static std::pair< double, std::string > | parseOptionalCoefficient (const std::string &token) |
| | Helper static method to parse an optional coefficient from a token.
|
| |
| std::string | function_str |
| | The function string to be parsed.
|
| |
Parser class for trigonometric functions.
This class extends FunctionParserBase and implements parsing logic specific to trigonometric functions.
◆ TrigonometricParser()
| TrigonometricParser::TrigonometricParser |
( |
std::string |
function_str | ) |
|
Constructor for TrigonometricParser.
- Parameters
-
| function_str | The string representation of the trigonometric function to be parsed. |
◆ parse()
| std::function< double(double)> TrigonometricParser::parse |
( |
| ) |
|
|
overridevirtual |
Parse the trigonometric function string.
- Returns
- A std::function<double(double)> representing the parsed trigonometric function.
Implements FunctionParserBase.
◆ parseTokenAsTrigTerm()
| bool TrigonometricParser::parseTokenAsTrigTerm |
( |
const std::string & |
raw_token, |
|
|
std::function< double(double)> & |
out_term |
|
) |
| |
|
staticprivate |
Helper static method to parse a token as a trigonometric term.
- Parameters
-
| raw_token | The token string to parse. |
| out_term | A reference to store the resulting trigonometric term function. |
- Returns
- true if the token was successfully parsed as a trigonometric term, false otherwise.
◆ TrigonometricParserTester
Friend test fixture class for unit testing.
The documentation for this class was generated from the following files: