15 std::queue<typet *> work_queue;
16 work_queue.push(&type);
17 while(!work_queue.empty())
19 typet ¤t = *work_queue.front();
21 if(
const auto c_enum_tag = type_try_dynamic_cast<c_enum_tag_typet>(current))
25 current = ns.
follow_tag(*c_enum_tag).underlying_type();
27 if(
const auto array = type_try_dynamic_cast<array_typet>(current))
30 work_queue.push(&array->element_type());
39 std::queue<exprt *> work_queue;
40 work_queue.push(&expr);
41 while(!work_queue.empty())
43 exprt ¤t = *work_queue.front();
49 for(
auto &operand : current.
operands())
50 work_queue.push(&operand);
Base class for all expressions.
typet & type()
Return the type of the expression.
const union_typet & follow_tag(const union_tag_typet &) const
Follow type tag of union type.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
The type of an expression, extends irept.
static typet encode(typet type, const namespacet &ns)
exprt lower_enum(exprt expr, const namespacet &ns)
Function to lower expr and its sub-expressions containing enum types.
Templated functions to cast to specific exprt-derived classes.