Doxygen Source Code Documentation
output.h
Go to the documentation of this file.00001 /* nice_printf -- same arguments as fprintf. 00002 00003 All output which is to become C code must be directed through this 00004 function. For now, no buffering is done. Later on, every line of 00005 output will be filtered to accomodate the style definitions (e.g. one 00006 statement per line, spaces between function names and argument lists, 00007 etc.) 00008 */ 00009 #include "niceprintf.h" 00010 00011 00012 /* Definitions for the opcode table. The table is indexed by the macros 00013 which are #defined in defines.h */ 00014 00015 #define UNARY_OP 01 00016 #define BINARY_OP 02 00017 00018 #define SPECIAL_FMT NULL 00019 00020 #define is_unary_op(x) (opcode_table[x].type == UNARY_OP) 00021 #define is_binary_op(x) (opcode_table[x].type == BINARY_OP) 00022 #define op_precedence(x) (opcode_table[x].prec) 00023 #define op_format(x) (opcode_table[x].format) 00024 00025 /* _assoc_table -- encodes left-associativity and right-associativity 00026 information; indexed by precedence level. Only 2, 3, 14 are 00027 right-associative. Source: Kernighan & Ritchie, p. 49 */ 00028 00029 extern char _assoc_table[]; 00030 00031 #define is_right_assoc(x) (_assoc_table [x]) 00032 #define is_left_assoc(x) (! _assoc_table [x]) 00033 00034 00035 typedef struct { 00036 int type; /* UNARY_OP or BINARY_OP */ 00037 int prec; /* Precedence level, useful for adjusting 00038 number of parens to insert. Zero is a 00039 special level, and 2, 3, 14 are 00040 right-associative */ 00041 char *format; 00042 } table_entry; 00043 00044 00045 extern char *fl_fmt_string; /* Float constant format string */ 00046 extern char *db_fmt_string; /* Double constant format string */ 00047 extern char *cm_fmt_string; /* Complex constant format string */ 00048 extern char *dcm_fmt_string; /* Double Complex constant format string */ 00049 00050 extern int indent; /* Number of spaces to indent; this is a 00051 temporary fix */ 00052 extern int tab_size; /* Number of spaces in each tab */ 00053 extern int in_string; 00054 00055 extern table_entry opcode_table[]; 00056 00057 00058 void compgoto_out Argdcl((FILEP, tagptr, tagptr)); 00059 void endif_out Argdcl((FILEP)); 00060 void expr_out Argdcl((FILEP, tagptr)); 00061 void out_and_free_statement Argdcl((FILEP, tagptr)); 00062 void out_end_for Argdcl((FILEP)); 00063 void out_if Argdcl((FILEP, tagptr)); 00064 void out_name Argdcl((FILEP, Namep));