cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
cpp_declarator_converter.h
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: C++ Language Type Checking
4
5
Author: Daniel Kroening, kroening@cs.cmu.edu
6
7
\*******************************************************************/
8
11
12
#ifndef CPROVER_CPP_CPP_DECLARATOR_CONVERTER_H
13
#define CPROVER_CPP_CPP_DECLARATOR_CONVERTER_H
14
15
#include "
cpp_declaration.h
"
16
17
class
cpp_scopet
;
18
class
symbolt
;
19
20
// converts a cpp_declator plus some
21
// additional information stored in the class
22
// into a symbol
23
24
class
cpp_declarator_convertert
25
{
26
public
:
27
cpp_declarator_convertert
(
28
class
cpp_typecheckt
&_cpp_typecheck);
29
30
bool
is_typedef
;
31
bool
is_template
;
32
bool
is_template_parameter
;
33
bool
is_friend
;
34
irep_idt
linkage_spec
;
35
36
symbolt
&
convert
(
37
const
typet
&type,
// already typechecked
38
const
cpp_storage_spect
&storage_spec,
39
const
cpp_member_spect
&member_spec,
40
cpp_declaratort
&declarator);
41
42
symbolt
&
convert
(
43
const
cpp_declarationt
&declaration,
44
cpp_declaratort
&declarator)
45
{
46
return
convert
(
47
declaration.
type
(),
48
declaration.
storage_spec
(),
49
declaration.
member_spec
(),
50
declarator);
51
}
52
53
class
cpp_typecheckt
&
cpp_typecheck
;
54
55
protected
:
56
irep_idt
base_name
;
57
typet
final_type
;
58
cpp_scopet
*
scope
;
59
irep_idt
final_identifier
;
60
bool
is_code
;
61
62
void
get_final_identifier
();
63
irep_idt
get_pretty_name
();
64
65
symbolt
&
convert_new_symbol
(
66
const
cpp_storage_spect
&storage_spec,
67
const
cpp_member_spect
&member_spec,
68
cpp_declaratort
&declarator);
69
70
void
handle_initializer
(
71
symbolt
&symbol,
72
cpp_declaratort
&declarator);
73
74
void
operator_overloading_rules
(
const
symbolt
&symbol);
75
void
main_function_rules
(
const
symbolt
&symbol);
76
77
void
enforce_rules
(
const
symbolt
&symbol);
78
79
void
check_array_types
(
80
typet
&type,
81
bool
force_constant);
82
83
bool
is_code_type
(
const
typet
&type)
const
84
{
85
return
type.
id
() == ID_code ||
86
(type.
id
() == ID_template &&
87
to_template_type
(type).subtype().
id
() == ID_code);
88
}
89
90
void
combine_types
(
91
const
source_locationt
&source_location,
92
const
typet
&decl_type,
93
symbolt
&symbol);
94
};
95
96
#endif
// CPROVER_CPP_CPP_DECLARATOR_CONVERTER_H
cpp_declarationt
Definition
cpp_declaration.h:22
cpp_declarationt::member_spec
const cpp_member_spect & member_spec() const
Definition
cpp_declaration.h:84
cpp_declarationt::storage_spec
const cpp_storage_spect & storage_spec() const
Definition
cpp_declaration.h:72
cpp_declarator_convertert::handle_initializer
void handle_initializer(symbolt &symbol, cpp_declaratort &declarator)
Definition
cpp_declarator_converter.cpp:346
cpp_declarator_convertert::linkage_spec
irep_idt linkage_spec
Definition
cpp_declarator_converter.h:34
cpp_declarator_convertert::check_array_types
void check_array_types(typet &type, bool force_constant)
cpp_declarator_convertert::scope
cpp_scopet * scope
Definition
cpp_declarator_converter.h:58
cpp_declarator_convertert::is_typedef
bool is_typedef
Definition
cpp_declarator_converter.h:30
cpp_declarator_convertert::convert_new_symbol
symbolt & convert_new_symbol(const cpp_storage_spect &storage_spec, const cpp_member_spect &member_spec, cpp_declaratort &declarator)
Definition
cpp_declarator_converter.cpp:440
cpp_declarator_convertert::final_type
typet final_type
Definition
cpp_declarator_converter.h:57
cpp_declarator_convertert::is_friend
bool is_friend
Definition
cpp_declarator_converter.h:33
cpp_declarator_convertert::is_code_type
bool is_code_type(const typet &type) const
Definition
cpp_declarator_converter.h:83
cpp_declarator_convertert::is_code
bool is_code
Definition
cpp_declarator_converter.h:60
cpp_declarator_convertert::get_pretty_name
irep_idt get_pretty_name()
Definition
cpp_declarator_converter.cpp:568
cpp_declarator_convertert::convert
symbolt & convert(const cpp_declarationt &declaration, cpp_declaratort &declarator)
Definition
cpp_declarator_converter.h:42
cpp_declarator_convertert::operator_overloading_rules
void operator_overloading_rules(const symbolt &symbol)
Definition
cpp_declarator_converter.cpp:595
cpp_declarator_convertert::cpp_declarator_convertert
cpp_declarator_convertert(class cpp_typecheckt &_cpp_typecheck)
Definition
cpp_declarator_converter.cpp:24
cpp_declarator_convertert::combine_types
void combine_types(const source_locationt &source_location, const typet &decl_type, symbolt &symbol)
Definition
cpp_declarator_converter.cpp:257
cpp_declarator_convertert::final_identifier
irep_idt final_identifier
Definition
cpp_declarator_converter.h:59
cpp_declarator_convertert::main_function_rules
void main_function_rules(const symbolt &symbol)
Definition
cpp_declarator_converter.cpp:600
cpp_declarator_convertert::convert
symbolt & convert(const typet &type, const cpp_storage_spect &storage_spec, const cpp_member_spect &member_spec, cpp_declaratort &declarator)
Definition
cpp_declarator_converter.cpp:36
cpp_declarator_convertert::base_name
irep_idt base_name
Definition
cpp_declarator_converter.h:56
cpp_declarator_convertert::cpp_typecheck
class cpp_typecheckt & cpp_typecheck
Definition
cpp_declarator_converter.h:53
cpp_declarator_convertert::get_final_identifier
void get_final_identifier()
Definition
cpp_declarator_converter.cpp:398
cpp_declarator_convertert::is_template_parameter
bool is_template_parameter
Definition
cpp_declarator_converter.h:32
cpp_declarator_convertert::enforce_rules
void enforce_rules(const symbolt &symbol)
Definition
cpp_declarator_converter.cpp:337
cpp_declarator_convertert::is_template
bool is_template
Definition
cpp_declarator_converter.h:31
cpp_declaratort
Definition
cpp_declarator.h:20
cpp_member_spect
Definition
cpp_member_spec.h:17
cpp_scopet
Definition
cpp_scope.h:21
cpp_storage_spect
Definition
cpp_storage_spec.h:18
cpp_typecheckt
Definition
cpp_typecheck.h:43
exprt::type
typet & type()
Return the type of the expression.
Definition
expr.h:85
irept::id
const irep_idt & id() const
Definition
irep.h:388
source_locationt
Definition
source_location.h:20
symbolt
Symbol table entry.
Definition
symbol.h:28
typet
The type of an expression, extends irept.
Definition
type.h:29
cpp_declaration.h
C++ Language Type Checking.
to_template_type
template_typet & to_template_type(typet &type)
Definition
cpp_template_type.h:50
irep_idt
dstringt irep_idt
Definition
verification_result.h:16
cpp
cpp_declarator_converter.h
Generated by
1.17.0