Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
numeric::expression_parser::ArithmeticScanner Class Reference

#include <Arithmetic.hh>

Inheritance diagram for numeric::expression_parser::ArithmeticScanner:
Inheritance graph
[legend]

Public Member Functions

 ~ArithmeticScanner () override
 Automatically generated virtual destructor for class deriving directly from VirtualBase. More...
 
 ArithmeticScanner ()
 Constructor which adds the "standard" set of min, max and sqrt functions. More...
 
 ArithmeticScanner (bool)
 Constructor which does not add the "standard" set of min, max and sqrt functions. More...
 
void add_standard_functions ()
 Add the functions min, max and sqrt. More...
 
void treat_AND_and_OR_as_operators (bool setting)
 
void treat_NOT_as_operator (bool setting)
 
void add_variable (std::string const &name)
 
void add_function (std::string const &name, numeric::Size nargs)
 
TokenSetOP scan (std::string const &input_string)
 
- Public Member Functions inherited from utility::VirtualBase
 VirtualBase ()=default
 Default constructor. More...
 
virtual ~VirtualBase ()=default
 The virtual destructor is one of the main reasons for the VirtualBase class. More...
 
 VirtualBase (VirtualBase const &)=default
 
 VirtualBase (VirtualBase &&)=default
 
VirtualBaseoperator= (VirtualBase const &)=default
 
VirtualBaseoperator= (VirtualBase &&)=default
 

Private Member Functions

LiteralTokenOP scan_literal (std::string const &input_string) const
 
TokenOP scan_identifier (std::string const &input_string) const
 
std::string log_error () const
 print the contents of functions_ and variables_ to a string More...
 

Private Attributes

bool treat_AND_and_OR_as_operators_
 
bool treat_NOT_as_operator_ = false
 
std::map< std::string,
numeric::Size
functions_
 
std::map< std::string,
numeric::Size
variables_
 

Constructor & Destructor Documentation

numeric::expression_parser::ArithmeticScanner::~ArithmeticScanner ( )
overridedefault

Automatically generated virtual destructor for class deriving directly from VirtualBase.

Auto-generated virtual destructor

numeric::expression_parser::ArithmeticScanner::ArithmeticScanner ( )

Constructor which adds the "standard" set of min, max and sqrt functions.

References add_standard_functions().

numeric::expression_parser::ArithmeticScanner::ArithmeticScanner ( bool  )

Constructor which does not add the "standard" set of min, max and sqrt functions.

Member Function Documentation

void numeric::expression_parser::ArithmeticScanner::add_function ( std::string const &  name,
numeric::Size  nargs 
)
void numeric::expression_parser::ArithmeticScanner::add_standard_functions ( )

Add the functions min, max and sqrt.

References add_function().

Referenced by ArithmeticScanner().

void numeric::expression_parser::ArithmeticScanner::add_variable ( std::string const &  name)
std::string numeric::expression_parser::ArithmeticScanner::log_error ( ) const
private

print the contents of functions_ and variables_ to a string

print the contents of functions_ and variables_ to std error

References functions_, test.T008_Serialization::oss, and variables_.

Referenced by scan_identifier().

TokenSetOP numeric::expression_parser::ArithmeticScanner::scan ( std::string const &  input_string)
TokenOP numeric::expression_parser::ArithmeticScanner::scan_identifier ( std::string const &  input_string) const
private
LiteralTokenOP numeric::expression_parser::ArithmeticScanner::scan_literal ( std::string const &  input_string) const
private
void numeric::expression_parser::ArithmeticScanner::treat_AND_and_OR_as_operators ( bool  setting)
void numeric::expression_parser::ArithmeticScanner::treat_NOT_as_operator ( bool  setting)

Member Data Documentation

std::map< std::string, numeric::Size > numeric::expression_parser::ArithmeticScanner::functions_
private
bool numeric::expression_parser::ArithmeticScanner::treat_AND_and_OR_as_operators_
private
bool numeric::expression_parser::ArithmeticScanner::treat_NOT_as_operator_ = false
private
std::map< std::string, numeric::Size > numeric::expression_parser::ArithmeticScanner::variables_
private

The documentation for this class was generated from the following files: