40 if(ns.
lookup(identifier, symbol))
51 std::pair<symbol_numbert::iterator, bool> entry=
56 std::string result =
"SYM" +
58 '#' + std::to_string(entry.first->second.first);
67 entry.first->second.second=
false;
110 if(type.
id().empty())
111 throw "empty type encountered";
146 for(code_typet::parameterst::const_iterator
147 it=parameters.begin();
148 it!=parameters.end();
151 if(it!=parameters.begin())
158 if(!parameters.empty())
216 const irep_idt &component_name =
c.get_name();
218 result +=
"'" +
id2string(component_name) +
"'";
234 for(c_enum_typet::memberst::const_iterator it = members.begin();
238 if(it != members.begin())
241 result +=
"'" +
id2string(it->get_identifier()) +
"'";
254 throw "unknown type '"+type.
id_string()+
"' encountered";
271 result[result.size()-1]=
'$';
290 std::string result{};
299 result +=
"_start_sub_";
302 result +=
"_end_sub_";
312 [](
const std::string &identifier) {
318 "[A-Za-z\x80-\xff_][A-Za-z0-9_\x80-\xff]*"};
const c_enum_typet & to_c_enum_type(const typet &type)
Cast a typet to a c_enum_typet.
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
std::vector< c_enum_membert > memberst
bool is_incomplete() const
enum types may be incomplete
std::vector< parametert > parameterst
const parameterst & parameters() const
const typet & return_type() const
bool has_ellipsis() const
A constant literal expression.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
bool get_bool(const irep_idt &name) const
const std::string & id_string() const
const irep_idt & id() const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
typet type
Type of symbol.
A tag-based type, i.e., typet with an identifier.
const irep_idt & get_identifier() const
The type of an expression, extends irept.
bool has_subtypes() const
const source_locationt & source_location() const
const std::string & id2string(const irep_idt &d)
const std::string integer2string(const mp_integer &n, unsigned base)
std::optional< mp_integer > pointer_offset_bits(const typet &type, const namespacet &ns)
#define CHECK_RETURN(CONDITION)
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
#define POSTCONDITION(CONDITION)
API to expression classes.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const vector_typet & to_vector_type(const typet &type)
Cast a typet to a vector_typet.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.
const tag_typet & to_tag_type(const typet &type)
Cast a typet to a tag_typet.
static std::string pointer_offset_bits_as_string(const typet &type, const namespacet &ns)
std::string type_to_partial_identifier(const typet &type, const namespacet &ns)
Constructs a string describing the given type, which can be used as part of a C identifier.
static std::string type2name(const typet &type, const namespacet &ns, symbol_numbert &symbol_number)
static std::string type2name_tag(const tag_typet &type, const namespacet &ns, symbol_numbert &symbol_number)
std::string type_name2type_identifier(const std::string &name)
type2name generates strings that aren't valid C identifiers If we want utilities like dump_c to work ...
std::unordered_map< irep_idt, std::pair< size_t, bool > > symbol_numbert
const type_with_subtypest & to_type_with_subtypes(const typet &type)
const type_with_subtypet & to_type_with_subtype(const typet &type)