CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cpp_typecheck_resolve.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: C++ Language Type Checking
4
5Author: Daniel Kroening, kroening@cs.cmu.edu
6
7\*******************************************************************/
8
11
12#ifndef CPROVER_CPP_CPP_TYPECHECK_RESOLVE_H
13#define CPROVER_CPP_CPP_TYPECHECK_RESOLVE_H
14
15#include <util/std_types.h>
16
17#include "cpp_template_args.h"
18#include "cpp_scopes.h"
19
20class cpp_namet;
22
24{
25public:
28
29 enum class wantt { VAR, TYPE, BOTH };
30
32 const cpp_namet &cpp_name,
33 const wantt want,
35 bool fail_with_exception=true);
36
37 // Returns the scope as a side-effect as 'current_scope'.
38 // Should really return explicitly.
40 const cpp_namet &cpp_name,
41 irep_idt &base_name,
43
45
46protected:
50
51 typedef std::vector<exprt> resolve_identifierst;
52
56 resolve_identifierst &identifiers);
57
59 const cpp_idt &id);
60
62 const cpp_idt &id,
64
66 resolve_identifierst &identifiers,
68
70 resolve_identifierst &identifiers,
72
73 void filter(
74 resolve_identifierst &identifiers,
75 const wantt want);
76
78 const irep_idt &base_name,
81
83 resolve_identifierst &identifiers);
84
86 resolve_identifierst &identifiers,
89
91 exprt &expr,
94
96 resolve_identifierst &identifiers,
98
100 resolve_identifierst &identifiers);
101
103 resolve_identifierst &identifiers);
104
106 const exprt &expr,
108
111 const typet &desired_type);
112
115 const exprt &desired_expr);
116
118 const exprt &expr,
119 unsigned &args_distance,
121
122 void resolve_argument(
125
127 const irep_idt &base_name,
130
131 void show_identifiers(
132 const irep_idt &base_name,
133 const resolve_identifierst &identifiers,
134 std::ostream &out);
135
138 const irep_idt &base_name,
140
143
144 struct matcht
145 {
146 std::size_t cost;
160
161 bool operator<(const matcht &other) const
162 {
163 return cost<other.cost;
164 }
165 };
166};
167
168#endif // CPROVER_CPP_CPP_TYPECHECK_RESOLVE_H
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
std::set< cpp_idt * > id_sett
Definition cpp_scopes.h:30
void remove_templates(resolve_identifierst &identifiers)
void filter(resolve_identifierst &identifiers, const wantt want)
exprt convert_template_parameter(const cpp_idt &id)
exprt convert_identifier(const cpp_idt &id, const cpp_typecheck_fargst &fargs)
cpp_scopet & resolve_namespace(const cpp_namet &cpp_name)
std::vector< exprt > resolve_identifierst
void remove_duplicates(resolve_identifierst &identifiers)
void filter_for_namespaces(cpp_scopest::id_sett &id_set)
exprt resolve(const cpp_namet &cpp_name, const wantt want, const cpp_typecheck_fargst &fargs, bool fail_with_exception=true)
void resolve_argument(exprt &argument, const cpp_typecheck_fargst &fargs)
exprt do_builtin(const irep_idt &base_name, const cpp_typecheck_fargst &fargs, const cpp_template_args_non_tct &template_args)
void show_identifiers(const irep_idt &base_name, const resolve_identifierst &identifiers, std::ostream &out)
void filter_for_named_scopes(cpp_scopest::id_sett &id_set)
void make_constructors(resolve_identifierst &identifiers)
void guess_function_template_args(resolve_identifierst &identifiers, const cpp_typecheck_fargst &fargs)
guess arguments of function templates
void convert_identifiers(const cpp_scopest::id_sett &id_set, const cpp_typecheck_fargst &fargs, resolve_identifierst &identifiers)
void disambiguate_functions(resolve_identifierst &identifiers, const cpp_typecheck_fargst &fargs)
void apply_template_args(resolve_identifierst &identifiers, const cpp_template_args_non_tct &template_args, const cpp_typecheck_fargst &fargs)
void resolve_with_arguments(cpp_scopest::id_sett &id_set, const irep_idt &base_name, const cpp_typecheck_fargst &fargs)
cpp_scopet & resolve_scope(const cpp_namet &cpp_name, irep_idt &base_name, cpp_template_args_non_tct &template_args)
struct_tag_typet disambiguate_template_classes(const irep_idt &base_name, const cpp_scopest::id_sett &id_set, const cpp_template_args_non_tct &template_args)
disambiguate partial specialization
void exact_match_functions(resolve_identifierst &identifiers, const cpp_typecheck_fargst &fargs)
void guess_template_args(const typet &template_parameter, const typet &desired_type)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition dstring.h:38
Base class for all expressions.
Definition expr.h:56
A struct tag type, i.e., struct_typet with an identifier.
Definition std_types.h:493
The type of an expression, extends irept.
Definition type.h:29
C++ Language Type Checking.
C++ Language Type Checking.
Pre-defined types.
bool operator<(const matcht &other) const
matcht(cpp_template_args_tct _s_args, cpp_template_args_tct _f_args, irep_idt _id)
cpp_template_args_tct specialization_args