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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 769 - (show annotations) (download) (as text)
Thu Jul 13 08:19:11 2006 UTC (16 years, 2 months ago) by johnpye
File MIME type: text/x-chdr
File size: 3844 byte(s)
Tidying up
1 /* ASCEND modelling environment
2 Copyright (C) 2006 Carnegie Mellon University
3 Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly
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 *//** @file
20 * Variable name list
21
22 Requires:
23 #include "utilities/ascConfig.h"
24 #include "compiler.h"
25 #include "expr_types.h"
26 *//*
27 by Tom Epperly
28 August 8, 1989
29 Last in CVS: $Revision: 1.7 $ $Date: 1997/07/18 12:36:38 $ $Author: mthomas $
30 */
31
32 #ifndef ASC_VLIST_H
33 #define ASC_VLIST_H
34
35 /**<
36 * Don't ever access these things yourself. Use the functions and/or
37 * macros defined in this file.
38 */
39 struct VariableList {
40 struct VariableList *next;
41 struct Name *nptr;
42 };
43
44 extern struct VariableList *CreateVariableNode(struct Name *name);
45 /**<
46 * Create a node with Name pointer name. The next attribute is initialized to
47 * NULL.
48 */
49
50 extern void LinkVariableNodes(struct VariableList *cur, struct VariableList *next);
51 /**<
52 * Set the next attribute of cur to next. Next can be NULL, but cur cannot.
53 */
54
55 #ifdef NDEBUG
56 # define NextVariableNode(n) ((n)->next)
57 #else
58 extern CONST struct VariableList *NextVariableNodeF(CONST struct VariableList *vl);
59 /**<
60 Implementation function for NextVariableNode() (debug mode).
61 Do not call this function directly - use NextVariableNode() instead.
62 */
63 # define NextVariableNode(n) NextVariableNodeF(n)
64 #endif
65 /**<
66 Return the name list node linked to vl.
67 @param n CONST struct VariableList*, the list to query.
68 @return The node as a CONST struct VariableList*.
69 @see NextVariableNodeF()
70 */
71
72 #ifdef NDEBUG
73 # define NamePointer(n) ((n)->nptr)
74 #else
75 extern CONST struct Name *NamePointerF(CONST struct VariableList *vl);
76 /**<
77 * Implementation function for NamePointer() (debug mode).
78 * Do not call this function directly - use NamePointer() instead.
79 */
80 # define NamePointer(n) NamePointerF(n)
81 #endif
82 /**<
83 * Return the name pointer stored in node vl.
84 * @param n CONST struct VariableList*, the list to query.
85 * @return The name as a CONST struct Name*.
86 * @see NamePointerF()
87 */
88
89 extern struct VariableList *CopyVariableList(struct VariableList *vl);
90 /**<
91 * Make and return a copy of the whole name list.
92 */
93
94 extern void DestroyVariableList(struct VariableList *vl);
95 /**<
96 * Deallocate the memory associated with the list of names.
97 */
98
99 extern void DestroyVariableListNode(struct VariableList *vl);
100 /**<
101 * Deallocate this name node, and don't change the next one.
102 */
103
104 extern struct VariableList
105 *JoinVariableLists(struct VariableList *vl1, struct VariableList *vl2);
106 /**<
107 * Appends vl2 to the end of vl1. This will return vl1, unless vl1 is NULL
108 * in which case it will return vl2.
109 */
110
111 extern struct VariableList *ReverseVariableList(struct VariableList *vl);
112 /**<
113 * Returns the reverse of vl.
114 */
115
116 extern unsigned long VariableListLength(CONST struct VariableList *vl);
117 /**<
118 * Returns the length of the variable list. Does not attempt to expand arrays
119 * of variables or anything like that.
120 */
121
122 extern int CompareVariableLists(CONST struct VariableList *vl1,
123 CONST struct VariableList *vl2);
124 /**<
125 * Returns -1,0,1 as vl1 is < == > vl2 in content.
126 * The NULL list is > all lists.
127 */
128
129 #endif /* ASC_VLIST_H */

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