00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00039 #ifndef __NUSMV_CORE_COMPILE_TYPE_CHECKING_CHECKERS_CHECKER_BASE_PRIVATE_H__
00040 #define __NUSMV_CORE_COMPILE_TYPE_CHECKING_CHECKERS_CHECKER_BASE_PRIVATE_H__
00041
00042
00043 #include "nusmv/core/compile/type_checking/checkers/CheckerBase.h"
00044 #include "nusmv/core/compile/type_checking/checkers/checkersInt.h"
00045
00046 #include "nusmv/core/node/NodeWalker_private.h"
00047 #include "nusmv/core/compile/type_checking/TypeChecker.h"
00048 #include "nusmv/core/compile/type_checking/TypeChecker_private.h"
00049
00050 #include "nusmv/core/utils/utils.h"
00051
00052
00061
00062 #define _THROW(exp, ctx) \
00063 (NodeWalker_can_handle(NODE_WALKER(self), exp) ? \
00064 CHECKER_BASE(self)->check_expr(self, exp, ctx) : \
00065 type_checker_check_expression(TYPE_CHECKER(NODE_WALKER(self)->master), \
00066 exp, ctx))
00067
00077 typedef struct CheckerBase_TAG
00078 {
00079
00080 INHERITS_FROM(NodeWalker);
00081
00082
00083
00084
00085
00086
00087
00088 TypeCheckingViolationHandler_ptr viol_handler;
00089
00090 SymbType_ptr (*check_expr)(CheckerBase_ptr self, node_ptr exp, node_ptr ctx);
00091
00092 } CheckerBase;
00093
00094
00095
00096
00097
00098
00099
00114 CheckerBase_ptr CheckerBase_create(const NuSMVEnv_ptr env,
00115 const char* name,
00116 int low, size_t num);
00117
00126 void
00127 checker_base_init(CheckerBase_ptr self, const NuSMVEnv_ptr env,
00128 const char* name, int low, size_t num);
00129
00138 void checker_base_deinit(CheckerBase_ptr self);
00139
00149 VIRTUAL boolean
00150 checker_base_manage_violation(CheckerBase_ptr self,
00151 TypeSystemViolation violation,
00152 node_ptr expression);
00153
00160 void
00161 checker_base_print_type(CheckerBase_ptr self, FILE* output_stream,
00162 node_ptr expression, node_ptr context);
00163
00164
00165 #endif