cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
typecheck.cpp
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module:
4
5
Author: Daniel Kroening, kroening@kroening.com
6
7
\*******************************************************************/
8
9
#include "
typecheck.h
"
10
11
#include "
exception_utils.h
"
12
#include "
invariant.h
"
13
14
bool
typecheckt::typecheck_main
()
15
{
16
PRECONDITION
(
message_handler
);
17
18
const
unsigned
errors_before=
19
message_handler
->get_message_count(
messaget::M_ERROR
);
20
21
try
22
{
23
typecheck
();
24
}
25
26
catch
(
int
)
27
{
28
error
();
29
}
30
31
catch
(
const
char
*e)
32
{
33
error
() << e <<
eom
;
34
}
35
36
catch
(
const
std::string &e)
37
{
38
error
() << e <<
eom
;
39
}
40
41
catch
(
const
invalid_source_file_exceptiont
&e)
42
{
43
error
().
source_location
= e.get_source_location();
44
error
() << e.get_reason() <<
messaget::eom
;
45
}
46
47
catch
(
const
errort
&e)
48
{
49
if
(e.what().empty())
50
error
();
51
else
52
{
53
error
().
source_location
= e.source_location();
54
error
() << e.what() <<
messaget::eom
;
55
}
56
}
57
58
return
message_handler
->get_message_count(
messaget::M_ERROR
)!=errors_before;
59
}
invalid_source_file_exceptiont
Thrown when we can't handle something in an input source file.
Definition
exception_utils.h:172
messaget::mstreamt::source_location
source_locationt source_location
Definition
message.h:239
messaget::message_handler
message_handlert * message_handler
Definition
message.h:431
messaget::error
mstreamt & error() const
Definition
message.h:391
messaget::M_ERROR
@ M_ERROR
Definition
message.h:169
messaget::eom
static eomt eom
Definition
message.h:289
typecheckt::errort
Definition
typecheck.h:26
typecheckt::typecheck
virtual void typecheck()=0
typecheckt::typecheck_main
virtual bool typecheck_main()
Definition
typecheck.cpp:14
exception_utils.h
invariant.h
PRECONDITION
#define PRECONDITION(CONDITION)
Definition
invariant.h:463
typecheck.h
util
typecheck.cpp
Generated by
1.17.0