21 #ifndef GCC_PRETTY_PRINT_H
22 #define GCC_PRETTY_PRINT_H
28 #define PP_NL_ARGMAX 30
69 const char *
args[PP_NL_ARGMAX * 2];
126 #define pp_line_cutoff(PP) (PP)->wrapping.line_cutoff
129 #define pp_prefixing_rule(PP) (PP)->wrapping.rule
132 #define pp_wrapping_mode(PP) (PP)->wrapping
138 int, bool, bool, bool);
141 #define pp_format_decoder(PP) (PP)->format_decoder
145 #define pp_needs_newline(PP) (PP)->need_newline
148 #define pp_is_wrapping_line(PP) (pp_line_cutoff (PP) > 0)
151 #define pp_indentation(PP) (PP)->indent_skip
155 #define pp_translate_identifiers(PP) (PP)->translate_identifiers
158 #define pp_show_color(PP) (PP)->show_color
214 static inline const char *
217 #define pp_space(PP) pp_character (PP, ' ')
218 #define pp_left_paren(PP) pp_character (PP, '(')
219 #define pp_right_paren(PP) pp_character (PP, ')')
220 #define pp_left_bracket(PP) pp_character (PP, '[')
221 #define pp_right_bracket(PP) pp_character (PP, ']')
222 #define pp_left_brace(PP) pp_character (PP, '{')
223 #define pp_right_brace(PP) pp_character (PP, '}')
224 #define pp_semicolon(PP) pp_character (PP, ';')
225 #define pp_comma(PP) pp_character (PP, ',')
226 #define pp_dot(PP) pp_character (PP, '.')
227 #define pp_colon(PP) pp_character (PP, ':')
228 #define pp_colon_colon(PP) pp_string (PP, "::")
229 #define pp_arrow(PP) pp_string (PP, "->")
230 #define pp_equal(PP) pp_character (PP, '=')
231 #define pp_question(PP) pp_character (PP, '?')
232 #define pp_bar(PP) pp_character (PP, '|')
233 #define pp_bar_bar(PP) pp_string (PP, "||")
234 #define pp_carret(PP) pp_character (PP, '^')
235 #define pp_ampersand(PP) pp_character (PP, '&')
236 #define pp_ampersand_ampersand(PP) pp_string (PP, "&&")
237 #define pp_less(PP) pp_character (PP, '<')
238 #define pp_less_equal(PP) pp_string (PP, "<=")
239 #define pp_greater(PP) pp_character (PP, '>')
240 #define pp_greater_equal(PP) pp_string (PP, ">=")
241 #define pp_plus(PP) pp_character (PP, '+')
242 #define pp_minus(PP) pp_character (PP, '-')
243 #define pp_star(PP) pp_character (PP, '*')
244 #define pp_slash(PP) pp_character (PP, '/')
245 #define pp_modulo(PP) pp_character (PP, '%')
246 #define pp_exclamation(PP) pp_character (PP, '!')
247 #define pp_complement(PP) pp_character (PP, '~')
248 #define pp_quote(PP) pp_character (PP, '\'')
249 #define pp_backquote(PP) pp_character (PP, '`')
250 #define pp_doublequote(PP) pp_character (PP, '"')
251 #define pp_underscore(PP) pp_character (PP, '_')
252 #define pp_maybe_newline_and_indent(PP, N) \
253 if (pp_needs_newline (PP)) pp_newline_and_indent (PP, N)
254 #define pp_scalar(PP, FORMAT, SCALAR) \
257 sprintf (pp_buffer (PP)->digit_buffer, FORMAT, SCALAR); \
258 pp_string (PP, pp_buffer (PP)->digit_buffer); \
261 #define pp_decimal_int(PP, I) pp_scalar (PP, "%d", I)
262 #define pp_unsigned_wide_integer(PP, I) \
263 pp_scalar (PP, HOST_WIDE_INT_PRINT_UNSIGNED, (unsigned HOST_WIDE_INT) I)
264 #define pp_wide_integer(PP, I) \
265 pp_scalar (PP, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT) I)
266 #define pp_widest_integer(PP, I) \
267 pp_scalar (PP, HOST_WIDEST_INT_PRINT_DEC, (HOST_WIDEST_INT) I)
268 #define pp_pointer(PP, P) pp_scalar (PP, "%p", P)
270 #define pp_identifier(PP, ID) pp_string (PP, (pp_translate_identifiers (PP) \
271 ? identifier_to_locale (ID) \
275 #define pp_buffer(PP) (PP)->buffer
292 #ifdef GCC_DIAG_STYLE
293 #define GCC_PPDIAG_STYLE GCC_DIAG_STYLE
295 #define GCC_PPDIAG_STYLE __gcc_diag__
300 #if GCC_VERSION >= 3005
301 #define ATTRIBUTE_GCC_PPDIAG(m, n) __attribute__ ((__format__ (GCC_PPDIAG_STYLE, m ,n))) ATTRIBUTE_NONNULL(m)
303 #define ATTRIBUTE_GCC_PPDIAG(m, n) ATTRIBUTE_NONNULL(m)
306 ATTRIBUTE_GCC_PPDIAG(2,3);
309 ATTRIBUTE_GCC_PPDIAG(2,3);
310 extern
void pp_flush (pretty_printer *);
315 extern
void pp_indent (pretty_printer *);
318 extern
void pp_string (pretty_printer *, const
char *);
325 pp_set_verbatim_wrapping_ (pretty_printer *pp)
328 pp_line_cutoff (pp) = 0;
332 #define pp_set_verbatim_wrapping(PP) pp_set_verbatim_wrapping_ (PP)
335 extern void *(*identifier_to_locale_alloc) (size_t);