From 3f21fb64de872fba5841c4d1bca4ce6a87717ca1 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Mon, 18 Dec 2017 09:43:07 -0800 Subject: [PATCH] [muparser] Remove additional unused functions --- muparser-2.2.5/include/muParserBase.h | 8 +- muparser-2.2.5/include/muParserDef.h | 3 - muparser-2.2.5/samples/example1/example1.cpp | 1 - muparser-2.2.5/src/muParserBase.cpp | 94 -------------------- 4 files changed, 1 insertion(+), 105 deletions(-) diff --git a/muparser-2.2.5/include/muParserBase.h b/muparser-2.2.5/include/muParserBase.h index cbc3d0546..6aaa1863f 100644 --- a/muparser-2.2.5/include/muParserBase.h +++ b/muparser-2.2.5/include/muParserBase.h @@ -130,19 +130,13 @@ class ParserBase { OptionalError DefineInfixOprt(const string_type &a_strName, fun_type1 a_pOprt, int a_iPrec = prINFIX); - // Clear user defined variables, constants or functions - void ClearVar(); - void ClearFun(); + // Clear user defined constants or operators. void ClearConst(); - void ClearInfixOprt(); void ClearPostfixOprt(); - void ClearOprt(); void RemoveVar(const string_type &a_strVarName); const varmap_type &GetVar() const; const string_type &GetExpr() const; - const funmap_type &GetFunDef() const; - string_type GetVersion(EParserVersionInfo eInfo = pviFULL) const; const char_type **GetOprtDef() const; void DefineNameChars(const char_type *a_szCharset); diff --git a/muparser-2.2.5/include/muParserDef.h b/muparser-2.2.5/include/muParserDef.h index 6f2a7efc6..58cf6c5f9 100644 --- a/muparser-2.2.5/include/muParserDef.h +++ b/muparser-2.2.5/include/muParserDef.h @@ -172,9 +172,6 @@ enum ETypeCode { tpVOID = 2 ///< Undefined type. }; -//------------------------------------------------------------------------------ -enum EParserVersionInfo { pviBRIEF, pviFULL }; - //------------------------------------------------------------------------------ /** \brief Parser operator precedence values. */ enum EOprtAssociativity { oaLEFT = 0, oaRIGHT = 1, oaNONE = 2 }; diff --git a/muparser-2.2.5/samples/example1/example1.cpp b/muparser-2.2.5/samples/example1/example1.cpp index fac5e253c..c4733d1dc 100644 --- a/muparser-2.2.5/samples/example1/example1.cpp +++ b/muparser-2.2.5/samples/example1/example1.cpp @@ -149,7 +149,6 @@ void Splash() { << _T(" | Y Y \\| | /| | / __ \\_| | \\/\\___ \\ \\ ___/ | | \\/ \n"); mu::console() << _T(" |__|_| /|____/ |____| (____ /|__| /____ > \\___ >|__| \n"); mu::console() << _T(" \\/ \\/ \\/ \\/ \n"); - mu::console() << _T(" Version ") << Parser().GetVersion(pviFULL) << _T("\n"); mu::console() << _T(" (C) 2015 Ingo Berg\n"); } diff --git a/muparser-2.2.5/src/muParserBase.cpp b/muparser-2.2.5/src/muParserBase.cpp index e0dc8ff0d..c167f2f9f 100644 --- a/muparser-2.2.5/src/muParserBase.cpp +++ b/muparser-2.2.5/src/muParserBase.cpp @@ -148,51 +148,6 @@ void ParserBase::ReInit() const { //--------------------------------------------------------------------------- void ParserBase::OnDetectVar(string_type * /*pExpr*/, int & /*nStart*/, int & /*nEnd*/) {} -//--------------------------------------------------------------------------- -/** \brief Returns the version of muparser. - \param eInfo A flag indicating whether the full version info should be - returned or not. - - Format is as follows: "MAJOR.MINOR (COMPILER_FLAGS)" The COMPILER_FLAGS - are returned only if eInfo==pviFULL. -*/ -string_type ParserBase::GetVersion(EParserVersionInfo eInfo) const { - stringstream_type ss; - - ss << MUP_VERSION; - - if (eInfo == pviFULL) { - ss << _T(" (") << MUP_VERSION_DATE; - ss << std::dec << _T("; ") << sizeof(void *) * 8 << _T("BIT"); - -#ifdef _DEBUG - ss << _T("; DEBUG"); -#else - ss << _T("; RELEASE"); -#endif - -#ifdef _UNICODE - ss << _T("; UNICODE"); -#else -#ifdef _MBCS - ss << _T("; MBCS"); -#else - ss << _T("; ASCII"); -#endif -#endif - -#if defined(MUP_MATH_EXCEPTIONS) - ss << _T("; MATHEXC"); -//#else -// ss << _T("; NO_MATHEXC"); -#endif - - ss << _T(")"); - } - - return ss.str(); -} - //--------------------------------------------------------------------------- /** \brief Add a value parsing function. @@ -542,18 +497,6 @@ EOprtAssociativity ParserBase::GetOprtAssociativity(const token_type &a_Tok) con } } -//--------------------------------------------------------------------------- -/** \brief Return prototypes of all parser functions. - \return #m_FunDef - \sa FunProt - - The return type is a map of the public type #funmap_type containing the prototype - definitions for all numerical parser functions. String functions are not part of - this map. The Prototype definition is encapsulated in objects of the class FunProt - one per parser function each associated with function names via a map construct. -*/ -const funmap_type &ParserBase::GetFunDef() const { return m_FunDef; } - //--------------------------------------------------------------------------- /** \brief Retrieve the formula. */ const string_type &ParserBase::GetExpr() const { return m_pTokenReader->GetExpr(); } @@ -1240,16 +1183,6 @@ ParserError ParserBase::Error(EErrorCodes a_iErrc, int a_iPos, const string_type return ParserError(a_iErrc, a_sTok, m_pTokenReader->GetExpr(), a_iPos); } -//------------------------------------------------------------------------------ -/** \brief Clear all user defined variables. - - Resets the parser to string parsing mode by calling #ReInit. -*/ -void ParserBase::ClearVar() { - m_VarDef.clear(); - ReInit(); -} - //------------------------------------------------------------------------------ /** \brief Remove a variable from internal storage. @@ -1263,15 +1196,6 @@ void ParserBase::RemoveVar(const string_type &a_strVarName) { } } -//------------------------------------------------------------------------------ -/** \brief Clear all functions. - \post Resets the parser to string parsing mode. -*/ -void ParserBase::ClearFun() { - m_FunDef.clear(); - ReInit(); -} - //------------------------------------------------------------------------------ /** \brief Clear all user defined constants. @@ -1293,24 +1217,6 @@ void ParserBase::ClearPostfixOprt() { ReInit(); } -//------------------------------------------------------------------------------ -/** \brief Clear all user defined binary operators. - \post Resets the parser to string parsing mode. -*/ -void ParserBase::ClearOprt() { - m_OprtDef.clear(); - ReInit(); -} - -//------------------------------------------------------------------------------ -/** \brief Clear the user defined Prefix operators. - \post Resets the parser to string parser mode. -*/ -void ParserBase::ClearInfixOprt() { - m_InfixOprtDef.clear(); - ReInit(); -} - //--------------------------------------------------------------------------- /** \brief Enable the dumping of bytecode and stack content on the console. \param bDumpCmd Flag to enable dumping of the current bytecode to the console.