tdata_t.h

00001 /*
00002  * Copyright (c) 2010 Jiri Svoboda
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *
00009  * - Redistributions of source code must retain the above copyright
00010  *   notice, this list of conditions and the following disclaimer.
00011  * - Redistributions in binary form must reproduce the above copyright
00012  *   notice, this list of conditions and the following disclaimer in the
00013  *   documentation and/or other materials provided with the distribution.
00014  * - The name of the author may not be used to endorse or promote products
00015  *   derived from this software without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00018  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00019  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00020  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
00021  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00022  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00023  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00024  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00025  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00026  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00027  */
00028 
00031 #ifndef TDATA_T_H_
00032 #define TDATA_T_H_
00033 
00034 #include "intmap_t.h"
00035 
00037 typedef enum {
00039         tpc_bool,
00041         tpc_char,
00043         tpc_int,
00045         tpc_nil,
00047         tpc_string,
00049         tpc_resource
00050 } tprimitive_class_t;
00051 
00053 typedef struct {
00055         tprimitive_class_t tpc;
00056 } tdata_primitive_t;
00057 
00059 typedef struct {
00061         statns_t static_ref;
00062 
00064         struct stree_csi *csi;
00065 
00067         list_t targs; /* of tdata_item_t */
00068 } tdata_object_t;
00069 
00071 typedef struct {
00073         struct tdata_item *base_ti;
00074 
00076         int rank;
00077 
00079         list_t extents; /* of stree_expr_t */
00080 } tdata_array_t;
00081 
00086 typedef struct {
00088         list_t arg_ti; /* of tdata_item_t */
00089 
00091         struct tdata_item *varg_ti;
00092 
00094         struct tdata_item *rtype;
00095 } tdata_fun_sig_t;
00096 
00098 typedef struct {
00100         struct stree_deleg *deleg;
00101 
00103         tdata_fun_sig_t *tsig;
00104 } tdata_deleg_t;
00105 
00112 typedef struct {
00114         struct stree_enum *enum_d;
00115 } tdata_ebase_t;
00116 
00118 typedef struct {
00120         struct stree_enum *enum_d;
00121 } tdata_enum_t;
00122 
00124 typedef struct {
00126         struct stree_deleg *deleg;
00127 
00129         tdata_fun_sig_t *tsig;
00130 } tdata_fun_t;
00131 
00133 typedef struct {
00135         struct stree_targ *targ;
00136 } tdata_vref_t;
00137 
00138 typedef enum {
00140         tic_tprimitive,
00142         tic_tobject,
00144         tic_tarray,
00146         tic_tdeleg,
00148         tic_tebase,
00150         tic_tenum,
00152         tic_tfun,
00154         tic_tvref,
00156         tic_ignore
00157 } titem_class_t;
00158 
00160 typedef struct tdata_item {
00161         titem_class_t tic;
00162 
00163         union {
00164                 tdata_primitive_t *tprimitive;
00165                 tdata_object_t *tobject;
00166                 tdata_array_t *tarray;
00167                 tdata_deleg_t *tdeleg;
00168                 tdata_ebase_t *tebase;
00169                 tdata_enum_t *tenum;
00170                 tdata_fun_t *tfun;
00171                 tdata_vref_t *tvref;
00172         } u;
00173 } tdata_item_t;
00174 
00176 typedef struct {
00178         intmap_t tvv; /* of tdata_item_t */
00179 } tdata_tvv_t;
00180 
00181 #endif

Generated on Thu Jun 2 07:45:43 2011 for HelenOS/USB by  doxygen 1.4.7