00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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
00104 #define CAC(acp) ((struct ArrayChild *)(acp))
00105
00106 extern pool_store_t g_array_child_pool;
00112 #ifdef ASC_NO_POOL
00113
00114
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
00134
00135 extern void InitInstanceNanny(void);
00147 extern void DestroyInstanceNanny(void);
00155 extern void ReportInstanceNanny(FILE *f);
00160
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
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
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