@@ -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
{
@@ -469,8 +469,8 @@ void interpretert::execute_other()
469
469
unsigned size=get_size (PC->code .op0 ().type ());
470
470
while (rhs.size ()<size) rhs.insert (rhs.end (),tmp.begin (),tmp.end ());
471
471
if (size!=rhs.size ())
472
- error () << " !! failed to obtain rhs (" << rhs.size () << " vs. "
473
- << size << " )" << messaget::endl << eom;
472
+ message-> error () << " !! failed to obtain rhs (" << rhs.size () << " vs. "
473
+ << size << " )" << messaget::endl << messaget:: eom;
474
474
else
475
475
{
476
476
assign (address, rhs);
@@ -681,8 +681,8 @@ exprt interpretert::get_value(const typet &type, std::vector<mp_integer> &rhs,un
681
681
index_exprt index_expr (symbol_expr,from_integer (cell.offset , integer_typet ()));
682
682
return index_expr;
683
683
}
684
- error () << " pointer out of memory " << rhs[offset] << " >"
685
- << memory.size () << messaget::endl << eom;
684
+ message-> error () << " pointer out of memory " << rhs[offset] << " >"
685
+ << memory.size () << messaget::endl << messaget:: eom;
686
686
throw " pointer out of memory" ;
687
687
}
688
688
return from_integer (rhs[offset], type);
@@ -714,8 +714,8 @@ void interpretert::execute_assign()
714
714
unsigned size=get_size (code_assign.lhs ().type ());
715
715
716
716
if (size!=rhs.size ())
717
- error () << " !! failed to obtain rhs (" << rhs.size () << " vs. "
718
- << size << " )" << messaget::endl << eom;
717
+ message-> error () << " !! failed to obtain rhs (" << rhs.size () << " vs. "
718
+ << size << " )" << messaget::endl << messaget:: eom;
719
719
else
720
720
{
721
721
goto_trace_stept &trace_step=steps.get_last_step ();
@@ -769,8 +769,8 @@ void interpretert::assign(
769
769
{
770
770
memory_cellt &cell=memory[integer2unsigned (address)];
771
771
if (show) {
772
- status () << " ** assigning " << cell.identifier << " ["
773
- << cell.offset << " ]:=" << rhs[i] << messaget::endl << eom;
772
+ message-> status () << " ** assigning " << cell.identifier << " ["
773
+ << cell.offset << " ]:=" << rhs[i] << messaget::endl << messaget:: eom;
774
774
}
775
775
cell.value =rhs[i];
776
776
if (cell.initialised ==0 ) cell.initialised =1 ;
@@ -815,7 +815,7 @@ void interpretert::execute_assert()
815
815
if ((targetAssert==PC) || stop_on_assertion)
816
816
throw " assertion failed" ;
817
817
else if (show)
818
- error () << " assertion failed" << messaget::endl << eom;
818
+ message-> error () << " assertion failed" << messaget::endl << messaget:: eom;
819
819
}
820
820
}
821
821
@@ -939,7 +939,7 @@ void interpretert::execute_function_call()
939
939
return ;
940
940
}
941
941
if (show)
942
- 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)
942
+ 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)
943
943
}
944
944
}
945
945
@@ -1019,7 +1019,7 @@ void interpretert::build_memory_map(const symbolt &symbol)
1019
1019
}
1020
1020
}
1021
1021
1022
- typet interpretert::concretise_type (const typet &type)
1022
+ typet interpretert::concretise_type (const typet &type) const
1023
1023
{
1024
1024
if (type.id ()==ID_array)
1025
1025
{
@@ -1050,7 +1050,7 @@ Function: interpretert::build_memory_map
1050
1050
Purpose:
1051
1051
1052
1052
\*******************************************************************/
1053
- mp_integer interpretert::build_memory_map (const irep_idt &id,const typet &type)
1053
+ mp_integer interpretert::build_memory_map (const irep_idt &id,const typet &type) const
1054
1054
{
1055
1055
if (dynamic_types.find (id)!=dynamic_types.end ()) return memory_map[id];
1056
1056
typet alloc_type=concretise_type (type);
@@ -1174,13 +1174,13 @@ void interpretert::list_non_bodied() {
1174
1174
}
1175
1175
}
1176
1176
1177
- result () << " non bodied varibles " << funcs << messaget::endl << eom;
1177
+ message-> result () << " non bodied varibles " << funcs << messaget::endl << messaget:: eom;
1178
1178
std::map<const irep_idt,const irep_idt>::const_iterator it;
1179
1179
/* for(it=function_input_vars.begin(); it!=function_input_vars.end(); it++)
1180
1180
{
1181
- message. result() << it->first << "=" << it->second.front() << messaget::endl;
1181
+ message-> result() << it->first << "=" << it->second.front() << messaget::endl;
1182
1182
}*/
1183
- result () << eom;
1183
+ message-> result () << messaget:: eom;
1184
1184
}
1185
1185
1186
1186
char interpretert::is_opaque_function (const goto_programt::instructionst::const_iterator &it, irep_idt &id)
@@ -1365,10 +1365,10 @@ void interpretert::print_inputs() {
1365
1365
list_inputs ();
1366
1366
for (input_varst::iterator it=input_vars.begin ();it!=input_vars.end ();
1367
1367
it++) {
1368
- result () << it->first << " =" << from_expr (ns, it->first , it->second )
1369
- << " [" << it->second .type ().id () << " ]" << messaget::endl << eom;
1368
+ message-> result () << it->first << " =" << from_expr (ns, it->first , it->second )
1369
+ << " [" << it->second .type ().id () << " ]" << messaget::endl << messaget:: eom;
1370
1370
}
1371
- result () << eom;
1371
+ message-> result () << messaget:: eom;
1372
1372
}
1373
1373
1374
1374
/* ******************************************************************
@@ -1385,10 +1385,10 @@ void interpretert::print_memory(bool input_flags) {
1385
1385
for (unsigned i=0 ;i<memory.size ();i++)
1386
1386
{
1387
1387
memory_cellt &cell=memory[i];
1388
- debug () << cell.identifier << " [" << cell.offset << " ]"
1389
- << " =" << cell.value << eom;
1390
- if (input_flags) debug () << " (" << (int )cell.initialised << " )" << eom;
1391
- debug () << messaget::endl << eom;
1388
+ message-> debug () << cell.identifier << " [" << cell.offset << " ]"
1389
+ << " =" << cell.value << messaget:: eom;
1390
+ if (input_flags) message-> debug () << " (" << (int )cell.initialised << " )" << messaget:: eom;
1391
+ message-> debug () << messaget::endl << messaget:: eom;
1392
1392
}
1393
1393
}
1394
1394
@@ -1467,7 +1467,7 @@ void interpretert::prune_inputs(input_varst &inputs,list_input_varst& function_i
1467
1467
}
1468
1468
catch (const char *e)
1469
1469
{
1470
- error () << e << messaget::endl << eom;
1470
+ message-> error () << e << messaget::endl << messaget:: eom;
1471
1471
}
1472
1472
list_inputs ();
1473
1473
list_inputs (inputs);
@@ -1687,8 +1687,8 @@ void interpretert::get_value_tree(const irep_idt& capture_symbol,
1687
1687
auto findit=inputs.find (capture_symbol);
1688
1688
if (findit==inputs.end ())
1689
1689
{
1690
- error () << " Stub method returned without defining " << capture_symbol
1691
- << " . Did the program trace end inside a stub?\n " << eom;
1690
+ message-> error () << " Stub method returned without defining " << capture_symbol
1691
+ << " . Did the program trace end inside a stub?\n " << messaget:: eom;
1692
1692
return ;
1693
1693
}
1694
1694
@@ -1873,7 +1873,7 @@ Function: interpreter
1873
1873
void interpreter (
1874
1874
const symbol_tablet &symbol_table,
1875
1875
const goto_functionst &goto_functions,
1876
- message_handlert & message_handler)
1876
+ messaget * message_handler)
1877
1877
{
1878
1878
interpretert interpreter (symbol_table,goto_functions,message_handler);
1879
1879
interpreter ();
0 commit comments