+
+/* declarator:
+ pointer(opt) direct-declarator */
+
+void
+pp_c_declarator (c_pretty_printer *pp, tree t)
+{
+ switch (TREE_CODE (t))
+ {
+ case INTEGER_TYPE:
+ case REAL_TYPE:
+ case ENUMERAL_TYPE:
+ case UNION_TYPE:
+ case RECORD_TYPE:
+ break;
+
+ case VAR_DECL:
+ case PARM_DECL:
+ case FIELD_DECL:
+ case ARRAY_TYPE:
+ case FUNCTION_TYPE:
+ case FUNCTION_DECL:
+ case TYPE_DECL:
+ pp_direct_declarator (pp, t);
+ break;
+
+
+ default:
+ pp_unsupported_tree (pp, t);
+ break;
+ }
+}
+
+/* declaration:
+ declaration-specifiers init-declarator-list(opt) ; */
+
+void
+pp_c_declaration (c_pretty_printer *pp, tree t)
+{
+ pp_declaration_specifiers (pp, t);
+ pp_c_init_declarator (pp, t);
+}
+
+/* Pretty-print ATTRIBUTES using GNU C extension syntax. */
+
+void
+pp_c_attributes (c_pretty_printer *pp, tree attributes)
+{
+ if (attributes == NULL_TREE)
+ return;
+
+ pp_c_identifier (pp, "__attribute__");
+ pp_c_left_paren (pp);
+ pp_c_left_paren (pp);
+ for (; attributes != NULL_TREE; attributes = TREE_CHAIN (attributes))
+ {
+ pp_tree_identifier (pp, TREE_PURPOSE (attributes));
+ if (TREE_VALUE (attributes))
+ pp_c_call_argument_list (pp, TREE_VALUE (attributes));
+
+ if (TREE_CHAIN (attributes))
+ pp_separate_with (pp, ',');
+ }
+ pp_c_right_paren (pp);
+ pp_c_right_paren (pp);
+}
+
+/* function-definition:
+ declaration-specifiers declarator compound-statement */
+
+void
+pp_c_function_definition (c_pretty_printer *pp, tree t)
+{
+ pp_declaration_specifiers (pp, t);
+ pp_declarator (pp, t);
+ pp_needs_newline (pp) = true;
+ pp_statement (pp, DECL_SAVED_TREE (t));
+ pp_newline (pp);
+ pp_flush (pp);
+}
+
+\f
+/* Expressions. */
+
+/* Print out a c-char. This is called solely for characters which are
+ in the *target* execution character set. We ought to convert them
+ back to the *host* execution character set before printing, but we
+ have no way to do this at present. A decent compromise is to print
+ all characters as if they were in the host execution character set,
+ and not attempt to recover any named escape characters, but render
+ all unprintables as octal escapes. If the host and target character
+ sets are the same, this produces relatively readable output. If they
+ are not the same, strings may appear as gibberish, but that's okay
+ (in fact, it may well be what the reader wants, e.g. if they are looking
+ to see if conversion to the target character set happened correctly).
+
+ A special case: we need to prefix \, ", and ' with backslashes. It is
+ correct to do so for the *host*'s \, ", and ', because the rest of the
+ file appears in the host character set. */
+
+static void
+pp_c_char (c_pretty_printer *pp, int c)
+{
+ if (ISPRINT (c))
+ {
+ switch (c)
+ {
+ case '\\': pp_string (pp, "\\\\"); break;
+ case '\'': pp_string (pp, "\\\'"); break;
+ case '\"': pp_string (pp, "\\\""); break;
+ default: pp_character (pp, c);
+ }
+ }
+ else
+ pp_scalar (pp, "\\%03o", (unsigned) c);
+}
+