22 if(type.
id()==ID_array)
25 apply(static_cast<exprt &>(type.
add(ID_size)));
27 else if(type.
id()==ID_pointer)
31 else if(type.
id()==ID_struct ||
38 typet &subtype=
static_cast<typet &
>(it->add(ID_type));
42 else if(type.
id()==ID_symbol)
44 type_mapt::const_iterator m_it =
53 else if(type.
id()==ID_code)
55 apply(static_cast<typet &>(type.
add(ID_return_type)));
61 if(it->id()==ID_parameter)
62 apply(static_cast<typet &>(it->add(ID_type)));
65 else if(type.
id()==ID_merged_type)
76 if(expr.
id()==ID_symbol)
78 expr_mapt::const_iterator m_it =
94 type_mapt::const_iterator t_it=
100 e.
type()=t_it->second;
104 expr_mapt::const_iterator e_it=
115 type_mapt::const_iterator t_it=
126 expr_mapt::const_iterator e_it=
137 for(type_mapt::const_iterator it=
type_map.begin();
140 out << it->first <<
" = " << it->second.pretty() <<
'\n';
142 for(expr_mapt::const_iterator it=
expr_map.begin();
145 out << it->first <<
" = " << it->second.pretty() <<
'\n';
158 template_typet::template_parameterst::const_iterator t_it=
159 template_parameters.begin();
161 if(instance.size()<template_parameters.size())
164 for(std::size_t i=instance.size();
165 i<template_parameters.size();
179 instance.size() == template_parameters.size(),
180 "template instantiation expected to match declaration");
182 for(cpp_template_args_tct::argumentst::const_iterator
183 i_it=instance.begin();
184 i_it!=instance.end();
195 if(parameter.
id()==ID_type)
197 if(parameter.
id()!=ID_type)
209 if(value.
id()==ID_type)
223 for(template_typet::template_parameterst::const_iterator
224 t_it=template_parameters.begin();
225 t_it!=template_parameters.end();
232 typet tmp(ID_unassigned);
233 tmp.
set(ID_identifier, t.
type().
get(ID_identifier));
240 tmp.
set(ID_identifier, t.
get(ID_identifier));
254 template_args.
arguments().resize(template_parameters.size());
256 for(std::size_t i=0; i<template_parameters.size(); i++)
272 return template_args;
const irept & get_nil_irep()
The type of an expression.
void set(const template_parametert ¶meter, const exprt &value)
void apply(exprt &dest) const
std::vector< template_parametert > template_parameterst
template_parameterst & template_parameters()
std::vector< irept > subt
exprt::operandst argumentst
const symbol_typet & to_symbol_type(const typet &type)
Cast a generic typet to a symbol_typet.
void build(const template_typet &template_type, const cpp_template_args_tct &template_args)
bool has_default_argument() const
exprt lookup(const irep_idt &identifier) const
const irep_idt & id() const
exprt lookup_expr(const irep_idt &identifier) const
API to expression classes.
const irep_idt & get(const irep_namet &name) const
cpp_template_args_tct build_template_args(const template_typet &template_type) const
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast a generic exprt to a symbol_exprt.
#define Forall_irep(it, irep)
typet lookup_type(const irep_idt &identifier) const
Base class for all expressions.
void build_unassigned(const template_typet &template_type)
source_locationt & add_source_location()
const source_locationt & source_location() const
irept & add(const irep_namet &name)
C++ Language Type Checking.
#define Forall_subtypes(it, type)
#define Forall_operands(it, expr)
const typet & subtype() const
#define DATA_INVARIANT(CONDITION, REASON)
void set(const irep_namet &name, const irep_idt &value)
void print(std::ostream &out) const
exprt & default_argument()