#include <symbol_generator.h>
|
| | symbol_generator (std::string prefix, unsigned counter=0) |
| | Construct a new symbol generator where the id of every symbol obtained has the given prefix.
|
| symbolt & | new_symbol (contextt &context, const typet &type, const std::string &name_prefix="") |
| | Creates a new symbol with name, id derived from the name and this->prefix, lvalue=true and the given type being set.
|
| symbolt & | new_symbol (contextt &context, const type2tc &type, const std::string &name_prefix="") |
◆ symbol_generator()
| symbol_generator::symbol_generator |
( |
std::string | prefix, |
|
|
unsigned | counter = 0 ) |
|
inline |
Construct a new symbol generator where the id of every symbol obtained has the given prefix.
- Parameters
-
| prefix | The id's prefix to give every generated symbol; note: it is not part of the symbol's name. |
| counter | Optional value to initialize the counter with; note: the minimal value appended to a symbol's name and id is counter+1. |
◆ new_symbol() [1/2]
| symbolt & symbol_generator::new_symbol |
( |
contextt & | context, |
|
|
const type2tc & | type, |
|
|
const std::string & | name_prefix = "" ) |
◆ new_symbol() [2/2]
| symbolt & symbol_generator::new_symbol |
( |
contextt & | context, |
|
|
const typet & | type, |
|
|
const std::string & | name_prefix = "" ) |
Creates a new symbol with name, id derived from the name and this->prefix, lvalue=true and the given type being set.
The name of the new symbol is derived from the given name_prefix and this->counter in such a way that the obtained id is unique within the given context. This method cannot fail, but it can run into trouble a) under out-of-memory conditions or b) when all possible symbol ids obtainable through the above pattern are already in use (counter is a 'unsigned int').
- Parameters
-
| context | The context to register this symbol with. |
| type | The new symbol's type. |
| name_prefix | Optional parameter defaulting to the empty string; it is not analyzed in any way and used just before appending the decimal value of the counter. |
- Returns
- A reference to the new symbol.
◆ counter
| unsigned symbol_generator::counter |
◆ prefix
| std::string symbol_generator::prefix |
The documentation for this class was generated from the following files: