File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,19 @@ struct Scope;
34
34
35
35
// ------------------------------------------------
36
36
37
+ /* * An abstract writer for recursive output formats.
38
+
39
+ The implementation visits the global namespace
40
+ and then each child namespace recursively. The
41
+ scope for each namespace is also iterated and
42
+ emitted. Subclasses should override the relevant
43
+ visitation functions (the default implementations
44
+ do nothing).
45
+
46
+ This base class is suitable for writing a single
47
+ file using a recursive syntax such as that found
48
+ in XML, HTML, or JSON.
49
+ */
37
50
class RecursiveWriter
38
51
{
39
52
llvm::raw_fd_ostream* fd_os_ = nullptr ;
@@ -50,6 +63,8 @@ class RecursiveWriter
50
63
void adjustNesting (int levels);
51
64
52
65
public:
66
+ /* * Describes an item in the list of all symbols.
67
+ */
53
68
struct AllSymbol
54
69
{
55
70
/* * The fully qualified name of this symbol.
@@ -67,13 +82,19 @@ class RecursiveWriter
67
82
AllSymbol (Info const & I);
68
83
};
69
84
85
+ /* * Constructor.
86
+ */
70
87
RecursiveWriter (
71
88
Corpus const & corpus,
72
89
Config const & config,
73
90
Reporter& R) noexcept ;
74
91
92
+ /* * Write the contents of the corpus to the output stream.
93
+ */
94
+ /* * @{ */
75
95
void write (llvm::raw_fd_ostream& os);
76
96
void write (llvm::raw_string_ostream& os);
97
+ /* * @} */
77
98
78
99
/* * Called to open and close the document.
79
100
Original file line number Diff line number Diff line change @@ -69,6 +69,8 @@ struct XMLGenerator : Generator
69
69
70
70
// ------------------------------------------------
71
71
72
+ /* * A writer which outputs XML.
73
+ */
72
74
class XMLGenerator ::Writer
73
75
: public RecursiveWriter
74
76
{
@@ -81,8 +83,8 @@ class XMLGenerator::Writer
81
83
Config const & config,
82
84
Reporter& R) noexcept ;
83
85
84
- virtual void beginDoc () override ;
85
- virtual void endDoc () override ;
86
+ void beginDoc () override ;
87
+ void endDoc () override ;
86
88
87
89
void writeAllSymbols (std::vector<AllSymbol> const & list) override ;
88
90
You can’t perform that action at this time.
0 commit comments