1 /* eval.h: evaluation functions of expressions */
4 #include "func_types.h"
5 #include "param_types.h"
13 #define CONSTANT_TERM_T 0
14 #define PARAM_TERM_T 1
27 inline double eval_gen_expr(gen_expr_t * gen_expr);
28 inline gen_expr_t * opt_gen_expr(gen_expr_t * gen_expr, int ** param_list);
30 gen_expr_t * const_to_expr(double val);
31 gen_expr_t * param_to_expr(struct PARAM_T * param);
32 gen_expr_t * prefun_to_expr(double (*func_ptr)(), gen_expr_t ** expr_list, int num_args);
34 tree_expr_t * new_tree_expr(infix_op_t * infix_op, gen_expr_t * gen_expr, tree_expr_t * left, tree_expr_t * right);
35 gen_expr_t * new_gen_expr(int type, void * item);
36 val_expr_t * new_val_expr(int type, term_t term);
38 int free_gen_expr(gen_expr_t * gen_expr);
39 int free_prefun_expr(prefun_expr_t * prefun_expr);
40 int free_tree_expr(tree_expr_t * tree_expr);
41 int free_val_expr(val_expr_t * val_expr);
43 infix_op_t * new_infix_op(int type, int precedence);
45 int destroy_infix_ops();
46 void reset_engine_vars();
48 gen_expr_t * clone_gen_expr(gen_expr_t * gen_expr);
49 tree_expr_t * clone_tree_expr(tree_expr_t * tree_expr);
50 val_expr_t * clone_val_expr(val_expr_t * val_expr);
51 prefun_expr_t * clone_prefun_expr(prefun_expr_t * prefun_expr);