@@ -41,17 +41,17 @@ Function: interpretert::operator()
41
41
void interpretert::operator ()()
42
42
{
43
43
show=true ;
44
- status () << " Initialize:" << eom;
44
+ message-> status () << " Initialize:" << messaget:: eom;
45
45
initialise (true );
46
46
try
47
47
{
48
48
std::cout << " Type h for help" << std::endl;
49
49
while (!done) command ();
50
- status () << " Program End." << messaget::endl << eom;
50
+ message-> status () << " Program End." << messaget::endl << messaget:: eom;
51
51
}
52
52
catch (const char *e)
53
53
{
54
- error () << e << messaget::endl << eom;
54
+ message-> error () << e << messaget::endl << messaget:: eom;
55
55
}
56
56
while (!done) command ();
57
57
}
@@ -119,19 +119,19 @@ Function: interpretert::show_state
119
119
void interpretert::show_state ()
120
120
{
121
121
if (!show) return ;
122
- status () << messaget::endl << eom;
123
- status () << " ----------------------------------------------------"
124
- << messaget::endl << eom;
122
+ message-> status () << messaget::endl << messaget:: eom;
123
+ message-> status () << " ----------------------------------------------------"
124
+ << messaget::endl << messaget:: eom;
125
125
126
126
if (PC==function->second .body .instructions .end ())
127
127
{
128
- status () << " End of function `"
128
+ message-> status () << " End of function `"
129
129
<< function->first << " '" << messaget::endl;
130
130
}
131
131
else
132
- function->second .body .output_instruction (ns, function->first , status (), PC);
132
+ function->second .body .output_instruction (ns, function->first , message-> status (), PC);
133
133
134
- status () << eom;
134
+ message-> status () << messaget:: eom;
135
135
}
136
136
137
137
/* ******************************************************************\
@@ -210,7 +210,7 @@ void interpretert::command()
210
210
return ;
211
211
}
212
212
}
213
- json_steps.output (result ());
213
+ json_steps.output (message-> result ());
214
214
}
215
215
else if (ch==' m' )
216
216
{
@@ -231,7 +231,7 @@ void interpretert::command()
231
231
return ;
232
232
}
233
233
}
234
- steps.output (ns, result ());
234
+ steps.output (ns, message-> result ());
235
235
}
236
236
else if (ch==' r' )
237
237
{
@@ -470,8 +470,8 @@ void interpretert::execute_other()
470
470
unsigned size=get_size (PC->code .op0 ().type ());
471
471
while (rhs.size ()<size) rhs.insert (rhs.end (),tmp.begin (),tmp.end ());
472
472
if (size!=rhs.size ())
473
- error () << " !! failed to obtain rhs (" << rhs.size () << " vs. "
474
- << size << " )" << messaget::endl << eom;
473
+ message-> error () << " !! failed to obtain rhs (" << rhs.size () << " vs. "
474
+ << size << " )" << messaget::endl << messaget:: eom;
475
475
else
476
476
{
477
477
assign (address, rhs);
@@ -682,8 +682,8 @@ exprt interpretert::get_value(const typet &type, std::vector<mp_integer> &rhs,un
682
682
index_exprt index_expr (symbol_expr,from_integer (cell.offset , integer_typet ()));
683
683
return index_expr;
684
684
}
685
- error () << " pointer out of memory " << rhs[offset] << " >"
686
- << memory.size () << messaget::endl << eom;
685
+ message-> error () << " pointer out of memory " << rhs[offset] << " >"
686
+ << memory.size () << messaget::endl << messaget:: eom;
687
687
throw " pointer out of memory" ;
688
688
}
689
689
return from_integer (rhs[offset], type);
@@ -715,8 +715,8 @@ void interpretert::execute_assign()
715
715
unsigned size=get_size (code_assign.lhs ().type ());
716
716
717
717
if (size!=rhs.size ())
718
- error () << " !! failed to obtain rhs (" << rhs.size () << " vs. "
719
- << size << " )" << messaget::endl << eom;
718
+ message-> error () << " !! failed to obtain rhs (" << rhs.size () << " vs. "
719
+ << size << " )" << messaget::endl << messaget:: eom;
720
720
else
721
721
{
722
722
goto_trace_stept &trace_step=steps.get_last_step ();
@@ -770,8 +770,8 @@ void interpretert::assign(
770
770
{
771
771
memory_cellt &cell=memory[integer2unsigned (address)];
772
772
if (show) {
773
- status () << " ** assigning " << cell.identifier << " ["
774
- << cell.offset << " ]:=" << rhs[i] << messaget::endl << eom;
773
+ message-> status () << " ** assigning " << cell.identifier << " ["
774
+ << cell.offset << " ]:=" << rhs[i] << messaget::endl << messaget:: eom;
775
775
}
776
776
cell.value =rhs[i];
777
777
if (cell.initialised ==0 ) cell.initialised =1 ;
@@ -816,7 +816,7 @@ void interpretert::execute_assert()
816
816
if ((targetAssert==PC) || stop_on_assertion)
817
817
throw " assertion failed" ;
818
818
else if (show)
819
- error () << " assertion failed" << messaget::endl << eom;
819
+ message-> error () << " assertion failed" << messaget::endl << messaget:: eom;
820
820
}
821
821
}
822
822
@@ -940,7 +940,7 @@ void interpretert::execute_function_call()
940
940
return ;
941
941
}
942
942
if (show)
943
- error () << " no body for " +id2string (identifier) << eom;// TODO:used to be throw. need some better approach? need to check state of buffers (and by refs)
943
+ message-> error () << " no body for " +id2string (identifier) << messaget:: eom;// TODO:used to be throw. need some better approach? need to check state of buffers (and by refs)
944
944
}
945
945
}
946
946
@@ -1154,13 +1154,13 @@ void interpretert::list_non_bodied() {
1154
1154
}
1155
1155
}
1156
1156
1157
- result () << " non bodied varibles " << funcs << messaget::endl << eom;
1157
+ message-> result () << " non bodied varibles " << funcs << messaget::endl << messaget:: eom;
1158
1158
std::map<const irep_idt,const irep_idt>::const_iterator it;
1159
1159
/* for(it=function_input_vars.begin(); it!=function_input_vars.end(); it++)
1160
1160
{
1161
- message. result() << it->first << "=" << it->second.front() << messaget::endl;
1161
+ message-> result() << it->first << "=" << it->second.front() << messaget::endl;
1162
1162
}*/
1163
- result () << eom;
1163
+ message-> result () << messaget:: eom;
1164
1164
}
1165
1165
1166
1166
char interpretert::is_opaque_function (const goto_programt::instructionst::const_iterator &it, irep_idt &id)
@@ -1345,10 +1345,10 @@ void interpretert::print_inputs() {
1345
1345
list_inputs ();
1346
1346
for (input_varst::iterator it=input_vars.begin ();it!=input_vars.end ();
1347
1347
it++) {
1348
- result () << it->first << " =" << from_expr (ns, it->first , it->second )
1349
- << " [" << it->second .type ().id () << " ]" << messaget::endl << eom;
1348
+ message-> result () << it->first << " =" << from_expr (ns, it->first , it->second )
1349
+ << " [" << it->second .type ().id () << " ]" << messaget::endl << messaget:: eom;
1350
1350
}
1351
- result () << eom;
1351
+ message-> result () << messaget:: eom;
1352
1352
}
1353
1353
1354
1354
/* ******************************************************************
@@ -1365,10 +1365,10 @@ void interpretert::print_memory(bool input_flags) {
1365
1365
for (unsigned i=0 ;i<memory.size ();i++)
1366
1366
{
1367
1367
memory_cellt &cell=memory[i];
1368
- debug () << cell.identifier << " [" << cell.offset << " ]"
1369
- << " =" << cell.value << eom;
1370
- if (input_flags) debug () << " (" << (int )cell.initialised << " )" << eom;
1371
- debug () << messaget::endl << eom;
1368
+ message-> debug () << cell.identifier << " [" << cell.offset << " ]"
1369
+ << " =" << cell.value << messaget:: eom;
1370
+ if (input_flags) message-> debug () << " (" << (int )cell.initialised << " )" << messaget:: eom;
1371
+ message-> debug () << messaget::endl << messaget:: eom;
1372
1372
}
1373
1373
}
1374
1374
@@ -1447,7 +1447,7 @@ void interpretert::prune_inputs(input_varst &inputs,list_input_varst& function_i
1447
1447
}
1448
1448
catch (const char *e)
1449
1449
{
1450
- error () << e << messaget::endl << eom;
1450
+ message-> error () << e << messaget::endl << messaget:: eom;
1451
1451
}
1452
1452
list_inputs ();
1453
1453
list_inputs (inputs);
@@ -1667,8 +1667,8 @@ void interpretert::get_value_tree(const irep_idt& capture_symbol,
1667
1667
auto findit=inputs.find (capture_symbol);
1668
1668
if (findit==inputs.end ())
1669
1669
{
1670
- error () << " Stub method returned without defining " << capture_symbol
1671
- << " . Did the program trace end inside a stub?\n " << eom;
1670
+ message-> error () << " Stub method returned without defining " << capture_symbol
1671
+ << " . Did the program trace end inside a stub?\n " << messaget:: eom;
1672
1672
return ;
1673
1673
}
1674
1674
@@ -1841,7 +1841,7 @@ Function: interpreter
1841
1841
void interpreter (
1842
1842
const symbol_tablet &symbol_table,
1843
1843
const goto_functionst &goto_functions,
1844
- message_handlert & message_handler)
1844
+ messaget * message_handler)
1845
1845
{
1846
1846
interpretert interpreter (symbol_table,goto_functions,message_handler);
1847
1847
interpreter ();
0 commit comments