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);
57 std::optional<reference_typet>
pop(
const irep_idt ¶meter_name);
74 template <
typename ostreamt>
75 friend ostreamt &
operator<<(ostreamt &stm,
const printert &map);
85 template <
typename ostreamt>
94 std::vector<std::vector<irep_idt>> container_to_params(
98 std::vector<irep_idt> ¶ms =
99 container_to_params[elt.second.container_index];
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;
105 for(std::size_t index = 0; index < container_to_params.size(); ++index)
110 container_to_params.at(index).begin(),
111 container_to_params.at(index).end(),
114 std::stack<std::vector<reference_typet>> stack =
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)
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.
std::unordered_map< irep_idt, container_paramt > param_to_container
A map from parameter names to container_paramt instances.
friend ostreamt & operator<<(ostreamt &stm, const printert &map)
Output a generic_parameter_specialization_mapt wrapped in a generic_parameter_specialization_mapt::pr...
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)