Mercurial > hg > CbC > CbC_gcc
diff gcc/pretty-print.h @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
line wrap: on
line diff
--- a/gcc/pretty-print.h Thu Oct 25 07:37:49 2018 +0900 +++ b/gcc/pretty-print.h Thu Feb 13 11:34:05 2020 +0900 @@ -1,5 +1,5 @@ /* Various declarations for language-independent pretty-print subroutines. - Copyright (C) 2002-2018 Free Software Foundation, Inc. + Copyright (C) 2002-2020 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net> This file is part of GCC. @@ -74,8 +74,9 @@ /* The output buffer datatype. This is best seen as an abstract datatype whose fields should not be accessed directly by clients. */ -struct output_buffer +class output_buffer { +public: output_buffer (); ~output_buffer (); @@ -191,6 +192,7 @@ { public: virtual ~format_postprocessor () {} + virtual format_postprocessor *clone() const = 0; virtual void handle (pretty_printer *) = 0; }; @@ -214,14 +216,18 @@ /* The data structure that contains the bare minimum required to do proper pretty-printing. Clients may derived from this structure and add additional fields they need. */ -struct pretty_printer +class pretty_printer { +public: /* Default construct a pretty printer with specified maximum line length cut off limit. */ explicit pretty_printer (int = 0); + explicit pretty_printer (const pretty_printer &other); virtual ~pretty_printer (); + virtual pretty_printer *clone () const; + /* Where we print external representation of ENTITY. */ output_buffer *buffer; @@ -271,6 +277,9 @@ /* Nonzero means that text should be colorized. */ bool show_color; + + /* Nonzero means that URLs should be emitted. */ + bool show_urls; }; static inline const char * @@ -330,6 +339,7 @@ pp_string (PP, pp_buffer (PP)->digit_buffer); \ } \ while (0) +#define pp_double(PP, F) pp_scalar (PP, "%f", F) #define pp_pointer(PP, P) pp_scalar (PP, "%p", P) #define pp_identifier(PP, ID) pp_string (PP, (pp_translate_identifiers (PP) \ @@ -383,13 +393,19 @@ extern void pp_newline (pretty_printer *); extern void pp_character (pretty_printer *, int); extern void pp_string (pretty_printer *, const char *); + extern void pp_write_text_to_stream (pretty_printer *); extern void pp_write_text_as_dot_label_to_stream (pretty_printer *, bool); +extern void pp_write_text_as_html_like_dot_to_stream (pretty_printer *pp); + extern void pp_maybe_space (pretty_printer *); extern void pp_begin_quote (pretty_printer *, bool); extern void pp_end_quote (pretty_printer *, bool); +extern void pp_begin_url (pretty_printer *pp, const char *url); +extern void pp_end_url (pretty_printer *pp); + /* Switch into verbatim mode and return the old mode. */ static inline pp_wrapping_mode_t pp_set_verbatim_wrapping_ (pretty_printer *pp)