@@ -17,44 +17,9 @@ Author: Daniel Kroening, kroening@cs.cmu.edu
1717
1818#include < ansi-c/c_misc.h>
1919#include < ansi-c/c_qualifiers.h>
20- #include < ansi-c/expr2c_class.h>
2120
2221#include " expr2cpp.h"
23-
24- class expr2cppt :public expr2ct
25- {
26- public:
27- explicit expr2cppt (const namespacet &_ns):expr2ct(_ns) { }
28-
29- std::string convert (const exprt &src) override
30- {
31- return expr2ct::convert (src);
32- }
33-
34- std::string convert (const typet &src) override
35- {
36- return expr2ct::convert (src);
37- }
38-
39- protected:
40- std::string convert (const exprt &src, unsigned &precedence) override ;
41- std::string convert_cpp_this (const exprt &src, unsigned precedence);
42- std::string convert_cpp_new (const exprt &src, unsigned precedence);
43- std::string convert_extractbit (const exprt &src, unsigned precedence);
44- std::string convert_extractbits (const exprt &src, unsigned precedence);
45- std::string convert_code_cpp_delete (const exprt &src, unsigned precedence);
46- std::string convert_struct (const exprt &src, unsigned &precedence) override ;
47- std::string convert_code (const codet &src, unsigned indent) override ;
48- // NOLINTNEXTLINE(whitespace/line_length)
49- std::string convert_constant (const constant_exprt &src, unsigned &precedence) override ;
50-
51- std::string convert_rec (
52- const typet &src,
53- const c_qualifierst &qualifiers,
54- const std::string &declarator) override ;
55-
56- typedef std::unordered_set<std::string, string_hash> id_sett;
57- };
22+ #include " expr2cpp_class.h"
5823
5924/* ******************************************************************\
6025
@@ -647,6 +612,8 @@ std::string expr2cpp(const exprt &expr, const namespacet &ns)
647612{
648613 expr2cppt expr2cpp (ns);
649614 expr2cpp.get_shorthands (expr);
615+ norep_pretty_printert norep;
616+ expr2cpp.set_next_pretty_printer (&norep);
650617 return expr2cpp.convert (expr);
651618}
652619
@@ -665,5 +632,7 @@ Function: type2cpp
665632std::string type2cpp (const typet &type, const namespacet &ns)
666633{
667634 expr2cppt expr2cpp (ns);
635+ norep_pretty_printert norep;
636+ expr2cpp.set_next_pretty_printer (&norep);
668637 return expr2cpp.convert (type);
669638}
0 commit comments