00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef ASC_TYPES_H
00033 #define ASC_TYPES_H
00034
00039 #include <limits.h>
00040 #include "compiler.h"
00041 #include "dimen.h"
00042 #include <general/list.h>
00043 #include "functype.h"
00044
00045
00046
00047
00048
00049 #define NUM_EXPR_ENUMS 44
00050
00062 enum Expr_enum {
00063
00064 e_nop = 0,
00067 e_undefined = 1,
00068 e_glassbox = 2,
00069 e_blackbox = 3,
00070 e_opcode = 4,
00071 e_token = 5,
00073 e_zero = 6,
00074 e_real = 7,
00075 e_int = 8,
00076
00077
00078
00079
00080
00081
00082 e_var = 9,
00084 e_uminus = 10,
00085 e_func = 11,
00087 e_plus = 12,
00088 e_minus = 13,
00089 e_times = 14,
00090 e_divide = 15,
00091 e_power = 16,
00092 e_ipower = 17,
00093
00094
00095
00096 e_bol_token,
00097
00098
00099 e_notequal,
00100 e_equal,
00101 e_less,
00102 e_greater,
00103 e_lesseq,
00104 e_greatereq,
00105 e_maximize,
00106 e_minimize,
00107 e_boolean_eq,
00108 e_boolean_neq,
00110
00111 e_boolean,
00112
00113 e_or,
00114 e_and,
00115 e_not,
00116 e_satisfied,
00118
00119 e_subexpr,
00120 e_const,
00121 e_par,
00122 e_sum,
00123 e_prod,
00125 e_symbol,
00126
00127 e_set,
00128 e_in,
00129 e_st,
00130 e_card,
00131 e_choice,
00132 e_union,
00133 e_inter,
00135
00136 e_qstring
00137 };
00138
00139 #define TOK_SCALAR_LOW e_zero
00140 #define TOK_SCALAR_HIGH e_var
00141 #define TOK_CONSTANT_LOW e_zero
00142 #define TOK_CONSTANT_HIGH e_int
00143 #define TOK_XARY_LOW e_uminus
00144 #define TOK_XARY_HIGH e_ipower
00145 #define TOK_BINARY_LOW e_plus
00146 #define TOK_BINARY_HIGH e_ipower
00147 #define TOK_UNARY_LOW e_uminus
00148 #define TOK_UNARY_HIGH e_func
00149 #define TOK_REAL_REL_LOW e_zero
00150 #define TOK_REAL_REL_HIGH e_ipower
00151 #define TOK_REL_TYPE_LOW e_glassbox
00152 #define TOK_REL_TYPE_HIGH e_token
00153
00154 struct ExprReal {
00155 double rvalue;
00156 CONST dim_type *dimensions;
00157 };
00158
00159 struct SatisfiedExpr {
00160 struct ExprReal ser;
00161 struct Name *sen;
00162 };
00163
00164 union ExprUnion {
00165 struct Name *nptr;
00166 long ivalue;
00167 symchar *sym_ptr;
00168 struct Set *s;
00169 struct ExprReal r;
00170 CONST struct Func *fptr;
00171 unsigned bvalue;
00172 struct SatisfiedExpr se;
00173 };
00174
00175 struct Expr {
00176 struct Expr *next;
00177 enum Expr_enum t;
00178 union ExprUnion v;
00179 };
00180
00181 struct Range {
00182 struct Expr *lower,*upper;
00183 };
00184
00185 union SetUnion {
00186 struct Expr *e;
00187 struct Range r;
00188 };
00189
00190 struct Set {
00191 struct Set *next;
00192 unsigned range;
00193 union SetUnion val;
00194 unsigned long ref_count;
00195 };
00196
00197 union NameUnion {
00198 symchar *id;
00199 struct Set *s;
00200 int attribute;
00201 };
00202
00203 struct Name {
00204
00205 unsigned int bits;
00221 #define NAMEBIT_IDTY 0x1
00222 #define NAMEBIT_ATTR 0x2
00223 #define NAMEBIT_CHAT 0x4
00224 #define NAMEBIT_AUTO 0x8
00225 struct Name *next;
00226 union NameUnion val;
00227 };
00228
00238 #define MAXINTREAL 100000
00239
00240
00241
00242 #endif
00243