00001 /* --------------------------------------------------------------------------- 00002 00003 00004 This file is part of the ``compile'' package of NuSMV version 2. 00005 Copyright (C) 2010 by FBK-irst. 00006 00007 NuSMV version 2 is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Lesser General Public 00009 License as published by the Free Software Foundation; either 00010 version 2 of the License, or (at your option) any later version. 00011 00012 NuSMV version 2 is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public 00018 License along with this library; if not, write to the Free Software 00019 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 00020 00021 For more information on NuSMV see <http://nusmv.fbk.eu> 00022 or email to <nusmv-users@fbk.eu>. 00023 Please report bugs to <nusmv-users@fbk.eu>. 00024 00025 To contact the NuSMV development board, email to <nusmv@fbk.eu>. 00026 00027 -----------------------------------------------------------------------------*/ 00028 00038 #ifndef __NUSMV_CORE_COMPILE_SYMB_TABLE_RESOLVE_SYMBOL_H__ 00039 #define __NUSMV_CORE_COMPILE_SYMB_TABLE_RESOLVE_SYMBOL_H__ 00040 00041 00042 #include "nusmv/core/utils/utils.h" 00043 #include "nusmv/core/node/node.h" 00044 00051 typedef struct ResolveSymbol_TAG* ResolveSymbol_ptr; 00052 00059 #define RESOLVE_SYMBOL(self) \ 00060 ((ResolveSymbol_ptr) self) 00061 00067 #define RESOLVE_SYMBOL_CHECK_INSTANCE(self) \ 00068 (nusmv_assert(RESOLVE_SYMBOL(self) != RESOLVE_SYMBOL(NULL))) 00069 00070 /* Forward declaration of the SymbTable structure, in order to avoid 00071 circular dependency (ST needs RS, RS needs ST) */ 00072 struct SymbTable_TAG; 00073 00074 00077 /*---------------------------------------------------------------------------*/ 00078 /* Function prototypes */ 00079 /*---------------------------------------------------------------------------*/ 00080 00089 ResolveSymbol_ptr ResolveSymbol_create(void); 00090 00099 void ResolveSymbol_destroy(ResolveSymbol_ptr self); 00100 00112 boolean ResolveSymbol_is_undefined(ResolveSymbol_ptr self); 00113 00125 boolean ResolveSymbol_is_defined(ResolveSymbol_ptr self); 00126 00135 boolean ResolveSymbol_is_ambiguous(ResolveSymbol_ptr self); 00136 00143 boolean ResolveSymbol_is_var(ResolveSymbol_ptr self); 00144 00151 boolean ResolveSymbol_is_define(ResolveSymbol_ptr self); 00152 00159 boolean ResolveSymbol_is_function(ResolveSymbol_ptr self); 00160 00167 boolean ResolveSymbol_is_constant(ResolveSymbol_ptr self); 00168 00175 boolean ResolveSymbol_is_parameter(ResolveSymbol_ptr self); 00176 00183 boolean ResolveSymbol_is_array(ResolveSymbol_ptr self); 00184 00191 boolean ResolveSymbol_is_array_def(ResolveSymbol_ptr self); 00192 00201 boolean ResolveSymbol_is_error(ResolveSymbol_ptr self); 00202 00210 char* ResolveSymbol_get_error_message(ResolveSymbol_ptr self, 00211 MasterPrinter_ptr printer); 00212 00220 void ResolveSymbol_print_error_message(ResolveSymbol_ptr self, 00221 MasterPrinter_ptr printer, 00222 FILE* stream); 00223 00237 void ResolveSymbol_throw_error(ResolveSymbol_ptr self, 00238 const NuSMVEnv_ptr env); 00239 00246 node_ptr ResolveSymbol_get_resolved_name(ResolveSymbol_ptr self); 00247 00267 node_ptr ResolveSymbol_resolve(ResolveSymbol_ptr self, 00268 struct SymbTable_TAG* st, 00269 node_ptr name, 00270 node_ptr context); 00271 00276 #endif /* __NUSMV_CORE_COMPILE_SYMB_TABLE_RESOLVE_SYMBOL_H__ */