17
17
18
18
#include < ansi-c/c_misc.h>
19
19
#include < ansi-c/c_qualifiers.h>
20
- #include < ansi-c/expr2c_class.h>
21
20
22
21
#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"
58
23
59
24
/* ******************************************************************\
60
25
@@ -647,6 +612,8 @@ std::string expr2cpp(const exprt &expr, const namespacet &ns)
647
612
{
648
613
expr2cppt expr2cpp (ns);
649
614
expr2cpp.get_shorthands (expr);
615
+ norep_pretty_printert norep;
616
+ expr2cpp.set_next_pretty_printer (&norep);
650
617
return expr2cpp.convert (expr);
651
618
}
652
619
@@ -665,5 +632,7 @@ Function: type2cpp
665
632
std::string type2cpp (const typet &type, const namespacet &ns)
666
633
{
667
634
expr2cppt expr2cpp (ns);
635
+ norep_pretty_printert norep;
636
+ expr2cpp.set_next_pretty_printer (&norep);
668
637
return expr2cpp.convert (type);
669
638
}
0 commit comments