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

Annotation of /trunk/base/generic/compiler/find.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 33 - (hide annotations) (download) (as text)
Sun Dec 26 20:06:01 2004 UTC (15 years, 1 month ago) by ben.allan
File MIME type: text/x-chdr
File size: 6816 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 ben.allan 33 /**<
2 aw0a 1 * Ascend Instance Tree Search Routines
3     * by Tom Epperly
4     * Created: 1/24/90
5     * Version: $Revision: 1.12 $
6     * Version control file: $RCSfile: find.h,v $
7     * Date last modified: $Date: 1998/03/26 20:39:45 $
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 __FIND_H_SEEN__
31     #define __FIND_H_SEEN__
32 ben.allan 33 /**<
33 aw0a 1 * When #including find.h, make sure these files are #included first:
34     * #include "fractions.h"
35     * #include "compiler.h"
36     * #include "dimen.h"
37     * #include "types.h"
38     */
39    
40    
41     enum find_errors {
42 ben.allan 33 unmade_instance, /**< in searching found an unmade instance (NULL child)*/
43     undefined_instance, /**< instance in an expression is unknown child */
44     impossible_instance, /**< name cannot possibily exist(real error),often sets*/
45     correct_instance /**< return value when everything went okay */
46 aw0a 1 };
47 ben.allan 33 /**<
48 aw0a 1 * At present, there is a GREAT DEAL of insanity between find_errors and
49     * evaluation_error (value_type.h). In particular there is a lot of idiocy
50     * mapping undefined_instance <--> undefined_value which is just plain wrong
51     * in most cases.
52     */
53    
54     extern int ListMode;
55 ben.allan 33 /**<
56 aw0a 1 * Tells whether to evaluate a set strictly as a set i.e no order,
57     * or as a list, i.e., with order important.
58     */
59    
60     extern int EvaluatingSets;
61 ben.allan 33 /**<
62 aw0a 1 * Tells whether the evaluation of a set is in place. Used for marking
63     * atoms as mutable or not.
64     */
65    
66     extern int g_DeclarativeContext;
67 ben.allan 33 /**<
68 aw0a 1 * Tells whether declarative processing, the default = 0 , is in effect,
69     * or procedural processing as when doing initializations.
70     * Access this varible only by get and set operators below.
71     */
72     #define FINDEBUG 0
73     #if (FINDEBUG==0)
74     #define GetDeclarativeContext() g_DeclarativeContext
75     #define SetDeclarativeContext(n) g_DeclarativeContext = (n)
76     #else
77     #define GetDeclarativeContext() GetDeclarativeContextF()
78     #define SetDeclarativeContext(n) SetDeclarativeContextF((n),__FILE__,__LINE__)
79     #endif
80 ben.allan 33 /**< wrapper functions for debugging */
81 aw0a 1 extern int GetDeclarativeContextF(void);
82     extern void SetDeclarativeContextF(int,char *,int);
83    
84 ben.allan 33 /**<
85 aw0a 1 * Global variables used throughout semantic analysis to
86     * indicate context of evaluation. Do Not reference these
87     * directly, but use the macros for them instead.
88     */
89     extern CONST struct Instance *g_EvaluationContext;
90     extern struct for_table_t *g_EvaluationForTable;
91     #ifndef NDEBUG
92 ben.allan 33 #define EVALDEBUG 0 /**< 1 = contextnoisy, 2 = fornoisy, 3 = both */
93 aw0a 1 #define GetEvaluationContext() GetEvaluationContextF()
94     #define GetEvaluationForTable() GetEvaluationForTableF()
95     #if EVALDEBUG
96     #if (EVALDEBUG == 1 || EVALDEBUG == 3)
97     #define SetEvaluationContext(i) SetEvaluationContextF((i),__FILE__,__LINE__)
98 ben.allan 33 #else /**< evaldebug12*/
99 aw0a 1 #define SetEvaluationContext(i) SetEvaluationContextF(i)
100 ben.allan 33 #endif /**< evaldebug 12*/
101 aw0a 1 #if (EVALDEBUG == 2 || EVALDEBUG == 3)
102     #define SetEvaluationForTable(ft) SetEvaluationForTableF((ft),__FILE__,__LINE__)
103 ben.allan 33 #else /**< evaldebug 23 */
104 aw0a 1 #define SetEvaluationForTable(ft) SetEvaluationForTableF(ft)
105 ben.allan 33 #endif /**< evaldebug 23*/
106 aw0a 1 #else /*evaldebug*/
107     #define SetEvaluationContext(i) SetEvaluationContextF(i)
108     #define SetEvaluationForTable(ft) SetEvaluationForTableF(ft)
109     #endif /*evaldebug*/
110 ben.allan 33 #else /**< ndebug */
111 aw0a 1 #define GetEvaluationContext() g_EvaluationContext
112     #define SetEvaluationContext(i) g_EvaluationContext = (i)
113     #define GetEvaluationForTable() g_EvaluationForTable
114     #define SetEvaluationForTable(ft) g_EvaluationForTable = (ft)
115     #endif /*ndebug*/
116 ben.allan 33 /**<
117 aw0a 1 * Wrappers mainly for break point purposes of g_EvaluationContext
118     * and g_EvaluationForTable.
119     */
120     extern struct Instance *GetEvaluationContextF(void);
121     extern struct for_table_t *GetEvaluationForTableF(void);
122 ben.allan 33 #if EVALDEBUG /**< version printing file/line when setting globals */
123 aw0a 1 extern void SetEvaluationContextF(CONST struct Instance *
124     #if (EVALDEBUG == 1 || EVALDEBUG == 3)
125     ,char *,int
126 ben.allan 33 #endif /**< evaldebug 13*/
127 aw0a 1 );
128     extern void SetEvaluationForTableF(struct for_table_t *
129     #if (EVALDEBUG == 2 || EVALDEBUG == 3)
130     ,char *,int
131 ben.allan 33 #endif /**< evaldebug 23*/
132 aw0a 1 );
133 ben.allan 33 #else /**< evaldebug */
134 aw0a 1 extern void SetEvaluationContextF(CONST struct Instance *);
135     extern void SetEvaluationForTableF(struct for_table_t *);
136 ben.allan 33 #endif /**< evaldebug*/
137 aw0a 1
138     extern struct value_t InstanceEvaluateName(CONST struct Name *);
139 ben.allan 33 /**<
140 aw0a 1 * struct value_t InstanceEvaluateName(nptr)
141     * struct Name *nptr;
142     * This evaluates the name in the context given by EvaluationContext.
143     * This must be set before the InstanceEvaluateName call. Note since
144     * this is a global variable you cannot evaluate names in more than
145     * one context simultaneously.
146     *
147     * If EvaluationForTable is non-NULL, the for table will be checked before
148     * the instance tree.
149     */
150    
151     extern struct value_t InstanceEvaluateSatisfiedName(CONST struct Name *,
152     double tol);
153 ben.allan 33 /**<
154 aw0a 1 * struct value_t InstanceEvaluateName(nptr,tol)
155     * struct Name *nptr;
156     * double tol;
157     *
158     * This functionis specially to evaluate name of relations or logical
159     * relations included in SATISFIED expressions.
160     * This evaluates the name in the context given by EvaluationContext.
161     * This must be set before the InstanceEvaluateName call. Note since
162     * this is a global variable you cannot evaluate names in more than
163     * one context simultaneously.
164     * If EvaluationForTable is non-NULL, the for table will be checked before
165     * the instance tree.
166     */
167    
168     extern struct gl_list_t *FindInstances(CONST struct Instance *,
169     CONST struct Name *,
170     enum find_errors *);
171 ben.allan 33 /**<
172 aw0a 1 * struct gl_list_t *FindInstances(i,n,err)
173     * struct Instance *i;
174     * CONST struct Name *n;
175     * enum find_errors *err;
176     * Return the list of instances specified by n. If this returns NULL,
177     * it indicates that it couldn't find the name. Check err to discover why.
178     */
179 ben.allan 33 #endif /**< __FIND_H_SEEN__ */

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