Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Macros | Typedefs | Functions | Variables
ParseExp.cpp File Reference

functions to parse expressions from strings More...

#include <exception>
#include <stack>
#include <queue>
#include <map>
#include <functional>
#include <cmath>
#include "ParseExp.h"
#include "hugin_utils/utils.h"
#include <panodata/ImageVariableTranslate.h>
#include "panodata/image_variables.h"
Include dependency graph for ParseExp.cpp:

Go to the source code of this file.

Classes

class  Parser::ShuntingYard::ParseException
 internal exception class for all errors More...
 
class  Parser::ShuntingYard::RPNTokens::TokenBase
 abstract base class More...
 
class  Parser::ShuntingYard::RPNTokens::NumericToken
 single numeric token on rpn queue More...
 
class  Parser::ShuntingYard::RPNTokens::FunctionToken
 unary operator or function on rpn queue More...
 
class  Parser::ShuntingYard::RPNTokens::BinaryToken
 binary operator on rpn stack More...
 
class  Parser::ShuntingYard::RPNTokens::IfToken
 if operator on rpn stack More...
 
class  Parser::ShuntingYard::Operators::OperatorBase
 base class for operator on shunting yards operator stack More...
 
class  Parser::ShuntingYard::Operators::FunctionOperator
 function or unary operator on shunting yards operator stack More...
 
class  Parser::ShuntingYard::Operators::BinaryOperator
 binary operator on stack on shunting yards operator stack More...
 
class  Parser::ShuntingYard::Operators::IfOperator
 if operator on operator stack, used only for ':' token More...
 

Namespaces

 Parser
 
 Parser::ShuntingYard
 
 Parser::ShuntingYard::RPNTokens
 classes for parsed tokens in rpn queue
 
 Parser::ShuntingYard::Operators
 classes for operators on shunting yards operator stack
 

Macros

#define _USE_MATH_DEFINES
 

Typedefs

typedef std::map< std::string,
double > 
Parser::ConstantMap
 

Functions

void Parser::ShuntingYard::ClearQueue (std::queue< RPNTokens::TokenBase * > &input)
 clear the queue More...
 
std::string Parser::ShuntingYard::RemoveWhiteSpaces (const std::string &text)
 remove all whitespaces and convert to lowercase More...
 
void Parser::ShuntingYard::InitParser ()
 initialize some internal variables More...
 
void Parser::ShuntingYard::CleanUpParser ()
 clean up some internal static variables More...
 
std::string Parser::ShuntingYard::FindOperator (const std::string &searchString)
 compare the first characters in string with supportedBinaryOperations, return longest match More...
 
bool Parser::ShuntingYard::ConvertToRPN (const std::string &expression, const ConstantMap &constants, std::queue< RPNTokens::TokenBase * > &rpn)
 convert expression to RPN * More...
 
bool Parser::ShuntingYard::EvaluateRPN (std::queue< RPNTokens::TokenBase * > &input, double &result)
 evaluate RPN in input More...
 
bool Parser::ParseExpression (const std::string &expression, double &result, const ConstantMap &constants, std::string &error)
 parse complete expression in 2 steps More...
 
void Parser::ParseSingleVar (ParseVarVec &varVec, const std::string &s, std::ostream &errorStream)
 
void Parser::ParseVariableString (ParseVarVec &parseVec, const std::string &input, std::ostream &errorStream, void(*func)(ParseVarVec &, const std::string &, std::ostream &))
 parse complete variables string More...
 
bool Parser::UpdateSingleVar (HuginBase::Panorama &pano, const Parser::ParseVar &parseVar, const Parser::ConstantMap &constants, size_t imgNr, std::ostream &statusStream, std::ostream &errorStream)
 
bool Parser::CalculateConstant (HuginBase::Panorama &pano, const Parser::ParseVar &parseVar, Parser::ConstantMap &constants, std::ostream &statusStream, std::ostream &errorStream)
 

Variables

static std::map< std::string,
Operators::OperatorBase * > 
Parser::ShuntingYard::supportedBinaryOperations
 
static Operators::OperatorBase * Parser::ShuntingYard::parenthesesOperator = nullptr
 
static Operators::OperatorBase * Parser::ShuntingYard::ifOperator = nullptr
 
static Operators::OperatorBase * Parser::ShuntingYard::ifOperatorClose = nullptr
 
static std::map< std::string,
Operators::FunctionOperator * > 
Parser::ShuntingYard::supportedFunctions
 

Detailed Description

functions to parse expressions from strings

Author
T. Modes

Definition in file ParseExp.cpp.

Macro Definition Documentation

#define _USE_MATH_DEFINES

Definition at line 33 of file ParseExp.cpp.