3#ifndef CPROVER_JAVA_BYTECODE_GENERIC_PARAMETER_SPECIALIZATION_MAP_H
4#define CPROVER_JAVA_BYTECODE_GENERIC_PARAMETER_SPECIALIZATION_MAP_H
36 std::vector<std::stack<std::vector<reference_typet>>>
45 const std::vector<java_generic_parametert> ¶meters,
46 std::vector<reference_typet>
types);
50 void pop(std::size_t container_index);
74 template <
typename ostreamt>
85template <
typename ostreamt>
90 if(map.
map.container_to_specializations.empty())
95 map.
map.container_to_specializations.size());
96 for(
const auto &
elt : map.
map.param_to_container)
98 std::vector<irep_idt> ¶ms =
100 if(params.size() <
elt.second.param_index + 1)
101 params.resize(
elt.second.param_index + 1);
102 params[
elt.second.param_index] =
elt.first;
114 std::stack<std::vector<reference_typet>> stack =
115 map.
map.container_to_specializations.at(index);
116 while(!stack.empty())
125 if(is_java_generic_parameter(pointer_type))
128 to_java_generic_parameter(pointer_type).get_name());
pointer_typet pointer_type(const typet &subtype)
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
std::vector< std::stack< std::vector< reference_typet > > > container_to_specializations
The list of containers and, for each one, the stack of lists of specializations.
std::size_t insert(const std::vector< java_generic_parametert > ¶meters, std::vector< reference_typet > types)
Insert a specialization for each type parameters of a container.
friend ostreamt & operator<<(ostreamt &stm, const printert &map)
Output a generic_parameter_specialization_mapt wrapped in a generic_parameter_specialization_mapt::pr...
std::unordered_map< irep_idt, container_paramt > param_to_container
A map from parameter names to container_paramt instances.
void pop(std::size_t container_index)
Pop the top of the specialization stack for a given container.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
std::string type2java(const typet &type, const namespacet &ns)
ostreamt & operator<<(ostreamt &stm, const generic_parameter_specialization_mapt::printert &map)
Output a generic_parameter_specialization_mapt wrapped in a generic_parameter_specialization_mapt::pr...
Stream & join_strings(Stream &&os, const It b, const It e, const Delimiter &delimiter, TransformFunc &&transform_func)
Prints items to an stream, separated by a constant delimiter.
The index of the container and the type parameter inside that container.
std::size_t container_index
A wrapper for a generic_parameter_specialization_mapt and a namespacet that can be output to a stream...
const generic_parameter_specialization_mapt & map
printert(const generic_parameter_specialization_mapt &map, const namespacet &ns)