1 |
/* ASCEND modelling environment |
2 |
Copyright (C) 2006 Carnegie Mellon University |
3 |
Copyright (C) 1998 Carnegie Mellon University |
4 |
|
5 |
This program is free software; you can redistribute it and/or modify |
6 |
it under the terms of the GNU General Public License as published by |
7 |
the Free Software Foundation; either version 2, or (at your option) |
8 |
any later version. |
9 |
|
10 |
This program is distributed in the hope that it will be useful, |
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
GNU General Public License for more details. |
14 |
|
15 |
You should have received a copy of the GNU General Public License |
16 |
along with this program; if not, write to the Free Software |
17 |
Foundation, Inc., 59 Temple Place - Suite 330, |
18 |
Boston, MA 02111-1307, USA. |
19 |
*//** |
20 |
@file |
21 |
Anonymous type manipulation |
22 |
|
23 |
Requires |
24 |
#include "utilities/ascConfig.h" |
25 |
#include "list.h" |
26 |
#include "instance_enum.h" |
27 |
*//* |
28 |
by Benjamin Allan |
29 |
September 08, 1997 |
30 |
Last in CVS $Revision: 1.2 $ $Date: 1998/06/16 16:38:35 $ $Author: mthomas $ |
31 |
*/ |
32 |
|
33 |
#ifndef ASC_ANONCOPY_H |
34 |
#define ASC_ANONCOPY_H |
35 |
|
36 |
/** addtogroup compiler Compiler |
37 |
@{ |
38 |
*/ |
39 |
|
40 |
extern struct gl_list_t *Pass2CollectAnonProtoVars(struct Instance *i); |
41 |
/**< |
42 |
Returns a gl_list of index paths through i to reach the vars |
43 |
occurring in relations (or relation arrays) of i. |
44 |
i must be a MODEL. |
45 |
|
46 |
Each var will only occur once in the path list returned. |
47 |
An index path can be followed through any instance isomorphic to i |
48 |
and will end at a variable semantically equivalent to the one |
49 |
in i that generated the path. |
50 |
|
51 |
At the expense of a visit tree call (which we need anyway) |
52 |
this returns the list unsorted and never searched.<br><br> |
53 |
|
54 |
The list returned should be destroyed with |
55 |
Pass2DestroyAnonProtoVars(). |
56 |
*/ |
57 |
|
58 |
extern void Pass2DestroyAnonProtoVars(struct gl_list_t *indexpathlist); |
59 |
/**< |
60 |
Deallocate the indexpathlist collected by Pass2CollectAnonProtoVars(). |
61 |
*/ |
62 |
|
63 |
extern void Pass2CopyAnonProto(struct Instance *proto, |
64 |
struct BitList *protoblist, |
65 |
struct gl_list_t *protovarindices, |
66 |
struct Instance *i); |
67 |
/**< |
68 |
Copies all the local relations (including those in arrays) |
69 |
of the MODEL instance proto to the instance i using only |
70 |
local information. No global information is needed, but |
71 |
we need to arrange that the tmpnums all start and end 0 |
72 |
so we can avoid extra 0ing of them. |
73 |
*/ |
74 |
|
75 |
/* @} */ |
76 |
|
77 |
#endif /* ASC_ANONCOPY_H */ |
78 |
|