Bridge++  Ver. 2.0.2
EvalExpr Class Reference

EvalExpr class for algebraic expression in parameter strings. More...

#include <evalexpr.h>

Public Types

typedef yy::parser::semantic_type semantic_type
 
typedef yy::parser::token token
 

Public Member Functions

 EvalExpr (const std::string &line, bool debug=false)
 
int next_token (semantic_type &yylval)
 
double parse ()
 
double get_symbol_value (char const *name)
 
function_t get_symbol_function (char const *name)
 
void set_result (double result)
 
void error (const std::string &msg)
 

Private Attributes

const std::string m_src
 
unsigned int m_pos
 
double m_result
 
bool m_trace
 

Static Private Attributes

static SymbolTable global_symbol_table = init_global_symbol()
 

Detailed Description

EvalExpr class for algebraic expression in parameter strings.

EvalExpr class provides support to evaluating algebraic expressions in parameter strings. The expression is evaluated into a single double precision value.

Supported expression includes arithmetic operations in in-fix notation, several transcendental functions including trigonometric and logarithmic functions, and numerical constant such as pi.

Definition at line 39 of file evalexpr.h.

Member Typedef Documentation

◆ semantic_type

Definition at line 43 of file evalexpr.h.

◆ token

Definition at line 44 of file evalexpr.h.

Constructor & Destructor Documentation

◆ EvalExpr()

EvalExpr::EvalExpr ( const std::string &  line,
bool  debug = false 
)
inline

Definition at line 46 of file evalexpr.h.

Member Function Documentation

◆ error()

void EvalExpr::error ( const std::string &  msg)

Definition at line 223 of file evalexpr.cpp.

◆ get_symbol_function()

function_t EvalExpr::get_symbol_function ( char const *  name)

Definition at line 216 of file evalexpr.cpp.

◆ get_symbol_value()

double EvalExpr::get_symbol_value ( char const *  name)

Definition at line 209 of file evalexpr.cpp.

◆ next_token()

int EvalExpr::next_token ( semantic_type yylval)

Definition at line 72 of file evalexpr.cpp.

◆ parse()

double EvalExpr::parse ( )

Definition at line 177 of file evalexpr.cpp.

◆ set_result()

void EvalExpr::set_result ( double  result)

Definition at line 200 of file evalexpr.cpp.

Member Data Documentation

◆ global_symbol_table

SymbolTable EvalExpr::global_symbol_table = init_global_symbol()
staticprivate

Definition at line 73 of file evalexpr.h.

◆ m_pos

unsigned int EvalExpr::m_pos
private

Definition at line 68 of file evalexpr.h.

◆ m_result

double EvalExpr::m_result
private

Definition at line 69 of file evalexpr.h.

◆ m_src

const std::string EvalExpr::m_src
private

Definition at line 67 of file evalexpr.h.

◆ m_trace

bool EvalExpr::m_trace
private

Definition at line 71 of file evalexpr.h.


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