Classes | |
class | ExpressionImporter |
Convenient class to mark begin of importing. More... | |
class | semantic_type |
The semantic_type class encapsulates the value in the parse tree during parsing. More... | |
Functions | |
void | ExpressionParser_yyerror (const char *errorinfo) |
Error function for parser. More... | |
int | ExpressionParserlex (void) |
static void | initParser (const App::DocumentObject *owner) |
bool | isModuleImported (PyObject *module) |
bool | isTokenAnIndentifier (const std::string &str) |
bool | isTokenAUnit (const std::string &str) |
double | num_change (char *yytext, char dez_delim, char grp_delim) |
Expression * | parse (const App::DocumentObject *owner, const char *buffer) |
Parse the expression given by buffer, and use owner as the owner of the returned expression. More... | |
ObjectIdentifier | parsePath (const App::DocumentObject *owner, const char *buffer) |
UnitExpression * | parseUnit (const App::DocumentObject *owner, const char *buffer) |
std::vector< std::tuple< int, int, std::string > > | tokenize (const std::string &str) |
Variables | |
static int | column |
static const App::DocumentObject * | DocumentObject = nullptr |
The DocumentObject that will own the expression. More... | |
static std::stack< std::string > | labels |
Label string primitive. More... | |
static int | last_column |
static std::map< std::string, FunctionExpression::Function > | registered_functions |
Registered functions. More... | |
static Expression * | ScanResult = nullptr |
The resulting expression after a successful parsing. More... | |
static bool | unitExpression = false |
True if the parsed string is a unit only. More... | |
static bool | valueExpression = false |
True if the parsed string is a full expression. More... | |
void App::ExpressionParser::ExpressionParser_yyerror | ( | const char * | errorinfo | ) |
Error function for parser.
Throws a generic Base::Exception with the parser error.
int App::ExpressionParser::ExpressionParserlex | ( | void | ) |
Referenced by isTokenAnIndentifier(), isTokenAUnit(), and tokenize().
|
static |
References App::FunctionExpression::ABS, App::FunctionExpression::ACOS, App::FunctionExpression::ASIN, App::FunctionExpression::ATAN, App::FunctionExpression::ATAN2, App::FunctionExpression::AVERAGE, App::FunctionExpression::CATH, App::FunctionExpression::CEIL, App::FunctionExpression::COS, App::FunctionExpression::COSH, App::FunctionExpression::COUNT, App::FunctionExpression::CREATE, DocumentObject, App::FunctionExpression::EXP, App::FunctionExpression::FLOOR, App::FunctionExpression::HIDDENREF, App::FunctionExpression::HREF, App::FunctionExpression::HYPOT, labels, App::FunctionExpression::LIST, App::FunctionExpression::LOG, App::FunctionExpression::LOG10, App::FunctionExpression::MAX, App::FunctionExpression::MIN, App::FunctionExpression::MINVERT, App::FunctionExpression::MOD, App::FunctionExpression::MSCALE, App::FunctionExpression::POW, registered_functions, App::FunctionExpression::ROUND, ScanResult, App::FunctionExpression::SIN, App::FunctionExpression::SINH, App::FunctionExpression::SQRT, App::FunctionExpression::STDDEV, App::FunctionExpression::STR, App::FunctionExpression::SUM, App::FunctionExpression::TAN, App::FunctionExpression::TANH, App::FunctionExpression::TRUNC, App::FunctionExpression::TUPLE, unitExpression, and valueExpression.
Referenced by parse(), and parseUnit().
Referenced by App::ObjectIdentifier::Component::get().
bool App::ExpressionParser::isTokenAnIndentifier | ( | const std::string & | str | ) |
References ExpressionParserlex().
bool App::ExpressionParser::isTokenAUnit | ( | const std::string & | str | ) |
References ExpressionParserlex().
double App::ExpressionParser::num_change | ( | char * | yytext, |
char | dez_delim, | ||
char | grp_delim | ||
) |
Expression * App::ExpressionParser::parse | ( | const App::DocumentObject * | owner, |
const char * | buffer | ||
) |
Parse the expression given by buffer, and use owner as the owner of the returned expression.
If the parser fails for some reason, and exception is thrown.
owner | The DocumentObject that will own the expression. |
buffer | The string buffer to parse. |
References initParser(), ScanResult, and valueExpression.
Referenced by App::ObjectIdentifier::parse(), App::Expression::parse(), and Spreadsheet::Cell::setContent().
ObjectIdentifier App::ExpressionParser::parsePath | ( | const App::DocumentObject * | owner, |
const char * | buffer | ||
) |
UnitExpression * App::ExpressionParser::parseUnit | ( | const App::DocumentObject * | owner, |
const char * | buffer | ||
) |
std::vector< std::tuple< int, int, std::string > > App::ExpressionParser::tokenize | ( | const std::string & | str | ) |
References ExpressionParserlex(), and last_column.
|
static |
|
static |
The DocumentObject that will own the expression.
Referenced by initParser().
|
static |
Label string primitive.
Referenced by initParser().
|
static |
Referenced by tokenize().
|
static |
Registered functions.
Referenced by initParser().
|
static |
The resulting expression after a successful parsing.
Referenced by initParser(), parse(), and parseUnit().
|
static |
True if the parsed string is a unit only.
Referenced by initParser(), and parseUnit().
|
static |
True if the parsed string is a full expression.
Referenced by initParser(), and parse().