CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
template_map.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_TEMPLATE_MAP_H
13#define CPROVER_CPP_TEMPLATE_MAP_H
14
15#include <map>
16#include <iosfwd>
17
18#include <util/expr.h>
19
20#include "cpp_template_args.h"
21
23class template_typet;
24
26{
27public:
28 // this maps template parameters to their instantiated value
29 typedef std::map<irep_idt, typet> type_mapt;
30 typedef std::map<irep_idt, exprt> expr_mapt;
33
34 void apply(exprt &dest) const;
35 void apply(typet &dest) const;
36
37 void swap(template_mapt &template_map)
38 {
39 type_map.swap(template_map.type_map);
40 expr_map.swap(template_map.expr_map);
41 }
42
43 exprt lookup(const irep_idt &identifier) const;
44 typet lookup_type(const irep_idt &identifier) const;
45 exprt lookup_expr(const irep_idt &identifier) const;
46
47 void print(std::ostream &out) const;
48
49 void clear()
50 {
53 }
54
55 void set(
57 const exprt &value);
58
59 void build(
60 const template_typet &template_type,
62
64 const template_typet &template_type);
65
67 const template_typet &template_type) const;
68};
69
71{
72public:
77
79 {
80 #if 0
81 std::cout << "RESTORING TEMPLATE MAP\n";
82 #endif
84 }
85
86private:
89};
90
91#endif // CPROVER_CPP_TEMPLATE_MAP_H
virtual void clear()
Reset the abstract state.
Definition ai.h:265
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
cpp_saved_template_mapt(template_mapt &map)
template_mapt & map
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
void build(const template_typet &template_type, const cpp_template_args_tct &template_args)
exprt lookup(const irep_idt &identifier) const
void build_unassigned(const template_typet &template_type)
void print(std::ostream &out) const
void apply(exprt &dest) const
expr_mapt expr_map
exprt lookup_expr(const irep_idt &identifier) const
void set(const template_parametert &parameter, const exprt &value)
typet lookup_type(const irep_idt &identifier) const
void swap(template_mapt &template_map)
std::map< irep_idt, typet > type_mapt
std::map< irep_idt, exprt > expr_mapt
type_mapt type_map
cpp_template_args_tct build_template_args(const template_typet &template_type) const
The type of an expression, extends irept.
Definition type.h:29
C++ Language Type Checking.