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< boost::tuple< int, int, std::string > > | tokenize (const std::string &str) |
Variables | |
static int | column |
static const App::DocumentObject * | DocumentObject = 0 |
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 = 0 |
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... | |
Function Documentation
◆ ExpressionParser_yyerror()
void App::ExpressionParser::ExpressionParser_yyerror | ( | const char * | errorinfo | ) |
Error function for parser.
Throws a generic Base::Exception with the parser error.
References ExpressionParser_yyerror().
Referenced by ExpressionParser_yyerror().
◆ ExpressionParserlex()
int App::ExpressionParser::ExpressionParserlex | ( | void | ) |
Referenced by isTokenAnIndentifier(), isTokenAUnit(), and tokenize().
◆ initParser()
|
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::HYPOT, initParser(), 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::Expression::owner, App::FunctionExpression::POW, registered_functions, App::FunctionExpression::ROUND, ScanResult, App::FunctionExpression::SIN, App::FunctionExpression::SINH, App::FunctionExpression::SQRT, App::FunctionExpression::STDDEV, App::FunctionExpression::SUM, App::FunctionExpression::TAN, App::FunctionExpression::TANH, App::FunctionExpression::TRUNC, App::FunctionExpression::TUPLE, unitExpression, and valueExpression.
Referenced by initParser(), parse(), and parseUnit().
◆ isModuleImported()
References isModuleImported().
Referenced by App::ObjectIdentifier::Component::get(), and isModuleImported().
◆ isTokenAnIndentifier()
bool App::ExpressionParser::isTokenAnIndentifier | ( | const std::string & | str | ) |
References ExpressionParserlex().
◆ isTokenAUnit()
bool App::ExpressionParser::isTokenAUnit | ( | const std::string & | str | ) |
References ExpressionParserlex().
◆ num_change()
double App::ExpressionParser::num_change | ( | char * | yytext, |
char | dez_delim, | ||
char | grp_delim | ||
) |
◆ parse()
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.
- Parameters
-
owner The DocumentObject that will own the expression. buffer The string buffer to parse.
- Returns
- A pointer to an expression.
References initParser(), App::Expression::owner, ScanResult, and valueExpression.
Referenced by App::Expression::parse(), App::ObjectIdentifier::parse(), Spreadsheet::Cell::setContent(), and App::DocumentObjectPy::setExpression().
◆ parsePath()
ObjectIdentifier App::ExpressionParser::parsePath | ( | const App::DocumentObject * | owner, |
const char * | buffer | ||
) |
◆ parseUnit()
UnitExpression * App::ExpressionParser::parseUnit | ( | const App::DocumentObject * | owner, |
const char * | buffer | ||
) |
◆ tokenize()
std::vector< boost::tuple< int, int, std::string > > App::ExpressionParser::tokenize | ( | const std::string & | str | ) |
References ExpressionParserlex(), last_column, and tokenize().
Referenced by tokenize().
Variable Documentation
◆ column
|
static |
◆ DocumentObject
|
static |
The DocumentObject that will own the expression.
Referenced by initParser().
◆ labels
|
static |
Label string primitive.
Referenced by initParser().
◆ last_column
|
static |
Referenced by tokenize().
◆ registered_functions
|
static |
Registered functions.
Referenced by initParser().
◆ ScanResult
|
static |
The resulting expression after a successful parsing.
Referenced by initParser(), parse(), and parseUnit().
◆ unitExpression
|
static |
True if the parsed string is a unit only.
Referenced by initParser(), and parseUnit().
◆ valueExpression
|
static |
True if the parsed string is a full expression.
Referenced by initParser(), and parse().