Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

Definition at line 43 of file evalexpr.h.

Definition at line 44 of file evalexpr.h.

Constructor & Destructor Documentation

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

Definition at line 46 of file evalexpr.h.

Member Function Documentation

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

Definition at line 223 of file evalexpr.cpp.

function_t EvalExpr::get_symbol_function ( char const *  name)

Definition at line 216 of file evalexpr.cpp.

double EvalExpr::get_symbol_value ( char const *  name)

Definition at line 209 of file evalexpr.cpp.

int EvalExpr::next_token ( semantic_type yylval)

Definition at line 72 of file evalexpr.cpp.

double EvalExpr::parse ( )

Definition at line 177 of file evalexpr.cpp.

void EvalExpr::set_result ( double  result)

Definition at line 200 of file evalexpr.cpp.

Member Data Documentation

SymbolTable EvalExpr::global_symbol_table = init_global_symbol()
staticprivate

Definition at line 73 of file evalexpr.h.

unsigned int EvalExpr::m_pos
private

Definition at line 68 of file evalexpr.h.

double EvalExpr::m_result
private

Definition at line 69 of file evalexpr.h.

const std::string EvalExpr::m_src
private

Definition at line 67 of file evalexpr.h.

bool EvalExpr::m_trace
private

Definition at line 71 of file evalexpr.h.


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