1 /* Subroutines common to both C and C++ pretty-printers.
2 Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3 Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
24 #include "coretypes.h"
27 #include "c-pretty-print.h"
30 /* The pretty-printer code is primarily designed to closely follow
31 (GNU) C and C++ grammars. That is to be contrasted with spaghetti
32 codes we used to have in the past. Following a structured
33 approach (preferably the official grammars) is believed to make it
34 much easier to add extensions and nifty pretty-printing effects that
35 takes expression or declaration contexts into account. */
38 #define pp_c_maybe_whitespace(PP) \
40 if (pp_base (PP)->padding == pp_before) \
41 pp_c_whitespace (PP); \
44 #define pp_c_left_bracket(PP) \
46 pp_left_bracket (PP); \
47 pp_base (PP)->padding = pp_none; \
50 #define pp_c_right_bracket(PP) \
52 pp_right_bracket (PP); \
53 pp_base (PP)->padding = pp_none; \
56 #define pp_c_star(PP) \
59 pp_base (PP)->padding = pp_none; \
63 static void pp_c_char (c_pretty_printer *, int);
65 /* postfix-expression */
66 static void pp_c_initializer_list (c_pretty_printer *, tree);
68 static void pp_c_multiplicative_expression (c_pretty_printer *, tree);
69 static void pp_c_additive_expression (c_pretty_printer *, tree);
70 static void pp_c_shift_expression (c_pretty_printer *, tree);
71 static void pp_c_relational_expression (c_pretty_printer *, tree);
72 static void pp_c_equality_expression (c_pretty_printer *, tree);
73 static void pp_c_and_expression (c_pretty_printer *, tree);
74 static void pp_c_exclusive_or_expression (c_pretty_printer *, tree);
75 static void pp_c_inclusive_or_expression (c_pretty_printer *, tree);
76 static void pp_c_logical_and_expression (c_pretty_printer *, tree);
77 static void pp_c_conditional_expression (c_pretty_printer *, tree);
78 static void pp_c_assignment_expression (c_pretty_printer *, tree);
83 /* Helper functions. */
86 pp_c_whitespace (c_pretty_printer *pp)
89 pp_base (pp)->padding = pp_none;
93 pp_c_left_paren (c_pretty_printer *pp)
96 pp_base (pp)->padding = pp_none;
100 pp_c_right_paren (c_pretty_printer *pp)
103 pp_base (pp)->padding = pp_none;
107 pp_c_left_brace (c_pretty_printer *pp)
110 pp_base (pp)->padding = pp_none;
114 pp_c_right_brace (c_pretty_printer *pp)
117 pp_base (pp)->padding = pp_none;
121 pp_c_dot (c_pretty_printer *pp)
124 pp_base (pp)->padding = pp_none;
128 pp_c_ampersand (c_pretty_printer *pp)
131 pp_base (pp)->padding = pp_none;
135 pp_c_arrow (c_pretty_printer *pp)
138 pp_base (pp)->padding = pp_none;
142 pp_c_semicolon(c_pretty_printer *pp)
145 pp_base (pp)->padding = pp_none;
149 pp_c_cv_qualifier (c_pretty_printer *pp, const char *cv)
151 const char *p = pp_last_position_in_text (pp);
152 if (p != NULL && *p == '*')
153 pp_c_whitespace (pp);
154 pp_c_identifier (pp, cv);
157 /* Pretty-print T using the type-cast notation '( type-name )'. */
159 pp_c_type_cast (c_pretty_printer *pp, tree t)
161 pp_c_left_paren (pp);
163 pp_c_right_paren (pp);
167 pp_c_space_for_pointer_operator (c_pretty_printer *pp, tree t)
169 if (POINTER_TYPE_P (t))
171 tree pointee = strip_pointer_operator (TREE_TYPE (t));
172 if (TREE_CODE (pointee) != ARRAY_TYPE
173 && TREE_CODE (pointee) != FUNCTION_TYPE)
174 pp_c_whitespace (pp);
181 /* C++ cv-qualifiers are called type-qualifiers in C. Print out the
182 cv-qualifiers of T. If T is a declaration then it is the cv-qualifier
183 of its type. Take care of possible extensions.
187 type-qualifier-list type-qualifier
192 __restrict__ -- GNU C
195 pp_c_type_qualifier_list (c_pretty_printer *pp, tree t)
202 qualifiers = TYPE_QUALS (t);
203 if (qualifiers & TYPE_QUAL_CONST)
204 pp_c_cv_qualifier (pp, "const");
205 if (qualifiers & TYPE_QUAL_VOLATILE)
206 pp_c_cv_qualifier (pp, "volatile");
207 if (qualifiers & TYPE_QUAL_RESTRICT)
208 pp_c_cv_qualifier (pp, flag_isoc99 ? "restrict" : "__restrict__");
212 * type-qualifier-list(opt)
213 * type-qualifier-list(opt) pointer */
215 pp_c_pointer (c_pretty_printer *pp, tree t)
217 if (!TYPE_P (t) && TREE_CODE (t) != TYPE_DECL)
219 switch (TREE_CODE (t))
222 /* It is easier to handle C++ reference types here. */
224 if (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE)
225 pp_c_pointer (pp, TREE_TYPE (t));
226 if (TREE_CODE (t) == POINTER_TYPE)
230 pp_c_type_qualifier_list (pp, t);
234 pp_unsupported_tree (pp, t);
251 struct-or-union-specifier
256 simple-type-specifier:
260 pp_c_type_specifier (c_pretty_printer *pp, tree t)
262 const enum tree_code code = TREE_CODE (t);
266 pp_c_identifier (pp, "<type-error>");
269 case IDENTIFIER_NODE:
270 pp_c_tree_identifier (pp, t);
278 pp_c_type_specifier (pp, TYPE_NAME (t));
283 pp_id_expression (pp, t);
285 pp_c_identifier (pp, "<typedef-error>");
291 if (code == UNION_TYPE)
292 pp_c_identifier (pp, "union");
293 else if (code == RECORD_TYPE)
294 pp_c_identifier (pp, "struct");
295 else if (code == ENUMERAL_TYPE)
296 pp_c_identifier (pp, "enum");
298 pp_c_identifier (pp, "<tag-error>");
301 pp_id_expression (pp, TYPE_NAME (t));
303 pp_c_identifier (pp, "<anonymous>");
307 pp_unsupported_tree (pp, t);
312 /* specifier-qualifier-list:
313 type-specifier specifier-qualifier-list-opt
314 type-qualifier specifier-qualifier-list-opt
317 Implementation note: Because of the non-linearities in array or
318 function declarations, this routine prints not just the
319 specifier-qualifier-list of such entities or types of such entities,
320 but also the 'pointer' production part of their declarators. The
321 remaining part is done by pp_declarator or pp_c_abstract_declarator. */
323 pp_c_specifier_qualifier_list (c_pretty_printer *pp, tree t)
325 const enum tree_code code = TREE_CODE (t);
327 if (TREE_CODE (t) != POINTER_TYPE)
328 pp_c_type_qualifier_list (pp, t);
334 /* Get the types-specifier of this type. */
335 tree pointee = strip_pointer_operator (TREE_TYPE (t));
336 pp_c_specifier_qualifier_list (pp, pointee);
337 if (TREE_CODE (pointee) == ARRAY_TYPE
338 || TREE_CODE (pointee) == FUNCTION_TYPE)
340 pp_c_whitespace (pp);
341 pp_c_left_paren (pp);
343 pp_ptr_operator (pp, t);
349 pp_c_specifier_qualifier_list (pp, TREE_TYPE (t));
354 pp_c_specifier_qualifier_list (pp, TREE_TYPE (t));
355 if (code == COMPLEX_TYPE)
356 pp_c_identifier (pp, flag_isoc99 ? "_Complex" : "__complex__");
357 else if (code == VECTOR_TYPE)
358 pp_c_identifier (pp, "__vector__");
362 pp_simple_type_specifier (pp, t);
367 /* parameter-type-list:
372 parameter-declaration
373 parameter-list , parameter-declaration
375 parameter-declaration:
376 declaration-specifiers declarator
377 declaration-specifiers abstract-declarator(opt) */
379 pp_c_parameter_type_list (c_pretty_printer *pp, tree t)
381 bool want_parm_decl = DECL_P (t) && !(pp->flags & pp_c_flag_abstract);
382 tree parms = want_parm_decl ? DECL_ARGUMENTS (t) : TYPE_ARG_TYPES (t);
383 pp_c_left_paren (pp);
384 if (parms == void_list_node)
385 pp_c_identifier (pp, "void");
389 for ( ; parms && parms != void_list_node; parms = TREE_CHAIN (parms))
392 pp_separate_with (pp, ',');
394 pp_declaration_specifiers
395 (pp, want_parm_decl ? parms : TREE_VALUE (parms));
397 pp_declarator (pp, parms);
399 pp_abstract_declarator (pp, TREE_VALUE (parms));
402 pp_c_right_paren (pp);
405 /* abstract-declarator:
407 pointer(opt) direct-abstract-declarator */
409 pp_c_abstract_declarator (c_pretty_printer *pp, tree t)
411 if (TREE_CODE (t) == POINTER_TYPE)
413 if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE
414 || TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE)
415 pp_c_right_paren (pp);
419 pp_direct_abstract_declarator (pp, t);
422 /* direct-abstract-declarator:
423 ( abstract-declarator )
424 direct-abstract-declarator(opt) [ assignment-expression(opt) ]
425 direct-abstract-declarator(opt) [ * ]
426 direct-abstract-declarator(opt) ( parameter-type-list(opt) ) */
428 pp_c_direct_abstract_declarator (c_pretty_printer *pp, tree t)
430 switch (TREE_CODE (t))
433 pp_abstract_declarator (pp, t);
437 pp_c_parameter_type_list (pp, t);
438 pp_direct_abstract_declarator (pp, TREE_TYPE (t));
442 pp_c_left_bracket (pp);
444 pp_expression (pp, TYPE_MAX_VALUE (TYPE_DOMAIN (t)));
445 pp_c_right_bracket (pp);
446 pp_direct_abstract_declarator (pp, TREE_TYPE (t));
449 case IDENTIFIER_NODE:
463 pp_unsupported_tree (pp, t);
469 specifier-qualifier-list abstract-declarator(opt) */
471 pp_c_type_id (c_pretty_printer *pp, tree t)
473 pp_c_specifier_qualifier_list (pp, t);
474 pp_abstract_declarator (pp, t);
477 /* storage-class-specifier:
484 pp_c_storage_class_specifier (c_pretty_printer *pp, tree t)
486 if (TREE_CODE (t) == TYPE_DECL)
487 pp_c_identifier (pp, "typedef");
490 if (DECL_REGISTER (t))
491 pp_c_identifier (pp, "register");
492 else if (TREE_STATIC (t) && TREE_CODE (t) == VAR_DECL)
493 pp_c_identifier (pp, "static");
497 /* function-specifier:
500 pp_c_function_specifier (c_pretty_printer *pp, tree t)
502 if (TREE_CODE (t) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (t))
503 pp_c_identifier (pp, "inline");
506 /* declaration-specifiers:
507 storage-class-specifier declaration-specifiers(opt)
508 type-specifier declaration-specifiers(opt)
509 type-qualifier declaration-specifiers(opt)
510 function-specifier declaration-specifiers(opt) */
512 pp_c_declaration_specifiers (c_pretty_printer *pp, tree t)
514 pp_storage_class_specifier (pp, t);
515 pp_function_specifier (pp, t);
516 pp_c_specifier_qualifier_list (pp, DECL_P (t) ? TREE_TYPE (t) : t);
522 direct-declarator [ type-qualifier-list(opt) assignment-expression(opt) ]
523 direct-declarator [ static type-qualifier-list(opt) assignment-expression(opt)]
524 direct-declarator [ type-qualifier-list static assignment-exression ]
525 direct-declarator [ type-qualifier-list * ]
526 direct-declaratpr ( parameter-type-list )
527 direct-declarator ( identifier-list(opt) ) */
529 pp_c_direct_declarator (c_pretty_printer *pp, tree t)
531 switch (TREE_CODE (t))
540 pp_c_space_for_pointer_operator (pp, TREE_TYPE (t));
541 pp_c_tree_identifier (pp, DECL_NAME (t));
545 pp_abstract_declarator (pp, TREE_TYPE (t));
549 pp_parameter_list (pp, t);
550 pp_abstract_declarator (pp, TREE_TYPE (t));
554 pp_c_space_for_pointer_operator (pp, TREE_TYPE (TREE_TYPE (t)));
555 pp_c_tree_identifier (pp, DECL_NAME (t));
556 if (pp_c_base (pp)->flags & pp_c_flag_abstract)
557 pp_abstract_declarator (pp, TREE_TYPE (t));
560 pp_parameter_list (pp, t);
561 pp_abstract_declarator (pp, TREE_TYPE (TREE_TYPE (t)));
573 pp_unsupported_tree (pp, t);
580 pointer(opt) direct-declarator */
582 pp_c_declarator (c_pretty_printer *pp, tree t)
584 switch (TREE_CODE (t))
600 pp_direct_declarator (pp, t);
605 pp_unsupported_tree (pp, t);
611 declaration-specifiers init-declarator-list(opt) ; */
613 pp_c_declaration (c_pretty_printer *pp, tree t)
615 pp_declaration_specifiers (pp, t);
616 pp_c_init_declarator (pp, t);
619 /* Pretty-print ATTRIBUTES using GNU C extension syntax. */
621 pp_c_attributes (c_pretty_printer *pp, tree attributes)
623 if (attributes == NULL_TREE)
626 pp_c_identifier (pp, "__attribute__");
627 pp_c_left_paren (pp);
628 pp_c_left_paren (pp);
629 for (; attributes != NULL_TREE; attributes = TREE_CHAIN (attributes))
631 pp_tree_identifier (pp, TREE_PURPOSE (attributes));
632 if (TREE_VALUE (attributes))
633 pp_c_call_argument_list (pp, TREE_VALUE (attributes));
635 if (TREE_CHAIN (attributes))
636 pp_separate_with (pp, ',');
638 pp_c_right_paren (pp);
639 pp_c_right_paren (pp);
642 /* function-definition:
643 declaration-specifiers declarator compound-statement */
645 pp_c_function_definition (c_pretty_printer *pp, tree t)
647 pp_declaration_specifiers (pp, t);
648 pp_declarator (pp, t);
649 pp_needs_newline (pp) = true;
650 pp_statement (pp, DECL_SAVED_TREE (t));
658 /* Print out a c-char. */
660 pp_c_char (c_pretty_printer *pp, int c)
665 pp_string (pp, "\\n");
668 pp_string (pp, "\\t");
671 pp_string (pp, "\\v");
674 pp_string (pp, "\\b");
677 pp_string (pp, "\\r");
680 pp_string (pp, "\\f");
683 pp_string (pp, "\\a");
686 pp_string (pp, "\\\\");
689 pp_string (pp, "\\'");
692 pp_string (pp, "\\\"");
696 pp_character (pp, c);
698 pp_scalar (pp, "\\%03o", (unsigned) c);
703 /* Print out a STRING literal. */
705 pp_c_string_literal (c_pretty_printer *pp, tree s)
707 const char *p = TREE_STRING_POINTER (s);
708 int n = TREE_STRING_LENGTH (s) - 1;
711 for (i = 0; i < n; ++i)
712 pp_c_char (pp, p[i]);
717 pp_c_integer_constant (c_pretty_printer *pp, tree i)
719 if (host_integerp (i, 0))
720 pp_wide_integer (pp, TREE_INT_CST_LOW (i));
723 if (tree_int_cst_sgn (i) < 0)
726 i = build_int_2 (-TREE_INT_CST_LOW (i),
727 ~TREE_INT_CST_HIGH (i) + !TREE_INT_CST_LOW (i));
729 sprintf (pp_buffer (pp)->digit_buffer,
730 HOST_WIDE_INT_PRINT_DOUBLE_HEX,
731 TREE_INT_CST_HIGH (i), TREE_INT_CST_LOW (i));
732 pp_string (pp, pp_buffer (pp)->digit_buffer);
736 /* Print out a CHARACTER literal. */
738 pp_c_character_constant (c_pretty_printer *pp, tree c)
740 tree type = TREE_TYPE (c);
741 if (type == wchar_type_node)
742 pp_character (pp, 'L');
744 if (host_integerp (c, TREE_UNSIGNED (type)))
745 pp_c_char (pp, tree_low_cst (c, TREE_UNSIGNED (type)));
747 pp_scalar (pp, "\\x%x", (unsigned) TREE_INT_CST_LOW (c));
751 /* Print out a BOOLEAN literal. */
753 pp_c_bool_constant (c_pretty_printer *pp, tree b)
755 if (b == boolean_false_node)
757 if (c_dialect_cxx ())
758 pp_c_identifier (pp, "false");
759 else if (flag_isoc99)
760 pp_c_identifier (pp, "_False");
762 pp_unsupported_tree (pp, b);
764 else if (b == boolean_true_node)
766 if (c_dialect_cxx ())
767 pp_c_identifier (pp, "true");
768 else if (flag_isoc99)
769 pp_c_identifier (pp, "_True");
771 pp_unsupported_tree (pp, b);
773 else if (TREE_CODE (b) == INTEGER_CST)
774 pp_c_integer_constant (pp, b);
776 pp_unsupported_tree (pp, b);
779 /* Attempt to print out an ENUMERATOR. Return true on success. Else return
780 false; that means the value was obtained by a cast, in which case
781 print out the type-id part of the cast-expression -- the casted value
782 is then printed by pp_c_integer_literal. */
784 pp_c_enumeration_constant (c_pretty_printer *pp, tree e)
786 bool value_is_named = true;
787 tree type = TREE_TYPE (e);
790 /* Find the name of this constant. */
791 for (value = TYPE_VALUES (type);
792 value != NULL_TREE && !tree_int_cst_equal (TREE_VALUE (value), e);
793 value = TREE_CHAIN (value))
796 if (value != NULL_TREE)
797 pp_id_expression (pp, TREE_PURPOSE (value));
800 /* Value must have been cast. */
801 pp_c_type_cast (pp, type);
802 value_is_named = false;
805 return value_is_named;
808 /* Print out a REAL value. */
810 pp_c_floating_constant (c_pretty_printer *pp, tree r)
812 real_to_decimal (pp_buffer (pp)->digit_buffer, &TREE_REAL_CST (r),
813 sizeof (pp_buffer (pp)->digit_buffer), 0, 1);
814 pp_string (pp, pp_buffer(pp)->digit_buffer);
821 chatracter-constant */
823 pp_c_constant (c_pretty_printer *pp, tree e)
825 switch (TREE_CODE (e))
829 tree type = TREE_TYPE (e);
830 if (type == boolean_type_node)
831 pp_c_bool_constant (pp, e);
832 else if (type == char_type_node)
833 pp_c_character_constant (pp, e);
834 else if (TREE_CODE (type) == ENUMERAL_TYPE
835 && pp_c_enumeration_constant (pp, e))
838 pp_c_integer_constant (pp, e);
843 pp_c_floating_constant (pp, e);
847 pp_c_string_literal (pp, e);
851 pp_unsupported_tree (pp, e);
857 pp_c_identifier (c_pretty_printer *pp, const char *id)
859 pp_c_maybe_whitespace (pp);
860 pp_identifier (pp, id);
861 pp_base (pp)->padding = pp_before;
864 /* Pretty-print a C primary-expression.
871 pp_c_primary_expression (c_pretty_printer *pp, tree e)
873 switch (TREE_CODE (e))
883 case IDENTIFIER_NODE:
884 pp_c_tree_identifier (pp, e);
888 pp_c_identifier (pp, "<erroneous-expression>");
892 pp_c_identifier (pp, "<return-value>");
898 pp_c_constant (pp, e);
902 pp_c_left_paren (pp);
903 pp_statement (pp, STMT_EXPR_STMT (e));
904 pp_c_right_paren (pp);
908 /* FIXME: Make sure we won't get into an infinie loop. */
909 pp_c_left_paren (pp);
910 pp_expression (pp, e);
911 pp_c_right_paren (pp);
916 /* Print out a C initializer -- also support C compound-literals.
918 assignment-expression:
920 { initializer-list , } */
923 pp_c_initializer (c_pretty_printer *pp, tree e)
925 if (TREE_CODE (e) == CONSTRUCTOR)
927 enum tree_code code = TREE_CODE (TREE_TYPE (e));
928 if (code == RECORD_TYPE || code == UNION_TYPE || code == ARRAY_TYPE)
930 pp_c_left_brace (pp);
931 pp_c_initializer_list (pp, e);
932 pp_c_right_brace (pp);
935 pp_unsupported_tree (pp, TREE_OPERAND (e, 1));
938 pp_expression (pp, e);
943 declarator = initializer */
945 pp_c_init_declarator (c_pretty_printer *pp, tree t)
947 pp_declarator (pp, t);
948 if (DECL_INITIAL (t))
950 tree init = DECL_INITIAL (t);
951 /* This C++ bit is handled here because it is easier to do so.
952 In templates, the C++ parser builds a TREE_LIST for a
953 direct-initialization; the TREE_PURPOSE is the variable to
954 initialize and the TREE_VALUE is the initializer. */
955 if (TREE_CODE (init) == TREE_LIST)
957 pp_c_left_paren (pp);
958 pp_expression (pp, TREE_VALUE (init));
966 pp_c_initializer (pp, init);
972 designation(opt) initializer
973 initializer-list , designation(opt) initializer
980 designator-list designator
983 [ constant-expression ]
986 pp_c_initializer_list (c_pretty_printer *pp, tree e)
988 tree type = TREE_TYPE (e);
989 const enum tree_code code = TREE_CODE (type);
991 if (code == RECORD_TYPE || code == UNION_TYPE || code == ARRAY_TYPE)
993 tree init = TREE_OPERAND (e, 0);
994 for (; init != NULL_TREE; init = TREE_CHAIN (init))
996 if (code == RECORD_TYPE || code == UNION_TYPE)
999 pp_c_primary_expression (pp, TREE_PURPOSE (init));
1003 pp_c_left_bracket (pp);
1004 if (TREE_PURPOSE (init))
1005 pp_c_constant (pp, TREE_PURPOSE (init));
1006 pp_c_right_bracket (pp);
1008 pp_c_whitespace (pp);
1010 pp_c_whitespace (pp);
1011 pp_initializer (pp, TREE_VALUE (init));
1012 if (TREE_CHAIN (init))
1013 pp_separate_with (pp, ',');
1017 pp_unsupported_tree (pp, type);
1020 /* This is a convenient function, used to bridge gap between C and C++
1026 pp_c_id_expression (c_pretty_printer *pp, tree t)
1028 switch (TREE_CODE (t))
1038 case IDENTIFIER_NODE:
1039 pp_c_tree_identifier (pp, t);
1043 pp_unsupported_tree (pp, t);
1048 /* postfix-expression:
1050 postfix-expression [ expression ]
1051 postfix-expression ( argument-expression-list(opt) )
1052 postfix-expression . identifier
1053 postfix-expression -> identifier
1054 postfix-expression ++
1055 postfix-expression --
1056 ( type-name ) { initializer-list }
1057 ( type-name ) { initializer-list , } */
1059 pp_c_postfix_expression (c_pretty_printer *pp, tree e)
1061 enum tree_code code = TREE_CODE (e);
1064 case POSTINCREMENT_EXPR:
1065 case POSTDECREMENT_EXPR:
1066 pp_postfix_expression (pp, TREE_OPERAND (e, 0));
1067 pp_identifier (pp, code == POSTINCREMENT_EXPR ? "++" : "--");
1071 pp_postfix_expression (pp, TREE_OPERAND (e, 0));
1076 pp_postfix_expression (pp, TREE_OPERAND (e, 0));
1077 pp_c_left_bracket (pp);
1078 pp_expression (pp, TREE_OPERAND (e, 1));
1079 pp_c_right_bracket (pp);
1083 pp_postfix_expression (pp, TREE_OPERAND (e, 0));
1084 pp_c_call_argument_list (pp, TREE_OPERAND (e, 1));
1089 pp_c_identifier (pp,
1090 code == ABS_EXPR ? "__builtin_abs" : "__builtin_ffs");
1091 pp_c_left_paren (pp);
1092 pp_expression (pp, TREE_OPERAND (e, 0));
1093 pp_c_right_paren (pp);
1098 tree object = TREE_OPERAND (e, 0);
1099 if (TREE_CODE (object) == INDIRECT_REF)
1101 pp_postfix_expression (pp, TREE_OPERAND (object, 0));
1106 pp_postfix_expression (pp, object);
1109 pp_expression (pp, TREE_OPERAND (e, 1));
1116 pp_c_type_cast (pp, TREE_TYPE (e));
1117 pp_c_left_brace (pp);
1119 if (code == COMPLEX_CST)
1121 pp_expression (pp, TREE_REALPART (e));
1122 pp_separate_with (pp, ',');
1123 pp_expression (pp, TREE_IMAGPART (e));
1125 else if (code == VECTOR_CST)
1126 pp_c_expression_list (pp, TREE_VECTOR_CST_ELTS (e));
1127 else if (code == COMPLEX_EXPR)
1129 pp_expression (pp, TREE_OPERAND (e, 0));
1130 pp_separate_with (pp, ',');
1131 pp_expression (pp, TREE_OPERAND (e, 1));
1134 pp_c_right_brace (pp);
1137 case COMPOUND_LITERAL_EXPR:
1138 e = DECL_INITIAL (e);
1141 pp_initializer (pp, e);
1145 pp_c_identifier (pp, "__builtin_va_arg");
1146 pp_c_left_paren (pp);
1147 pp_assignment_expression (pp, TREE_OPERAND (e, 0));
1148 pp_separate_with (pp, ',');
1149 pp_type_id (pp, TREE_TYPE (e));
1150 pp_c_right_paren (pp);
1154 if (TREE_CODE (TREE_OPERAND (e, 0)) == FUNCTION_DECL)
1156 pp_c_id_expression (pp, TREE_OPERAND (e, 0));
1159 /* else fall through. */
1162 pp_primary_expression (pp, e);
1167 /* Print out an expression-list; E is expected to be a TREE_LIST */
1169 pp_c_expression_list (c_pretty_printer *pp, tree e)
1171 for (; e != NULL_TREE; e = TREE_CHAIN (e))
1173 pp_expression (pp, TREE_VALUE (e));
1175 pp_separate_with (pp, ',');
1179 /* Print out an expression-list in parens, as in a function call. */
1181 pp_c_call_argument_list (c_pretty_printer *pp, tree t)
1183 pp_c_left_paren (pp);
1184 if (t && TREE_CODE (t) == TREE_LIST)
1185 pp_c_expression_list (pp, t);
1186 pp_c_right_paren (pp);
1189 /* unary-expression:
1193 unary-operator cast-expression
1194 sizeof unary-expression
1197 unary-operator: one of
1202 __alignof__ unary-expression
1203 __alignof__ ( type-id )
1204 __real__ unary-expression
1205 __imag__ unary-expression */
1207 pp_c_unary_expression (c_pretty_printer *pp, tree e)
1209 enum tree_code code = TREE_CODE (e);
1212 case PREINCREMENT_EXPR:
1213 case PREDECREMENT_EXPR:
1214 pp_identifier (pp, code == PREINCREMENT_EXPR ? "++" : "--");
1215 pp_c_unary_expression (pp, TREE_OPERAND (e, 0));
1222 case TRUTH_NOT_EXPR:
1224 /* String literal are used by address. */
1225 if (code == ADDR_EXPR && TREE_CODE (TREE_OPERAND (e, 0)) != STRING_CST)
1227 else if (code == INDIRECT_REF)
1229 else if (code == NEGATE_EXPR)
1231 else if (code == BIT_NOT_EXPR || code == CONJ_EXPR)
1233 else if (code == TRUTH_NOT_EXPR)
1234 pp_exclamation (pp);
1235 pp_c_cast_expression (pp, TREE_OPERAND (e, 0));
1240 pp_c_identifier (pp, code == SIZEOF_EXPR ? "sizeof" : "__alignof__");
1241 pp_c_whitespace (pp);
1242 if (TYPE_P (TREE_OPERAND (e, 0)))
1243 pp_c_type_cast (pp, TREE_OPERAND (e, 0));
1245 pp_unary_expression (pp, TREE_OPERAND (e, 0));
1250 pp_c_identifier (pp, code == REALPART_EXPR ? "__real__" : "__imag__");
1251 pp_c_whitespace (pp);
1252 pp_unary_expression (pp, TREE_OPERAND (e, 0));
1256 pp_postfix_expression (pp, e);
1263 ( type-name ) cast-expression */
1265 pp_c_cast_expression (c_pretty_printer *pp, tree e)
1267 switch (TREE_CODE (e))
1270 case FIX_TRUNC_EXPR:
1272 pp_c_type_cast (pp, TREE_TYPE (e));
1273 pp_c_cast_expression (pp, TREE_OPERAND (e, 0));
1277 pp_unary_expression (pp, e);
1281 /* multiplicative-expression:
1283 multiplicative-expression * cast-expression
1284 multiplicative-expression / cast-expression
1285 multiplicative-expression % cast-expression */
1287 pp_c_multiplicative_expression (c_pretty_printer *pp, tree e)
1289 enum tree_code code = TREE_CODE (e);
1293 case TRUNC_DIV_EXPR:
1294 case TRUNC_MOD_EXPR:
1295 pp_multiplicative_expression (pp, TREE_OPERAND (e, 0));
1296 pp_c_whitespace (pp);
1297 if (code == MULT_EXPR)
1299 else if (code == TRUNC_DIV_EXPR)
1303 pp_c_whitespace (pp);
1304 pp_c_cast_expression (pp, TREE_OPERAND (e, 1));
1308 pp_c_cast_expression (pp, e);
1313 /* additive-expression:
1314 multiplicative-expression
1315 additive-expression + multiplicative-expression
1316 additive-expression - multiplicative-expression */
1318 pp_c_additive_expression (c_pretty_printer *pp, tree e)
1320 enum tree_code code = TREE_CODE (e);
1325 pp_c_additive_expression (pp, TREE_OPERAND (e, 0));
1326 pp_c_whitespace (pp);
1327 if (code == PLUS_EXPR)
1331 pp_c_whitespace (pp);
1332 pp_multiplicative_expression (pp, TREE_OPERAND (e, 1));
1336 pp_multiplicative_expression (pp, e);
1341 /* additive-expression:
1343 shift-expression << additive-expression
1344 shift-expression >> additive-expression */
1346 pp_c_shift_expression (c_pretty_printer *pp, tree e)
1348 enum tree_code code = TREE_CODE (e);
1353 pp_c_shift_expression (pp, TREE_OPERAND (e, 0));
1354 pp_c_whitespace (pp);
1355 pp_identifier (pp, code == LSHIFT_EXPR ? "<<" : ">>");
1356 pp_c_whitespace (pp);
1357 pp_c_additive_expression (pp, TREE_OPERAND (e, 1));
1361 pp_c_additive_expression (pp, e);
1365 /* relational-expression:
1367 relational-expression < shift-expression
1368 relational-expression > shift-expression
1369 relational-expression <= shift-expression
1370 relational-expression >= shift-expression */
1372 pp_c_relational_expression (c_pretty_printer *pp, tree e)
1374 enum tree_code code = TREE_CODE (e);
1381 pp_c_relational_expression (pp, TREE_OPERAND (e, 0));
1382 pp_c_whitespace (pp);
1383 if (code == LT_EXPR)
1385 else if (code == GT_EXPR)
1387 else if (code == LE_EXPR)
1388 pp_identifier (pp, "<=");
1389 else if (code == GE_EXPR)
1390 pp_identifier (pp, ">=");
1391 pp_c_whitespace (pp);
1392 pp_c_shift_expression (pp, TREE_OPERAND (e, 1));
1396 pp_c_shift_expression (pp, e);
1401 /* equality-expression:
1402 relational-expression
1403 equality-expression == relational-expression
1404 equality-equality != relational-expression */
1406 pp_c_equality_expression (c_pretty_printer *pp, tree e)
1408 enum tree_code code = TREE_CODE (e);
1413 pp_c_equality_expression (pp, TREE_OPERAND (e, 0));
1414 pp_c_whitespace (pp);
1415 pp_identifier (pp, code == EQ_EXPR ? "==" : "!=");
1416 pp_c_whitespace (pp);
1417 pp_c_relational_expression (pp, TREE_OPERAND (e, 1));
1421 pp_c_relational_expression (pp, e);
1428 AND-expression & equality-equality */
1430 pp_c_and_expression (c_pretty_printer *pp, tree e)
1432 if (TREE_CODE (e) == BIT_AND_EXPR)
1434 pp_c_and_expression (pp, TREE_OPERAND (e, 0));
1435 pp_c_whitespace (pp);
1437 pp_c_whitespace (pp);
1438 pp_c_equality_expression (pp, TREE_OPERAND (e, 1));
1441 pp_c_equality_expression (pp, e);
1444 /* exclusive-OR-expression:
1446 exclusive-OR-expression ^ AND-expression */
1448 pp_c_exclusive_or_expression (c_pretty_printer *pp, tree e)
1450 if (TREE_CODE (e) == BIT_XOR_EXPR)
1452 pp_c_exclusive_or_expression (pp, TREE_OPERAND (e, 0));
1453 pp_c_maybe_whitespace (pp);
1455 pp_c_whitespace (pp);
1456 pp_c_and_expression (pp, TREE_OPERAND (e, 1));
1459 pp_c_and_expression (pp, e);
1462 /* inclusive-OR-expression:
1463 exclusive-OR-expression
1464 inclusive-OR-expression | exclusive-OR-expression */
1466 pp_c_inclusive_or_expression (c_pretty_printer *pp, tree e)
1468 if (TREE_CODE (e) == BIT_IOR_EXPR)
1470 pp_c_exclusive_or_expression (pp, TREE_OPERAND (e, 0));
1471 pp_c_whitespace (pp);
1473 pp_c_whitespace (pp);
1474 pp_c_exclusive_or_expression (pp, TREE_OPERAND (e, 1));
1477 pp_c_exclusive_or_expression (pp, e);
1480 /* logical-AND-expression:
1481 inclusive-OR-expression
1482 logical-AND-expression && inclusive-OR-expression */
1484 pp_c_logical_and_expression (c_pretty_printer *pp, tree e)
1486 if (TREE_CODE (e) == TRUTH_ANDIF_EXPR)
1488 pp_c_logical_and_expression (pp, TREE_OPERAND (e, 0));
1489 pp_c_whitespace (pp);
1490 pp_identifier (pp, "&&");
1491 pp_c_whitespace (pp);
1492 pp_c_inclusive_or_expression (pp, TREE_OPERAND (e, 1));
1495 pp_c_inclusive_or_expression (pp, e);
1498 /* logical-OR-expression:
1499 logical-AND-expression
1500 logical-OR-expression || logical-AND-expression */
1502 pp_c_logical_or_expression (c_pretty_printer *pp, tree e)
1504 if (TREE_CODE (e) == TRUTH_ORIF_EXPR)
1506 pp_c_logical_or_expression (pp, TREE_OPERAND (e, 0));
1507 pp_c_whitespace (pp);
1508 pp_identifier (pp, "||");
1509 pp_c_whitespace (pp);
1510 pp_c_logical_and_expression (pp, TREE_OPERAND (e, 1));
1513 pp_c_logical_and_expression (pp, e);
1516 /* conditional-expression:
1517 logical-OR-expression
1518 logical-OR-expression ? expression : conditional-expression */
1520 pp_c_conditional_expression (c_pretty_printer *pp, tree e)
1522 if (TREE_CODE (e) == COND_EXPR)
1524 pp_c_logical_or_expression (pp, TREE_OPERAND (e, 0));
1525 pp_c_whitespace (pp);
1527 pp_c_whitespace (pp);
1528 pp_expression (pp, TREE_OPERAND (e, 1));
1529 pp_c_whitespace (pp);
1531 pp_c_whitespace (pp);
1532 pp_c_conditional_expression (pp, TREE_OPERAND (e, 2));
1535 pp_c_logical_or_expression (pp, e);
1539 /* assignment-expression:
1540 conditional-expression
1541 unary-expression assignment-operator assignment-expression
1543 assignment-expression: one of
1544 = *= /= %= += -= >>= <<= &= ^= |= */
1546 pp_c_assignment_expression (c_pretty_printer *pp, tree e)
1548 if (TREE_CODE (e) == MODIFY_EXPR || TREE_CODE (e) == INIT_EXPR)
1550 pp_c_unary_expression (pp, TREE_OPERAND (e, 0));
1551 pp_c_whitespace (pp);
1554 pp_c_expression (pp, TREE_OPERAND (e, 1));
1557 pp_c_conditional_expression (pp, e);
1561 assignment-expression
1562 expression , assignment-expression
1564 Implementation note: instead of going through the usual recursion
1565 chain, I take the liberty of dispatching nodes to the appropriate
1566 functions. This makes some redundancy, but it worths it. That also
1567 prevents a possible infinite recursion between pp_c_primary_expression ()
1568 and pp_c_expression (). */
1570 pp_c_expression (c_pretty_printer *pp, tree e)
1572 switch (TREE_CODE (e))
1575 pp_c_integer_constant (pp, e);
1579 pp_c_floating_constant (pp, e);
1583 pp_c_string_literal (pp, e);
1586 case IDENTIFIER_NODE:
1596 pp_primary_expression (pp, e);
1599 case POSTINCREMENT_EXPR:
1600 case POSTDECREMENT_EXPR:
1610 case COMPOUND_LITERAL_EXPR:
1613 pp_postfix_expression (pp, e);
1621 case TRUTH_NOT_EXPR:
1622 case PREINCREMENT_EXPR:
1623 case PREDECREMENT_EXPR:
1628 pp_c_unary_expression (pp, e);
1632 case FIX_TRUNC_EXPR:
1634 pp_c_cast_expression (pp, e);
1638 case TRUNC_MOD_EXPR:
1639 case TRUNC_DIV_EXPR:
1640 pp_multiplicative_expression (pp, e);
1645 pp_c_shift_expression (pp, e);
1652 pp_c_relational_expression (pp, e);
1656 pp_c_and_expression (pp, e);
1660 pp_c_exclusive_or_expression (pp, e);
1664 pp_c_inclusive_or_expression (pp, e);
1667 case TRUTH_ANDIF_EXPR:
1668 pp_c_logical_and_expression (pp, e);
1671 case TRUTH_ORIF_EXPR:
1672 pp_c_logical_or_expression (pp, e);
1677 pp_c_equality_expression (pp, e);
1681 pp_conditional_expression (pp, e);
1686 pp_c_additive_expression (pp, e);
1691 pp_assignment_expression (pp, e);
1695 pp_c_left_paren (pp);
1696 pp_expression (pp, TREE_OPERAND (e, 0));
1697 pp_separate_with (pp, ',');
1698 pp_assignment_expression (pp, TREE_OPERAND (e, 1));
1699 pp_c_right_paren (pp);
1703 case NON_LVALUE_EXPR:
1706 pp_expression (pp, TREE_OPERAND (e, 0));
1710 pp_postfix_expression (pp, TREE_OPERAND (e, 1));
1714 pp_unsupported_tree (pp, e);
1726 expression-statement
1731 pp_c_statement (c_pretty_printer *pp, tree stmt)
1733 enum tree_code code;
1738 code = TREE_CODE (stmt);
1741 /* labeled-statement:
1742 identifier : statement
1743 case constant-expression : statement
1744 default : statement */
1747 if (pp_needs_newline (pp))
1748 pp_newline_and_indent (pp, -3);
1750 pp_indentation (pp) -= 3;
1751 if (code == LABEL_STMT)
1752 pp_tree_identifier (pp, DECL_NAME (LABEL_STMT_LABEL (stmt)));
1753 else if (code == CASE_LABEL)
1755 if (CASE_LOW (stmt) == NULL_TREE)
1756 pp_identifier (pp, "default");
1759 pp_c_identifier (pp, "case");
1760 pp_c_whitespace (pp);
1761 pp_conditional_expression (pp, CASE_LOW (stmt));
1762 if (CASE_HIGH (stmt))
1764 pp_identifier (pp, "...");
1765 pp_conditional_expression (pp, CASE_HIGH (stmt));
1770 pp_indentation (pp) += 3;
1771 pp_needs_newline (pp) = true;
1774 /* coumpound-statement:
1775 { block-item-list(opt) }
1779 block-item-list block-item
1785 if (pp_needs_newline (pp))
1786 pp_newline_and_indent (pp, 0);
1787 pp_c_left_brace (pp);
1788 pp_newline_and_indent (pp, 3);
1789 for (stmt = COMPOUND_BODY (stmt); stmt; stmt = TREE_CHAIN (stmt))
1790 pp_statement (pp, stmt);
1791 pp_newline_and_indent (pp, -3);
1792 pp_c_right_brace (pp);
1793 pp_needs_newline (pp) = true;
1796 /* expression-statement:
1797 expression(opt) ; */
1800 if (pp_needs_newline (pp))
1801 pp_newline_and_indent (pp, 0);
1803 tree e = code == EXPR_STMT
1804 ? EXPR_STMT_EXPR (stmt)
1805 : CLEANUP_EXPR (stmt);
1807 pp_expression (pp, e);
1809 pp_c_semicolon (pp);
1810 pp_needs_newline (pp) = true;
1813 /* selection-statement:
1814 if ( expression ) statement
1815 if ( expression ) statement else statement
1816 switch ( expression ) statement */
1818 if (pp_needs_newline (pp))
1819 pp_newline_and_indent (pp, 0);
1820 pp_c_identifier (pp, "if");
1821 pp_c_whitespace (pp);
1822 pp_c_left_paren (pp);
1823 pp_expression (pp, IF_COND (stmt));
1824 pp_c_right_paren (pp);
1825 pp_newline_and_indent (pp, 3);
1826 pp_statement (pp, THEN_CLAUSE (stmt));
1827 pp_newline_and_indent (pp, -3);
1828 if (ELSE_CLAUSE (stmt))
1830 tree else_clause = ELSE_CLAUSE (stmt);
1831 pp_c_identifier (pp, "else");
1832 if (TREE_CODE (else_clause) == IF_STMT)
1833 pp_c_whitespace (pp);
1835 pp_newline_and_indent (pp, 3);
1836 pp_statement (pp, else_clause);
1837 if (TREE_CODE (else_clause) != IF_STMT)
1838 pp_newline_and_indent (pp, -3);
1843 if (pp_needs_newline (pp))
1844 pp_newline_and_indent (pp, 0);
1845 pp_c_identifier (pp, "switch");
1847 pp_c_left_paren (pp);
1848 pp_expression (pp, SWITCH_COND (stmt));
1849 pp_c_right_paren (pp);
1850 pp_indentation (pp) += 3;
1851 pp_needs_newline (pp) = true;
1852 pp_statement (pp, SWITCH_BODY (stmt));
1853 pp_newline_and_indent (pp, -3);
1856 /* iteration-statement:
1857 while ( expression ) statement
1858 do statement while ( expression ) ;
1859 for ( expression(opt) ; expression(opt) ; expression(opt) ) statement
1860 for ( declaration expression(opt) ; expression(opt) ) statement */
1862 if (pp_needs_newline (pp))
1863 pp_newline_and_indent (pp, 0);
1864 pp_c_identifier (pp, "while");
1866 pp_c_left_paren (pp);
1867 pp_expression (pp, WHILE_COND (stmt));
1868 pp_c_right_paren (pp);
1869 pp_newline_and_indent (pp, 3);
1870 pp_statement (pp, WHILE_BODY (stmt));
1871 pp_indentation (pp) -= 3;
1872 pp_needs_newline (pp) = true;
1876 if (pp_needs_newline (pp))
1877 pp_newline_and_indent (pp, 0);
1878 pp_c_identifier (pp, "do");
1879 pp_newline_and_indent (pp, 3);
1880 pp_statement (pp, DO_BODY (stmt));
1881 pp_newline_and_indent (pp, -3);
1882 pp_c_identifier (pp, "while");
1884 pp_c_left_paren (pp);
1885 pp_expression (pp, DO_COND (stmt));
1886 pp_c_right_paren (pp);
1887 pp_c_semicolon (pp);
1888 pp_needs_newline (pp) = true;
1892 if (pp_needs_newline (pp))
1893 pp_newline_and_indent (pp, 0);
1894 pp_c_identifier (pp, "for");
1896 pp_c_left_paren (pp);
1897 if (FOR_INIT_STMT (stmt))
1898 pp_statement (pp, FOR_INIT_STMT (stmt));
1900 pp_c_semicolon (pp);
1901 pp_needs_newline (pp) = false;
1902 pp_c_whitespace (pp);
1903 if (FOR_COND (stmt))
1904 pp_expression (pp, FOR_COND (stmt));
1905 pp_c_semicolon (pp);
1906 pp_needs_newline (pp) = false;
1907 pp_c_whitespace (pp);
1908 if (FOR_EXPR (stmt))
1909 pp_expression (pp, FOR_EXPR (stmt));
1910 pp_c_right_paren (pp);
1911 pp_newline_and_indent (pp, 3);
1912 pp_statement (pp, FOR_BODY (stmt));
1913 pp_indentation (pp) -= 3;
1914 pp_needs_newline (pp) = true;
1920 return expression(opt) ; */
1923 if (pp_needs_newline (pp))
1924 pp_newline_and_indent (pp, 0);
1925 pp_identifier (pp, code == BREAK_STMT ? "break" : "continue");
1926 pp_c_semicolon (pp);
1927 pp_needs_newline (pp) = true;
1933 tree e = code == RETURN_STMT
1934 ? RETURN_STMT_EXPR (stmt)
1935 : GOTO_DESTINATION (stmt);
1936 if (pp_needs_newline (pp))
1937 pp_newline_and_indent (pp, 0);
1938 pp_c_identifier (pp, code == RETURN_STMT ? "return" : "goto");
1939 pp_c_whitespace (pp);
1942 if (TREE_CODE (e) == INIT_EXPR
1943 && TREE_CODE (TREE_OPERAND (e, 0)) == RESULT_DECL)
1944 e = TREE_OPERAND (e, 1);
1945 pp_expression (pp, e);
1947 pp_c_semicolon (pp);
1948 pp_needs_newline (pp) = true;
1953 if (!SCOPE_NULLIFIED_P (stmt) && SCOPE_NO_CLEANUPS_P (stmt))
1956 if (pp_needs_newline (pp))
1957 pp_newline_and_indent (pp, 0);
1958 if (SCOPE_BEGIN_P (stmt))
1963 else if (SCOPE_END_P (stmt))
1965 pp_right_brace (pp);
1968 pp_indentation (pp) += i;
1969 pp_needs_newline (pp) = true;
1974 if (pp_needs_newline (pp))
1975 pp_newline_and_indent (pp, 0);
1976 pp_declaration (pp, DECL_STMT_DECL (stmt));
1977 pp_needs_newline (pp) = true;
1982 bool has_volatile_p = ASM_VOLATILE_P (stmt);
1983 bool is_extended = has_volatile_p || ASM_INPUTS (stmt)
1984 || ASM_OUTPUTS (stmt) || ASM_CLOBBERS (stmt);
1985 pp_c_identifier (pp, is_extended ? "__asm__" : "asm");
1987 pp_c_identifier (pp, "__volatile__");
1989 pp_c_left_paren (pp);
1990 pp_c_string_literal (pp, ASM_STRING (stmt));
1994 pp_separate_with (pp, ':');
1995 if (ASM_OUTPUTS (stmt))
1996 pp_expression (pp, ASM_OUTPUTS (stmt));
1998 pp_separate_with (pp, ':');
1999 if (ASM_INPUTS (stmt))
2000 pp_expression (pp, ASM_INPUTS (stmt));
2002 pp_separate_with (pp, ':');
2003 if (ASM_CLOBBERS (stmt))
2004 pp_expression (pp, ASM_CLOBBERS (stmt));
2006 pp_c_right_paren (pp);
2012 pp_c_identifier (pp, "__FILE__");
2015 pp_c_whitespace (pp);
2016 pp_c_identifier (pp, FILE_STMT_FILENAME (stmt));
2017 pp_c_semicolon (pp);
2018 pp_needs_newline (pp) = true;
2022 pp_unsupported_tree (pp, stmt);
2027 /* Initialize the PRETTY-PRINTER for handling C codes. */
2029 pp_c_pretty_printer_init (c_pretty_printer *pp)
2031 pp->offset_list = 0;
2033 pp->declaration = pp_c_declaration;
2034 pp->declaration_specifiers = pp_c_declaration_specifiers;
2035 pp->declarator = pp_c_declarator;
2036 pp->direct_declarator = pp_c_direct_declarator;
2037 pp->type_specifier_seq = pp_c_specifier_qualifier_list;
2038 pp->abstract_declarator = pp_c_abstract_declarator;
2039 pp->direct_abstract_declarator = pp_c_direct_abstract_declarator;
2040 pp->ptr_operator = pp_c_pointer;
2041 pp->parameter_list = pp_c_parameter_type_list;
2042 pp->type_id = pp_c_type_id;
2043 pp->simple_type_specifier = pp_c_type_specifier;
2044 pp->function_specifier = pp_c_function_specifier;
2045 pp->storage_class_specifier = pp_c_storage_class_specifier;
2047 pp->statement = pp_c_statement;
2049 pp->id_expression = pp_c_id_expression;
2050 pp->primary_expression = pp_c_primary_expression;
2051 pp->postfix_expression = pp_c_postfix_expression;
2052 pp->unary_expression = pp_c_unary_expression;
2053 pp->initializer = pp_c_initializer;
2054 pp->multiplicative_expression = pp_c_multiplicative_expression;
2055 pp->conditional_expression = pp_c_conditional_expression;
2056 pp->assignment_expression = pp_c_assignment_expression;
2057 pp->expression = pp_c_expression;