Go to the documentation of this file.
26 if(expr.
id()==ID_code)
29 if(expr.
id()==ID_typecast &&
30 expr.
type().
id()==ID_pointer)
41 expr.
id() != ID_java_string_literal,
42 "String literals should have been converted to constant globals "
43 "before typecheck_expr");
45 if(expr.
id()==ID_symbol)
47 else if(expr.
id()==ID_side_effect)
50 if(statement==ID_java_new)
52 else if(statement==ID_java_new_array)
55 else if(expr.
id()==ID_member)
79 symbol_tablet::symbolst::const_iterator s_it=
90 new_symbol.
name=identifier;
94 new_symbol.
mode=ID_java;
97 if(new_symbol.
type.
id()==ID_code)
108 error() <<
"failed to add expression symbol to symbol table" <<
eom;
115 INVARIANT(!s_it->second.is_type,
"symbol identifier should not be a type");
117 const symbolt &symbol=s_it->second;
147 if(components.empty())
159 warning() <<
"failed to find field `"
160 << component_name <<
"` in class hierarchy" <<
eom;
const componentst & components() const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
#define PRECONDITION(CONDITION)
void typecheck_expr_java_new(side_effect_exprt &)
void typecheck_expr_member(member_exprt &)
#define Forall_operands(it, expr)
const struct_typet & to_struct_type(const typet &type)
Cast a typet to a struct_typet.
The type of an expression, extends irept.
typet type
Type of symbol.
void typecheck_code(codet &)
Base class for all expressions.
exprt make_clean_pointer_cast(const exprt &rawptr, const pointer_typet &target_type, const namespacet &ns)
std::vector< componentt > componentst
irep_idt base_name
Base (non-scoped) name.
side_effect_exprt & to_side_effect_expr(exprt &expr)
Expression to hold a symbol (variable)
void typecheck_type(typet &)
irep_idt pretty_name
Language-specific display name.
const codet & to_code(const exprt &expr)
typet & type()
Return the type of the expression.
irep_idt mode
Language mode.
void base_type(typet &type, const namespacet &ns)
const std::string & id2string(const irep_idt &d)
const irep_idt & get_name() const
source_locationt source_location
const exprt & struct_op() const
const irep_idt & get_identifier() const
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
bool has_component(const irep_idt &component_name) const
symbol_table_baset & symbol_table
const irep_idt & id() const
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
void typecheck_expr_symbol(symbol_exprt &)
const irep_idt & get_statement() const
A side_effect_exprt that returns a non-deterministically chosen value.
bool add(const symbolt &symbol)
Add a new symbol to the symbol table.
Extract member of struct or union.
Structure type, corresponds to C style structs.
const typet & follow(const typet &) const
Resolve type symbol to the type it points to.
const irep_idt & get(const irep_namet &name) const
void typecheck_expr_java_new_array(side_effect_exprt &)
const member_exprt & to_member_expr(const exprt &expr)
Cast an exprt to a member_exprt.
bool has_prefix(const std::string &s, const std::string &prefix)
irep_idt get_component_name() const
source_locationt & add_source_location()
mstreamt & warning() const
const source_locationt & source_location() const
irep_idt name
The unique identifier.
An expression containing a side effect.
virtual void typecheck_expr(exprt &expr)