Go to the documentation of this file.
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);
116 #endif // CPROVER_UTIL_STD_CODE_BASE_H
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
codet(const irep_idt &statement)
Base class for all expressions.
codet(const irep_idt &statement, operandst _op)
const irep_idt & get(const irep_idt &name) const
codet & last_statement()
In the case of a codet type that represents multiple statements, return the last of them.
const codet & to_code(const exprt &expr)
bool can_cast_expr< codet >(const exprt &base)
void set(const irep_idt &name, const irep_idt &value)
#define PRECONDITION(CONDITION)
const irep_idt & id() const
std::vector< exprt > operandst
codet(const irep_idt &statement, source_locationt loc)
Templated functions to cast to specific exprt-derived classes.
void set_statement(const irep_idt &statement)
codet & first_statement()
In the case of a codet type that represents multiple statements, return the first of them.
const irep_idt & get_statement() const
bool can_cast_code_impl(const exprt &expr, const Tag &tag)
codet(const irep_idt &statement, operandst op, source_locationt loc)
Data structure for representing an arbitrary statement in a program.