diff options
Diffstat (limited to 'gcc/pretty-print.h')
-rw-r--r-- | gcc/pretty-print.h | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/gcc/pretty-print.h b/gcc/pretty-print.h index 99e55dc..b41d3ce 100644 --- a/gcc/pretty-print.h +++ b/gcc/pretty-print.h @@ -70,16 +70,38 @@ enum diagnostic_prefixing_rule_t }; class quoting_info; +class output_buffer; +class urlifier; /* The chunk_info data structure forms a stack of the results from the first phase of formatting (pp_format) which have not yet been output (pp_output_formatted_text). A stack is necessary because the diagnostic starter may decide to generate its own output by way of the formatter. */ -struct chunk_info +class chunk_info { + friend class pretty_printer; + +public: + const char * const *get_args () const { return m_args; } + quoting_info *get_quoting_info () const { return m_quotes; } + + void append_formatted_chunk (const char *content); + + void pop_from_output_buffer (output_buffer &buf); + +private: + void on_begin_quote (const output_buffer &buf, + unsigned chunk_idx, + const urlifier *urlifier); + + void on_end_quote (pretty_printer *pp, + output_buffer &buf, + unsigned chunk_idx, + const urlifier *urlifier); + /* Pointer to previous chunk on the stack. */ - struct chunk_info *prev; + chunk_info *m_prev; /* Array of chunks to output. Each chunk is a NUL-terminated string. In the first phase of formatting, even-numbered chunks are @@ -87,7 +109,7 @@ struct chunk_info The second phase replaces all odd-numbered chunks with formatted text, and the third phase simply emits all the chunks in sequence with appropriate line-wrapping. */ - const char *args[PP_NL_ARGMAX * 2]; + const char *m_args[PP_NL_ARGMAX * 2]; /* If non-null, information on quoted text runs within the chunks for use by a urlifier. */ @@ -114,7 +136,7 @@ public: struct obstack *obstack; /* Stack of chunk arrays. These come from the chunk_obstack. */ - struct chunk_info *cur_chunk_array; + chunk_info *cur_chunk_array; /* Where to output formatted text. */ FILE *stream; |