File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,25 @@ typet &java_array_element_type(symbol_typet &array_symbol)
140140 return array_symbol.add_type (ID_C_element_type);
141141}
142142
143+ // / Checks whether the given type is an array pointer type
144+ bool is_java_array_type (const typet &type)
145+ {
146+ if (!(type.id () == ID_pointer && type.subtype ().id () == ID_symbol))
147+ return false ;
148+ const auto &subtype_symbol = to_symbol_type (type.subtype ());
149+ return is_java_array_tag (subtype_symbol.get_identifier ());
150+ }
151+
152+ // / Checks whether the given type is a multi-dimensional array pointer type,
153+ // i.e., a pointer to an array type with element type also being a pointer to an
154+ // / array type.
155+ bool is_multidim_java_array_type (const typet &type)
156+ {
157+ return is_java_array_type (type) &&
158+ is_java_array_type (
159+ java_array_element_type (to_symbol_type (type.subtype ())));
160+ }
161+
143162// / See above
144163// / \par parameters: Struct tag 'tag'
145164// / \return True if the given struct is a Java array
Original file line number Diff line number Diff line change @@ -247,6 +247,8 @@ symbol_typet java_classname(const std::string &);
247247reference_typet java_array_type (const char subtype);
248248const typet &java_array_element_type (const symbol_typet &array_symbol);
249249typet &java_array_element_type (symbol_typet &array_symbol);
250+ bool is_java_array_type (const typet &type);
251+ bool is_multidim_java_array_type (const typet &type);
250252
251253bool is_reference_type (char t);
252254
You can’t perform that action at this time.
0 commit comments