25 if(type.
id()==ID_array)
30 else if(type.
id()==ID_pointer)
34 else if(type.
id()==ID_struct ||
39 typet &subtype = c.type();
43 else if(type.
id() == ID_template_parameter_symbol_type)
45 type_mapt::const_iterator m_it =
54 else if(type.
id()==ID_code)
60 for(
auto ¶meter : parameters)
62 if(parameter.id() == ID_parameter)
63 apply(
static_cast<typet &
>(parameter.add(ID_type)));
66 else if(type.
id()==ID_merged_type)
77 if(expr.
id()==ID_symbol)
79 expr_mapt::const_iterator m_it =
95 type_mapt::const_iterator t_it=
101 e.
type()=t_it->second;
105 expr_mapt::const_iterator e_it=
116 type_mapt::const_iterator t_it=
127 expr_mapt::const_iterator e_it=
139 out << mapping.first <<
" = " << mapping.second.pretty() <<
'\n';
142 out << mapping.first <<
" = " << mapping.second.pretty() <<
'\n';
155 template_typet::template_parameterst::const_iterator t_it=
156 template_parameters.begin();
158 if(instance.size()<template_parameters.size())
161 for(std::size_t i=instance.size();
162 i<template_parameters.size();
176 instance.size() == template_parameters.size(),
177 "template instantiation expected to match declaration");
179 for(cpp_template_args_tct::argumentst::const_iterator
180 i_it=instance.begin();
181 i_it!=instance.end();
192 if(parameter.
id()==ID_type)
194 if(parameter.
id()!=ID_type)
206 if(value.
id()==ID_type)
221 typet tmp(ID_unassigned);
222 tmp.
set(ID_identifier, t.type().get(ID_identifier));
224 type_map[t.type().get(ID_identifier)]=tmp;
228 exprt tmp(ID_unassigned, t.type());
229 tmp.
set(ID_identifier, t.get(ID_identifier));
243 template_args.
arguments().resize(template_parameters.size());
245 for(std::size_t i=0; i<template_parameters.size(); i++)
261 return template_args;
exprt::operandst argumentst
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
source_locationt & add_source_location()
typet & type()
Return the type of the expression.
const irep_idt & get(const irep_idt &name) const
void set(const irep_idt &name, const irep_idt &value)
const irep_idt & id() const
irept & add(const irep_idt &name)
void build(const template_typet &template_type, const cpp_template_args_tct &template_args)
exprt lookup(const irep_idt &identifier) const
void build_unassigned(const template_typet &template_type)
void print(std::ostream &out) const
void apply(exprt &dest) const
exprt lookup_expr(const irep_idt &identifier) const
void set(const template_parametert ¶meter, const exprt &value)
typet lookup_type(const irep_idt &identifier) const
cpp_template_args_tct build_template_args(const template_typet &template_type) const
template_parameterst & template_parameters()
std::vector< template_parametert > template_parameterst
The type of an expression, extends irept.
source_locationt & add_source_location()
const template_parameter_symbol_typet & to_template_parameter_symbol_type(const typet &type)
Cast a typet to a template_parameter_symbol_typet.
#define Forall_operands(it, expr)
const irept & get_nil_irep()
API to expression classes for Pointers.
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
#define UNREACHABLE
This should be used to mark dead code.
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
API to expression classes.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.
exprt & default_argument()
bool has_default_argument() const
C++ Language Type Checking.
const type_with_subtypest & to_type_with_subtypes(const typet &type)