1 2 #ifndef COMPUGEN_HEADER 3 #define COMPUGEN_HEADER 4 5 #include "dyna2.h" 6 7 #define CUGEN_MAX_ONEMODEL_TRANS 1024 8 #define CUGEN_MAX_STATE_NAMES 128 9 #define CUGEN_MAX_FUNCS 128 10 #define CUGEN_MAX_PRF_NUM_LEN 20 11 #define CUGEN_MININF -1000000 12 13 typedef struct OneModelTrans { 14 ExprTree * tprf; 15 ExprTree * wprf; 16 char * tseq; 17 ExprTree * wseq_node_to_replace; 18 char *wseq; 19 int tpos_tprf; 20 int tpos_wprf; 21 int range; 22 int dseq; 23 int dwx; 24 int dwy; 25 int dprf; 26 char * from_state; 27 char * to_state; 28 char * name; 29 int dx; 30 int dy; 31 char * xlabel; 32 char * ylabel; 33 char * map_func; 34 } OneModelTrans; 35 36 37 typedef struct OneModel { 38 char *name; 39 char * datatype_str; 40 char * statenames [CUGEN_MAX_STATE_NAMES]; 41 char * semistatenames[CUGEN_MAX_STATE_NAMES]; 42 char * midstatenames [CUGEN_MAX_STATE_NAMES]; 43 char * seqfuncs [CUGEN_MAX_FUNCS]; 44 OneModelTrans * trans[CUGEN_MAX_ONEMODEL_TRANS]; 45 Scope * sc; 46 char * arg_str; 47 char * chain_str; 48 int states_num; 49 int semistates_num; 50 int prof_line_len; 51 } OneModel; 52 53 typedef enum { 54 CALC_PRF, 55 CALC_SEQ, 56 CALC_W, 57 MAX_CALC_TYPES 58 }calc_type_t; 59 60 typedef enum { 61 COMPUGEN_OK, 62 COMPUGEN_TOO_MANY_CALC_FUNCS, 63 COMPUGEN_ILLEGAL_SEQ_EXPR, 64 COMPUGEN_NO_WSEQ 65 } compugen_rc_t; 66 67 typedef struct { 68 char * dy_func_name; 69 char * om_func_name; 70 int range; 71 char * map_func; 72 } seq_func_t; 73 74 typedef struct { 75 int funcs_num; 76 seq_func_t * func; 77 } seq_func_table_t; 78 79 enum { 80 OM_TMPSTART, 81 OM_TMPEND, 82 OM_TMP_STATES_NUM 83 }; 84 85 #define is_sum_tree(tree) \ 86 ((tree->type == ETR_EXPRESSION) && (tree->nochild == 3) && \ 87 (tree->child[1]->type == ETR_OPERATOR) && (strcmp(tree->child[1]->word, "+") == 0)) 88 89 OneModel * OneModel_from_GenericMatrix(GenericMatrix * gm); 90 91 boolean write_cugen_funcs(OneModel * om,MethodTypeSet * mts,DYNFILE * dfp); 92 #endif 93 94 95 96 97 98 99