File tree 2 files changed +21
-0
lines changed
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)
140
140
return array_symbol.add_type (ID_C_element_type);
141
141
}
142
142
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
+
143
162
// / See above
144
163
// / \par parameters: Struct tag 'tag'
145
164
// / \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 &);
247
247
reference_typet java_array_type (const char subtype);
248
248
const typet &java_array_element_type (const symbol_typet &array_symbol);
249
249
typet &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);
250
252
251
253
bool is_reference_type (char t);
252
254
You can’t perform that action at this time.
0 commit comments