Go to the documentation of this file.
24 if(expr.
id()==ID_code)
27 if(expr.
id()==ID_typecast &&
28 expr.
type().
id()==ID_pointer)
40 "String literals should have been converted to constant globals "
41 "before typecheck_expr");
43 if(expr.
id()==ID_symbol)
45 else if(expr.
id()==ID_side_effect)
48 if(statement==ID_java_new)
50 else if(statement==ID_java_new_array)
75 symbol_tablet::symbolst::const_iterator s_it=
86 new_symbol.
name=identifier;
90 new_symbol.
mode=ID_java;
93 if(new_symbol.
type.
id()==ID_code)
104 error() <<
"failed to add expression symbol to symbol table" <<
eom;
111 INVARIANT(!s_it->second.is_type,
"symbol identifier should not be a type");
113 const symbolt &symbol=s_it->second;
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
void typecheck_expr_java_new(side_effect_exprt &)
#define Forall_operands(it, expr)
The type of an expression, extends irept.
typet type
Type of symbol.
void typecheck_code(codet &)
bool can_cast_expr< java_string_literal_exprt >(const exprt &base)
Base class for all expressions.
exprt make_clean_pointer_cast(const exprt &rawptr, const pointer_typet &target_type, const namespacet &ns)
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 &)
const irep_idt & get(const irep_idt &name) const
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.
bool has_prefix(const std::string &s, const std::string &prefix)
const std::string & id2string(const irep_idt &d)
#define PRECONDITION(CONDITION)
const irep_idt & get_identifier() const
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
symbol_table_baset & symbol_table
const irep_idt & id() const
void typecheck_expr_symbol(symbol_exprt &)
const irep_idt & get_statement() const
bool add(const symbolt &symbol)
Add a new symbol to the symbol table.
const symbolst & symbols
Read-only field, used to look up symbols given their names.
void typecheck_expr_java_new_array(side_effect_exprt &)
irep_idt name
The unique identifier.
An expression containing a side effect.
virtual void typecheck_expr(exprt &expr)