9 #ifndef CPROVER_UTIL_STD_CODE_BASE_H
10 #define CPROVER_UTIL_STD_CODE_BASE_H
55 :
codet(statement, std::move(loc))
62 set(ID_statement, statement);
67 return get(ID_statement);
83 template <
typename Tag>
86 if(
const auto ptr = expr_try_dynamic_cast<codet>(expr))
88 return ptr->get_statement() == tag;
98 return base.
id() == ID_code;
107 return static_cast<const codet &
>(expr);
113 return static_cast<codet &
>(expr);
Data structure for representing an arbitrary statement in a program.
codet(const irep_idt &statement, source_locationt loc)
codet(const irep_idt &statement)
codet(const irep_idt &statement, operandst op, source_locationt loc)
codet & first_statement()
In the case of a codet type that represents multiple statements, return the first of them.
codet & last_statement()
In the case of a codet type that represents multiple statements, return the last of them.
void set_statement(const irep_idt &statement)
const irep_idt & get_statement() const
codet(const irep_idt &statement, operandst _op)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
std::vector< exprt > operandst
const irep_idt & get(const irep_idt &name) const
void set(const irep_idt &name, const irep_idt &value)
const irep_idt & id() const
Templated functions to cast to specific exprt-derived classes.
bool can_cast_code_impl(const exprt &expr, const Tag &tag)
#define PRECONDITION(CONDITION)
bool can_cast_expr< codet >(const exprt &base)
const codet & to_code(const exprt &expr)