49 for (
int i = 0; arithmetic_functions[i].name != 0; ++i) {
50 table.
put_symbol(arithmetic_functions[i].name, arithmetic_functions[i].func);
53 for (
int i = 0; predefined_constants[i].name != 0; ++i) {
54 table.
put_symbol(predefined_constants[i].name, predefined_constants[i].val);
76 char *p =
const_cast<char *
>(
m_src.c_str()) +
m_pos;
81 while ((c ==
' ') || (c ==
'\t'))
87 if (c ==
'\0')
return 0;
95 IN_INT, IN_FRAC, IN_EXP, IN_EXP_DIGIT
100 for (i = 0; ; c = p[++i]) {
101 if (state == IN_INT) {
103 }
else if (c ==
'.') {
105 }
else if (c ==
'e') {
110 }
else if (state == IN_FRAC) {
112 }
else if (c ==
'e') {
117 }
else if ((state == IN_EXP) || (state == IN_EXP_DIGIT)) {
119 }
else if ((state == IN_EXP) && ((c ==
'+') || (c ==
'-'))) {
120 state = IN_EXP_DIGIT;
132 char *symbol = strdup(p);
134 char *symbol = strndup(p, i + 1);
151 for (i = 0; isalnum(p[i]) || p[i] ==
'.'; ++i) {
156 char *symbol = strdup(p);
158 char *symbol = strndup(p, i + 1);
183 int retv = parser.
parse();
function_t get_symbol_function(const std::string &name) const
bool put_symbol(const std::string &name, const double value)
void error(const std::string &msg)
double get_symbol_value(const std::string &name) const
function_t get_symbol_function(char const *name)
void general(const char *format,...)
static SymbolTable global_symbol_table
int yylex(EvalExpr::semantic_type *yylval, EvalExpr &driver)
void set_debug_level(debug_level_type l)
Set the current debugging level.
EvalExpr class for algebraic expression in parameter strings.
void paranoiac(const char *format,...)
void crucial(const char *format,...)
double get_symbol_value(char const *name)
double(* function_t)(double)
void set_result(double result)
int next_token(semantic_type &yylval)