Hugintrunk
0.1
|
Namespaces | |
Operators | |
classes for operators on shunting yards operator stack | |
RPNTokens | |
classes for parsed tokens in rpn queue | |
Classes | |
class | ParseException |
internal exception class for all errors More... | |
Functions | |
void | ClearQueue (std::queue< RPNTokens::TokenBase * > &input) |
clear the queue More... | |
std::string | RemoveWhiteSpaces (const std::string &text) |
remove all whitespaces and convert to lowercase More... | |
void | InitParser () |
initialize some internal variables More... | |
void | CleanUpParser () |
clean up some internal static variables More... | |
std::string | FindOperator (const std::string &searchString) |
compare the first characters in string with supportedBinaryOperations, return longest match More... | |
bool | ConvertToRPN (const std::string &expression, const ConstantMap &constants, std::queue< RPNTokens::TokenBase * > &rpn) |
convert expression to RPN * More... | |
bool | EvaluateRPN (std::queue< RPNTokens::TokenBase * > &input, double &result) |
evaluate RPN in input More... | |
Variables | |
static std::map< std::string, Operators::OperatorBase * > | supportedBinaryOperations |
static Operators::OperatorBase * | parenthesesOperator = nullptr |
static Operators::OperatorBase * | ifOperator = nullptr |
static Operators::OperatorBase * | ifOperatorClose = nullptr |
static std::map< std::string, Operators::FunctionOperator * > | supportedFunctions |
void Parser::ShuntingYard::CleanUpParser | ( | ) |
clean up some internal static variables
Definition at line 300 of file ParseExp.cpp.
References ifOperator, ifOperatorClose, parenthesesOperator, supportedBinaryOperations, and supportedFunctions.
void Parser::ShuntingYard::ClearQueue | ( | std::queue< RPNTokens::TokenBase * > & | input | ) |
clear the queue
Definition at line 217 of file ParseExp.cpp.
Referenced by EvaluateRPN(), and Parser::ParseExpression().
bool Parser::ShuntingYard::ConvertToRPN | ( | const std::string & | expression, |
const ConstantMap & | constants, | ||
std::queue< RPNTokens::TokenBase * > & | rpn | ||
) |
convert expression to RPN *
Definition at line 349 of file ParseExp.cpp.
References Parser::ShuntingYard::Operators::OperatorBase::ComparePrecedence(), FindOperator(), ifOperator, ifOperatorClose, InitParser(), parenthesesOperator, supportedBinaryOperations, and supportedFunctions.
Referenced by Parser::ParseExpression().
bool Parser::ShuntingYard::EvaluateRPN | ( | std::queue< RPNTokens::TokenBase * > & | input, |
double & | result | ||
) |
evaluate RPN in input
Definition at line 551 of file ParseExp.cpp.
References ClearQueue(), and Parser::ShuntingYard::RPNTokens::TokenBase::evaluate().
Referenced by Parser::ParseExpression().
std::string Parser::ShuntingYard::FindOperator | ( | const std::string & | searchString | ) |
compare the first characters in string with supportedBinaryOperations, return longest match
Definition at line 330 of file ParseExp.cpp.
References supportedBinaryOperations.
Referenced by ConvertToRPN().
void Parser::ShuntingYard::InitParser | ( | ) |
initialize some internal variables
Definition at line 248 of file ParseExp.cpp.
References ifOperator, ifOperatorClose, vigra_ext::log(), M_PI, parenthesesOperator, vigra_ext::pow(), supportedBinaryOperations, and supportedFunctions.
Referenced by ConvertToRPN().
std::string Parser::ShuntingYard::RemoveWhiteSpaces | ( | const std::string & | text | ) |
remove all whitespaces and convert to lowercase
Definition at line 227 of file ParseExp.cpp.
References hugin_utils::tolower().
Referenced by Parser::ParseExpression().
|
static |
Definition at line 243 of file ParseExp.cpp.
Referenced by CleanUpParser(), ConvertToRPN(), and InitParser().
|
static |
Definition at line 244 of file ParseExp.cpp.
Referenced by CleanUpParser(), ConvertToRPN(), and InitParser().
|
static |
Definition at line 242 of file ParseExp.cpp.
Referenced by CleanUpParser(), ConvertToRPN(), and InitParser().
|
static |
Definition at line 239 of file ParseExp.cpp.
Referenced by CleanUpParser(), ConvertToRPN(), FindOperator(), and InitParser().
|
static |
Definition at line 245 of file ParseExp.cpp.
Referenced by CleanUpParser(), ConvertToRPN(), and InitParser().