Rosetta
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::Sizefunctions_
 
std::map< std::string, numeric::Sizevariables_
 

Constructor & Destructor Documentation

◆ ~ArithmeticScanner()

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

Automatically generated virtual destructor for class deriving directly from VirtualBase.

Auto-generated virtual destructor

◆ ArithmeticScanner() [1/2]

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

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

References add_standard_functions().

◆ ArithmeticScanner() [2/2]

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

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

Member Function Documentation

◆ add_function()

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

◆ add_standard_functions()

void numeric::expression_parser::ArithmeticScanner::add_standard_functions ( )

Add the functions min, max and sqrt.

References add_function().

Referenced by ArithmeticScanner().

◆ add_variable()

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

◆ log_error()

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().

◆ scan()

TokenSetOP numeric::expression_parser::ArithmeticScanner::scan ( std::string const &  input_string)

◆ scan_identifier()

TokenOP numeric::expression_parser::ArithmeticScanner::scan_identifier ( std::string const &  input_string) const
private

◆ scan_literal()

LiteralTokenOP numeric::expression_parser::ArithmeticScanner::scan_literal ( std::string const &  input_string) const
private

◆ treat_AND_and_OR_as_operators()

void numeric::expression_parser::ArithmeticScanner::treat_AND_and_OR_as_operators ( bool  setting)

◆ treat_NOT_as_operator()

void numeric::expression_parser::ArithmeticScanner::treat_NOT_as_operator ( bool  setting)

Member Data Documentation

◆ functions_

std::map< std::string, numeric::Size > numeric::expression_parser::ArithmeticScanner::functions_
private

◆ treat_AND_and_OR_as_operators_

bool numeric::expression_parser::ArithmeticScanner::treat_AND_and_OR_as_operators_
private

◆ treat_NOT_as_operator_

bool numeric::expression_parser::ArithmeticScanner::treat_NOT_as_operator_ = false
private

◆ variables_

std::map< std::string, numeric::Size > numeric::expression_parser::ArithmeticScanner::variables_
private

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