diff options
author | Gabriel Dos Reis <gdr@integrable-solutions.net> | 2003-08-10 18:17:06 +0000 |
---|---|---|
committer | Gabriel Dos Reis <gdr@gcc.gnu.org> | 2003-08-10 18:17:06 +0000 |
commit | 4b780675e462fe50a27c972672a171927d37564d (patch) | |
tree | 6b4733cd709d9969e774e038f5d1924ffe164466 /gcc/c-pretty-print.h | |
parent | bae39a73bedabd843cbd6adfe195fa2327ca89ea (diff) | |
download | gcc-4b780675e462fe50a27c972672a171927d37564d.zip gcc-4b780675e462fe50a27c972672a171927d37564d.tar.gz gcc-4b780675e462fe50a27c972672a171927d37564d.tar.bz2 |
pretty-print.c (pp_base_indent): Rename from pp_indent.
* pretty-print.c (pp_base_indent): Rename from pp_indent.
* c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype.
(struct c_pretty_print_info): Add more fields.
(pp_c_left_paren): Move to c-pretty-print.c.
(pp_c_right_paren): Likewise.
(pp_c_left_brace): Likewise.
(pp_c_right_brace): Likewise.
(pp_c_left_bracket): Likewise.
(pp_c_right_bracket): Likewise.
(pp_c_declarator): Declare.
(pp_c_direct_declarator): Likewise.
(pp_c_specifier_qualifier_list): Likewise.
(pp_c_type_id): Likewise.
* c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework..
(pp_c_type_qualifier_list): New.
(pp_c_pointer): Likewise.
(pp_c_parameter_type_list): Likewise.
(pp_c_function_definition): Likewise.
(pp_c_id_expression): Likewise.
(pp_c_simple_type_specifier): Tidy.
(pp_c_unary_expression): Likewise.
(pp_c_expression): Likewise.
(pp_c_pretty_printer_init): Likewise.
(pp_c_specifier_qualifier_list): Rework..
(pp_c_abstract_declarator): Likewise.
(pp_c_postfix_expression): Likewise.
(pp_c_primary_expression): Likewise.
(pp_c_cast_expression): Likewise.
(pp_c_direct_abstract_declarator): Likewise.
(pp_c_storage_class_specifier): Likewise.
(pp_c_function_specifier): Likewise.
(pp_c_declaration_specifiers): Likewise.
(pp_c_direct_declarator): Likewise.
(pp_c_declarator): Likewise.
(pp_c_declaration): Likewise.
(pp_c_statement): Likewise.
(pp_c_integer_constant): Rename from pp_c_integer_literal.
(pp_c_character_constant): Rename from pp_c_character_literal.
(pp_c_bool_constant): Rename from pp_c_bool_literal.
(pp_c_enumeration_constant): Rename from pp_c_enumerator.
(pp_c_floating_constant): Rename from pp_c_real_literal.
(pp_c_constant): Rename from pp_c_literal.
* c-lang.c: Include diagnostic.h and c-pretty-print.h
(LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define.
(c_initialize_diagnostics): New.
* Makefile.in (c-lang.o): Update dependency.
cp/
* error.c (dump_expr): Tidy.
* cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New.
(pp_cxx_begin_template_argument_list): Likewise.
(pp_cxx_end_template_argument_list): Likewise.
(is_destructor_name): Likewise.
(pp_cxx_unqualified_id): Likewise.
(pp_cxx_qualified_id): Likewise.
(pp_cxx_id_expression): Likewise.
(pp_cxx_new_expression): Likewise.
(pp_cxx_delete_expression): Likewise.
(pp_cxx_pm_expression): Likewise.
(pp_cxx_type_specifier): Rework.
(pp_cxx_type_id): Likewise.
(pp_cxx_primary_expression): Likewise.
(pp_cxx_postfix_expression): Likewise.
(pp_cxx_unary_expression): Likewise.
(pp_cxx_multiplicative_expression): Likewise.
(pp_cxx_conditional_expression): Likewise.
(pp_cxx_assignment_expression): Likewise.
(pp_cxx_pretty_printer_init): Tidy.
From-SVN: r70299
Diffstat (limited to 'gcc/c-pretty-print.h')
-rw-r--r-- | gcc/c-pretty-print.h | 103 |
1 files changed, 47 insertions, 56 deletions
diff --git a/gcc/c-pretty-print.h b/gcc/c-pretty-print.h index c093300..8052662 100644 --- a/gcc/c-pretty-print.h +++ b/gcc/c-pretty-print.h @@ -27,6 +27,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "pretty-print.h" +typedef enum + { + pp_c_flag_abstract = 1 << 1, + pp_c_flag_last_bit = 2 + } pp_c_pretty_print_flags; + + /* The data type used to bundle information necessary for pretty-printing a C or C++ entity. */ typedef struct c_pretty_print_info *c_pretty_printer; @@ -41,18 +48,24 @@ struct c_pretty_print_info Not used yet. */ int *offset_list; + pp_flags flags; + /* These must be overridden by each of the C and C++ front-end to reflect their understanding of syntactic productions when they differ. */ c_pretty_print_fn declaration; c_pretty_print_fn declaration_specifiers; - c_pretty_print_fn type_specifier; c_pretty_print_fn declarator; + c_pretty_print_fn abstract_declarator; + c_pretty_print_fn type_specifier; c_pretty_print_fn direct_declarator; c_pretty_print_fn parameter_declaration; c_pretty_print_fn type_id; + c_pretty_print_fn function_specifier; + c_pretty_print_fn storage_class_specifier; c_pretty_print_fn statement; + c_pretty_print_fn id_expression; c_pretty_print_fn primary_expression; c_pretty_print_fn postfix_expression; c_pretty_print_fn unary_expression; @@ -65,78 +78,50 @@ struct c_pretty_print_info #undef pp_base #define pp_base(PP) (&pp_c_base (PP)->base) -#define pp_c_left_paren(PPI) \ - do { \ - pp_left_paren (PPI); \ - pp_c_base (PPI)->base.padding = pp_none; \ - } while (0) -#define pp_c_right_paren(PPI) \ - do { \ - pp_right_paren (PPI); \ - pp_c_base (PPI)->base.padding = pp_none; \ - } while (0) -#define pp_c_left_bracket(PPI) \ - do { \ - pp_left_bracket (PPI); \ - pp_c_base (PPI)->base.padding = pp_none; \ - } while (0) -#define pp_c_right_bracket(PPI) \ - do { \ - pp_right_bracket (PPI); \ - pp_c_base (PPI)->base.padding = pp_none; \ - } while (0) -#define pp_c_whitespace(PPI) \ - do { \ - pp_space (PPI); \ - pp_c_base (PPI)->base.padding = pp_none; \ - } while (0) -#define pp_c_maybe_whitespace(PPI) \ - do { \ - if (pp_c_base (PPI)->base.padding != pp_none) \ - pp_c_whitespace (PPI); \ - } while (0) -#define pp_c_identifier(PPI, ID) \ - do { \ - pp_c_maybe_whitespace (PPI); \ - pp_identifier (PPI, ID); \ - pp_c_base (PPI)->base.padding = pp_before; \ - } while (0) #define pp_c_tree_identifier(PPI, ID) \ pp_c_identifier (PPI, IDENTIFIER_POINTER (ID)) #define pp_declaration(PPI, T) \ - (*pp_c_base (PPI)->declaration) (pp_c_base (PPI), T) + pp_c_base (PPI)->declaration (pp_c_base (PPI), T) #define pp_declaration_specifiers(PPI, D) \ - (*pp_c_base (PPI)->declaration_specifiers) (pp_c_base (PPI), D) + pp_c_base (PPI)->declaration_specifiers (pp_c_base (PPI), D) +#define pp_abstract_declarator(PP, D) \ + pp_c_base (PP)->abstract_declarator (pp_c_base (PP), D) #define pp_type_specifier(PPI, D) \ - (*pp_c_base (PPI)->type_specifier) (pp_c_base (PPI), D) + pp_c_base (PPI)->type_specifier (pp_c_base (PPI), D) #define pp_declarator(PPI, D) \ - (*pp_c_base (PPI)->declarator) (pp_c_base (PPI), D) + pp_c_base (PPI)->declarator (pp_c_base (PPI), D) #define pp_direct_declarator(PPI, D) \ - (*pp_c_base (PPI)->direct_declarator) (pp_c_base (PPI), D) + pp_c_base (PPI)->direct_declarator (pp_c_base (PPI), D) #define pp_parameter_declaration(PPI, T) \ - (*pp_c_base (PPI)->parameter_declaration) (pp_c_base (PPI), T) + pp_c_base (PPI)->parameter_declaration (pp_c_base (PPI), T) #define pp_type_id(PPI, D) \ - (*pp_c_base (PPI)->type_id) (pp_c_base (PPI), D) + pp_c_base (PPI)->type_id (pp_c_base (PPI), D) +#define pp_function_specifier(PP, D) \ + pp_c_base (PP)->function_specifier (pp_c_base (PP), D) +#define pp_storage_class_specifier(PP, D) \ + pp_c_base (PP)->storage_class_specifier (pp_c_base (PP), D); #define pp_statement(PPI, S) \ - (*pp_c_base (PPI)->statement) (pp_c_base (PPI), S) + pp_c_base (PPI)->statement (pp_c_base (PPI), S) +#define pp_id_expression(PP, E) \ + pp_c_base (PP)->id_expression (pp_c_base (PP), E) #define pp_primary_expression(PPI, E) \ - (*pp_c_base (PPI)->primary_expression) (pp_c_base (PPI), E) + pp_c_base (PPI)->primary_expression (pp_c_base (PPI), E) #define pp_postfix_expression(PPI, E) \ - (*pp_c_base (PPI)->postfix_expression) (pp_c_base (PPI), E) + pp_c_base (PPI)->postfix_expression (pp_c_base (PPI), E) #define pp_unary_expression(PPI, E) \ - (*pp_c_base (PPI)->unary_expression) (pp_c_base (PPI), E) + pp_c_base (PPI)->unary_expression (pp_c_base (PPI), E) #define pp_initializer(PPI, E) \ - (*pp_c_base (PPI)->initializer) (pp_c_base (PPI), E) + pp_c_base (PPI)->initializer (pp_c_base (PPI), E) #define pp_multiplicative_expression(PPI, E) \ - (*pp_c_base (PPI)->multiplicative_expression) (pp_c_base (PPI), E) + pp_c_base (PPI)->multiplicative_expression (pp_c_base (PPI), E) #define pp_conditional_expression(PPI, E) \ - (*pp_c_base (PPI)->conditional_expression) (pp_c_base (PPI), E) + pp_c_base (PPI)->conditional_expression (pp_c_base (PPI), E) #define pp_assignment_expression(PPI, E) \ - (*pp_c_base (PPI)->assignment_expression) (pp_c_base (PPI), E) + pp_c_base (PPI)->assignment_expression (pp_c_base (PPI), E) /* Returns the c_pretty_printer base object of PRETTY-PRINTER. This @@ -146,22 +131,28 @@ struct c_pretty_print_info extern void pp_c_pretty_printer_init (c_pretty_printer); /* Declarations. */ +void pp_c_function_definition (c_pretty_printer, tree); void pp_c_attributes (c_pretty_printer, tree); -void pp_c_cv_qualifier (c_pretty_printer, int); +void pp_c_type_qualifier_list (c_pretty_printer, tree); void pp_c_parameter_declaration_clause (c_pretty_printer, tree); void pp_c_declaration (c_pretty_printer, tree); +void pp_c_declarator (c_pretty_printer, tree); +void pp_c_direct_declarator (c_pretty_printer, tree); +void pp_c_specifier_qualifier_list (c_pretty_printer, tree); +void pp_c_type_id (c_pretty_printer, tree); /* Statements. */ void pp_c_statement (c_pretty_printer, tree); /* Expressions. */ void pp_c_expression (c_pretty_printer, tree); void pp_c_logical_or_expression (c_pretty_printer, tree); void pp_c_expression_list (c_pretty_printer, tree); +void pp_c_unary_expression (c_pretty_printer, tree); void pp_c_cast_expression (c_pretty_printer, tree); void pp_c_postfix_expression (c_pretty_printer, tree); void pp_c_initializer (c_pretty_printer, tree); -void pp_c_literal (c_pretty_printer, tree); +void pp_c_constant (c_pretty_printer, tree); +void pp_c_id_expression (c_pretty_printer, tree); +void pp_c_identifier (c_pretty_printer, const char *); void pp_c_string_literal (c_pretty_printer, tree); -void pp_c_real_literal (c_pretty_printer, tree); -void pp_c_integer_literal (c_pretty_printer, tree); #endif /* GCC_C_PRETTY_PRINTER */ |