cxx-pretty-print.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /* Interface for the GNU C++ pretty-printer.
  2. Copyright (C) 2003-2015 Free Software Foundation, Inc.
  3. Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
  4. This file is part of GCC.
  5. GCC is free software; you can redistribute it and/or modify it under
  6. the terms of the GNU General Public License as published by the Free
  7. Software Foundation; either version 3, or (at your option) any later
  8. version.
  9. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  12. for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with GCC; see the file COPYING3. If not see
  15. <http://www.gnu.org/licenses/>. */
  16. #ifndef GCC_CXX_PRETTY_PRINT_H
  17. #define GCC_CXX_PRETTY_PRINT_H
  18. #include "c-family/c-pretty-print.h"
  19. enum cxx_pretty_printer_flags
  20. {
  21. /* Ask for a qualified-id. */
  22. pp_cxx_flag_default_argument = 1 << pp_c_flag_last_bit
  23. };
  24. struct cxx_pretty_printer : c_pretty_printer
  25. {
  26. cxx_pretty_printer ();
  27. void constant (tree);
  28. void id_expression (tree);
  29. void primary_expression (tree);
  30. void postfix_expression (tree);
  31. void unary_expression (tree);
  32. void multiplicative_expression (tree);
  33. void conditional_expression (tree);
  34. void assignment_expression (tree);
  35. void expression (tree);
  36. void type_id (tree);
  37. void statement (tree);
  38. void declaration (tree);
  39. void declaration_specifiers (tree);
  40. void simple_type_specifier (tree);
  41. void function_specifier (tree);
  42. void declarator (tree);
  43. void direct_declarator (tree);
  44. void abstract_declarator (tree);
  45. void direct_abstract_declarator (tree);
  46. /* This is the enclosing scope of the entity being pretty-printed. */
  47. tree enclosing_scope;
  48. };
  49. #define pp_cxx_cv_qualifier_seq(PP, T) \
  50. pp_c_type_qualifier_list (PP, T)
  51. #define pp_cxx_cv_qualifiers(PP, CV, FT) \
  52. pp_c_cv_qualifiers (PP, CV, FT)
  53. #define pp_cxx_whitespace(PP) pp_c_whitespace (PP)
  54. #define pp_cxx_left_paren(PP) pp_c_left_paren (PP)
  55. #define pp_cxx_right_paren(PP) pp_c_right_paren (PP)
  56. #define pp_cxx_left_brace(PP) pp_c_left_brace (PP)
  57. #define pp_cxx_right_brace(PP) pp_c_right_brace (PP)
  58. #define pp_cxx_left_bracket(PP) pp_c_left_bracket (PP)
  59. #define pp_cxx_right_bracket(PP) pp_c_right_bracket (PP)
  60. #define pp_cxx_dot(PP) pp_c_dot (PP)
  61. #define pp_cxx_ampersand(PP) pp_c_ampersand (PP)
  62. #define pp_cxx_star(PP) pp_c_star (PP)
  63. #define pp_cxx_arrow(PP) pp_c_arrow (PP)
  64. #define pp_cxx_semicolon(PP) pp_c_semicolon (PP)
  65. #define pp_cxx_complement(PP) pp_c_complement (PP)
  66. #define pp_cxx_ws_string(PP, I) pp_c_ws_string (PP, I)
  67. #define pp_cxx_identifier(PP, I) pp_c_identifier (PP, I)
  68. #define pp_cxx_tree_identifier(PP, T) \
  69. pp_c_tree_identifier (PP, T)
  70. void pp_cxx_begin_template_argument_list (cxx_pretty_printer *);
  71. void pp_cxx_end_template_argument_list (cxx_pretty_printer *);
  72. void pp_cxx_colon_colon (cxx_pretty_printer *);
  73. void pp_cxx_separate_with (cxx_pretty_printer *, int);
  74. void pp_cxx_canonical_template_parameter (cxx_pretty_printer *, tree);
  75. void pp_cxx_trait_expression (cxx_pretty_printer *, tree);
  76. void pp_cxx_va_arg_expression (cxx_pretty_printer *, tree);
  77. void pp_cxx_offsetof_expression (cxx_pretty_printer *, tree);
  78. void pp_cxx_userdef_literal (cxx_pretty_printer *, tree);
  79. #endif /* GCC_CXX_PRETTY_PRINT_H */