annotate gcc/pretty-print.h @ 120:f93fa5091070

fix conv1.c
author mir3636
date Thu, 08 Mar 2018 14:53:42 +0900
parents 04ced10e8804
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 /* Various declarations for language-independent pretty-print subroutines.
111
kono
parents: 67
diff changeset
2 Copyright (C) 2002-2017 Free Software Foundation, Inc.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 This file is part of GCC.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 GCC is free software; you can redistribute it and/or modify it under
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 the terms of the GNU General Public License as published by the Free
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 Software Foundation; either version 3, or (at your option) any later
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 version.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 for more details.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 along with GCC; see the file COPYING3. If not see
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 <http://www.gnu.org/licenses/>. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 #ifndef GCC_PRETTY_PRINT_H
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 #define GCC_PRETTY_PRINT_H
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 #include "obstack.h"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 /* Maximum number of format string arguments. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 #define PP_NL_ARGMAX 30
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 /* The type of a text to be formatted according a format specification
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 along with a list of things. */
111
kono
parents: 67
diff changeset
31 struct text_info
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 const char *format_spec;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 va_list *args_ptr;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 int err_no; /* for %m */
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
36 void **x_data;
111
kono
parents: 67
diff changeset
37 rich_location *m_richloc;
kono
parents: 67
diff changeset
38
kono
parents: 67
diff changeset
39 void set_location (unsigned int idx, location_t loc, bool caret_p);
kono
parents: 67
diff changeset
40 location_t get_location (unsigned int index_of_location) const;
kono
parents: 67
diff changeset
41 };
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 /* How often diagnostics are prefixed by their locations:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 o DIAGNOSTICS_SHOW_PREFIX_NEVER: never - not yet supported;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 o DIAGNOSTICS_SHOW_PREFIX_ONCE: emit only once;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 o DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE: emit each time a physical
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 line is started. */
111
kono
parents: 67
diff changeset
48 enum diagnostic_prefixing_rule_t
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 DIAGNOSTICS_SHOW_PREFIX_ONCE = 0x0,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 DIAGNOSTICS_SHOW_PREFIX_NEVER = 0x1,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE = 0x2
111
kono
parents: 67
diff changeset
53 };
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 /* The chunk_info data structure forms a stack of the results from the
111
kono
parents: 67
diff changeset
56 first phase of formatting (pp_format) which have not yet been
kono
parents: 67
diff changeset
57 output (pp_output_formatted_text). A stack is necessary because
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 the diagnostic starter may decide to generate its own output by way
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 of the formatter. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 struct chunk_info
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 /* Pointer to previous chunk on the stack. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 struct chunk_info *prev;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 /* Array of chunks to output. Each chunk is a NUL-terminated string.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 In the first phase of formatting, even-numbered chunks are
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 to be output verbatim, odd-numbered chunks are format specifiers.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 The second phase replaces all odd-numbered chunks with formatted
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 text, and the third phase simply emits all the chunks in sequence
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 with appropriate line-wrapping. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 const char *args[PP_NL_ARGMAX * 2];
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 };
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 /* The output buffer datatype. This is best seen as an abstract datatype
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 whose fields should not be accessed directly by clients. */
111
kono
parents: 67
diff changeset
76 struct output_buffer
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 {
111
kono
parents: 67
diff changeset
78 output_buffer ();
kono
parents: 67
diff changeset
79 ~output_buffer ();
kono
parents: 67
diff changeset
80
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
81 /* Obstack where the text is built up. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 struct obstack formatted_obstack;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 /* Obstack containing a chunked representation of the format
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 specification plus arguments. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 struct obstack chunk_obstack;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
87
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 /* Currently active obstack: one of the above two. This is used so
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 that the text formatters don't need to know which phase we're in. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 struct obstack *obstack;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
91
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 /* Stack of chunk arrays. These come from the chunk_obstack. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 struct chunk_info *cur_chunk_array;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
94
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 /* Where to output formatted text. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
96 FILE *stream;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
97
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
98 /* The amount of characters output so far. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
99 int line_length;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
100
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 /* This must be large enough to hold any printed integer or
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 floating-point value. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 char digit_buffer[128];
111
kono
parents: 67
diff changeset
104
kono
parents: 67
diff changeset
105 /* Nonzero means that text should be flushed when
kono
parents: 67
diff changeset
106 appropriate. Otherwise, text is buffered until either
kono
parents: 67
diff changeset
107 pp_really_flush or pp_clear_output_area are called. */
kono
parents: 67
diff changeset
108 bool flush_p;
kono
parents: 67
diff changeset
109 };
kono
parents: 67
diff changeset
110
kono
parents: 67
diff changeset
111 /* Finishes constructing a NULL-terminated character string representing
kono
parents: 67
diff changeset
112 the buffered text. */
kono
parents: 67
diff changeset
113 static inline const char *
kono
parents: 67
diff changeset
114 output_buffer_formatted_text (output_buffer *buff)
kono
parents: 67
diff changeset
115 {
kono
parents: 67
diff changeset
116 obstack_1grow (buff->obstack, '\0');
kono
parents: 67
diff changeset
117 return (const char *) obstack_base (buff->obstack);
kono
parents: 67
diff changeset
118 }
kono
parents: 67
diff changeset
119
kono
parents: 67
diff changeset
120 /* Append to the output buffer a string specified by its
kono
parents: 67
diff changeset
121 STARTing character and LENGTH. */
kono
parents: 67
diff changeset
122 static inline void
kono
parents: 67
diff changeset
123 output_buffer_append_r (output_buffer *buff, const char *start, int length)
kono
parents: 67
diff changeset
124 {
kono
parents: 67
diff changeset
125 gcc_checking_assert (start);
kono
parents: 67
diff changeset
126 obstack_grow (buff->obstack, start, length);
kono
parents: 67
diff changeset
127 for (int i = 0; i < length; i++)
kono
parents: 67
diff changeset
128 if (start[i] == '\n')
kono
parents: 67
diff changeset
129 buff->line_length = 0;
kono
parents: 67
diff changeset
130 else
kono
parents: 67
diff changeset
131 buff->line_length++;
kono
parents: 67
diff changeset
132 }
kono
parents: 67
diff changeset
133
kono
parents: 67
diff changeset
134 /* Return a pointer to the last character emitted in the
kono
parents: 67
diff changeset
135 output_buffer. A NULL pointer means no character available. */
kono
parents: 67
diff changeset
136 static inline const char *
kono
parents: 67
diff changeset
137 output_buffer_last_position_in_text (const output_buffer *buff)
kono
parents: 67
diff changeset
138 {
kono
parents: 67
diff changeset
139 const char *p = NULL;
kono
parents: 67
diff changeset
140 struct obstack *text = buff->obstack;
kono
parents: 67
diff changeset
141
kono
parents: 67
diff changeset
142 if (obstack_base (text) != obstack_next_free (text))
kono
parents: 67
diff changeset
143 p = ((const char *) obstack_next_free (text)) - 1;
kono
parents: 67
diff changeset
144 return p;
kono
parents: 67
diff changeset
145 }
kono
parents: 67
diff changeset
146
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
147
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
148 /* The type of pretty-printer flags passed to clients. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
149 typedef unsigned int pp_flags;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
150
111
kono
parents: 67
diff changeset
151 enum pp_padding
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
152 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
153 pp_none, pp_before, pp_after
111
kono
parents: 67
diff changeset
154 };
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
155
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
156 /* Structure for switching in and out of verbatim mode in a convenient
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
157 manner. */
111
kono
parents: 67
diff changeset
158 struct pp_wrapping_mode_t
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
159 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
160 /* Current prefixing rule. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
161 diagnostic_prefixing_rule_t rule;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
162
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
163 /* The ideal upper bound of number of characters per line, as suggested
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
164 by front-end. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
165 int line_cutoff;
111
kono
parents: 67
diff changeset
166 };
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
167
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
168 /* Maximum characters per line in automatic line wrapping mode.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
169 Zero means don't wrap lines. */
111
kono
parents: 67
diff changeset
170 #define pp_line_cutoff(PP) (PP)->wrapping.line_cutoff
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
171
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
172 /* Prefixing rule used in formatting a diagnostic message. */
111
kono
parents: 67
diff changeset
173 #define pp_prefixing_rule(PP) (PP)->wrapping.rule
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
174
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
175 /* Get or set the wrapping mode as a single entity. */
111
kono
parents: 67
diff changeset
176 #define pp_wrapping_mode(PP) (PP)->wrapping
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
177
111
kono
parents: 67
diff changeset
178 /* The type of a hook that formats client-specific data onto a pretty_printer.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
179 A client-supplied formatter returns true if everything goes well,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
180 otherwise it returns false. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
181 typedef bool (*printer_fn) (pretty_printer *, text_info *, const char *,
111
kono
parents: 67
diff changeset
182 int, bool, bool, bool, bool, const char **);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
183
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
184 /* Client supplied function used to decode formats. */
111
kono
parents: 67
diff changeset
185 #define pp_format_decoder(PP) (PP)->format_decoder
kono
parents: 67
diff changeset
186
kono
parents: 67
diff changeset
187 /* Base class for an optional client-supplied object for doing additional
kono
parents: 67
diff changeset
188 processing between stages 2 and 3 of formatted printing. */
kono
parents: 67
diff changeset
189 class format_postprocessor
kono
parents: 67
diff changeset
190 {
kono
parents: 67
diff changeset
191 public:
kono
parents: 67
diff changeset
192 virtual ~format_postprocessor () {}
kono
parents: 67
diff changeset
193 virtual void handle (pretty_printer *) = 0;
kono
parents: 67
diff changeset
194 };
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
195
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
196 /* TRUE if a newline character needs to be added before further
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
197 formatting. */
111
kono
parents: 67
diff changeset
198 #define pp_needs_newline(PP) (PP)->need_newline
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
199
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
200 /* True if PRETTY-PRINTER is in line-wrapping mode. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
201 #define pp_is_wrapping_line(PP) (pp_line_cutoff (PP) > 0)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
202
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
203 /* The amount of whitespace to be emitted when starting a new line. */
111
kono
parents: 67
diff changeset
204 #define pp_indentation(PP) (PP)->indent_skip
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
205
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
206 /* True if identifiers are translated to the locale character set on
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
207 output. */
111
kono
parents: 67
diff changeset
208 #define pp_translate_identifiers(PP) (PP)->translate_identifiers
kono
parents: 67
diff changeset
209
kono
parents: 67
diff changeset
210 /* True if colors should be shown. */
kono
parents: 67
diff changeset
211 #define pp_show_color(PP) (PP)->show_color
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
212
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
213 /* The data structure that contains the bare minimum required to do
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
214 proper pretty-printing. Clients may derived from this structure
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
215 and add additional fields they need. */
111
kono
parents: 67
diff changeset
216 struct pretty_printer
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
217 {
111
kono
parents: 67
diff changeset
218 // Default construct a pretty printer with specified prefix
kono
parents: 67
diff changeset
219 // and a maximum line length cut off limit.
kono
parents: 67
diff changeset
220 explicit pretty_printer (const char* = NULL, int = 0);
kono
parents: 67
diff changeset
221
kono
parents: 67
diff changeset
222 virtual ~pretty_printer ();
kono
parents: 67
diff changeset
223
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
224 /* Where we print external representation of ENTITY. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
225 output_buffer *buffer;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
226
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
227 /* The prefix for each new line. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
228 const char *prefix;
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
229
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
230 /* Where to put whitespace around the entity being formatted. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
231 pp_padding padding;
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
232
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
233 /* The real upper bound of number of characters per line, taking into
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
234 account the case of a very very looong prefix. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
235 int maximum_length;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
236
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
237 /* Indentation count. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
238 int indent_skip;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
239
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
240 /* Current wrapping mode. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
241 pp_wrapping_mode_t wrapping;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
242
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
243 /* If non-NULL, this function formats a TEXT into the BUFFER. When called,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
244 TEXT->format_spec points to a format code. FORMAT_DECODER should call
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
245 pp_string (and related functions) to add data to the BUFFER.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
246 FORMAT_DECODER can read arguments from *TEXT->args_pts using VA_ARG.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
247 If the BUFFER needs additional characters from the format string, it
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
248 should advance the TEXT->format_spec as it goes. When FORMAT_DECODER
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
249 returns, TEXT->format_spec should point to the last character processed.
111
kono
parents: 67
diff changeset
250 The QUOTE and BUFFER_PTR are passed in, to allow for deferring-handling
kono
parents: 67
diff changeset
251 of format codes (e.g. %H and %I in the C++ frontend). */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
252 printer_fn format_decoder;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
253
111
kono
parents: 67
diff changeset
254 /* If non-NULL, this is called by pp_format once after all format codes
kono
parents: 67
diff changeset
255 have been processed, to allow for client-specific postprocessing.
kono
parents: 67
diff changeset
256 This is used by the C++ frontend for handling the %H and %I
kono
parents: 67
diff changeset
257 format codes (which interract with each other). */
kono
parents: 67
diff changeset
258 format_postprocessor *m_format_postprocessor;
kono
parents: 67
diff changeset
259
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
260 /* Nonzero if current PREFIX was emitted at least once. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
261 bool emitted_prefix;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
262
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
263 /* Nonzero means one should emit a newline before outputting anything. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
264 bool need_newline;
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
265
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
266 /* Nonzero means identifiers are translated to the locale character
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
267 set on output. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
268 bool translate_identifiers;
111
kono
parents: 67
diff changeset
269
kono
parents: 67
diff changeset
270 /* Nonzero means that text should be colorized. */
kono
parents: 67
diff changeset
271 bool show_color;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
272 };
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
273
111
kono
parents: 67
diff changeset
274 static inline const char *
kono
parents: 67
diff changeset
275 pp_get_prefix (const pretty_printer *pp) { return pp->prefix; }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
276
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
277 #define pp_space(PP) pp_character (PP, ' ')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
278 #define pp_left_paren(PP) pp_character (PP, '(')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
279 #define pp_right_paren(PP) pp_character (PP, ')')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
280 #define pp_left_bracket(PP) pp_character (PP, '[')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
281 #define pp_right_bracket(PP) pp_character (PP, ']')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
282 #define pp_left_brace(PP) pp_character (PP, '{')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
283 #define pp_right_brace(PP) pp_character (PP, '}')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
284 #define pp_semicolon(PP) pp_character (PP, ';')
111
kono
parents: 67
diff changeset
285 #define pp_comma(PP) pp_character (PP, ',')
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
286 #define pp_dot(PP) pp_character (PP, '.')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
287 #define pp_colon(PP) pp_character (PP, ':')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
288 #define pp_colon_colon(PP) pp_string (PP, "::")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
289 #define pp_arrow(PP) pp_string (PP, "->")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
290 #define pp_equal(PP) pp_character (PP, '=')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
291 #define pp_question(PP) pp_character (PP, '?')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
292 #define pp_bar(PP) pp_character (PP, '|')
111
kono
parents: 67
diff changeset
293 #define pp_bar_bar(PP) pp_string (PP, "||")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
294 #define pp_carret(PP) pp_character (PP, '^')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
295 #define pp_ampersand(PP) pp_character (PP, '&')
111
kono
parents: 67
diff changeset
296 #define pp_ampersand_ampersand(PP) pp_string (PP, "&&")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
297 #define pp_less(PP) pp_character (PP, '<')
111
kono
parents: 67
diff changeset
298 #define pp_less_equal(PP) pp_string (PP, "<=")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
299 #define pp_greater(PP) pp_character (PP, '>')
111
kono
parents: 67
diff changeset
300 #define pp_greater_equal(PP) pp_string (PP, ">=")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
301 #define pp_plus(PP) pp_character (PP, '+')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
302 #define pp_minus(PP) pp_character (PP, '-')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
303 #define pp_star(PP) pp_character (PP, '*')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
304 #define pp_slash(PP) pp_character (PP, '/')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
305 #define pp_modulo(PP) pp_character (PP, '%')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
306 #define pp_exclamation(PP) pp_character (PP, '!')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
307 #define pp_complement(PP) pp_character (PP, '~')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
308 #define pp_quote(PP) pp_character (PP, '\'')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
309 #define pp_backquote(PP) pp_character (PP, '`')
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
310 #define pp_doublequote(PP) pp_character (PP, '"')
111
kono
parents: 67
diff changeset
311 #define pp_underscore(PP) pp_character (PP, '_')
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
312 #define pp_maybe_newline_and_indent(PP, N) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
313 if (pp_needs_newline (PP)) pp_newline_and_indent (PP, N)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
314 #define pp_scalar(PP, FORMAT, SCALAR) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
315 do \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
316 { \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
317 sprintf (pp_buffer (PP)->digit_buffer, FORMAT, SCALAR); \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
318 pp_string (PP, pp_buffer (PP)->digit_buffer); \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
319 } \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
320 while (0)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
321 #define pp_decimal_int(PP, I) pp_scalar (PP, "%d", I)
111
kono
parents: 67
diff changeset
322 #define pp_unsigned_wide_integer(PP, I) \
kono
parents: 67
diff changeset
323 pp_scalar (PP, HOST_WIDE_INT_PRINT_UNSIGNED, (unsigned HOST_WIDE_INT) I)
kono
parents: 67
diff changeset
324 #define pp_wide_int(PP, W, SGN) \
kono
parents: 67
diff changeset
325 do \
kono
parents: 67
diff changeset
326 { \
kono
parents: 67
diff changeset
327 print_dec (W, pp_buffer (PP)->digit_buffer, SGN); \
kono
parents: 67
diff changeset
328 pp_string (PP, pp_buffer (PP)->digit_buffer); \
kono
parents: 67
diff changeset
329 } \
kono
parents: 67
diff changeset
330 while (0)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
331 #define pp_wide_integer(PP, I) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
332 pp_scalar (PP, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT) I)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
333 #define pp_pointer(PP, P) pp_scalar (PP, "%p", P)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
334
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
335 #define pp_identifier(PP, ID) pp_string (PP, (pp_translate_identifiers (PP) \
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
336 ? identifier_to_locale (ID) \
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
337 : (ID)))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
338
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
339
111
kono
parents: 67
diff changeset
340 #define pp_buffer(PP) (PP)->buffer
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
341
111
kono
parents: 67
diff changeset
342 extern void pp_set_line_maximum_length (pretty_printer *, int);
kono
parents: 67
diff changeset
343 extern void pp_set_prefix (pretty_printer *, const char *);
kono
parents: 67
diff changeset
344 extern void pp_destroy_prefix (pretty_printer *);
kono
parents: 67
diff changeset
345 extern int pp_remaining_character_count_for_line (pretty_printer *);
kono
parents: 67
diff changeset
346 extern void pp_clear_output_area (pretty_printer *);
kono
parents: 67
diff changeset
347 extern const char *pp_formatted_text (pretty_printer *);
kono
parents: 67
diff changeset
348 extern const char *pp_last_position_in_text (const pretty_printer *);
kono
parents: 67
diff changeset
349 extern void pp_emit_prefix (pretty_printer *);
kono
parents: 67
diff changeset
350 extern void pp_append_text (pretty_printer *, const char *, const char *);
kono
parents: 67
diff changeset
351 extern void pp_newline_and_flush (pretty_printer *);
kono
parents: 67
diff changeset
352 extern void pp_newline_and_indent (pretty_printer *, int);
kono
parents: 67
diff changeset
353 extern void pp_separate_with (pretty_printer *, char);
kono
parents: 67
diff changeset
354
kono
parents: 67
diff changeset
355 /* If we haven't already defined a front-end-specific diagnostics
kono
parents: 67
diff changeset
356 style, use the generic one. */
kono
parents: 67
diff changeset
357 #ifdef GCC_DIAG_STYLE
kono
parents: 67
diff changeset
358 #define GCC_PPDIAG_STYLE GCC_DIAG_STYLE
kono
parents: 67
diff changeset
359 #else
kono
parents: 67
diff changeset
360 #define GCC_PPDIAG_STYLE __gcc_diag__
kono
parents: 67
diff changeset
361 #endif
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
362
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
363 /* This header may be included before diagnostics-core.h, hence the duplicate
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
364 definitions to allow for GCC-specific formats. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
365 #if GCC_VERSION >= 3005
111
kono
parents: 67
diff changeset
366 #define ATTRIBUTE_GCC_PPDIAG(m, n) __attribute__ ((__format__ (GCC_PPDIAG_STYLE, m ,n))) ATTRIBUTE_NONNULL(m)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
367 #else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
368 #define ATTRIBUTE_GCC_PPDIAG(m, n) ATTRIBUTE_NONNULL(m)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
369 #endif
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
370 extern void pp_printf (pretty_printer *, const char *, ...)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
371 ATTRIBUTE_GCC_PPDIAG(2,3);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
372
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
373 extern void pp_verbatim (pretty_printer *, const char *, ...)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
374 ATTRIBUTE_GCC_PPDIAG(2,3);
111
kono
parents: 67
diff changeset
375 extern void pp_flush (pretty_printer *);
kono
parents: 67
diff changeset
376 extern void pp_really_flush (pretty_printer *);
kono
parents: 67
diff changeset
377 extern void pp_format (pretty_printer *, text_info *);
kono
parents: 67
diff changeset
378 extern void pp_output_formatted_text (pretty_printer *);
kono
parents: 67
diff changeset
379 extern void pp_format_verbatim (pretty_printer *, text_info *);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
380
111
kono
parents: 67
diff changeset
381 extern void pp_indent (pretty_printer *);
kono
parents: 67
diff changeset
382 extern void pp_newline (pretty_printer *);
kono
parents: 67
diff changeset
383 extern void pp_character (pretty_printer *, int);
kono
parents: 67
diff changeset
384 extern void pp_string (pretty_printer *, const char *);
kono
parents: 67
diff changeset
385 extern void pp_write_text_to_stream (pretty_printer *);
kono
parents: 67
diff changeset
386 extern void pp_write_text_as_dot_label_to_stream (pretty_printer *, bool);
kono
parents: 67
diff changeset
387 extern void pp_maybe_space (pretty_printer *);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
388
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
389 /* Switch into verbatim mode and return the old mode. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
390 static inline pp_wrapping_mode_t
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
391 pp_set_verbatim_wrapping_ (pretty_printer *pp)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
392 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
393 pp_wrapping_mode_t oldmode = pp_wrapping_mode (pp);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
394 pp_line_cutoff (pp) = 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
395 pp_prefixing_rule (pp) = DIAGNOSTICS_SHOW_PREFIX_NEVER;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
396 return oldmode;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
397 }
111
kono
parents: 67
diff changeset
398 #define pp_set_verbatim_wrapping(PP) pp_set_verbatim_wrapping_ (PP)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
399
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
400 extern const char *identifier_to_locale (const char *);
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
401 extern void *(*identifier_to_locale_alloc) (size_t);
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
402 extern void (*identifier_to_locale_free) (void *);
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
403
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
404 #endif /* GCC_PRETTY_PRINT_H */