MCPcopy Create free account
hub / github.com/SatDump/SatDump / ParseString

Method ParseString

src-core/libs/muparser/muParserBase.cpp:1525–1548  ·  view source on GitHub ↗

--------------------------------------------------------------------------- \brief One of the two main parse functions. \sa ParseCmdCode(...) Parse expression from input string. Perform syntax checking and create bytecode. After parsing the string and creating the bytecode the function pointer #m_pParseFormula will be changed to the second parse routine the uses bytecode instead of

Source from the content-addressed store, hash-verified

1523 uses bytecode instead of string parsing.
1524 */
1525 value_type ParserBase::ParseString() const
1526 {
1527 try
1528 {
1529 CreateRPN();
1530
1531 if (m_vRPN.GetSize() == 2)
1532 {
1533 m_pParseFormula = &ParserBase::ParseCmdCodeShort;
1534 m_vStackBuffer[1] = (this->*m_pParseFormula)();
1535 return m_vStackBuffer[1];
1536 }
1537 else
1538 {
1539 m_pParseFormula = &ParserBase::ParseCmdCode;
1540 return (this->*m_pParseFormula)();
1541 }
1542 }
1543 catch (ParserError& exc)
1544 {
1545 exc.SetFormula(m_pTokenReader->GetExpr());
1546 throw;
1547 }
1548 }
1549
1550 //---------------------------------------------------------------------------
1551 /** \brief Create an error containing the parse error position.

Callers

nothing calls this directly

Calls 2

GetSizeMethod · 0.45
SetFormulaMethod · 0.45

Tested by

no test coverage detected