Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 # define CONTINUE_COLUMN 6
00044
00045 # if defined(_HOST_OS_UNICOS) || defined(_HOST_OS_MAX)
00046 # define SIGN_BIT 63
00047 # define NUM_MQ_WDS 3
00048 # else
00049 # define SIGN_BIT 31
00050 # ifdef _WHIRL_HOST64_TARGET64
00051 # define NUM_MQ_WDS 3
00052 # else
00053 # define NUM_MQ_WDS 5
00054 # endif
00055 # endif
00056
00057 # define MASK_CHAR_CONST_IDX 017777777400
00058
00059 # define NO_ARG 0
00060 # define STR_ARG 1
00061 # define ARG_ARG 2
00062 # define STR_ARG_ARG 3
00063 # define ARG_STR_ARG 4
00064 # define MULT_STR_ARG 5
00065
00066
00067
00068
00069
00070 # define MAX_ASCII_CHARS 256
00071
00072
00073
00074 # define FIXED_SRC_LINE_SIZE_72 72
00075 # define FIXED_SRC_LINE_SIZE_80 80
00076 # define FIXED_SRC_LINE_SIZE_132 132
00077 # define FREE_SRC_LINE_SIZE 132
00078 # define MAX_SRC_LINE_SIZE 135
00079
00080 # define MAX_STMT_CHAR_SIZE 13500
00081
00082
00083
00084 # define MAX_ANSI_FIXED_LINES 20
00085 # define MAX_ANSI_FREE_LINES 40
00086 # define MAX_FIXED_LINES 100
00087 # define MAX_FREE_LINES 100
00088
00089
00090
00091
00092
00093
00094 # define SRC_STK_BASE_IDX 1
00095
00096 # define SRC_STK_CIF_FILE_ID(IDX) src_stk[IDX].cif_file_id
00097 # define SRC_STK_FILE_IDX(IDX) src_stk[IDX].file_idx
00098 # define SRC_STK_FILE_LINE(IDX) src_stk[IDX].file_line
00099 # define SRC_STK_FILE_NAME(IDX) &src_stk[IDX].path_name[src_stk[IDX].file_idx]
00100 # define SRC_STK_DO_NOT_FCLOSE(IDX) src_stk[IDX].do_not_fclose
00101 # define SRC_STK_FILE_PTR(IDX) src_stk[IDX].file_ptr
00102 # define SRC_STK_FILE_TYPE(IDX) src_stk[IDX].file_type
00103 # define SRC_STK_GLOBAL_LINE_IDX(IDX) src_stk[IDX].global_line_first_idx
00104 # define SRC_STK_PREV_SRC_FORM(IDX) src_stk[IDX].prev_src_form
00105 # define SRC_STK_PATH_NAME(IDX) src_stk[IDX].path_name
00106
00107
00108
00109
00110
00111 # define IS_1TO9(CH) ((CH) >= one && (CH) <= nine)
00112
00113
00114
00115
00116
00117
00118 # define POP_SRC \
00119 { if (! SRC_STK_DO_NOT_FCLOSE(src_stk_idx)) \
00120 fclose(SRC_STK_FILE_PTR(src_stk_idx)); \
00121 if (src_stk_idx == NULL_IDX) { \
00122 PRINTMSG (curr_glb_line, 12, Internal, 0, "src_stk_idx"); \
00123 } \
00124 src_stk_idx--; \
00125 }
00126
00127 # define OUTPUT_POUND_INCLUDE_EXIT_LINE(GLB_LINE) \
00128 if (on_off_flags.output_pound_lines && \
00129 (on_off_flags.preprocess_only || on_off_flags.save_dot_i)) { \
00130 int _g_idx; int _file_line; \
00131 GLOBAL_LINE_TO_FILE_LINE(GLB_LINE, _g_idx, _file_line); \
00132 fprintf(dot_i_fptr,"# %d \"%s\" 2\n", _file_line, \
00133 SRC_STK_FILE_NAME(src_stk_idx)); \
00134 fprintf(dot_i_fptr,"# %d \"%s\"\n", _file_line, \
00135 SRC_STK_FILE_NAME(src_stk_idx)); \
00136 }
00137
00138 # define OUTPUT_POUND_LINE_NUM(GLB_LINE) \
00139 if (on_off_flags.output_pound_lines && \
00140 (on_off_flags.preprocess_only || on_off_flags.save_dot_i)) { \
00141 int _g_idx; int _file_line; \
00142 GLOBAL_LINE_TO_FILE_LINE(GLB_LINE, _g_idx, _file_line); \
00143 fprintf(dot_i_fptr,"# %d\n", _file_line); \
00144 }
00145
00146
00147 # if 0
00148 # define MARK_CHAR_CONST(CH) ((CH) = ((1 << SIGN_BIT) | (CH)))
00149 # define MARK_CHAR_CONST(CH) ((CH) = (((int)0x80000000) | (CH)))
00150 # else
00151 # define MARK_CHAR_CONST(CH) ((CH) = (((unsigned)1 << SIGN_BIT) | (CH)))
00152 # endif
00153
00154 # ifdef _DEBUG
00155 # define PRINT_STMT_SRC() \
00156 if (dump_flags.src_dmp) { \
00157 print_src(); \
00158 }
00159
00160
00161
00162
00163 # else
00164 # define PRINT_STMT_SRC()
00165 # endif
00166
00167 # define SAVE_GLOBAL_VARIABLES \
00168 save_prev_char_delim = prev_char_delim; \
00169 save_prev_char_delim_idx = prev_char_delim_idx; \
00170 save_previous_char = previous_char; \
00171 save_seen_lp_eq_slash = seen_lp_eq_slash; \
00172 save_char_delim = char_delim; \
00173 save_digit_start = digit_start; \
00174 save_format_idx = format_idx; \
00175 save_in_format = in_format; \
00176 save_expected_line = expected_line; \
00177 save_first_line = first_line;
00178
00179 # define RESTORE_GLOBAL_VARIABLES \
00180 prev_char_delim = save_prev_char_delim; \
00181 prev_char_delim_idx = save_prev_char_delim_idx; \
00182 previous_char = save_previous_char; \
00183 seen_lp_eq_slash = save_seen_lp_eq_slash; \
00184 char_delim = save_char_delim; \
00185 digit_start = save_digit_start; \
00186 format_idx = save_format_idx; \
00187 in_format = save_in_format; \
00188 expected_line = save_expected_line; \
00189 first_line = save_first_line;
00190
00191 # define NXT_COL(COL) (nxt_line_start_idx[pp_line_idx]+(COL)-1)
00192 # define PP_IDX_TO_COL(IDX) ((IDX - nxt_line_start_idx[pp_line_idx]) + 1)
00193
00194 # define PP_IDX pp_nxt_line_idx[pp_line_idx]
00195 # define PP_LINE_TYPE pp_nxt_line_type[pp_line_idx]
00196 # define PP_DIR_PREFIX pp_nxt_line_dir_prefix[pp_line_idx]
00197 # define PP_ACTUAL_DIR_PREFIX pp_nxt_line_actual_dir_prefix[pp_line_idx]
00198 # define PP_PREFIX_LEN pp_nxt_line_prefix_len[pp_line_idx]
00199 # define PP_LINE_NUM pp_nxt_line_num[pp_line_idx]
00200 # define PP_EOL pp_nxt_line_EOL[pp_line_idx]
00201 # define PP_LABEL pp_nxt_line_label[pp_line_idx]
00202 # define PP_MP_LINE pp_nxt_line_mp_line[pp_line_idx]
00203 # define PP_EXPECTED_LINE pp_expected_line[pp_line_idx]
00204 # define PP_ORIG_SIZE pp_orig_line_size[pp_line_idx]
00205 # define PP_CHANGE_SOURCE_FORM pp_change_source_form[pp_line_idx]
00206
00207 # define IS_DIR_CONTINUATION(DIR) \
00208 ((nxt_line_num_lines > 1 && \
00209 pp_nxt_line_type[1] == Dir_Line && \
00210 pp_nxt_line_dir_prefix[1] == DIR) || \
00211 (nxt_line_num_lines <= 1 && \
00212 stmt_buf_type == Dir_Line && \
00213 stmt_buf_dir_prefix == DIR))