1 /* nice_printf -- same arguments as fprintf.
3 All output which is to become C code must be directed through this
4 function. For now, no buffering is done. Later on, every line of
5 output will be filtered to accomodate the style definitions (e.g. one
6 statement per line, spaces between function names and argument lists,
11 extern int nice_printf ();
14 /* Definitions for the opcode table. The table is indexed by the macros
15 which are #defined in defines.h */
20 #define SPECIAL_FMT NULL
22 #define is_unary_op(x) (opcode_table[x].type == UNARY_OP)
23 #define is_binary_op(x) (opcode_table[x].type == BINARY_OP)
24 #define op_precedence(x) (opcode_table[x].prec)
25 #define op_format(x) (opcode_table[x].format)
27 /* _assoc_table -- encodes left-associativity and right-associativity
28 information; indexed by precedence level. Only 2, 3, 14 are
29 right-associative. Source: Kernighan & Ritchie, p. 49 */
31 extern char _assoc_table[];
33 #define is_right_assoc(x) (_assoc_table [x])
34 #define is_left_assoc(x) (! _assoc_table [x])
38 int type; /* UNARY_OP or BINARY_OP */
39 int prec; /* Precedence level, useful for adjusting
40 number of parens to insert. Zero is a
41 special level, and 2, 3, 14 are
47 extern char *fl_fmt_string; /* Float constant format string */
48 extern char *db_fmt_string; /* Double constant format string */
49 extern char *cm_fmt_string; /* Complex constant format string */
50 extern char *dcm_fmt_string; /* Double Complex constant format string */
52 extern int indent; /* Number of spaces to indent; this is a
54 extern int tab_size; /* Number of spaces in each tab */
57 extern table_entry opcode_table[];
60 void expr_out (), out_init (), out_addr (), out_const ();
61 void out_name (), extern_out (), out_asgoto ();
62 void out_if (), out_else (), elif_out ();
63 void endif_out (), end_else_out ();
64 void compgoto_out (), out_for ();
65 void out_end_for (), out_and_free_statement ();