CBMC
|
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in them. More...
#include <namespace.h>
Protected Attributes | |
const symbol_table_baset * | symbol_table1 |
const symbol_table_baset * | symbol_table2 |
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in them.
The basic idea is that you might want to combine a value table and a type table, so that for a variable you can lookup both of these essential properties, in one structure.
Definition at line 90 of file namespace.h.
|
inlineexplicit |
Definition at line 94 of file namespace.h.
|
inline |
Definition at line 97 of file namespace.h.
|
inline |
Definition at line 105 of file namespace.h.
|
inline |
Return first symbol table registered with the namespace.
Definition at line 123 of file namespace.h.
Lookup a symbol in the namespace.
name | The name of the symbol to lookup. |
Definition at line 45 of file namespace.h.
See documentation for namespace_baset::lookup().
Search for a given symbol by name, in the two symbol tables, if present.
Note that namespacet has two symbol tables.
name | The name of the symbol to be looked up. |
symbol | The const pointer to the reference of the symbol if it's found during lookup. |
Implements namespace_baset.
Definition at line 134 of file namespace.cpp.
|
virtual |
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.
Implements namespace_baset.
const symbolt & namespace_baset::lookup | ( | const symbol_exprt & | expr | ) | const |
Generic lookup function for a symbol expression in a symbol table.
expr | The symbol expression to lookup. |
Definition at line 57 of file namespace.cpp.
Generic lookup function for a tag type in a symbol table.
type | The tag type to lookup. |
Definition at line 58 of file namespace.cpp.
|
overridevirtual |
See documentation for namespace_baset::smallest_unused_suffix().
Find smallest unused suffix in the two symbol tables, assuming they are present.
prefix | The prefix to find smallest unused suffix of. |
Implements namespace_baset.
Definition at line 116 of file namespace.cpp.
|
protected |
Definition at line 129 of file namespace.h.
|
protected |
Definition at line 129 of file namespace.h.