cprover
typecheck.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module:
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
9 
10 #ifndef CPROVER_UTIL_TYPECHECK_H
11 #define CPROVER_UTIL_TYPECHECK_H
12 
13 #include "expr.h"
14 #include "message.h"
15 
16 class typecheckt:public messaget
17 {
18 public:
19  explicit typecheckt(message_handlert &_message_handler):
20  messaget(_message_handler)
21  {
22  }
23 
24  virtual ~typecheckt() { }
25 
26  // not pretty, but makes transition easier
28  {
30  }
31 
32  // not pretty, but makes transition easier
33  void err_location(const exprt &src)
34  {
36  }
37 
38  void err_location(const typet &src)
39  {
41  }
42 
43 protected:
44  // main function -- overload this one
45  virtual void typecheck()=0;
46 
47 public:
48  // call that one
49  virtual bool typecheck_main();
50 };
51 
52 #endif // CPROVER_UTIL_TYPECHECK_H
#define loc()
The type of an expression.
Definition: type.h:22
void err_location(const exprt &src)
Definition: typecheck.h:33
void err_location(const typet &src)
Definition: typecheck.h:38
virtual ~typecheckt()
Definition: typecheck.h:24
const source_locationt & find_source_location() const
Definition: expr.cpp:246
source_locationt source_location
Definition: message.h:214
mstreamt & error() const
Definition: message.h:302
virtual void typecheck()=0
void err_location(const source_locationt &loc)
Definition: typecheck.h:27
const source_locationt & source_location() const
Definition: type.h:97
Base class for all expressions.
Definition: expr.h:42
typecheckt(message_handlert &_message_handler)
Definition: typecheck.h:19
virtual bool typecheck_main()
Definition: typecheck.cpp:13