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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1066 - (show annotations) (download) (as text)
Sun Jan 7 10:02:41 2007 UTC (17 years, 9 months ago) by johnpye
File MIME type: text/x-chdr
File size: 2868 byte(s)
Adding doxygen 'addtogroup' for Solver, Compiler, Integrator.
1 /*
2 * Instance name routines
3 * by Tom Epperly
4 * Part Of Ascend
5 * Version: $Revision: 1.6 $
6 * Version control file: $RCSfile: instance_name.h,v $
7 * Date last modified: $Date: 1998/02/05 16:36:20 $
8 * Last modified by: $Author: ballan $
9 *
10 * This file is part of the Ascend Language Interpreter.
11 *
12 * Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly
13 *
14 * The Ascend Language Interpreter is free software; you can redistribute
15 * it and/or modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of the
17 * License, or (at your option) any later version.
18 *
19 * The Ascend Language Interpreter is distributed in hope that it will be
20 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with the program; if not, write to the Free Software Foundation,
26 * Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check the file named
27 * COPYING.
28 */
29
30 /** @file
31 * Instance name routines.
32 * <pre>
33 * When #including instance_name.h, make sure these files are #included first:
34 * #include "utilities/ascConfig.h"
35 * #include "compiler.h"
36 * </pre>
37 */
38
39 #ifndef ASC_INSTANCE_NAME_H
40 #define ASC_INSTANCE_NAME_H
41
42 /** addtogroup compiler Compiler
43 @{
44 */
45
46 enum NameTypes {
47 IntArrayIndex, /**< integer array index */
48 StrArrayIndex, /**< string array index */
49 StrName /**< string name */
50 };
51
52 union InstanceNameUnion {
53 long index;
54 symchar *name;
55 };
56
57 struct InstanceName {
58 enum NameTypes t;
59 union InstanceNameUnion u;
60 };
61
62 #define InstanceNameType(in) ((in).t)
63 /**<
64 * Return the type of InstanceName structure in.
65 */
66
67 #define InstanceNameStr(in) ((in).u.name)
68 /**<
69 * Return the name of InstanceName structure in.
70 * in must be of type StrName.
71 */
72
73 #define InstanceIntIndex(in) ((in).u.index)
74 /**<
75 * Return the integer index value of InstanceName structure in.
76 */
77
78 #define InstanceStrIndex(in) ((in).u.name)
79 /**<
80 * Return the string index value of InstanceName structure in.
81 */
82
83 #define SetInstanceNameType(in,type) ((in).t) = (type)
84 /**<
85 * Set the type of InstanceName structure in to type (a NameTypes).
86 */
87
88 #define SetInstanceNameStrPtr(in,str) ((in).u.name) = (str)
89 /**<
90 * Set the string pointer of InstanceName structure in to str (a symchar*).
91 */
92
93 #define SetInstanceNameStrIndex(in,str) ((in).u.name) = (str)
94 /**<
95 * Set the string index of InstanceName structure in to str (a symchar*).
96 */
97
98 #define SetInstanceNameIntIndex(in,int_index) ((in).u.index) = (int_index)
99 /**<
100 * Set the integer index of InstanceName structure in to int_index (a long).
101 */
102
103 /* @} */
104
105 #endif /* ASC_INSTANCE_NAME_H */
106

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