diff options
Diffstat (limited to 'examples/calc_file.cpp')
-rw-r--r-- | examples/calc_file.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/examples/calc_file.cpp b/examples/calc_file.cpp index 8c5a8bb..ddd4d6c 100644 --- a/examples/calc_file.cpp +++ b/examples/calc_file.cpp @@ -15,33 +15,33 @@ int main(int argc, char *argv[]) infix_calc::compiler cc; cc.variables["x"] = 2.0; cc.variables["y"] = 3.0; - printf("Vars: %s\n", infix_calc::to_string(cc.variables).c_str()); + printf("Vars: %s\n", rpn_calc::to_string(cc.variables).c_str()); { const bool pok = cc.parse ("-"); // stdin - printf("Vanilla RPN: %s\n", infix_calc::to_string(cc.rpn_stack).c_str()); + printf("Vanilla RPN: %s\n", cc.rpn_expr.toString().c_str()); if( !pok ) { std::cerr << "Error occurred @ parsing: " << cc.location() << std::endl; return EXIT_FAILURE; } } double res = 0.0; - infix_calc::RPNStatus estatus = cc.eval(res); - if( infix_calc::RPNStatus::No_Error != estatus ) { - printf("Error occurred @ eval(Vanilla): %s\n", infix_calc::to_string(estatus).c_str()); + rpn_calc::RPNStatus estatus = cc.eval(res); + if( rpn_calc::RPNStatus::No_Error != estatus ) { + printf("Error occurred @ eval(Vanilla): %s\n", rpn_calc::to_string(estatus).c_str()); return EXIT_FAILURE; } printf("Vanilla Result: %f\n", res); estatus = cc.reduce(); - if( infix_calc::RPNStatus::No_Error != estatus ) { - printf("Error occurred @ reduce: %s\n", infix_calc::to_string(estatus).c_str()); + if( rpn_calc::RPNStatus::No_Error != estatus ) { + printf("Error occurred @ reduce: %s\n", rpn_calc::to_string(estatus).c_str()); return EXIT_FAILURE; } - printf("Reduced RPN: %s\n", infix_calc::to_string(cc.rpn_stack).c_str()); + printf("Reduced RPN: %s\n", cc.rpn_expr.toString().c_str()); double res2 = 0.0; estatus = cc.eval(res2); - if( infix_calc::RPNStatus::No_Error != estatus ) { - printf("Error occurred @ eval(Reduced): %s\n", infix_calc::to_string(estatus).c_str()); + if( rpn_calc::RPNStatus::No_Error != estatus ) { + printf("Error occurred @ eval(Reduced): %s\n", rpn_calc::to_string(estatus).c_str()); return EXIT_FAILURE; } printf("Reduced Result: %f\n", res2); |