Hugin trunk 0.1
Loading...
Searching...
No Matches
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

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

Macros

#define _USE_MATH_DEFINES
 

Typedefs

typedef std::map< std::string, doubleParser::ConstantMap
 

Functions

void Parser::ShuntingYard::ClearQueue (std::queue< RPNTokens::TokenBase * > &input)
 clear the queue
 
std::string Parser::ShuntingYard::RemoveWhiteSpaces (const std::string &text)
 remove all whitespaces and convert to lowercase
 
void Parser::ShuntingYard::InitParser ()
 initialize some internal variables
 
void Parser::ShuntingYard::CleanUpParser ()
 clean up some internal static variables
 
std::string Parser::ShuntingYard::FindOperator (const std::string &searchString)
 compare the first characters in string with supportedBinaryOperations, return longest match
 
bool Parser::ShuntingYard::ConvertToRPN (const std::string &expression, const ConstantMap &constants, std::queue< RPNTokens::TokenBase * > &rpn)
 convert expression to RPN *
 
bool Parser::ShuntingYard::EvaluateRPN (std::queue< RPNTokens::TokenBase * > &input, double &result)
 evaluate RPN in input
 
bool Parser::ParseExpression (const std::string &expression, double &result, const ConstantMap &constants, std::string &error)
 parse complete expression in 2 steps
 
bool Parser::ParseVarNumber (const std::string &s, Parser::ParseVar &var)
 parse string s and store result in ParseVar var
 
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
 
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)
 
void Parser::PanoParseExpression (HuginBase::Panorama &pano, const std::string &expression, std::ostream &statusStream=std::cout, std::ostream &errorStream=std::cerr)
 parses the given expression and apply the changes to the Panorama
 

Variables

static std::map< std::string, Operators::OperatorBase * > Parser::ShuntingYard::supportedBinaryOperations
 
static Operators::OperatorBaseParser::ShuntingYard::parenthesesOperator = nullptr
 
static Operators::OperatorBaseParser::ShuntingYard::ifOperator = nullptr
 
static Operators::OperatorBaseParser::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

◆ _USE_MATH_DEFINES

#define _USE_MATH_DEFINES

Definition at line 33 of file ParseExp.cpp.