/home/doxygen/libascend/compiler/arrayinst.h

Go to the documentation of this file.
00001 /*  ASCEND modelling environment
00002     Copyright (C) 2006 Carnegie Mellon University
00003     Copyright (C) 1996, 1997 Ben Allan
00004     Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2, or (at your option)
00009     any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place - Suite 330,
00019     Boston, MA 02111-1307, USA.
00020 *//*
00021     by Tom Epperly 8/16/89, Ben Allan
00022     Last in CVS $Revision: 1.15 $ $Date: 1998/04/07 19:52:46 $ $Author: ballan $
00023 */
00024 
00090 #ifndef ASC_ARRAYINST_H
00091 #define ASC_ARRAYINST_H
00092 
00093 #include "setinstval.h"
00094 #include "expr_types.h"
00095 #include "instance_enum.h"
00096 #include "compiler.h"
00097 #include <general/pool.h>
00098 
00103 /* Array child memory management */
00104 #define CAC(acp) ((struct ArrayChild *)(acp))
00105 
00106 extern pool_store_t g_array_child_pool;
00112 #ifdef ASC_NO_POOL
00113 
00114 /* slow version for debugging */
00115 #define MALLOCPOOLAC CAC( ascmalloc(sizeof(struct ArrayChild)) )
00116 
00120 #define FREEPOOLAC(ac) ascfree(ac);
00121 
00126 #else
00127 
00128 #define MALLOCPOOLAC CAC(pool_get_element(g_array_child_pool))
00129 
00130 #define FREEPOOLAC(ac) pool_free_element(g_array_child_pool,(ac))
00131 
00133 #endif /* ASC_NO_POOL */
00134 
00135 extern void InitInstanceNanny(void);
00147 extern void DestroyInstanceNanny(void);
00155 extern void ReportInstanceNanny(FILE *f);
00160 /* Array management */
00161 
00162 extern struct gl_list_t
00163 *CollectArrayInstances(CONST struct Instance *i,
00164                        struct gl_list_t *list);
00175 typedef void (*AVProc)(struct Instance *);
00178 extern void ArrayVisitLocalLeaves(struct Instance *mch, AVProc func);
00186 ASC_DLLSPEC struct Instance*ChildByChar(CONST struct Instance *i,
00187                                     symchar *str);
00198 /* Dense array procedures. (non-relations) */
00199 
00200 extern int RectangleArrayExpanded(CONST struct Instance *i);
00213 extern int RectangleSubscriptsMatch(CONST struct Instance *context,
00214                                     CONST struct Instance *ary,
00215                                     CONST struct Name *subscripts);
00233 extern unsigned long NextToExpand(CONST struct Instance *i);
00239 extern unsigned long NumberofDereferences(CONST struct Instance *i);
00245 extern CONST struct Set *IndexSet(CONST struct Instance *i, unsigned long num);
00254 extern void ExpandArray(struct Instance *i,
00255                         unsigned long num,
00256                         struct set_t *set,
00257                         struct Instance *rhsinst,
00258                         struct Instance *arginst,
00259                         struct gl_list_t *rhslist);
00282 /* Sparse arrays stuff. */
00283 
00284 extern struct Instance *FindOrAddIntChild(struct Instance *i,
00285                                           long v,
00286                                           struct Instance *rhsinst,
00287                                           struct Instance *arginst);
00295 extern struct Instance *FindOrAddStrChild(struct Instance *i,
00296                                           symchar *sym,
00297                                           struct Instance *rhsinst,
00298                                           struct Instance *arginst);
00306 extern int CmpArrayInsts(struct Instance *i1, struct Instance *i2);
00316 /* @} */
00317 
00318 #endif /* ASC_ARRAYINST_H */

Generated on Thu Jul 17 04:00:09 2008 for libascend by  doxygen 1.5.1