Loading...
Searching...
No Matches
namespace_baset Class Referenceabstract
Basic interface for a namespace.
More...
#include <namespace.h>
+ Inheritance diagram for namespace_baset:
Lookup a symbol in the namespace.
Generic lookup function for a symbol expression in a symbol table.
Generic lookup function for a tag type in a symbol table.
Follow macros to their values in a given expression.
Follow type tag of union type.
Follow type tag of struct type.
Follow type tag of enum type.
Returns the minimal integer n such that there is no symbol (in any of the symbol tables) whose name is of the form "An" where A is prefix.
Searches for a symbol named name.
Detailed Description
Basic interface for a namespace.
This is not used in practice, as the one being used is namespacet which uses two symbol tables, and multi_namespacet which can combine more than two.
Definition at line 35 of file namespace.h.
Constructor & Destructor Documentation
◆ ~namespace_baset()
namespace_baset::~namespace_baset
(
)
virtual
Member Function Documentation
◆ follow_macros()
void namespace_baset::follow_macros
(
exprt &
expr )
const
Follow macros to their values in a given expression.
- Parameters
-
expr The expression to follow macros in.
Definition at line 93 of file namespace.cpp.
◆ follow_tag() [1/4]
Follow type tag of enum type.
- Parameters
-
src The enum tag type to dispatch on.
- Returns
- The type of the enum tag in the symbol table.
Definition at line 73 of file namespace.cpp.
◆ follow_tag() [2/4]
◆ follow_tag() [3/4]
Follow type tag of struct type.
- Parameters
-
src The struct tag type to dispatch on.
- Returns
- The type of the struct tag in the symbol table.
Definition at line 61 of file namespace.cpp.
◆ follow_tag() [4/4]
Follow type tag of union type.
- Parameters
-
src The union tag type to dispatch on.
- Returns
- The type of the union tag in the symbol table.
Definition at line 49 of file namespace.cpp.
◆ lookup() [1/4]
Lookup a symbol in the namespace.
- Parameters
-
name The name of the symbol to lookup.
- Returns
- A reference to the symbol found.
- Remarks
- : It is a PRECONDITION that the symbol name exists in the namespace.
Definition at line 45 of file namespace.h.
◆ lookup() [2/4]
Searches for a symbol named name.
Iff found, set symbol to point to the symbol and return false; else symbol is unmodified and true is returned. With multiple symbol tables, symbol_table1 is searched first and then symbol_table2.
- Returns
- False iff the requested symbol is found in at least one of the tables.
Implemented in namespacet, multi_namespacet, namespacet, and multi_namespacet.
◆ lookup() [3/4]
Generic lookup function for a symbol expression in a symbol table.
- Parameters
-
expr The symbol expression to lookup.
- Returns
- The symbol found in the namespace.
- Remarks
- The lookup function called assumes that the symbol we are looking for exists in the symbol table. If it doesn't, it hits an INVARIANT.
Definition at line 30 of file namespace.cpp.
◆ lookup() [4/4]
Generic lookup function for a tag type in a symbol table.
- Parameters
-
type The tag type to lookup.
- Returns
- The symbol found in the namespace.
- Remarks
- The lookup function called assumes that the tag symbol we are looking for exists in the symbol table. If it doesn't, it hits an INVARIANT.
Definition at line 41 of file namespace.cpp.
◆ smallest_unused_suffix()
virtual std::size_t namespace_baset::smallest_unused_suffix
(
const std::string &
prefix )
const
pure virtual
Returns the minimal integer n such that there is no symbol (in any of the symbol tables) whose name is of the form "An" where A is prefix.
The intended use case is finding the next available symbol name for a sequence of auto-generated symbols.
Implemented in namespacet, and multi_namespacet.
The documentation for this class was generated from the following files: