Rosetta
Classes | Typedefs | Enumerations | Functions
numeric::expression_parser Namespace Reference

Classes

class  Token
 
class  LiteralToken
 
class  VariableToken
 
class  FunctionToken
 
class  SimpleToken
 
class  TokenSet
 
class  ArithmeticScanner
 
class  BooleanExpressionScanner
 
class  ArithmeticASTNode
 Base class for Abstract Syntax Tree (AST) for the simple Arithmetic language defined here. More...
 
class  ArithmeticASTExpression
 
class  ArithmeticASTFunction
 
class  ArithmeticASTTerm
 
class  ArithmeticASTFactor
 
class  ArithmeticASTOrClause
 
class  ArithmeticASTAndClause
 
class  ArithmeticASTValue
 either a variable or a literal. More...
 
class  ArithmeticASTRestTerm
 
class  ArithmeticASTRestOrClause
 
class  ArithmeticASTRestAndClause
 
class  ArithmeticASTRestExpression
 
class  ASTVisitor
 Double-dispatch visitor pattern for abstract syntax tree. More...
 
class  ASTPrinter
 Traverse the AST and print it to standard out. More...
 
class  ExpressionCreator
 Class to traverse the abstract syntax tree produced by the parsing of a properly-formed string in the Arithmetic expression language. Produces an Expression tree capable of performing arithmetic. Connects the "variable" nodes in this tree to the owning WrapperOptEMultifunc so that their values can be retrieved during expression evaluation inside the WrapperOptEMultifunc functor. More...
 
class  SimpleExpressionCreator
 
class  BooleanExpressionCreator
 
class  Expression
 Pure virtual base class to define arbitrary expressions for scripting arithmetic operations (e.g. addition and multipliction). More...
 
class  LiteralExpression
 
class  VariableExpression
 
class  UnaryExpression
 
class  BinaryExpression
 
class  NaryExpression
 
class  SquarerootExpression
 
class  AbsoluteValueExpression
 
class  AddExpression
 
class  SubtractExpression
 
class  MultiplyExpression
 
class  DivideExpression
 
class  MaxExpression
 
class  MinExpression
 
class  MetaMaxExpression
 Evaluates ee1 when e1 is larger than e2; evaluates ee2 otherwise. More...
 
class  MetaMinExpression
 Evaluates ee1 when e1 is less than e2; evaluates ee2 otherwise. More...
 
class  EqualsExpression
 
class  GT_Expression
 Greater Than. More...
 
class  GTE_Expression
 Greater Than or Equal To. More...
 
class  LT_Expression
 Less Than. More...
 
class  LTE_Expression
 Less Than or Equal To. More...
 
class  AndExpression
 
class  OrExpression
 
class  NotExpression
 
class  ITEExpression
 

Typedefs

typedef utility::pointer::shared_ptr< TokenTokenOP
 
typedef utility::pointer::shared_ptr< Token const > TokenCOP
 
typedef utility::pointer::shared_ptr< LiteralTokenLiteralTokenOP
 
typedef utility::pointer::shared_ptr< LiteralToken const > LiteralTokenCOP
 
typedef utility::pointer::shared_ptr< VariableTokenVariableTokenOP
 
typedef utility::pointer::shared_ptr< VariableToken const > VariableTokenCOP
 
typedef utility::pointer::shared_ptr< FunctionTokenFunctionTokenOP
 
typedef utility::pointer::shared_ptr< FunctionToken const > FunctionTokenCOP
 
typedef utility::pointer::shared_ptr< SimpleTokenSimpleTokenOP
 
typedef utility::pointer::shared_ptr< SimpleToken const > SimpleTokenCOP
 
typedef utility::pointer::shared_ptr< TokenSetTokenSetOP
 
typedef utility::pointer::shared_ptr< TokenSet const > TokenSetCOP
 
typedef utility::pointer::shared_ptr< ArithmeticScannerArithmeticScannerOP
 
typedef utility::pointer::shared_ptr< ArithmeticScanner const > ArithmeticScannerCOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTNodeArithmeticASTNodeOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTNode const > ArithmeticASTNodeCOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTExpressionArithmeticASTExpressionOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTExpression const > ArithmeticASTExpressionCOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTFunctionArithmeticASTFunctionOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTFunction const > ArithmeticASTFunctionCOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTTermArithmeticASTTermOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTTerm const > ArithmeticASTTermCOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTFactorArithmeticASTFactorOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTFactor const > ArithmeticASTFactorCOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTOrClauseArithmeticASTOrClauseOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTOrClause const > ArithmeticASTOrClauseCOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTAndClauseArithmeticASTAndClauseOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTAndClause const > ArithmeticASTAndClauseCOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTValueArithmeticASTValueOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTValue const > ArithmeticASTValueCOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTRestTermArithmeticASTRestTermOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTRestTerm const > ArithmeticASTRestTermCOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTRestAndClauseArithmeticASTRestAndClauseOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTRestAndClause const > ArithmeticASTRestAndClauseCOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTRestOrClauseArithmeticASTRestOrClauseOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTRestOrClause const > ArithmeticASTRestOrClauseCOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTRestExpressionArithmeticASTRestExpressionOP
 
typedef utility::pointer::shared_ptr< ArithmeticASTRestExpression const > ArithmeticASTRestExpressionCOP
 
typedef utility::pointer::shared_ptr< ASTVisitorASTVisitorOP
 
typedef utility::pointer::shared_ptr< ASTVisitor const > ASTVisitorCOP
 
typedef utility::pointer::shared_ptr< ASTPrinterASTPrinterOP
 
typedef utility::pointer::shared_ptr< ASTPrinter const > ASTPrinterCOP
 
typedef utility::pointer::shared_ptr< ExpressionExpressionOP
 
typedef utility::pointer::shared_ptr< Expression const > ExpressionCOP
 
typedef utility::pointer::shared_ptr< LiteralExpressionLiteralExpressionOP
 
typedef utility::pointer::shared_ptr< LiteralExpression const > LiteralExpressionCOP
 
typedef utility::pointer::shared_ptr< VariableExpressionVariableExpressionOP
 
typedef utility::pointer::shared_ptr< VariableExpression const > VariableExpressionCOP
 
typedef utility::pointer::shared_ptr< UnaryExpressionUnaryExpressionOP
 
typedef utility::pointer::shared_ptr< UnaryExpression const > UnaryExpressionCOP
 
typedef utility::pointer::shared_ptr< BinaryExpressionBinaryExpressionOP
 
typedef utility::pointer::shared_ptr< BinaryExpression const > BinaryExpressionCOP
 
typedef utility::pointer::shared_ptr< SquarerootExpressionSquarerootExpressionOP
 
typedef utility::pointer::shared_ptr< SquarerootExpression const > SquarerootExpressionCOP
 
typedef utility::pointer::shared_ptr< AddExpressionAddExpressionOP
 
typedef utility::pointer::shared_ptr< AddExpression const > AddExpressionCOP
 
typedef utility::pointer::shared_ptr< SubtractExpressionSubtractExpressionOP
 
typedef utility::pointer::shared_ptr< SubtractExpression const > SubtractExpressionCOP
 
typedef utility::pointer::shared_ptr< MultiplyExpressionMultiplyExpressionOP
 
typedef utility::pointer::shared_ptr< MultiplyExpression const > MultiplyExpressionCOP
 
typedef utility::pointer::shared_ptr< DivideExpressionDivideExpressionOP
 
typedef utility::pointer::shared_ptr< DivideExpression const > DivideExpressionCOP
 
typedef utility::pointer::shared_ptr< MaxExpressionMaxExpressionOP
 
typedef utility::pointer::shared_ptr< MaxExpression const > MaxExpressionCOP
 
typedef utility::pointer::shared_ptr< MinExpressionMinExpressionOP
 
typedef utility::pointer::shared_ptr< MinExpression const > MinExpressionCOP
 
typedef utility::pointer::shared_ptr< MetaMaxExpressionMetaMaxExpressionOP
 
typedef utility::pointer::shared_ptr< MetaMaxExpression const > MetaMaxExpressionCOP
 
typedef utility::pointer::shared_ptr< MetaMinExpressionMetaMinExpressionOP
 
typedef utility::pointer::shared_ptr< MetaMinExpression const > MetaMinExpressionCOP
 

Enumerations

enum  TokenType {
  INVALID_TOKEN_TYPE , LITERAL , VARIABLE , FUNCTION ,
  COMMA , LEFT_PAREN , RIGHT_PAREN , PLUS_SYMBOL ,
  SUBTRACT_SYMBOL , MULTIPLY_SYMBOL , DIVIDE_SYMBOL , AND_SYMBOL ,
  OR_SYMBOL , NOT_SYMBOL
}
 

Functions

std::string token_type_name (TokenType tt)
 
bool is_numeral (char c)
 
bool is_letter (char c)
 
std::string to_uppercase (std::string const &s)
 
ExpressionCOP parse_string_to_expression (std::string const &input_string)
 
ExpressionCOP parse_string_to_boolean_expression (std::string const &input_string)
 

Typedef Documentation

◆ AddExpressionCOP

typedef utility::pointer::shared_ptr< AddExpression const > numeric::expression_parser::AddExpressionCOP

◆ AddExpressionOP

typedef utility::pointer::shared_ptr< AddExpression > numeric::expression_parser::AddExpressionOP

◆ ArithmeticASTAndClauseCOP

◆ ArithmeticASTAndClauseOP

◆ ArithmeticASTExpressionCOP

◆ ArithmeticASTExpressionOP

◆ ArithmeticASTFactorCOP

typedef utility::pointer::shared_ptr< ArithmeticASTFactor const > numeric::expression_parser::ArithmeticASTFactorCOP

◆ ArithmeticASTFactorOP

◆ ArithmeticASTFunctionCOP

typedef utility::pointer::shared_ptr< ArithmeticASTFunction const > numeric::expression_parser::ArithmeticASTFunctionCOP

◆ ArithmeticASTFunctionOP

◆ ArithmeticASTNodeCOP

typedef utility::pointer::shared_ptr< ArithmeticASTNode const > numeric::expression_parser::ArithmeticASTNodeCOP

◆ ArithmeticASTNodeOP

typedef utility::pointer::shared_ptr< ArithmeticASTNode > numeric::expression_parser::ArithmeticASTNodeOP

◆ ArithmeticASTOrClauseCOP

typedef utility::pointer::shared_ptr< ArithmeticASTOrClause const > numeric::expression_parser::ArithmeticASTOrClauseCOP

◆ ArithmeticASTOrClauseOP

◆ ArithmeticASTRestAndClauseCOP

◆ ArithmeticASTRestAndClauseOP

◆ ArithmeticASTRestExpressionCOP

◆ ArithmeticASTRestExpressionOP

◆ ArithmeticASTRestOrClauseCOP

◆ ArithmeticASTRestOrClauseOP

◆ ArithmeticASTRestTermCOP

typedef utility::pointer::shared_ptr< ArithmeticASTRestTerm const > numeric::expression_parser::ArithmeticASTRestTermCOP

◆ ArithmeticASTRestTermOP

◆ ArithmeticASTTermCOP

typedef utility::pointer::shared_ptr< ArithmeticASTTerm const > numeric::expression_parser::ArithmeticASTTermCOP

◆ ArithmeticASTTermOP

typedef utility::pointer::shared_ptr< ArithmeticASTTerm > numeric::expression_parser::ArithmeticASTTermOP

◆ ArithmeticASTValueCOP

typedef utility::pointer::shared_ptr< ArithmeticASTValue const > numeric::expression_parser::ArithmeticASTValueCOP

◆ ArithmeticASTValueOP

◆ ArithmeticScannerCOP

typedef utility::pointer::shared_ptr< ArithmeticScanner const > numeric::expression_parser::ArithmeticScannerCOP

◆ ArithmeticScannerOP

typedef utility::pointer::shared_ptr< ArithmeticScanner > numeric::expression_parser::ArithmeticScannerOP

◆ ASTPrinterCOP

typedef utility::pointer::shared_ptr< ASTPrinter const > numeric::expression_parser::ASTPrinterCOP

◆ ASTPrinterOP

typedef utility::pointer::shared_ptr< ASTPrinter > numeric::expression_parser::ASTPrinterOP

◆ ASTVisitorCOP

typedef utility::pointer::shared_ptr< ASTVisitor const > numeric::expression_parser::ASTVisitorCOP

◆ ASTVisitorOP

typedef utility::pointer::shared_ptr< ASTVisitor > numeric::expression_parser::ASTVisitorOP

◆ BinaryExpressionCOP

typedef utility::pointer::shared_ptr< BinaryExpression const > numeric::expression_parser::BinaryExpressionCOP

◆ BinaryExpressionOP

typedef utility::pointer::shared_ptr< BinaryExpression > numeric::expression_parser::BinaryExpressionOP

◆ DivideExpressionCOP

typedef utility::pointer::shared_ptr< DivideExpression const > numeric::expression_parser::DivideExpressionCOP

◆ DivideExpressionOP

typedef utility::pointer::shared_ptr< DivideExpression > numeric::expression_parser::DivideExpressionOP

◆ ExpressionCOP

typedef utility::pointer::shared_ptr< Expression const > numeric::expression_parser::ExpressionCOP

◆ ExpressionOP

typedef utility::pointer::shared_ptr< Expression > numeric::expression_parser::ExpressionOP

◆ FunctionTokenCOP

typedef utility::pointer::shared_ptr< FunctionToken const > numeric::expression_parser::FunctionTokenCOP

◆ FunctionTokenOP

typedef utility::pointer::shared_ptr< FunctionToken > numeric::expression_parser::FunctionTokenOP

◆ LiteralExpressionCOP

typedef utility::pointer::shared_ptr< LiteralExpression const > numeric::expression_parser::LiteralExpressionCOP

◆ LiteralExpressionOP

typedef utility::pointer::shared_ptr< LiteralExpression > numeric::expression_parser::LiteralExpressionOP

◆ LiteralTokenCOP

typedef utility::pointer::shared_ptr< LiteralToken const > numeric::expression_parser::LiteralTokenCOP

◆ LiteralTokenOP

typedef utility::pointer::shared_ptr< LiteralToken > numeric::expression_parser::LiteralTokenOP

◆ MaxExpressionCOP

typedef utility::pointer::shared_ptr< MaxExpression const > numeric::expression_parser::MaxExpressionCOP

◆ MaxExpressionOP

typedef utility::pointer::shared_ptr< MaxExpression > numeric::expression_parser::MaxExpressionOP

◆ MetaMaxExpressionCOP

typedef utility::pointer::shared_ptr< MetaMaxExpression const > numeric::expression_parser::MetaMaxExpressionCOP

◆ MetaMaxExpressionOP

typedef utility::pointer::shared_ptr< MetaMaxExpression > numeric::expression_parser::MetaMaxExpressionOP

◆ MetaMinExpressionCOP

typedef utility::pointer::shared_ptr< MetaMinExpression const > numeric::expression_parser::MetaMinExpressionCOP

◆ MetaMinExpressionOP

typedef utility::pointer::shared_ptr< MetaMinExpression > numeric::expression_parser::MetaMinExpressionOP

◆ MinExpressionCOP

typedef utility::pointer::shared_ptr< MinExpression const > numeric::expression_parser::MinExpressionCOP

◆ MinExpressionOP

typedef utility::pointer::shared_ptr< MinExpression > numeric::expression_parser::MinExpressionOP

◆ MultiplyExpressionCOP

typedef utility::pointer::shared_ptr< MultiplyExpression const > numeric::expression_parser::MultiplyExpressionCOP

◆ MultiplyExpressionOP

◆ SimpleTokenCOP

typedef utility::pointer::shared_ptr< SimpleToken const > numeric::expression_parser::SimpleTokenCOP

◆ SimpleTokenOP

typedef utility::pointer::shared_ptr< SimpleToken > numeric::expression_parser::SimpleTokenOP

◆ SquarerootExpressionCOP

typedef utility::pointer::shared_ptr< SquarerootExpression const > numeric::expression_parser::SquarerootExpressionCOP

◆ SquarerootExpressionOP

◆ SubtractExpressionCOP

typedef utility::pointer::shared_ptr< SubtractExpression const > numeric::expression_parser::SubtractExpressionCOP

◆ SubtractExpressionOP

◆ TokenCOP

typedef utility::pointer::shared_ptr< Token const > numeric::expression_parser::TokenCOP

◆ TokenOP

typedef utility::pointer::shared_ptr< Token > numeric::expression_parser::TokenOP

◆ TokenSetCOP

typedef utility::pointer::shared_ptr< TokenSet const > numeric::expression_parser::TokenSetCOP

◆ TokenSetOP

typedef utility::pointer::shared_ptr< TokenSet > numeric::expression_parser::TokenSetOP

◆ UnaryExpressionCOP

typedef utility::pointer::shared_ptr< UnaryExpression const > numeric::expression_parser::UnaryExpressionCOP

◆ UnaryExpressionOP

typedef utility::pointer::shared_ptr< UnaryExpression > numeric::expression_parser::UnaryExpressionOP

◆ VariableExpressionCOP

typedef utility::pointer::shared_ptr< VariableExpression const > numeric::expression_parser::VariableExpressionCOP

◆ VariableExpressionOP

◆ VariableTokenCOP

typedef utility::pointer::shared_ptr< VariableToken const > numeric::expression_parser::VariableTokenCOP

◆ VariableTokenOP

typedef utility::pointer::shared_ptr< VariableToken > numeric::expression_parser::VariableTokenOP

Enumeration Type Documentation

◆ TokenType

Enumerator
INVALID_TOKEN_TYPE 
LITERAL 
VARIABLE 
FUNCTION 
COMMA 
LEFT_PAREN 
RIGHT_PAREN 
PLUS_SYMBOL 
SUBTRACT_SYMBOL 
MULTIPLY_SYMBOL 
DIVIDE_SYMBOL 
AND_SYMBOL 
OR_SYMBOL 
NOT_SYMBOL 

Function Documentation

◆ is_letter()

bool numeric::expression_parser::is_letter ( char  c)

◆ is_numeral()

bool numeric::expression_parser::is_numeral ( char  c)

◆ parse_string_to_boolean_expression()

ExpressionCOP numeric::expression_parser::parse_string_to_boolean_expression ( std::string const &  input_string)

◆ parse_string_to_expression()

ExpressionCOP numeric::expression_parser::parse_string_to_expression ( std::string const &  input_string)

◆ to_uppercase()

std::string numeric::expression_parser::to_uppercase ( std::string const &  s)

◆ token_type_name()

std::string numeric::expression_parser::token_type_name ( TokenType  tt)