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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 767 by johnpye, Wed Jun 21 07:00:45 2006 UTC revision 768 by johnpye, Thu Jul 13 07:39:30 2006 UTC
# Line 1  Line 1 
1  /*  /*  ASCEND modelling environment
2   *  Ascend Instance Tree Search Routines      Copyright (C) 2006 Carnegie Mellon University
3   *  by Tom Epperly      Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly
4   *  Created: 1/24/90  
5   *  Version: $Revision: 1.12 $      This program is free software; you can redistribute it and/or modify
6   *  Version control file: $RCSfile: find.h,v $      it under the terms of the GNU General Public License as published by
7   *  Date last modified: $Date: 1998/03/26 20:39:45 $      the Free Software Foundation; either version 2, or (at your option)
8   *  Last modified by: $Author: ballan $      any later version.
9   *  
10   *  This file is part of the Ascend Language Interpreter.      This program is distributed in the hope that it will be useful,
11   *      but WITHOUT ANY WARRANTY; without even the implied warranty of
12   *  Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   *      GNU General Public License for more details.
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      You should have received a copy of the GNU General Public License
16   *  published by the Free Software Foundation; either version 2 of the      along with this program; if not, write to the Free Software
17   *  License, or (at your option) any later version.      Foundation, Inc., 59 Temple Place - Suite 330,
18   *      Boston, MA 02111-1307, USA.
19   *  The Ascend Language Interpreter is distributed in hope that it will be  *//** @file
20   *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of      Ascend Instance Tree Search Routines.
21   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      
22   *  General Public License for more details.      Requires:
23   *      #include "utilities/ascConfig.h"
24   *  You should have received a copy of the GNU General Public License      #include "fractions.h"
25   *  along with the program; if not, write to the Free Software Foundation,      #include "compiler.h"
26   *  Inc., 675 Mass Ave, Cambridge, MA 02139 USA.  Check the file named      #include "instance_enum.h"
27   *  COPYING.      #include "dimen.h"
28   */      #include "expr_types.h"
29    *//*
30  /** @file      by Tom Epperly
31   *  Ascend Instance Tree Search Routines.      Created: 1/24/90
32   *  <pre>      Last in CVS: $Revision: 1.12 $ $Date: 1998/03/26 20:39:45 $ $Author: ballan $
33   *  When #including find.h, make sure these files are #included first:  */
  *         #include "utilities/ascConfig.h"  
  *         #include "fractions.h"  
  *         #include "compiler.h"  
  *         #include "instance_enum.h"  
  *         #include "dimen.h"  
  *         #include "expr_types.h"  
  *  </pre>  
  */  
34    
35  #ifndef ASC_FIND_H  #ifndef ASC_FIND_H
36  #define ASC_FIND_H  #define ASC_FIND_H
# Line 81  extern int g_DeclarativeContext; Line 73  extern int g_DeclarativeContext;
73    
74  #define FINDEBUG 0  #define FINDEBUG 0
75  #if (FINDEBUG==0)  #if (FINDEBUG==0)
76  /** retrieve the declarative context */  # define GetDeclarativeContext() g_DeclarativeContext
77  #define GetDeclarativeContext() g_DeclarativeContext    /**< retrieve the declarative context */
78  #define SetDeclarativeContext(n) g_DeclarativeContext = (n)  # define SetDeclarativeContext(n) g_DeclarativeContext = (n)
79  /**< set the declarative context */    /**< set the declarative context */
80  #else  #else
81  /** retrieve the declarative context */  # define GetDeclarativeContext() GetDeclarativeContextF()
82  #define GetDeclarativeContext() GetDeclarativeContextF()    /** retrieve the declarative context */
 #define SetDeclarativeContext(n) SetDeclarativeContextF((n),__FILE__,__LINE__)  
 /**< set the declarative context */  
 #endif  
83  extern int GetDeclarativeContextF(void);  extern int GetDeclarativeContextF(void);
84  /**< retrieve the declarative context (for debugging) */    /**< retrieve the declarative context (for debugging) */
85    # define SetDeclarativeContext(n) SetDeclarativeContextF((n),__FILE__,__LINE__)
86      /**< set the declarative context */
87  extern void SetDeclarativeContextF(int value, char *file, int line);  extern void SetDeclarativeContextF(int value, char *file, int line);
88  /**< set the declarative context (for debugging) */    /**< set the declarative context (for debugging) */
89    #endif
90    
91  extern CONST struct Instance *g_EvaluationContext;  extern CONST struct Instance *g_EvaluationContext;
92  /**<  /**<
# Line 103  extern CONST struct Instance *g_Evaluati Line 95  extern CONST struct Instance *g_Evaluati
95   * directly, but use GetEvaluationContext() and   * directly, but use GetEvaluationContext() and
96   * SetEvaluationContext() instead.   * SetEvaluationContext() instead.
97   */   */
98    
99  extern struct for_table_t *g_EvaluationForTable;  extern struct for_table_t *g_EvaluationForTable;
100  /**<  /**<
101   * Global variable used throughout semantic analysis to   * Global variable used throughout semantic analysis to
# Line 112  extern struct for_table_t *g_EvaluationF Line 105  extern struct for_table_t *g_EvaluationF
105   */   */
106    
107  #ifndef NDEBUG  #ifndef NDEBUG
108  #define EVALDEBUG 0 /**< 1 = contextnoisy, 2 = fornoisy, 3 = both */  # define EVALDEBUG 0 /**< 1 = contextnoisy, 2 = fornoisy, 3 = both */
109  #define GetEvaluationContext() GetEvaluationContextF()  # define GetEvaluationContext() GetEvaluationContextF()
110  #define GetEvaluationForTable() GetEvaluationForTableF()  # define GetEvaluationForTable() GetEvaluationForTableF()
111  #if EVALDEBUG  # if EVALDEBUG
112  #if (EVALDEBUG == 1 || EVALDEBUG == 3)  #  if (EVALDEBUG == 1 || EVALDEBUG == 3)
113  #define SetEvaluationContext(i) SetEvaluationContextF((i),__FILE__,__LINE__)  #   define SetEvaluationContext(i) SetEvaluationContextF((i),__FILE__,__LINE__)
114  #else /* evaldebug 12 */  #  else
115  #define SetEvaluationContext(i) SetEvaluationContextF(i)  #   define SetEvaluationContext(i) SetEvaluationContextF(i)
116  #endif /* evaldebug  12 */  #  endif
117  #if (EVALDEBUG == 2 || EVALDEBUG == 3)  #  if (EVALDEBUG == 2 || EVALDEBUG == 3)
118  #define SetEvaluationForTable(ft) SetEvaluationForTableF((ft),__FILE__,__LINE__)  #   define SetEvaluationForTable(ft) SetEvaluationForTableF((ft),__FILE__,__LINE__)
119  #else /* evaldebug 23 */  #  else
120  #define SetEvaluationForTable(ft) SetEvaluationForTableF(ft)  #   define SetEvaluationForTable(ft) SetEvaluationForTableF(ft)
121  #endif /* evaldebug  23 */  #  endif
122  #else /* evaldebug */  # else
123  #define SetEvaluationContext(i) SetEvaluationContextF(i)  #  define SetEvaluationContext(i) SetEvaluationContextF(i)
124  #define SetEvaluationForTable(ft) SetEvaluationForTableF(ft)  #  define SetEvaluationForTable(ft) SetEvaluationForTableF(ft)
125  #endif /* evaldebug */  # endif
126  #else /* ndebug */  #else
127  #define GetEvaluationContext() g_EvaluationContext  # define GetEvaluationContext() g_EvaluationContext
128  #define SetEvaluationContext(i) g_EvaluationContext = (i)  # define SetEvaluationContext(i) g_EvaluationContext = (i)
129  #define GetEvaluationForTable() g_EvaluationForTable  # define GetEvaluationForTable() g_EvaluationForTable
130  #define SetEvaluationForTable(ft) g_EvaluationForTable = (ft)  # define SetEvaluationForTable(ft) g_EvaluationForTable = (ft)
131  #endif /* ndebug */  #endif
132    
133  /*  /*
134   * Wrappers mainly for break point purposes of g_EvaluationContext   * Wrappers mainly for break point purposes of g_EvaluationContext
# Line 171  extern void SetEvaluationForTableF(struc Line 164  extern void SetEvaluationForTableF(struc
164    
165  extern struct value_t InstanceEvaluateName(CONST struct Name *nptr);  extern struct value_t InstanceEvaluateName(CONST struct Name *nptr);
166  /**<  /**<
  *  <!--  struct value_t InstanceEvaluateName(nptr)                    -->  
  *  <!--  struct Name *nptr;                                           -->  
167   *  This evaluates the name in the context given by EvaluationContext.   *  This evaluates the name in the context given by EvaluationContext.
168   *  This must be set before the InstanceEvaluateName call.  Note since   *  This must be set before the InstanceEvaluateName call.  Note since
169   *  this is a global variable you cannot evaluate names in more than   *  this is a global variable you cannot evaluate names in more than
170   *  one context simultaneously.<br><br>   *  one context simultaneously.
171   *   *
172   *  If EvaluationForTable is non-NULL, the for table will be checked before   *  If EvaluationForTable is non-NULL, the for table will be checked before
173   *  the instance tree.   *  the instance tree.
# Line 185  extern struct value_t InstanceEvaluateNa Line 176  extern struct value_t InstanceEvaluateNa
176  extern struct value_t InstanceEvaluateSatisfiedName(CONST struct Name *nptr,  extern struct value_t InstanceEvaluateSatisfiedName(CONST struct Name *nptr,
177                                                      double tol);                                                      double tol);
178  /**<  /**<
179   *  <!--  struct value_t InstanceEvaluateName(nptr,tol)                -->   *  This function is specially to evaluate name of relations or logical
  *  <!--  struct Name *nptr;                                           -->  
  *  <!--  double tol;                                                  -->  
  *  
  *  This functionis specially to evaluate name of relations or logical  
180   *  relations included in SATISFIED expressions.   *  relations included in SATISFIED expressions.
181   *  This evaluates the name in the context given by EvaluationContext.   *  This evaluates the name in the context given by EvaluationContext.
182   *  This must be set before the InstanceEvaluateName call.  Note since   *  This must be set before the InstanceEvaluateName call.  Note since
# Line 203  extern struct gl_list_t *FindInstances(C Line 190  extern struct gl_list_t *FindInstances(C
190                                         CONST struct Name *n,                                         CONST struct Name *n,
191                                         enum find_errors *err);                                         enum find_errors *err);
192  /**<  /**<
  *  <!--  struct gl_list_t *FindInstances(i,n,err)                     -->  
  *  <!--  struct Instance *i;                                          -->  
  *  <!--  CONST struct Name *n;                                        -->  
  *  <!--  enum find_errors *err;                                       -->  
193   *  Return the list of instances specified by n.  If this returns NULL,   *  Return the list of instances specified by n.  If this returns NULL,
194   *  it indicates that it couldn't find the name.  Check err to discover why.   *  it indicates that it couldn't find the name.  Check err to discover why.
195   */   */

Legend:
Removed from v.767  
changed lines
  Added in v.768

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