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 #ifndef PLINT_DATA_TYPE_H
00026 #define PLINT_DATA_TYPE_H
00027
00058 #include "share/defines.h"
00059
00060 #include "gc.h"
00061
00062
00063
00064
00065 #include "types.h"
00066
00067
00068
00072 typedef enum
00073 {
00074
00075 PLINT_ASG_REF = 1 << 0,
00076 PLINT_ASG_VAL = 1 << 1,
00078 PLINT_ASG_MSK = (1 << 2) - 1,
00080 PLINT_ASG_CPY = 1 << 2,
00082 } plint_easg_t;
00083
00084
00085
00089 typedef enum
00090 {
00091 _PLINT_typ = 0,
00093 _PLINT_typ_start = _PLINT_typ,
00094
00095
00096 PLINT_nul,
00097 PLINT_num,
00098 PLINT_num_int,
00099 PLINT_num_dbl,
00100 PLINT_pnt,
00101 PLINT_str,
00102 PLINT_bol,
00104
00105 PLINT_var,
00106 PLINT_tab,
00107 PLINT_hsh,
00109
00110
00111
00112
00113
00114
00115
00116 PLINT_err,
00118 _PLINT_typ_stop,
00119 _PLINT_typ_NO = _PLINT_typ_stop,
00121 } plint_typ_t;
00122
00123
00124
00125 #include "val/number.h"
00126 #include "val/point.h"
00127 #include "val/2points.h"
00128 #include "val/string.h"
00129 #include "val/boolean.h"
00130 #include "val/table.h"
00131 #include "val/hash.h"
00132
00133
00134
00138 union _plint_value
00139 {
00140
00141 int num_int;
00142 double num_dbl;
00143 plint_pnt_t pnt;
00144 plint_str_t str;
00145 plint_bol_t bol;
00147 plint_var_t var;
00148 plint_tab_t tab;
00149 plint_hsh_t hsh;
00151 };
00152
00153
00154
00155 #include "index.h"
00156 #include "range.h"
00157 #include "iterator.h"
00158
00159
00160 #include "memref.h"
00161 #include "variable.h"
00162 #include "value.h"
00163
00164
00165
00170 extern plint_typkey_t plint_builtin_key;
00171
00172
00173
00174 __BEGIN_DECLS
00175
00176 void plint_data_type_init();
00177 void plint_data_type_finish();
00178
00179 int plint_typ_equ(plint_typ_t LEFT, plint_typ_t RIGHT);
00180 int plint_typ_neq(plint_typ_t LEFT, plint_typ_t RIGHT);
00181 int plint_typ_mem(plint_typ_t TYPE);
00182
00183 plint_typ_t plint_str_typ(plint_str_t STRING);
00184 plint_str_t plint_typ_str(plint_typ_t TYPE);
00185
00186 void plint_val_fre(plint_val_t * PVALUE, plint_typ_t TYPE);
00187 plint_val_t plint_val_cpy(plint_val_t * PVALUE, plint_typ_t TYPE);
00188
00189 void plint_blind_assign(plint_ref_t DESTINATION, plint_var_t SOURCE, plint_easg_t TYPE);
00190
00191 #define plint_bar_new(__args__...) plint_var_new(plint_builtin_key, __args__)
00192 #define plint_val_nul() plint_ptr_new(PLINT_nul)
00193 #define plint_bar_nul() plint_bar_new(plint_val_nul())
00194 #define plint_var_nul(__key__...) plint_var_new(__key__, plint_val_nul())
00195
00196 __END_DECLS
00197
00200 #endif