File tree Expand file tree Collapse file tree 3 files changed +56
-0
lines changed Expand file tree Collapse file tree 3 files changed +56
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ SRC = anonymous_member.cpp \
2
2
ansi_c_convert_type.cpp \
3
3
ansi_c_declaration.cpp \
4
4
ansi_c_entry_point.cpp \
5
+ ansi_c_formatter.cpp \
5
6
ansi_c_internal_additions.cpp \
6
7
ansi_c_language.cpp \
7
8
ansi_c_lex.yy.cpp \
Original file line number Diff line number Diff line change
1
+ /* ******************************************************************\
2
+
3
+ Module:
4
+
5
+ Author: Daniel Kroening, kroening@kroening.com
6
+
7
+ \*******************************************************************/
8
+
9
+ #include " ansi_c_formatter.h"
10
+
11
+ #include " expr2c.h"
12
+
13
+ std::ostream &ansi_c_formattert::format (std::ostream &os, const exprt &expr)
14
+ {
15
+ return os << expr2c (expr, ns);
16
+ }
17
+
18
+ std::ostream &ansi_c_formattert::format (std::ostream &os, const typet &type)
19
+ {
20
+ return os << type2c (type, ns);
21
+ }
22
+
23
+ std::ostream &
24
+ ansi_c_formattert::format (std::ostream &os, const source_locationt &loc)
25
+ {
26
+ return os << loc;
27
+ }
Original file line number Diff line number Diff line change
1
+ /* ******************************************************************\
2
+
3
+ Module:
4
+
5
+ Author: Daniel Kroening, kroening@kroening.com
6
+
7
+ \*******************************************************************/
8
+
9
+ #ifndef CPROVER_ANSI_C_FORMATTER_H
10
+ #define CPROVER_ANSI_C_FORMATTER_H
11
+
12
+ #include < util/formatter.h>
13
+
14
+ class ansi_c_formattert : public formattert
15
+ {
16
+ public:
17
+ explicit ansi_c_formattert (const namespacet &_ns) : ns(_ns)
18
+ {
19
+ }
20
+
21
+ std::ostream &format (std::ostream &, const exprt &) override ;
22
+ std::ostream &format (std::ostream &, const typet &) override ;
23
+ std::ostream &format (std::ostream &, const source_locationt &) override ;
24
+
25
+ const namespacet &ns;
26
+ };
27
+
28
+ #endif // CPROVER_UTIL_FORMATTER_H
You can’t perform that action at this time.
0 commit comments