| 3630 | #endif |
| 3631 | |
| 3632 | static void initParser(const App::DocumentObject *owner) |
| 3633 | { |
| 3634 | static bool has_registered_functions = false; |
| 3635 | |
| 3636 | using namespace App::ExpressionParser; |
| 3637 | |
| 3638 | ScanResult.reset(); |
| 3639 | App::ExpressionParser::DocumentObject = owner; |
| 3640 | labels = std::stack<std::string>(); |
| 3641 | column = 0; |
| 3642 | unitExpression = valueExpression = false; |
| 3643 | |
| 3644 | if (!has_registered_functions) { |
| 3645 | registered_functions["abs"] = FunctionExpression::ABS; |
| 3646 | registered_functions["acos"] = FunctionExpression::ACOS; |
| 3647 | registered_functions["asin"] = FunctionExpression::ASIN; |
| 3648 | registered_functions["atan"] = FunctionExpression::ATAN; |
| 3649 | registered_functions["atan2"] = FunctionExpression::ATAN2; |
| 3650 | registered_functions["cath"] = FunctionExpression::CATH; |
| 3651 | registered_functions["cbrt"] = FunctionExpression::CBRT; |
| 3652 | registered_functions["ceil"] = FunctionExpression::CEIL; |
| 3653 | registered_functions["cos"] = FunctionExpression::COS; |
| 3654 | registered_functions["cosh"] = FunctionExpression::COSH; |
| 3655 | registered_functions["exp"] = FunctionExpression::EXP; |
| 3656 | registered_functions["floor"] = FunctionExpression::FLOOR; |
| 3657 | registered_functions["hypot"] = FunctionExpression::HYPOT; |
| 3658 | registered_functions["log"] = FunctionExpression::LOG; |
| 3659 | registered_functions["log10"] = FunctionExpression::LOG10; |
| 3660 | registered_functions["mod"] = FunctionExpression::MOD; |
| 3661 | registered_functions["pow"] = FunctionExpression::POW; |
| 3662 | registered_functions["round"] = FunctionExpression::ROUND; |
| 3663 | registered_functions["sin"] = FunctionExpression::SIN; |
| 3664 | registered_functions["sinh"] = FunctionExpression::SINH; |
| 3665 | registered_functions["sqrt"] = FunctionExpression::SQRT; |
| 3666 | registered_functions["tan"] = FunctionExpression::TAN; |
| 3667 | registered_functions["tanh"] = FunctionExpression::TANH; |
| 3668 | registered_functions["trunc"] = FunctionExpression::TRUNC; |
| 3669 | registered_functions["vangle"] = FunctionExpression::VANGLE; |
| 3670 | registered_functions["vcross"] = FunctionExpression::VCROSS; |
| 3671 | registered_functions["vdot"] = FunctionExpression::VDOT; |
| 3672 | registered_functions["vlinedist"] = FunctionExpression::VLINEDIST; |
| 3673 | registered_functions["vlinesegdist"] = FunctionExpression::VLINESEGDIST; |
| 3674 | registered_functions["vlineproj"] = FunctionExpression::VLINEPROJ; |
| 3675 | registered_functions["vnormalize"] = FunctionExpression::VNORMALIZE; |
| 3676 | registered_functions["vplanedist"] = FunctionExpression::VPLANEDIST; |
| 3677 | registered_functions["vplaneproj"] = FunctionExpression::VPLANEPROJ; |
| 3678 | registered_functions["vscale"] = FunctionExpression::VSCALE; |
| 3679 | registered_functions["vscalex"] = FunctionExpression::VSCALEX; |
| 3680 | registered_functions["vscaley"] = FunctionExpression::VSCALEY; |
| 3681 | registered_functions["vscalez"] = FunctionExpression::VSCALEZ; |
| 3682 | |
| 3683 | registered_functions["minvert"] = FunctionExpression::MINVERT; |
| 3684 | registered_functions["mrotate"] = FunctionExpression::MROTATE; |
| 3685 | registered_functions["mrotatex"] = FunctionExpression::MROTATEX; |
| 3686 | registered_functions["mrotatey"] = FunctionExpression::MROTATEY; |
| 3687 | registered_functions["mrotatez"] = FunctionExpression::MROTATEZ; |
| 3688 | registered_functions["mscale"] = FunctionExpression::MSCALE; |
| 3689 | registered_functions["mtranslate"] = FunctionExpression::MTRANSLATE; |