List of all members | Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
utl::MathExpressionGrammar Struct Reference

#include <MathExpressionGrammar.h>

Inheritance diagram for utl::MathExpressionGrammar:
Inheritance graph
[legend]

Classes

struct  definition
 Boost spirit definition template (Read Boost Spirit documentation) More...
 
struct  SAssignmentClosure
 Assignment closure set. More...
 
struct  SStringClosure
 String closure set. More...
 
struct  SValueClosure
 Value closure set. More...
 

Public Member Functions

int GetNVariables () const
 
double GetVariable (const std::string &name) const
 
SymbolTableGetVariables ()
 
const SymbolTableGetVariables () const
 
bool HasVariable (const std::string &name) const
 
 MathExpressionGrammar (double &result, const utl::SymbolTable &sym)
 
 MathExpressionGrammar (double &result, const utl::SymbolTable &sym, utl::SymbolTable &vars)
 
void SetResult (double &v) const
 
void SetVariable (const std::string &name, const double &v)
 

Protected Member Functions

 ERROR (err)
 
void SaveResult (const double val) const
 
throw XMLParseException (err)
 

Protected Attributes

double const
 Function which searches in the symbol table. More...
 
const std::string err
 
const auto it1 = symbols.find(symbol)
 
 return
 
return it1 second
 
return it2 second
 

Private Attributes

double * fResult = nullptr
 
const SymbolTablefSymbols
 
SymbolTable fVariables
 

Detailed Description

Definition at line 68 of file MathExpressionGrammar.h.

Constructor & Destructor Documentation

utl::MathExpressionGrammar::MathExpressionGrammar ( double &  result,
const utl::SymbolTable sym 
)
inline

Definition at line 70 of file MathExpressionGrammar.h.

utl::MathExpressionGrammar::MathExpressionGrammar ( double &  result,
const utl::SymbolTable sym,
utl::SymbolTable vars 
)
inline

Definition at line 73 of file MathExpressionGrammar.h.

Member Function Documentation

utl::MathExpressionGrammar::ERROR ( err  )
protected
int utl::MathExpressionGrammar::GetNVariables ( ) const
inline

Definition at line 223 of file MathExpressionGrammar.h.

double utl::MathExpressionGrammar::GetVariable ( const std::string &  name) const
inline

Definition at line 227 of file MathExpressionGrammar.h.

SymbolTable& utl::MathExpressionGrammar::GetVariables ( )
inline

Definition at line 221 of file MathExpressionGrammar.h.

const SymbolTable& utl::MathExpressionGrammar::GetVariables ( ) const
inline

Definition at line 222 of file MathExpressionGrammar.h.

bool utl::MathExpressionGrammar::HasVariable ( const std::string &  name) const
inline

Definition at line 225 of file MathExpressionGrammar.h.

void utl::MathExpressionGrammar::SaveResult ( const double  val) const
inlineprotected
void utl::MathExpressionGrammar::SetResult ( double &  v) const
inline

Definition at line 76 of file MathExpressionGrammar.h.

References fResult.

void utl::MathExpressionGrammar::SetVariable ( const std::string &  name,
const double &  v 
)
inline

Definition at line 226 of file MathExpressionGrammar.h.

throw utl::MathExpressionGrammar::XMLParseException ( err  )
protected

Member Data Documentation

double utl::MathExpressionGrammar::const
protected
Initial value:
{
const auto& symbols = *fSymbols

Function which searches in the symbol table.

Definition at line 199 of file MathExpressionGrammar.h.

const std::string utl::MathExpressionGrammar::err
protected
Initial value:
=
"The symbol '" + symbol + "' " +
"is not defined during the evaluaion with the MathExpressionGrammer\n"

Definition at line 212 of file MathExpressionGrammar.h.

double* utl::MathExpressionGrammar::fResult = nullptr
mutableprivate

Definition at line 232 of file MathExpressionGrammar.h.

Referenced by SaveResult(), and SetResult().

const SymbolTable* utl::MathExpressionGrammar::fSymbols
private

Definition at line 230 of file MathExpressionGrammar.h.

SymbolTable utl::MathExpressionGrammar::fVariables
private

Definition at line 231 of file MathExpressionGrammar.h.

const auto utl::MathExpressionGrammar::it1 = symbols.find(symbol)
protected

Definition at line 201 of file MathExpressionGrammar.h.

utl::MathExpressionGrammar::return
protected

Definition at line 217 of file MathExpressionGrammar.h.

return it1 utl::MathExpressionGrammar::second
protected

Definition at line 203 of file MathExpressionGrammar.h.

return it2 utl::MathExpressionGrammar::second
protected
Initial value:
{
const auto it2 = fVariables.find(symbol)

Definition at line 206 of file MathExpressionGrammar.h.


The documentation for this struct was generated from the following file:

, generated on Tue Sep 26 2023.