CBMC
Loading...
Searching...
No Matches
empty_namespacet Class Reference

A namespacet that contains an empty symbol table, for use in tests that need a namespacet but don't actually look up any symbols. More...

#include <empty_namespace.h>

+ Inheritance diagram for empty_namespacet:
+ Collaboration diagram for empty_namespacet:

Public Member Functions

 empty_namespacet ()
 
 empty_namespacet (const empty_namespacet &)=delete
 
 empty_namespacet (empty_namespacet &&)=delete
 
empty_namespacetoperator= (const empty_namespacet &)=delete
 
empty_namespacetoperator= (empty_namespacet &&)=delete
 
- Public Member Functions inherited from namespacet
 namespacet (const symbol_table_baset &_symbol_table)
 
 namespacet (const symbol_table_baset &_symbol_table1, const symbol_table_baset &_symbol_table2)
 
 namespacet (const symbol_table_baset *_symbol_table1, const symbol_table_baset *_symbol_table2)
 
bool lookup (const irep_idt &name, const symbolt *&symbol) const override
 See documentation for namespace_baset::lookup().
 
std::size_t smallest_unused_suffix (const std::string &prefix) const override
 See documentation for namespace_baset::smallest_unused_suffix().
 
const symbol_table_basetget_symbol_table () const
 Return first symbol table registered with the namespace.
 
const symboltlookup (const irep_idt &name) const
 Lookup a symbol in the namespace.
 
const symboltlookup (const symbol_exprt &) const
 Generic lookup function for a symbol expression in a symbol table.
 
const symboltlookup (const tag_typet &) const
 Generic lookup function for a tag type in a symbol table.
 
virtual bool lookup (const irep_idt &name, const symbolt *&symbol) const=0
 Searches for a symbol named name.
 
- Public Member Functions inherited from namespace_baset
const symboltlookup (const irep_idt &name) const
 Lookup a symbol in the namespace.
 
const symboltlookup (const symbol_exprt &) const
 Generic lookup function for a symbol expression in a symbol table.
 
const symboltlookup (const tag_typet &) const
 Generic lookup function for a tag type in a symbol table.
 
virtual ~namespace_baset ()
 
void follow_macros (exprt &) const
 Follow macros to their values in a given expression.
 
const union_typetfollow_tag (const union_tag_typet &) const
 Follow type tag of union type.
 
const struct_typetfollow_tag (const struct_tag_typet &) const
 Follow type tag of struct type.
 
const c_enum_typetfollow_tag (const c_enum_tag_typet &) const
 Follow type tag of enum type.
 
const struct_union_typetfollow_tag (const struct_or_union_tag_typet &) const
 Resolve a struct_tag_typet or union_tag_typet to the complete version.
 

Additional Inherited Members

- Protected Attributes inherited from namespacet
const symbol_table_basetsymbol_table1
 
const symbol_table_basetsymbol_table2
 
- Private Types inherited from symbol_table_baset
typedef std::unordered_map< irep_idt, symboltsymbolst
 
using const_iteratort = symbolst::const_iterator
 
- Private Member Functions inherited from symbol_tablet
 symbol_tablet ()
 
 symbol_tablet (const symbol_tablet &other)
 Copy constructor.
 
symbol_tabletoperator= (const symbol_tablet &other)
 Copy assignment operator.
 
 symbol_tablet (symbol_tablet &&other)
 Move constructor.
 
symbol_tabletoperator= (symbol_tablet &&other)
 Move assignment operator.
 
void swap (symbol_tablet &other)
 Swap symbol maps between two symbol tables.
 
virtual const symbol_tabletget_symbol_table () const override
 
virtual symboltget_writeable (const irep_idt &name) override
 Find a symbol in the symbol table for read-write access.
 
virtual std::pair< symbolt &, boolinsert (symbolt symbol) override
 Author: Diffblue Ltd.
 
virtual bool move (symbolt &symbol, symbolt *&new_symbol) override
 Move a symbol into the symbol table.
 
virtual void erase (const symbolst::const_iterator &entry) override
 Remove a symbol from the symbol table.
 
virtual void clear () override
 Wipe internal state of the symbol table.
 
virtual iteratort begin () override
 
virtual iteratort end () override
 
void validate (const validation_modet vm=validation_modet::INVARIANT) const override
 Check that the symbol table is well-formed.
 
bool operator== (const symbol_tablet &other) const
 
virtual iteratort begin ()=0
 
virtual const_iteratort begin () const
 
virtual iteratort end ()=0
 
virtual const_iteratort end () const
 
- Private Member Functions inherited from symbol_table_baset
 symbol_table_baset (const symbolst &symbols, const symbol_base_mapt &symbol_base_map, const symbol_module_mapt &symbol_module_map)
 
 symbol_table_baset (const symbol_table_baset &other)=delete
 
symbol_table_basetoperator= (const symbol_table_baset &other)=delete
 
virtual ~symbol_table_baset ()
 Author: Diffblue Ltd.
 
std::size_t next_unused_suffix (const std::string &prefix, std::size_t start_number) const
 Find smallest unused integer i so that prefix + std::to_string(i) does not exist in the list symbols.
 
virtual std::size_t next_unused_suffix (const std::string &prefix) const
 
 operator const symbol_tablet & () const
 Permits implicit cast to const symbol_tablet &.
 
bool has_symbol (const irep_idt &name) const
 Check whether a symbol exists in the symbol table.
 
const symboltlookup (const irep_idt &name) const
 Find a symbol in the symbol table for read-only access.
 
const symboltlookup_ref (const irep_idt &name) const
 Find a symbol in the symbol table for read-only access.
 
std::list< symbolst::const_iterator > match_name_or_base_name (const irep_idt &id) const
 Collect all symbols the name of which matches id or the base name of which matches id.
 
symboltget_writeable_ref (const irep_idt &name)
 Find a symbol in the symbol table for read-write access.
 
bool add (const symbolt &symbol)
 Add a new symbol to the symbol table.
 
bool remove (const irep_idt &name)
 Remove a symbol from the symbol table.
 
void show (std::ostream &out) const
 Print the contents of the symbol table.
 
std::vector< irep_idtsorted_symbol_names () const
 Build and return a lexicographically sorted vector of symbol names from all symbols stored in this symbol table.
 
- Private Attributes inherited from symbol_table_baset
const symbolstsymbols
 Read-only field, used to look up symbols given their names.
 
const symbol_base_maptsymbol_base_map
 Read-only field, used to look up symbol names given their base names.
 
const symbol_module_maptsymbol_module_map
 Read-only field, used to look up symbol names given their modules.
 

Detailed Description

A namespacet that contains an empty symbol table, for use in tests that need a namespacet but don't actually look up any symbols.

This avoids the boilerplate of declaring a symbol_tablet and namespacet in every test.

Definition at line 22 of file empty_namespace.h.

Constructor & Destructor Documentation

◆ empty_namespacet() [1/3]

empty_namespacet::empty_namespacet ( )
inline

Definition at line 25 of file empty_namespace.h.

◆ empty_namespacet() [2/3]

empty_namespacet::empty_namespacet ( const empty_namespacet )
delete

◆ empty_namespacet() [3/3]

empty_namespacet::empty_namespacet ( empty_namespacet &&  )
delete

Member Function Documentation

◆ operator=() [1/2]

empty_namespacet & empty_namespacet::operator= ( const empty_namespacet )
delete

◆ operator=() [2/2]

empty_namespacet & empty_namespacet::operator= ( empty_namespacet &&  )
delete

The documentation for this class was generated from the following file: