@@ -46,13 +46,14 @@ optionalt<source_locationt> find_property(
46
46
return { };
47
47
}
48
48
49
-
50
49
void show_properties (
51
50
const namespacet &ns,
52
51
const irep_idt &identifier,
52
+ message_handlert &message_handler,
53
53
ui_message_handlert::uit ui,
54
54
const goto_programt &goto_program)
55
55
{
56
+ messaget msg (message_handler);
56
57
for (const auto &ins : goto_program.instructions )
57
58
{
58
59
if (!ins.is_assert ())
@@ -83,7 +84,7 @@ void show_properties(
83
84
xml_property.new_element (" expression" ).data =
84
85
from_expr (ns, identifier, ins.guard );
85
86
86
- std::cout << xml_property << ' \n ' ;
87
+ msg. result () << xml_property;
87
88
}
88
89
break ;
89
90
@@ -92,14 +93,13 @@ void show_properties(
92
93
break ;
93
94
94
95
case ui_message_handlert::uit::PLAIN:
95
- std::cout << " Property " << property_id << " :\n " ;
96
+ msg. result () << " Property " << property_id << " :\n " ;
96
97
97
- std::cout << " " << ins.source_location << ' \n '
98
- << " " << description << ' \n '
99
- << " " << from_expr (ns, identifier, ins.guard )
100
- << ' \n ' ;
98
+ msg.result () << " " << ins.source_location << ' \n '
99
+ << " " << description << ' \n '
100
+ << " " << from_expr (ns, identifier, ins.guard ) << ' \n ' ;
101
101
102
- std::cout << ' \n ' ;
102
+ msg. result () << messaget::eom ;
103
103
break ;
104
104
105
105
default :
@@ -147,8 +147,10 @@ void show_properties_json(
147
147
148
148
void show_properties_json (
149
149
const namespacet &ns,
150
+ message_handlert &message_handler,
150
151
const goto_functionst &goto_functions)
151
152
{
153
+ messaget msg (message_handler);
152
154
json_arrayt json_properties;
153
155
154
156
for (const auto &fct : goto_functions.function_map )
@@ -161,29 +163,31 @@ void show_properties_json(
161
163
162
164
json_objectt json_result;
163
165
json_result[" properties" ] = json_properties;
164
- std::cout << " , \n " << json_result;
166
+ msg. result () << json_result;
165
167
}
166
168
167
169
void show_properties (
168
170
const namespacet &ns,
171
+ message_handlert &message_handler,
169
172
ui_message_handlert::uit ui,
170
173
const goto_functionst &goto_functions)
171
174
{
172
175
if (ui == ui_message_handlert::uit::JSON_UI)
173
- show_properties_json (ns, goto_functions);
176
+ show_properties_json (ns, message_handler, goto_functions);
174
177
else
175
178
for (const auto &fct : goto_functions.function_map )
176
179
if (!fct.second .is_inlined ())
177
- show_properties (ns, fct.first , ui, fct.second .body );
180
+ show_properties (ns, fct.first , message_handler, ui, fct.second .body );
178
181
}
179
182
180
183
void show_properties (
181
184
const goto_modelt &goto_model,
185
+ message_handlert &message_handler,
182
186
ui_message_handlert::uit ui)
183
187
{
184
188
const namespacet ns (goto_model.symbol_table );
185
189
if (ui == ui_message_handlert::uit::JSON_UI)
186
- show_properties_json (ns, goto_model.goto_functions );
190
+ show_properties_json (ns, message_handler, goto_model.goto_functions );
187
191
else
188
- show_properties (ns, ui, goto_model.goto_functions );
192
+ show_properties (ns, message_handler, ui, goto_model.goto_functions );
189
193
}
0 commit comments