Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals  

type.h

Go to the documentation of this file.
00001  /*
00002   * plint/data/type.h : standard `plint' data types (header)
00003   * 
00004   * Time-stamp: <2002-12-21 14:28:10 gseba>
00005   * 
00006   * Copyright (C) Sebastian Glita, email: gseba@users.sourceforge.net
00007   * 
00008   * This file is part of plint.
00009   * 
00010   * plint is free software; you can  redistribute it and/or modify it under the
00011   * terms of the  GNU General Public License as published  by the Free Software
00012   * Foundation; either version 2, or (at your option) any later version.
00013   *
00014   * plint  is distributed  in the  hope  that it  will be  useful, but  WITHOUT
00015   * ANY  WARRANTY; without  even  the implied  warranty  of MERCHANTABILITY  or
00016   * FITNESS FOR A  PARTICULAR PURPOSE.  See the GNU  General Public License for
00017   * more details.
00018   * 
00019   * You should  have received a  copy of the  GNU General Public  License along
00020   * with  plint; see  the file  COPYING.  If  not, write  to the  Free Software
00021   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA USA.
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 /* forward type declarations */
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   /* scalars */
00096   PLINT_nul,            
00097   PLINT_num,            
00098   PLINT_num_int,        
00099   PLINT_num_dbl,        
00100   PLINT_pnt,            
00101   PLINT_str,            
00102   PLINT_bol,            
00104   /* memories */
00105   PLINT_var,            
00106   PLINT_tab,            
00107   PLINT_hsh,            
00109   /*
00110   soon to come...
00111   PLINT_opq,
00112   PLINT_txt,
00113   PLINT_bin,
00114   PLINT_sok,
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

Generated on Thu Jan 9 19:02:39 2003 for plint by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002