46 error() <<
"failed to produce integer for enum constant" <<
eom;
58 symbol.base_name=name;
64 symbol.is_file_local =
true;
65 symbol.is_thread_local =
true;
71 error() <<
"cpp_typecheckt::typecheck_enum_body: "
72 <<
"symbol_table.move() failed" <<
eom;
136 error() <<
"enum symbol '" << base_name <<
"' declared previously\n"
137 <<
"location of previous definition: " << symbol.
location <<
eom;
145 std::string pretty_name=
162 error() <<
"underlying type must be integral" <<
eom;
168 symbol.base_name=base_name;
169 symbol.value.make_nil();
171 symbol.module=
module;
172 symbol.pretty_name=pretty_name;
179 error() <<
"cpp_typecheckt::typecheck_enum_type: "
180 <<
"symbol_table.move() failed" <<
eom;
202 error() <<
"use of enum '" << base_name <<
"' without previous declaration"
signedbv_typet signed_int_type()
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...
C enum tag type, i.e., c_enum_typet with an identifier.
symbol_table_baset & symbol_table
virtual void make_constant(exprt &expr)
struct configt::ansi_ct ansi_c
cpp_idt & put_into_scope(const symbolt &symbol, cpp_scopet &scope, bool is_friend=false)
cpp_scopet & current_scope()
void typecheck_type(typet &) override
void typecheck_enum_type(typet &type)
void implicit_typecast(exprt &expr, const typet &type) override
cpp_scopet & tag_scope(const irep_idt &_base_name, bool has_body, bool tag_only_declaration)
void typecheck_expr(exprt &) override
void typecheck_enum_body(symbolt &symbol)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
const source_locationt & find_source_location() const
Get a source_locationt from the expression or from its operands (non-recursively).
bool get_bool(const irep_idt &name) const
source_locationt source_location
virtual bool move(symbolt &symbol, symbolt *&new_symbol)=0
const symbolst & symbols
Read-only field, used to look up symbols given their names.
source_locationt location
Source code location of definition of symbol.
typet type
Type of symbol.
Symbol table entry describing a data typeThis is a symbol generated as part of type checking.
The type of an expression, extends irept.
const source_locationt & source_location() const
C++ Language Type Checking.
const cpp_enum_typet & to_cpp_enum_type(const irept &irep)
C++ Language Type Checking.
const std::string & id2string(const irep_idt &d)
auto component(T &struct_expr, const irep_idt &name, const namespacet &ns) -> decltype(struct_expr.op0())
const constant_exprt & to_constant_expr(const exprt &expr)
Cast an exprt to a constant_exprt.
const type_with_subtypet & to_type_with_subtype(const typet &type)