CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ansi_c_scope.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module:
4
5Author: Daniel Kroening, kroening@kroening.com
6
7\*******************************************************************/
8
9
10#ifndef CPROVER_ANSI_C_ANSI_C_SCOPE_H
11#define CPROVER_ANSI_C_ANSI_C_SCOPE_H
12
13#include <util/irep.h>
14
15#include <unordered_map>
16
25
26std::ostream &operator<<(std::ostream &os, ansi_c_id_classt c);
27
38
40{
41public:
42 // This maps "scope names" (tag-X, label-X, X) to
43 // ansi_c_identifiert.
44 typedef std::unordered_map<irep_idt, ansi_c_identifiert> name_mapt;
46
47 std::string prefix;
48
49 // We remember the last declarator for the benefit
50 // of function argument scoping.
52
53 // for(;;) and { } scopes are numbered
55 unsigned anon_counter;
56
58
59 void swap(ansi_c_scopet &scope)
60 {
61 name_map.swap(scope.name_map);
62 prefix.swap(scope.prefix);
64 std::swap(compound_counter, scope.compound_counter);
65 }
66
67 void print(std::ostream &out) const;
68};
69
70#endif // CPROVER_ANSI_C_ANSI_C_SCOPE_H
std::ostream & operator<<(std::ostream &os, ansi_c_id_classt c)
ansi_c_id_classt
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
ansi_c_id_classt id_class
unsigned anon_counter
void print(std::ostream &out) const
void swap(ansi_c_scopet &scope)
std::string prefix
name_mapt name_map
std::unordered_map< irep_idt, ansi_c_identifiert > name_mapt
unsigned compound_counter
irep_idt last_declarator
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition dstring.h:38
void swap(dstringt &b)
Definition dstring.h:162