00001 #ifndef EXPR_TYPES_H
00002 #define EXPR_TYPES_H
00003 #include "param_types.h"
00004
00005 #define CONST_STACK_ELEMENT 0
00006 #define EXPR_STACK_ELEMENT 1
00007
00008
00009 typedef struct GEN_EXPR_T {
00010 int type;
00011 void * item;
00012 } gen_expr_t;
00013
00014 typedef union TERM_T {
00015 double constant;
00016 struct PARAM_T * param;
00017 } term_t;
00018
00019
00020 typedef struct VAL_EXPR_T {
00021 int type;
00022 term_t term;
00023 } val_expr_t;
00024
00025
00026 typedef struct INFIX_OP_T {
00027 int type;
00028 int precedence;
00029 } infix_op_t;
00030
00031
00032 typedef struct TREE_EXPR_T {
00033 infix_op_t * infix_op;
00034 gen_expr_t * gen_expr;
00035 struct TREE_EXPR_T * left, * right;
00036 } tree_expr_t;
00037
00038
00039 typedef struct PREFUN_EXPR_T {
00040 double (*func_ptr)();
00041 int num_args;
00042 gen_expr_t ** expr_list;
00043 } prefun_expr_t;
00044
00045
00046
00047
00048 #endif