/[ascend]/trunk/base/generic/compiler/createinst.h
ViewVC logotype

Contents of /trunk/base/generic/compiler/createinst.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 303 - (show annotations) (download) (as text)
Tue Feb 21 02:38:13 2006 UTC (18 years, 4 months ago) by johnpye
File MIME type: text/x-chdr
File size: 6723 byte(s)
Documentation, indentation and debugging-message changes.
1 /*
2 * Ascend Instance Allocation Functions
3 * by Tom Epperly & Ben Allan
4 * 8/16/89
5 * Version: $Revision: 1.5 $
6 * Version control file: $RCSfile: createinst.h,v $
7 * Date last modified: $Date: 1998/02/05 16:35:48 $
8 * Last modified by: $Author: ballan $
9 *
10 * This file is part of the Ascend Language Interpreter.
11 *
12 * Copyright (C) 1996 Ben Allan
13 * based on instance.c
14 * Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly
15 *
16 * The Ascend Language Interpreter is free software; you can redistribute
17 * it and/or modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of the
19 * License, or (at your option) any later version.
20 *
21 * The Ascend Language Interpreter is distributed in hope that it will be
22 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with the program; if not, write to the Free Software Foundation,
28 * Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check the file named
29 * COPYING.
30 */
31
32 /** @file
33 * Ascend Instance Allocation Functions.
34 * <pre>
35 * When #including createinst.h, make sure these files are #included first:
36 * #include "utilities/ascConfig.h"
37 * #include "instance_enum.h"
38 * </pre>
39 */
40
41 #ifndef ASC_CREATEINST_H
42 #define ASC_CREATEINST_H
43
44 extern void ZeroNewChildrenEntries(struct Instance **ary, unsigned long int num);
45 /**<
46 * Sets num entries of ary to NULL.
47 */
48
49 extern struct Instance *CreateSimulationInstance(struct TypeDescription *type,
50 symchar *name);
51 /**<
52 * Create an instance of the type described by "type". The memory of "type"
53 * is used by the instance structure, so do not dispose or modify the memory.
54 * This initializes the instance with no parents, no clique membership.
55 * Being a simulation instance, it will have only 1 child and will make
56 * a separate copy of its name. The type should be the type of the root
57 * instance of the simulation. A simulation instance will have no parents.
58 * It will respond cleanly to all general instance query commands.<br><br>
59 *
60 * The reference count of type is incremented.
61 */
62
63 extern struct Instance *CreateModelInstance(struct TypeDescription *type);
64 /**<
65 * Create an instance of the type described by "type". The memory of "type"
66 * is used by the instance structure, so do not dispose or modify the memory.
67 * This initializes the instance with no parents, no clique membership,
68 * and no statements executed.<br><br>
69 *
70 * The reference count of type is incremented.
71 */
72
73 extern struct Instance *CreateDummyInstance(struct TypeDescription *type);
74 /**<
75 * Returns a DummyInstance using the type given, which must be
76 * the dummy_type named BASE_UNSELECTED.
77 * The instance returned is UNIVERSAL.<br><br>
78 *
79 * The reference count of type is incremented.
80 */
81
82 extern struct Instance *CreateRealInstance(struct TypeDescription *type);
83 /**<
84 * Create a real instance whose type is described by "type". The instance
85 * struct will use the memory pointed to by type, so don't destroy this
86 * structure. It is cheaper to copy an instance of a real, than to create
87 * one.
88 * The value of the instance is initialized to def.<br><br>
89 *
90 * Type may be either real_type or real_constant_type or refinements thereof.
91 * User is expected to know what to do with the result.
92 * The reference count of type and units are incremented.
93 */
94
95 extern struct Instance *CreateIntegerInstance(struct TypeDescription *type);
96 /**<
97 * Create an integer instance whose type is described by "type". The memory
98 * pointed to by type is used by the instance, so don't destroy it or modify
99 * it.
100 * Type may be either integer_type or integer_constant_type or
101 * refinements thereof.
102 * User is expected to know what to do with the result.<br><br>
103 *
104 * It is cheaper to copy an instance of an integer, than to create one.
105 * FALSE: Integer instances don't have default values.
106 */
107
108 extern struct Instance *CreateBooleanInstance(struct TypeDescription *type);
109 /**<
110 * Create a boolean instance whose type is described by "type". The
111 * instance structure will use the memory pointed to by type, so don't
112 * modify it or free it.
113 * FALSE: Booleans don't yet have defaults.
114 * Type may be either boolean_type or boolean_constant_type or
115 * refinements thereof.
116 * User is expected to know what to do with the result.
117 */
118
119 extern struct Instance *CreateSetInstance(struct TypeDescription *type, int intset);
120 /**<
121 * Create a set instance whose type is described by "type". The instance
122 * will use the memory pointed to by type, so don't modify it or free it.
123 * Set instances don't have defaults.<br><br>
124 *
125 * intset determines the "type" of set. True means it is a set of integers,
126 * FALSE means a set of symbols.
127 */
128
129 extern struct Instance *CreateSymbolInstance(struct TypeDescription *type);
130 /**<
131 * Create a symbol instance whose type is described by "type". The
132 * instance will use the memory pointed by type type, so don't modify
133 * it or free it.
134 * FALSE: Symbol instances don't yet have defaults.
135 * Type may be either symbol_type or symbol_constant_type or
136 * refinements thereof.
137 */
138
139 extern struct Instance *CreateArrayInstance(struct TypeDescription *type,
140 unsigned long index);
141 /**<
142 * Create an array instance whose type is described by "set". The instance
143 * will use the memory pointed to by type, so don't modify it or free it.<br><br>
144 *
145 * index indicates the number in the index list which this array is.
146 * Normally this should be 1.
147 */
148
149 extern struct Instance *CreateRelationInstance(struct TypeDescription *type,
150 enum Expr_enum reltype);
151 /**<
152 * Create a relation instance who type is described by "type". The instance
153 * will use the memory pointed to by type, so don't modify it or free it.
154 * reltype is one of e_glassbox, e_blackbox, e_opcode, e_tokens and must
155 * be provided.
156 */
157
158 extern struct Instance *CreateLogRelInstance(struct TypeDescription *type);
159 /**<
160 * Create a logical relation instance. The instance will use the memory
161 * pointed to by type, so don't modify it or free it.
162 * the type is always e_bol_token.
163 */
164
165 extern struct Instance *CreateWhenInstance(struct TypeDescription *type);
166 /**<
167 * Create a when instance. The instance will use the memory
168 * pointed to by type, so don't modify it or free it.
169 */
170
171 #endif /* ASC_CREATEINST_H */
172

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22