/[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 33 - (show annotations) (download) (as text)
Sun Dec 26 20:06:01 2004 UTC (14 years, 10 months ago) by ben.allan
File MIME type: text/x-chdr
File size: 3168 byte(s)
First pass at doxygenation -- mechanically putting in ** and where
most likely needed **< using sed. Lots of cleanup needed to
be really useful, including grouping data types and their
member methods into class-like documentation.
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 #ifndef __INSTANCE_NAME_H_SEEN__
31 #define __INSTANCE_NAME_H_SEEN__
32
33
34 /**<
35 * When #including instance_name.h, make sure these files are #included first:
36 * #include "compiler.h"
37 */
38
39
40 enum NameTypes {
41 IntArrayIndex, /**< integer array index */
42 StrArrayIndex, /**< string array index */
43 StrName /**< string name */
44 };
45
46 union InstanceNameUnion {
47 long index;
48 symchar *name;
49 };
50
51 struct InstanceName {
52 enum NameTypes t;
53 union InstanceNameUnion u;
54 };
55
56 #define InstanceNameType(in) ((in).t)
57 /**<
58 * macro InstanceNameType(in)
59 * struct InstanceName in;
60 *
61 * Return the type of instance name structure n.
62 */
63
64 #define InstanceNameStr(in) ((in).u.name)
65 /**<
66 * macro InstanceNameStr(in)
67 * struct InstanceName in;
68 *
69 * in must be of type StrName.
70 * Return the name.
71 */
72
73 #define InstanceIntIndex(in) ((in).u.index)
74 /**<
75 * macro InstanceIntIndex(in)
76 * struct InstanceName in;
77 * Return the integer index value.
78 */
79
80 #define InstanceStrIndex(in) ((in).u.name)
81 /**<
82 * macro InstanceStrIndex(in)
83 * struct InstanceName in;
84 *
85 * Return the string index value.
86 */
87
88 #define SetInstanceNameType(in,type) ((in).t) = (type)
89 /**<
90 * macro SetInstanceNameType(in,type)
91 * struct InstanceName in;
92 * enum NameTypes type;
93 *
94 * Set the instance name type to type.
95 */
96
97 #define SetInstanceNameStrPtr(in,str) ((in).u.name) = (str)
98 /**<
99 * macro SetInstanceNameStrPtr(in,str)
100 * struct InstanceName in;
101 * symchar *str;
102 *
103 * Set the instance string pointer to str.
104 */
105
106 #define SetInstanceNameStrIndex(in,str) ((in).u.name) = (str)
107 /**<
108 * macro SetInstanceNameStrIndex(in,str)
109 * struct InstanceName in;
110 * symchar *str;
111 *
112 * Set the instance name structure string index to str.
113 */
114
115 #define SetInstanceNameIntIndex(in,int_index) ((in).u.index) = (int_index)
116 /**<
117 * macro SetInstanceNameIndex(in,int_index)
118 * struct InstanceName in;
119 * long int_index;
120 *
121 * Set the instance name structure integer index to int_index.
122 */
123 #endif /**< __INSTANCE_NAME_H_SEEN__ */

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