File tree Expand file tree Collapse file tree 4 files changed +17
-10
lines changed
jbmc/unit/java_bytecode/goto-programs Expand file tree Collapse file tree 4 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ SCENARIO(
47
47
std::stringstream output_dot_stream;
48
48
49
49
hierarchy (symbol_table);
50
- hierarchy.output (output_stream);
50
+ hierarchy.output (output_stream, false );
51
51
hierarchy.output_dot (output_dot_stream);
52
52
53
53
std::string output = output_stream.str ();
Original file line number Diff line number Diff line change @@ -659,7 +659,7 @@ int goto_instrument_parse_optionst::doit()
659
659
if (cmdline.isset (" dot" ))
660
660
hierarchy.output_dot (std::cout);
661
661
else
662
- hierarchy.output (std::cout);
662
+ hierarchy.output (std::cout, false );
663
663
664
664
return 0 ;
665
665
}
Original file line number Diff line number Diff line change @@ -30,6 +30,9 @@ void class_hierarchyt::operator()(const symbol_tablet &symbol_table)
30
30
{
31
31
const struct_typet &struct_type = to_struct_type (symbol_pair.second .type );
32
32
33
+ class_map[symbol_pair.first ].is_abstract =
34
+ struct_type.get_bool (ID_abstract);
35
+
33
36
const irept::subt &bases=
34
37
struct_type.find (ID_bases).get_sub ();
35
38
@@ -123,17 +126,20 @@ void class_hierarchyt::get_parents_trans_rec(
123
126
get_parents_trans_rec (child, dest);
124
127
}
125
128
126
- void class_hierarchyt::output (std::ostream &out) const
129
+ // / Output the class hierarchy in plain text
130
+ // / \param out: the output stream
131
+ // / \param children_only: print the children only and do not print the parents
132
+ void class_hierarchyt::output (std::ostream &out, bool children_only) const
127
133
{
128
134
for (const auto &c : class_map)
129
135
{
130
- for (const auto &pa : c.second .parents )
131
- out << " Parent of " << c.first << " : "
132
- << pa << ' \n ' ;
133
-
136
+ if (!children_only)
137
+ {
138
+ for (const auto &pa : c.second .parents )
139
+ out << " Parent of " << c.first << " : " << pa << ' \n ' ;
140
+ }
134
141
for (const auto &ch : c.second .children )
135
- out << " Child of " << c.first << " : "
136
- << ch << ' \n ' ;
142
+ out << " Child of " << c.first << " : " << ch << ' \n ' ;
137
143
}
138
144
}
139
145
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ class class_hierarchyt
32
32
{
33
33
public:
34
34
idst parents, children;
35
+ bool is_abstract;
35
36
};
36
37
37
38
typedef std::map<irep_idt, entryt> class_mapt;
@@ -55,7 +56,7 @@ class class_hierarchyt
55
56
return result;
56
57
}
57
58
58
- void output (std::ostream &) const ;
59
+ void output (std::ostream &, bool children_only ) const ;
59
60
void output_dot (std::ostream &) const ;
60
61
61
62
protected:
You can’t perform that action at this time.
0 commit comments