/home/doxygen/libascend/compiler/find.h

Go to the documentation of this file.
00001 /*  ASCEND modelling environment
00002     Copyright (C) 2006 Carnegie Mellon University
00003     Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2, or (at your option)
00008     any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place - Suite 330,
00018     Boston, MA 02111-1307, USA.
00019 *//*
00022     by Tom Epperly
00023     Created: 1/24/90
00024     Last in CVS: $Revision: 1.12 $ $Date: 1998/03/26 20:39:45 $ $Author: ballan $
00025 */
00026 
00027 #ifndef ASC_FIND_H
00028 #define ASC_FIND_H
00029 
00030 #include "utilities/ascConfig.h"
00031 #include "instance_enum.h"
00032 #include "expr_types.h"
00033 
00045 enum find_errors {
00046   unmade_instance,      
00047   undefined_instance,   
00048   impossible_instance,  
00049   correct_instance      
00050 };
00051 
00052 /* mmm, nasty global variables... */
00053 
00054 extern int ListMode;
00060 extern int EvaluatingSets;
00066 extern int g_DeclarativeContext;
00074 #define FINDEBUG 0
00075 #if (FINDEBUG==0)
00076 # define GetDeclarativeContext() g_DeclarativeContext
00077 
00078 # define SetDeclarativeContext(n) g_DeclarativeContext = (n)
00079 
00080 #else
00081 # define GetDeclarativeContext() GetDeclarativeContextF()
00082 
00083 extern int GetDeclarativeContextF(void);
00085 # define SetDeclarativeContext(n) SetDeclarativeContextF((n),__FILE__,__LINE__)
00086 
00087 extern void SetDeclarativeContextF(int value, char *file, int line);
00089 #endif
00090 
00091 extern CONST struct Instance *g_EvaluationContext;
00099 extern struct for_table_t *g_EvaluationForTable;
00107 #ifndef NDEBUG
00108 # define EVALDEBUG 0 
00109 # define GetEvaluationContext() GetEvaluationContextF()
00110 # define GetEvaluationForTable() GetEvaluationForTableF()
00111 # if EVALDEBUG
00112 #  if (EVALDEBUG == 1 || EVALDEBUG == 3)
00113 #   define SetEvaluationContext(i) SetEvaluationContextF((i),__FILE__,__LINE__)
00114 #  else
00115 #   define SetEvaluationContext(i) SetEvaluationContextF(i)
00116 #  endif
00117 #  if (EVALDEBUG == 2 || EVALDEBUG == 3)
00118 #   define SetEvaluationForTable(ft) SetEvaluationForTableF((ft),__FILE__,__LINE__)
00119 #  else
00120 #   define SetEvaluationForTable(ft) SetEvaluationForTableF(ft)
00121 #  endif
00122 # else
00123 #  define SetEvaluationContext(i) SetEvaluationContextF(i)
00124 #  define SetEvaluationForTable(ft) SetEvaluationForTableF(ft)
00125 # endif
00126 #else
00127 # define GetEvaluationContext() g_EvaluationContext
00128 # define SetEvaluationContext(i) g_EvaluationContext = (i)
00129 # define GetEvaluationForTable() g_EvaluationForTable
00130 # define SetEvaluationForTable(ft) g_EvaluationForTable = (ft)
00131 #endif
00132 
00133 /*
00134     Wrappers mainly for break point purposes of g_EvaluationContext
00135     and g_EvaluationForTable.
00136 */
00137 extern struct Instance *GetEvaluationContextF(void);
00140 extern struct for_table_t *GetEvaluationForTableF(void);#include "expr_types.h"
00142 
00143 #if EVALDEBUG /* version printing file/line when setting globals */
00144 extern void SetEvaluationContextF(
00145         CONST struct Instance *i
00146 # if (EVALDEBUG == 1 || EVALDEBUG == 3)
00147         ,char *file, int line
00148 # endif
00149 );
00152 extern void SetEvaluationForTableF(
00153         struct for_table_t *ft
00154 # if (EVALDEBUG == 2 || EVALDEBUG == 3)
00155         ,char *file, int line
00156 # endif
00157 );
00160 #else /* EVALDEBUG */
00161 
00162 extern void SetEvaluationContextF(CONST struct Instance *i);
00164 extern void SetEvaluationForTableF(struct for_table_t *ft);
00167 #endif /* EVALDEBUG*/
00168 
00169 extern struct value_t InstanceEvaluateName(CONST struct Name *nptr);
00180 extern struct value_t InstanceEvaluateSatisfiedName(
00181         CONST struct Name *nptr, double tol
00182 );
00194 extern struct gl_list_t *FindInstances(
00195         CONST struct Instance *i,
00196         CONST struct Name *n, enum find_errors *err
00197 );
00204 extern struct gl_list_t *FindInstancesFromNames(
00205         CONST struct Instance *i,
00206         CONST struct gl_list_t *names,
00207         enum find_errors *err, unsigned long *errpos
00208 );
00216 /* @} */
00217 
00218 #endif /* ASC_FIND_H */
00219 

Generated on Thu Jul 17 04:00:10 2008 for libascend by  doxygen 1.5.1