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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 54 - (show annotations) (download) (as text)
Tue Aug 2 11:20:09 2005 UTC (14 years, 4 months ago) by jds
File MIME type: text/x-chdr
File size: 5560 byte(s)
Manual rework of doxygen comments in all headers.
- Added @file comment to all headers.
- Added parameter names to all function declarations in headers.
- Corrected comment referencing where necessary.
- Split some comments which documented blocks of declarations.
- Converted notes about required work into @todo comments so doxygen can generate a todo list.
Minor bug fixes.
1 /*
2 * Ascend Instance Tree Type Definitions
3 * by Ben Allan
4 * 6/02/96
5 * Version: $Revision: 1.8 $
6 * Version control file: $RCSfile: instance_enum.h,v $
7 * Date last modified: $Date: 1997/07/18 12:30:11 $
8 * Last modified by: $Author: mthomas $
9 *
10 * This file is part of the Ascend Language Interpreter.
11 *
12 * Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly
13 * Copyright (C) 1996 Benjamin Andrew Allan
14 *
15 * The Ascend Language Interpreter is free software; you can redistribute
16 * it and/or modify it under the terms of the GNU General Public License as
17 * published by the Free Software Foundation; either version 2 of the
18 * License, or (at your option) any later version.
19 *
20 * The Ascend Language Interpreter is distributed in hope that it will be
21 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with the program; if not, write to the Free Software Foundation,
27 * Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check the file named
28 * COPYING.
29 */
30
31 #ifndef __INSTANCE_ENUM_H_SEEN__
32 #define __INSTANCE_ENUM_H_SEEN__
33
34 /** @file
35 * Ascend Instance Tree Type Definitions
36 * <pre>
37 * When #including instance_enum.h, make sure these files are #included first:
38 * NO INCLUDES NEEDED
39 *
40 * Notes on the instance type scheme.
41 * Ben Allan, Feb. 1996.
42 * We have three types of 'scalar data' instances:
43 * *_INST, *_ATOM_INST, and *_CONSTANT_INST,
44 * where * is REAL, INTEGER, BOOLEAN, SYMBOL and SET.
45 * (Sets are a little weird and should perhaps not be grouped in *.)
46 * The word Atom is used a little loosely in naming of functions in
47 * this file. Many places it implies any of these types, but in some
48 * it implies exclusively *_ATOM_INST types.
49 * READ YOUR HEADERS CAREFULLY.
50 * Atoms are the 'variables' in the ASCEND language.
51 * Constants are the 'structural variables' and 'real constants'.
52 * *_INST are the children of Atoms.
53 * Constants do not have children and cannot be children of Atoms.
54 * Constants may be refined up until they are actually assigned
55 * a value (and in the case of reals a dimensionality).
56 * Constants in a clique (bad style, imho) all have the same value/dims:
57 * assigning one assigns them all. ATS is usually a better style.
58 *
59 * Future work:
60 * LIST replaces SET in the Atom group; the atomic SET becoming the
61 * constant SET.
62 * REAL_ATOM_INST becomes the parametric reals of a model and
63 * a new SOLVER_ATOM_INST becomes the real variables of a model.
64 * </pre>
65 */
66
67 #define IREAL 0x1
68 #define IINT 0x2
69 #define IBOOL 0x4
70 #define ISYM 0x8
71 #define ISET 0x10
72 #define IARR 0x20
73 #define IENUM 0x40
74 #define IFUND 0x80
75 #define ICONS 0x100
76 #define IATOM 0x200
77 #define ICOMP 0x400
78 #define IMOD 0x800
79 #define IRELN 0x1000
80 #define ILRELN 0x2000
81 #define IWHEN 0x4000
82 #define IAUTO 0x8000
83 #define IDUMB 0x10000
84 /** @todo future work */
85 #define ICHILDLESS (IFUND | ICONS | IWHEN | IDUMB)
86 /* constants and fundamental types have no child list */
87 /* when's have no children. Better way of doing this? */
88 #define IERRINST ~(IREAL|IINT|IBOOL|ISYM|ISET|IARR|IENUM|IFUND|ICONS|IATOM| \
89 ICOMP|IMOD|IRELN|ILRELN|IWHEN|IAUTO|IDUMB)
90 /**< any of these bits on is an error */
91
92 /** Instance types. */
93 enum inst_t {
94 ERROR_INST = 0, /**< Deleted instances get this type. */
95 SIM_INST = ICOMP, /**< A simulation instance. */
96 MODEL_INST = ICOMP | IMOD, /**< Model instance. */
97 /* AUTO_INST = ICOMP | IMOD | IAUTO, */ /* future stack instance */
98 REL_INST = IRELN, /**< Relation(equality or inequality). */
99 LREL_INST = ILRELN, /**< Logical relation( == || != ). */
100 WHEN_INST = IWHEN, /**< WHEN instance */
101 ARRAY_INT_INST = ICOMP | IARR | IINT, /**< Array instance integer */
102 ARRAY_ENUM_INST = ICOMP | IARR | ISYM, /**< Array instance enumed */
103 /* fundamental instances */
104 REAL_INST = IFUND | IREAL, /**< Real instance. */
105 INTEGER_INST = IFUND | IINT, /**< Int instance. */
106 BOOLEAN_INST = IFUND | IBOOL, /**< Boolean instance. */
107 SYMBOL_INST = IFUND | ISYM, /**< Symbol instance. */
108 SET_INST = IFUND | ISET, /**< Set instance. */
109 /* nonfundamental atomic instances */
110 REAL_ATOM_INST = IATOM | IREAL, /**< Real atomic instance. */
111 INTEGER_ATOM_INST = IATOM | IINT, /**< Int atomic instance. */
112 BOOLEAN_ATOM_INST = IATOM | IBOOL, /**< Boolean atomic instance. */
113 SYMBOL_ATOM_INST = IATOM | ISYM, /**< Symbol atomic instance. */
114 SET_ATOM_INST = IATOM | ISET, /**< Set atomic instance. */
115 /* nonfundamental constant instances */
116 REAL_CONSTANT_INST = ICONS | IREAL, /**< Real constant instance. */
117 BOOLEAN_CONSTANT_INST = ICONS | IINT, /**< Boolean constant instance. */
118 INTEGER_CONSTANT_INST = ICONS | IBOOL, /**< Int constant instance. */
119 SYMBOL_CONSTANT_INST = ICONS | ISYM, /**< Symbol constant instance. */
120 /* dummy instance - unselected IS_A children. */
121 DUMMY_INST = IDUMB /**< Dummy instance - unselected IS_A children. */
122 };
123
124 /** Never, ever, allocate either one of these types. */
125 struct Instance {
126 enum inst_t t;
127 };
128
129 #endif /* __INSTANCE_ENUM_H_SEEN__ */
130

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