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 static char USMID[] = "\n@(#)5.0_pl/sources/src_input.c 5.5 10/20/99 17:17:46\n";
00038
00039 # include "defines.h"
00040
00041 # include "host.m"
00042 # include "host.h"
00043 # include "target.m"
00044 # include "target.h"
00045
00046 # include "globals.m"
00047 # include "tokens.m"
00048 # include "sytb.m"
00049 # include "p_globals.m"
00050 # include "src_input.m"
00051 # include "debug.m"
00052
00053 # include "globals.h"
00054 # include "tokens.h"
00055 # include "sytb.h"
00056 # include "p_globals.h"
00057 # include "src_input.h"
00058
00059
00060
00061
00062
00063
00064 static boolean is_pound_line_dir(void);
00065 static void fixed_classify_line (void);
00066 static void fixed_get_stmt (void);
00067 boolean read_line (boolean);
00068 static void free_classify_line (void);
00069 static void free_get_stmt (void);
00070 void ntr_next_msg_queue(int,int,msg_severities_type,
00071 int,char *, long,int);
00072 static void move_up_next_msg_queue(void);
00073 static boolean open_include_file (boolean);
00074 static void update_global_line (void);
00075 static int whats_after_paren_group(int *, int *, int);
00076 static int whats_after_brkt_group(int *, int *, int);
00077 static void print_nxt_line(void);
00078 static void classify_line(void);
00079 static boolean get_nxt_line(void);
00080 static void pp_get_stmt (void);
00081 static void shift_to_line_size(int);
00082
00083 static boolean issue_classify_msg = TRUE;
00084
00085 # ifdef _DEBUG
00086
00087 static void print_stmt (void);
00088 static void print_src (void);
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114 static void print_stmt()
00115
00116 {
00117 int idx;
00118 int line;
00119 int ich2;
00120
00121
00122 for (line = 1; line <= lines_in_buf; line++) {
00123
00124 for (idx = 0;
00125 (((ich2 = stmt_buf[idx + stmt_line_start_idx[line]]) != newline)
00126 && (ich2 != eos));
00127 idx++) {
00128 fprintf(stderr, "%c", ich2);
00129 }
00130 fprintf(stderr, "\n");
00131 }
00132
00133 return;
00134
00135 }
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155 static void print_src()
00156 {
00157 int idx;
00158 int line;
00159
00160 if (source_form == Fixed_Form) {
00161 fprintf(stderr, "Fixed_Form\n");
00162 }
00163 else {
00164 fprintf(stderr, "Free_Form\n");
00165 }
00166
00167 for (line = 1; line <= lines_in_buf; line++) {
00168
00169 fprintf(stderr, "global line num = %d\n", stmt_line_num[line]);
00170 for (idx = stmt_line_start_idx[line]; idx < stmt_line_end_idx[line];
00171 idx++) {
00172
00173 if (stmt_buf[idx] < 0) {
00174 fprintf(stderr, "^%c", stmt_buf[idx]);
00175 }
00176 else {
00177 fprintf(stderr, "%c", stmt_buf[idx]);
00178 }
00179 }
00180 fprintf(stderr, "\n");
00181 }
00182 fprintf(stderr, "*******************************************************\n");
00183
00184 return;
00185
00186 }
00187
00188 # endif
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209 void init_src_input (void)
00210
00211 {
00212 TRACE (Func_Entry, "init_src_input", NULL);
00213
00214 dot_i_fptr = stdout;
00215
00216 if (on_off_flags.save_dot_i) {
00217 dot_i_fptr = fopen(dot_i_file, "w");
00218 }
00219
00220 previous_global_line = 0;
00221
00222
00223
00224 CHECK_INITIAL_ALLOC(src_stk, 1);
00225
00226
00227
00228 SRC_STK_GLOBAL_LINE_IDX(src_stk_idx) = NULL_IDX;
00229 SRC_STK_PREV_SRC_FORM(src_stk_idx) = source_form;
00230
00231
00232
00233 if (src_file[0] == EOS) {
00234 SRC_STK_FILE_LINE(SRC_STK_BASE_IDX) = 0;
00235 SRC_STK_FILE_TYPE(SRC_STK_BASE_IDX) = Stdin_Src;
00236 SRC_STK_FILE_PTR(SRC_STK_BASE_IDX) = stdin;
00237 strcpy (src_file, "'stdin'");
00238 }
00239 else {
00240 SRC_STK_FILE_LINE(SRC_STK_BASE_IDX) = 0;
00241 SRC_STK_FILE_TYPE(SRC_STK_BASE_IDX) = Input_Src;
00242
00243 SRC_STK_FILE_PTR(SRC_STK_BASE_IDX) = fopen (src_file, "r");
00244
00245 if (SRC_STK_FILE_PTR(SRC_STK_BASE_IDX) == NULL) {
00246 PRINTMSG (0, 49, Log_Error, 0, src_file);
00247 exit_compiler (RC_USER_ERROR);
00248 }
00249 }
00250
00251 if (on_off_flags.output_pound_lines &&
00252 (on_off_flags.preprocess_only || on_off_flags.save_dot_i)) {
00253 fprintf(dot_i_fptr, "# 1 \"%s\"\n", src_file);
00254 }
00255
00256
00257
00258 if (src_file[0] != SLASH)
00259 {
00260 getcwd (SRC_STK_PATH_NAME(SRC_STK_BASE_IDX), MAX_FILE_NAME_SIZE);
00261
00262 strcat (SRC_STK_PATH_NAME(SRC_STK_BASE_IDX), "/");
00263 SRC_STK_FILE_IDX(SRC_STK_BASE_IDX) =
00264 strlen(SRC_STK_PATH_NAME(SRC_STK_BASE_IDX));
00265 strcat (SRC_STK_PATH_NAME(SRC_STK_BASE_IDX), src_file);
00266 }
00267 else {
00268 SRC_STK_FILE_IDX(SRC_STK_BASE_IDX) = 0;
00269 strcpy (SRC_STK_PATH_NAME(SRC_STK_BASE_IDX), src_file);
00270 }
00271
00272
00273
00274 update_global_line();
00275
00276
00277
00278
00279 GL_GLOBAL_LINE(global_line_tbl_idx) = 1;
00280 GL_FILE_LINE(global_line_tbl_idx) = 1;
00281
00282
00283
00284 starting_pt = NULL_IDX;
00285
00286
00287
00288 have_issued_msg_37 = FALSE;
00289
00290 havent_issued_tab_ansi = TRUE;
00291 havent_issued_at_ansi = TRUE;
00292 havent_issued_dollar_ansi = TRUE;
00293
00294 nxt_line_start_idx[0] = 0;
00295 nxt_line_end_idx[0] = 0;
00296 nxt_line_col[0] = 0;
00297 nxt_line_num_lines = 1;
00298 pp_line_idx = 1;
00299
00300 pp_nxt_line_type[0] = Regular_Line;
00301
00302
00303
00304 nxt_line_start_idx[1] = 1;
00305 nxt_line_end_idx[1] = 2;
00306 nxt_line[0] = blank;
00307 nxt_line[1] = newline;
00308 nxt_line[2] = eos;
00309 nxt_line_idx = 1;
00310 nxt_line_num = 0;
00311 nxt_line_type = Comment_Line;
00312 PP_LINE_TYPE = Comment_Line;
00313 PP_EOL = 1;
00314
00315 if (source_form == Fixed_Form) {
00316
00317 if (cmd_line_flags.line_size_80) {
00318 line_size = FIXED_SRC_LINE_SIZE_80;
00319 }
00320 else if (cmd_line_flags.line_size_132) {
00321 line_size = FIXED_SRC_LINE_SIZE_132;
00322 }
00323 else {
00324 line_size = FIXED_SRC_LINE_SIZE_72;
00325 }
00326
00327 if (! on_off_flags.preprocess_only) {
00328 fixed_get_stmt ();
00329 }
00330 }
00331 else {
00332
00333 line_size = FREE_SRC_LINE_SIZE;
00334 if (! on_off_flags.preprocess_only) {
00335 expected_line = Regular_Line;
00336 free_get_stmt ();
00337 }
00338 }
00339
00340 if (change_orig_src_file) {
00341
00342
00343 if (pound_file[0] != SLASH) {
00344 getcwd (SRC_STK_PATH_NAME(SRC_STK_BASE_IDX), MAX_FILE_NAME_SIZE);
00345 strcat (SRC_STK_PATH_NAME(SRC_STK_BASE_IDX), "/");
00346 SRC_STK_FILE_IDX(SRC_STK_BASE_IDX) =
00347 strlen(SRC_STK_PATH_NAME(SRC_STK_BASE_IDX));
00348 strcat (SRC_STK_PATH_NAME(SRC_STK_BASE_IDX), pound_file);
00349 }
00350 else {
00351 SRC_STK_FILE_IDX(SRC_STK_BASE_IDX) = 0;
00352 strcpy (SRC_STK_PATH_NAME(SRC_STK_BASE_IDX), pound_file);
00353 }
00354
00355
00356
00357
00358 c_i_f = cif_actual_file;
00359 SRC_STK_CIF_FILE_ID(SRC_STK_BASE_IDX) =
00360 cif_file_name_rec(SRC_STK_PATH_NAME(SRC_STK_BASE_IDX), pound_file);
00361
00362 if (cif_flags) {
00363 cif_source_file_rec(SRC_STK_CIF_FILE_ID(SRC_STK_BASE_IDX),
00364 cmd_line_flags.src_form);
00365 }
00366
00367 c_i_f = cif_tmp_file;
00368
00369 cif_file_rec_issued = TRUE;
00370
00371 global_line_tbl_idx = 0;
00372 SRC_STK_FILE_LINE(SRC_STK_BASE_IDX) = 0;
00373 SRC_STK_GLOBAL_LINE_IDX(src_stk_idx) = NULL_IDX;
00374 update_global_line();
00375
00376
00377
00378
00379 GL_CIF_FILE_ID(global_line_tbl_idx) =
00380 SRC_STK_CIF_FILE_ID(SRC_STK_BASE_IDX);
00381 GL_GLOBAL_LINE(global_line_tbl_idx) = 1;
00382 GL_FILE_LINE(global_line_tbl_idx) = 1;
00383
00384 if (source_form == Fixed_Form) {
00385 if (! on_off_flags.preprocess_only) {
00386 fixed_get_stmt ();
00387 }
00388 }
00389 else {
00390 if (! on_off_flags.preprocess_only) {
00391 expected_line = Regular_Line;
00392 free_get_stmt ();
00393 }
00394 }
00395 }
00396 else if (! cif_file_rec_issued ) {
00397
00398
00399
00400 c_i_f = cif_actual_file;
00401 SRC_STK_CIF_FILE_ID(SRC_STK_BASE_IDX) =
00402 cif_file_name_rec(SRC_STK_PATH_NAME(SRC_STK_BASE_IDX), src_file);
00403
00404 if (cif_flags) {
00405 cif_source_file_rec(SRC_STK_CIF_FILE_ID(SRC_STK_BASE_IDX),
00406 cmd_line_flags.src_form);
00407 }
00408
00409 c_i_f = cif_tmp_file;
00410 cif_file_rec_issued = TRUE;
00411
00412
00413
00414
00415 GL_CIF_FILE_ID(global_line_tbl_idx) =
00416 SRC_STK_CIF_FILE_ID(SRC_STK_BASE_IDX);
00417 }
00418
00419 TRACE (Func_Exit, "init_src_input", SRC_STK_FILE_NAME(SRC_STK_BASE_IDX));
00420
00421 return;
00422
00423 }
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447 void reset_src_input (int buf_idx,
00448 int stmt_num)
00449
00450 {
00451 char ch;
00452 int i;
00453
00454 TRACE (Func_Entry, "reset_src_input", NULL);
00455
00456
00457
00458
00459
00460
00461 if (stmt_num != statement_number && !in_action_stmt_of_if_where_or_forall) {
00462 PRINTMSG (stmt_line_num[stmt_line_idx], 207, Internal, 1);
00463 }
00464
00465 if (buf_idx < 0) {
00466 PRINTMSG (stmt_line_num[stmt_line_idx], 626, Internal, 1,
00467 "valid buf_idx",
00468 "reset_src_input");
00469 }
00470
00471 stmt_line_idx = 0;
00472
00473 if (buf_idx == 0) {
00474 stmt_line_idx = 1;
00475 }
00476 else {
00477 for (i = 1; i <= lines_in_buf; i++) {
00478 if (buf_idx >= stmt_line_start_idx[i] &&
00479 buf_idx <= stmt_line_end_idx[i]) {
00480 stmt_line_idx = i;
00481 break;
00482 }
00483 }
00484 }
00485
00486 # ifdef _DEBUG
00487 if (stmt_line_idx == 0) {
00488 PRINTMSG(1,626,Internal,1,
00489 "valid stmt_line_idx",
00490 "reset_src_input");
00491 }
00492 # endif
00493
00494 stmt_buf_idx = buf_idx;
00495
00496 if (stmt_buf_idx == 0 ||
00497 stmt_buf[stmt_buf_idx] == '\0' ||
00498 stmt_buf[stmt_buf_idx] == '\n') {
00499 ch = ' ';
00500 }
00501 else {
00502 ch = stmt_buf[stmt_buf_idx];
00503 }
00504
00505 if (islower(ch)) {
00506 ch = TOUPPER(ch);
00507 }
00508
00509 LA_CH_VALUE = ch;
00510 LA_CH_LINE = stmt_line_num[stmt_line_idx];
00511 LA_CH_COLUMN = stmt_buf_col[stmt_buf_idx];
00512 LA_CH_BUF_IDX = stmt_buf_idx;
00513 LA_CH_STMT_NUM = statement_number;
00514 LA_CH_CLASS = (ch == (char) EOF) ? Ch_Class_EOF : ch_class[LA_CH_VALUE];
00515
00516 TRACE (Func_Exit, "reset_src_input", NULL);
00517
00518 return;
00519
00520 }
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542 void fixed_get_char (void)
00543
00544 {
00545 char ch;
00546 int ich;
00547
00548
00549 TRACE (Func_Entry, "fixed_get_char", NULL);
00550
00551
00552
00553 if (LA_CH_VALUE == EOS) {
00554 stmt_end_line = LA_CH_LINE;
00555 stmt_end_col = LA_CH_COLUMN - 1;
00556
00557 if (change_source_form) {
00558 change_source_form = FALSE;
00559 line_size = FREE_SRC_LINE_SIZE;
00560 expected_line = Regular_Line;
00561 get_char = free_get_char;
00562 get_char_literal = free_get_char_literal;
00563 source_form = Free_Form;
00564
00565 free_get_char ();
00566
00567 TRACE (Func_Exit, "fixed_get_char",
00568 ch_str[(unsigned char)LA_CH_VALUE]);
00569
00570 return;
00571 }
00572
00573 fixed_get_stmt ();
00574
00575
00576 while (stmt_buf_type == Comment_Line) {
00577 if (change_source_form) {
00578 change_source_form = FALSE;
00579 line_size = FREE_SRC_LINE_SIZE;
00580 expected_line = Regular_Line;
00581 get_char = free_get_char;
00582 get_char_literal = free_get_char_literal;
00583 source_form = Free_Form;
00584
00585 free_get_char ();
00586
00587 TRACE (Func_Exit, "fixed_get_char",
00588 ch_str[(unsigned char)LA_CH_VALUE]);
00589
00590 return;
00591 }
00592 else {
00593 fixed_get_stmt ();
00594 }
00595 }
00596
00597
00598 ich = stmt_buf[stmt_buf_idx + 1];
00599
00600 while (((ich == newline) |
00601 (ich == semi_colon) |
00602 (ich == bang)) &&
00603 (stmt_line_idx >= lines_in_buf)) {
00604
00605 fixed_get_stmt ();
00606
00607 while (stmt_buf_type == Comment_Line) {
00608 if (change_source_form) {
00609 change_source_form = FALSE;
00610 line_size = FREE_SRC_LINE_SIZE;
00611 expected_line = Regular_Line;
00612 get_char = free_get_char;
00613 get_char_literal = free_get_char_literal;
00614 source_form = Free_Form;
00615
00616 free_get_char ();
00617
00618 TRACE (Func_Exit, "fixed_get_char",
00619 ch_str[(unsigned char)LA_CH_VALUE]);
00620
00621 return;
00622 }
00623 else {
00624 fixed_get_stmt ();
00625 }
00626 }
00627
00628 ich = stmt_buf[stmt_buf_idx + 1];
00629 }
00630
00631 if (stmt_buf_type == Dir_Line) {
00632 ch = stmt_buf[stmt_buf_idx];
00633
00634 if (islower(ch)) {
00635 ch = TOUPPER(ch);
00636 }
00637
00638 LA_CH_VALUE = ch;
00639 LA_CH_LINE = stmt_line_num[stmt_line_idx];
00640 LA_CH_COLUMN = stmt_buf_col[stmt_buf_idx];
00641 LA_CH_BUF_IDX = stmt_buf_idx;
00642 LA_CH_STMT_NUM = statement_number;
00643
00644 switch (stmt_prefix_len) {
00645 case 1 :
00646 LA_CH_CLASS = Ch_Class_Dir1;
00647 break;
00648 case 2 :
00649 LA_CH_CLASS = Ch_Class_Dir2;
00650 break;
00651 case 3 :
00652 LA_CH_CLASS = Ch_Class_Dir3;
00653 break;
00654 case 4 :
00655 LA_CH_CLASS = Ch_Class_Dir4;
00656 break;
00657 case 7 :
00658
00659 LA_CH_CLASS = Ch_Class_Dir7;
00660 break;
00661 }
00662
00663 TRACE (Func_Exit, "fixed_get_char",
00664 ch_str[(unsigned char) LA_CH_VALUE]);
00665
00666 return;
00667 }
00668 }
00669
00670
00671
00672 do {
00673 ich = stmt_buf[++stmt_buf_idx];
00674
00675 if (stmt_buf_idx == stmt_buf_EOS_idx) {
00676 ich = eos;
00677 }
00678 else if (stmt_buf_idx == stmt_line_end_idx[stmt_line_idx]) {
00679
00680 if (stmt_line_idx < lines_in_buf) {
00681 ++stmt_line_idx;
00682 stmt_buf_idx = stmt_line_start_idx[stmt_line_idx]
00683 + stmt_line_offset[stmt_line_idx];
00684
00685 ich = blank;
00686 }
00687 else {
00688 ich = eos;
00689 }
00690 }
00691 }
00692 while ((ich == blank) | (ich == tab));
00693
00694 LA_CH_LINE = stmt_line_num[stmt_line_idx];
00695 LA_CH_COLUMN = stmt_buf_col[stmt_buf_idx];
00696 LA_CH_BUF_IDX = stmt_buf_idx;
00697 LA_CH_STMT_NUM = statement_number;
00698
00699
00700 if (havent_issued_at_ansi && ich == at_sign) {
00701 havent_issued_at_ansi = FALSE;
00702 ntr_msg_queue(LA_CH_LINE, 900, Ansi,
00703 LA_CH_COLUMN,
00704 (char *)NULL,
00705 0,
00706 NO_ARG);
00707 }
00708
00709 if (havent_issued_dollar_ansi && ich == dollar) {
00710 havent_issued_dollar_ansi = FALSE;
00711 ntr_msg_queue(LA_CH_LINE, 901, Ansi,
00712 LA_CH_COLUMN,
00713 (char *)NULL,
00714 0,
00715 NO_ARG);
00716 }
00717
00718 ch = ich;
00719
00720 if (islower(ch)) {
00721 ch = TOUPPER(ch);
00722 }
00723
00724 LA_CH_VALUE = ch;
00725 LA_CH_CLASS = (ch == (char) EOF) ? Ch_Class_EOF : ch_class[LA_CH_VALUE];
00726
00727 TRACE (Func_Exit, "fixed_get_char", ch_str[(unsigned char) LA_CH_VALUE]);
00728
00729 return;
00730
00731 }
00732
00733
00734
00735
00736
00737
00738
00739
00740
00741
00742
00743
00744
00745
00746
00747
00748
00749
00750
00751 void fixed_get_char_literal (void)
00752
00753 {
00754 char ch;
00755 int ich;
00756
00757
00758 TRACE (Func_Entry, "fixed_get_char_literal", NULL);
00759
00760 ich = stmt_buf[++stmt_buf_idx];
00761
00762 if (stmt_buf_idx == stmt_line_end_idx[stmt_line_idx]) {
00763
00764 if (stmt_line_idx < lines_in_buf) {
00765 ++stmt_line_idx;
00766 stmt_buf_idx = stmt_line_start_idx[stmt_line_idx]
00767 + stmt_line_offset[stmt_line_idx];
00768
00769 ich = stmt_buf[++stmt_buf_idx];
00770 }
00771 else {
00772 ich = eos;
00773 }
00774 }
00775
00776 ch = ich;
00777 LA_CH_VALUE = ch;
00778 LA_CH_LINE = stmt_line_num[stmt_line_idx];
00779 LA_CH_COLUMN = stmt_buf_col[stmt_buf_idx];
00780 LA_CH_BUF_IDX = stmt_buf_idx;
00781 LA_CH_STMT_NUM = statement_number;
00782 LA_CH_CLASS = (ch == (char) EOF) ? Ch_Class_EOF : ch_class[LA_CH_VALUE];
00783
00784 TRACE (Func_Exit, "fixed_get_char_literal",
00785 ch_str[(unsigned char) LA_CH_VALUE]);
00786
00787 return;
00788
00789 }
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807
00808
00809
00810
00811
00812
00813 void free_get_char (void)
00814
00815 {
00816 char ch;
00817 int ich;
00818
00819
00820 TRACE (Func_Entry, "free_get_char", NULL);
00821
00822 sig_blank = FALSE;
00823
00824
00825
00826 if (LA_CH_VALUE == EOS) {
00827 stmt_end_line = LA_CH_LINE;
00828 stmt_end_col = LA_CH_COLUMN - 1;
00829
00830 if (change_source_form) {
00831 change_source_form = FALSE;
00832
00833 if (cmd_line_flags.line_size_80) {
00834 line_size = FIXED_SRC_LINE_SIZE_80;
00835 }
00836 else if (cmd_line_flags.line_size_132) {
00837 line_size = FIXED_SRC_LINE_SIZE_132;
00838 }
00839 else {
00840 line_size = FIXED_SRC_LINE_SIZE_72;
00841 }
00842 get_char = fixed_get_char;
00843 get_char_literal = fixed_get_char_literal;
00844 source_form = Fixed_Form;
00845
00846 fixed_get_char ();
00847
00848 TRACE (Func_Exit, "free_get_char",
00849 ch_str[(unsigned char) LA_CH_VALUE]);
00850
00851 return;
00852 }
00853
00854 free_get_stmt ();
00855
00856
00857 while (stmt_buf_type == Comment_Line) {
00858 if (change_source_form) {
00859 change_source_form = FALSE;
00860
00861 if (cmd_line_flags.line_size_80) {
00862 line_size = FIXED_SRC_LINE_SIZE_80;
00863 }
00864 else if (cmd_line_flags.line_size_132) {
00865 line_size = FIXED_SRC_LINE_SIZE_132;
00866 }
00867 else {
00868 line_size = FIXED_SRC_LINE_SIZE_72;
00869 }
00870
00871 get_char = fixed_get_char;
00872 get_char_literal = fixed_get_char_literal;
00873 source_form = Fixed_Form;
00874
00875 fixed_get_char ();
00876
00877 TRACE (Func_Exit, "free_get_char",
00878 ch_str[(unsigned char) LA_CH_VALUE]);
00879
00880 return;
00881 }
00882 else {
00883 free_get_stmt ();
00884 }
00885 }
00886
00887 ich = stmt_buf[stmt_buf_idx + 1];
00888
00889 while (((ich == newline) |
00890 (ich == semi_colon) |
00891 (ich == bang)) &&
00892 (stmt_line_idx >= lines_in_buf)) {
00893
00894 free_get_stmt ();
00895
00896 while (stmt_buf_type == Comment_Line) {
00897 if (change_source_form) {
00898 change_source_form = FALSE;
00899
00900 if (cmd_line_flags.line_size_80) {
00901 line_size = FIXED_SRC_LINE_SIZE_80;
00902 }
00903 else if (cmd_line_flags.line_size_132) {
00904 line_size = FIXED_SRC_LINE_SIZE_132;
00905 }
00906 else {
00907 line_size = FIXED_SRC_LINE_SIZE_72;
00908 }
00909
00910 get_char = fixed_get_char;
00911 get_char_literal = fixed_get_char_literal;
00912 source_form = Fixed_Form;
00913
00914 fixed_get_char ();
00915
00916 TRACE (Func_Exit, "free_get_char",
00917 ch_str[(unsigned char) LA_CH_VALUE]);
00918
00919 return;
00920 }
00921 else {
00922 free_get_stmt ();
00923 }
00924 }
00925
00926 ich = stmt_buf[stmt_buf_idx + 1];
00927 }
00928
00929
00930 if (stmt_buf_type == Dir_Line) {
00931 ch = stmt_buf[stmt_buf_idx];
00932
00933 if (islower(ch)) {
00934 ch = TOUPPER(ch);
00935 }
00936
00937 LA_CH_VALUE = ch;
00938 LA_CH_LINE = stmt_line_num[stmt_line_idx];
00939 LA_CH_COLUMN = stmt_buf_col[stmt_buf_idx];
00940 LA_CH_BUF_IDX = stmt_buf_idx;
00941 LA_CH_STMT_NUM = statement_number;
00942
00943 switch (stmt_prefix_len) {
00944 case 1 :
00945 LA_CH_CLASS = Ch_Class_Dir1;
00946 break;
00947 case 2 :
00948 LA_CH_CLASS = Ch_Class_Dir2;
00949 break;
00950 case 3 :
00951 LA_CH_CLASS = Ch_Class_Dir3;
00952 break;
00953 case 4 :
00954 LA_CH_CLASS = Ch_Class_Dir4;
00955 break;
00956 case 7 :
00957
00958 LA_CH_CLASS = Ch_Class_Dir7;
00959 break;
00960 }
00961
00962 TRACE (Func_Exit, "free_get_char",
00963 ch_str[(unsigned char) LA_CH_VALUE]);
00964
00965 return;
00966 }
00967 }
00968
00969
00970
00971
00972
00973
00974
00975
00976 ich = stmt_buf[++stmt_buf_idx];
00977
00978 if (ich == blank || ich == tab) {
00979
00980 do {
00981 ich = stmt_buf[++stmt_buf_idx];
00982 }
00983 while (ich == blank || ich == tab);
00984
00985 sig_blank = TRUE;
00986 }
00987
00988 if (stmt_buf_idx == stmt_buf_EOS_idx) {
00989 ich = eos;
00990 }
00991 else if (stmt_buf_idx == stmt_line_end_idx[stmt_line_idx]) {
00992
00993 if (stmt_line_idx < lines_in_buf) {
00994 ++stmt_line_idx;
00995 stmt_buf_idx = stmt_line_start_idx[stmt_line_idx]
00996 + stmt_line_offset[stmt_line_idx];
00997 ich = stmt_buf[++stmt_buf_idx];
00998 }
00999 else {
01000 ich = eos;
01001 }
01002
01003 if (ich == blank || ich == tab) {
01004
01005 do {
01006 ich = stmt_buf[++stmt_buf_idx];
01007 }
01008 while (ich == blank || ich == tab);
01009
01010 sig_blank = TRUE;
01011 }
01012
01013 if (stmt_buf_idx == stmt_buf_EOS_idx) {
01014 ich = eos;
01015 }
01016 }
01017
01018 LA_CH_LINE = stmt_line_num[stmt_line_idx];
01019 LA_CH_COLUMN = stmt_buf_col[stmt_buf_idx];
01020 LA_CH_BUF_IDX = stmt_buf_idx;
01021 LA_CH_STMT_NUM = statement_number;
01022
01023 if (havent_issued_at_ansi && ich == at_sign) {
01024 havent_issued_at_ansi = FALSE;
01025 ntr_msg_queue(LA_CH_LINE, 900, Ansi,
01026 LA_CH_COLUMN,
01027 (char *)NULL,
01028 0,
01029 NO_ARG);
01030 }
01031
01032 if (havent_issued_dollar_ansi && ich == dollar) {
01033 havent_issued_dollar_ansi = FALSE;
01034 ntr_msg_queue(LA_CH_LINE, 901, Ansi,
01035 LA_CH_COLUMN,
01036 (char *)NULL,
01037 0,
01038 NO_ARG);
01039 }
01040
01041 ch = ich;
01042
01043 if (islower(ch)) {
01044 ch = TOUPPER(ch);
01045 }
01046
01047 LA_CH_VALUE = ch;
01048 LA_CH_CLASS = (ch == (char) EOF) ? Ch_Class_EOF : ch_class[LA_CH_VALUE];
01049
01050 TRACE (Func_Exit, "free_get_char",
01051 ch_str[(unsigned char) LA_CH_VALUE]);
01052
01053 return;
01054
01055 }
01056
01057
01058
01059
01060
01061
01062
01063
01064
01065
01066
01067
01068
01069
01070
01071
01072
01073
01074
01075 void free_get_char_literal (void)
01076
01077 {
01078 char ch;
01079 int ich;
01080
01081
01082 TRACE (Func_Entry, "free_get_char_literal", NULL);
01083
01084
01085
01086
01087
01088
01089
01090
01091
01092
01093 ich = stmt_buf[++stmt_buf_idx];
01094
01095
01096 if (stmt_buf_idx == stmt_line_end_idx[stmt_line_idx]) {
01097
01098 if (stmt_line_idx < lines_in_buf) {
01099 ++stmt_line_idx;
01100 stmt_buf_idx = stmt_line_start_idx[stmt_line_idx]
01101 + stmt_line_offset[stmt_line_idx];
01102
01103 ich = stmt_buf[++stmt_buf_idx];
01104 }
01105 else {
01106 ich = eos;
01107 }
01108 }
01109
01110 ch = ich;
01111
01112 LA_CH_VALUE = ch;
01113 LA_CH_LINE = stmt_line_num[stmt_line_idx];
01114 LA_CH_COLUMN = stmt_buf_col[stmt_buf_idx];
01115 LA_CH_BUF_IDX = stmt_buf_idx;
01116 LA_CH_STMT_NUM = statement_number;
01117 LA_CH_CLASS = (ch == (char) EOF) ? Ch_Class_EOF : ch_class[LA_CH_VALUE];
01118
01119 TRACE (Func_Exit, "free_get_char_literal",
01120 ch_str[(unsigned char) LA_CH_VALUE]);
01121
01122 return;
01123
01124 }
01125
01126
01127
01128
01129
01130
01131
01132
01133
01134
01135
01136
01137
01138
01139
01140
01141
01142
01143
01144
01145
01146
01147
01148
01149
01150
01151
01152
01153
01154 static void fixed_get_stmt (void)
01155 {
01156 int idx;
01157 int line_counter = 1;
01158 int loc_stmt_num;
01159 int save_idx;
01160 int stmt_buf_EOS;
01161
01162
01163 TRACE (Func_Entry, "fixed_get_stmt", NULL);
01164
01165
01166
01167 issue_deferred_msgs();
01168
01169
01170 if (stmt_buf_type == EOF_Line) {
01171
01172 PRINTMSG (0, 50, Internal, 1);
01173 }
01174
01175 stmt_line_idx = NULL_IDX;
01176 stmt_buf_idx = NULL_IDX;
01177 lines_in_buf = 0;
01178
01179 label_ok = FALSE;
01180
01181
01182 do {
01183
01184 save_idx = 0;
01185
01186
01187
01188 stmt_line_num[++stmt_line_idx] = nxt_line_num;
01189
01190
01191
01192 if (starting_pt) {
01193 stmt_line_offset[stmt_line_idx] = starting_pt - 2;
01194 label_ok = FALSE;
01195 }
01196 else {
01197 stmt_line_offset[stmt_line_idx] = nxt_line_idx - 1;
01198 starting_pt = nxt_line_idx;
01199
01200 if (nxt_line_label) {
01201 label_ok = TRUE;
01202 }
01203 }
01204
01205
01206
01207 stmt_line_start_idx[stmt_line_idx] = line_counter;
01208
01209
01210
01211 stmt_line_end_idx[stmt_line_idx] = nxt_line_EOL + line_counter - 1;
01212
01213
01214
01215 if (nxt_line_type != Continuation_Line &&
01216 nxt_line_type != Dir_Continuation_Line) {
01217 stmt_buf_type = nxt_line_type;
01218
01219 if (nxt_line_type == Dir_Line) {
01220 stmt_prefix_len = nxt_line_prefix_len;
01221 stmt_buf_dir_prefix = nxt_line_dir_prefix;
01222 }
01223
01224 if (stmt_buf_type != Comment_Line &&
01225 stmt_buf_type != Pound_Src_Line &&
01226 stmt_buf_type != Pound_Include_Exit_Line) {
01227 INCREMENT_STATEMENT_NUMBER;
01228 }
01229 }
01230
01231 if (stmt_buf_type == Dir_Line) {
01232 line_dir_prefix[stmt_line_idx] = nxt_line_actual_dir_prefix;
01233 }
01234
01235 move_up_next_msg_queue();
01236
01237
01238
01239 stmt_buf_idx = line_counter + nxt_line_EOL - 1;
01240 line_counter += nxt_line_EOL;
01241
01242 for (idx = nxt_line_EOL; idx > 0; idx --) {
01243 stmt_buf[stmt_buf_idx] = nxt_line[NXT_COL(idx)];
01244 stmt_buf_col[stmt_buf_idx] = nxt_line_col[NXT_COL(idx)];
01245 stmt_buf_idx--;
01246
01247 if (havent_issued_tab_ansi &&
01248 idx < nxt_line_EOL &&
01249 nxt_line[NXT_COL(idx)] == tab) {
01250 havent_issued_tab_ansi = FALSE;
01251 ntr_msg_queue(nxt_line_num, 899, Ansi,
01252 idx,
01253 (char *)NULL,
01254 0,
01255 NO_ARG);
01256 }
01257
01258 if (nxt_line[NXT_COL(idx)] == semi_colon &&
01259 stmt_buf_type != Dir_Line) {
01260 if ((idx > starting_pt) && (idx < nxt_line_EOL)) {
01261 save_idx = idx;
01262 }
01263 }
01264 }
01265
01266 idx = 0;
01267 lines_in_buf++;
01268
01269
01270
01271
01272
01273
01274
01275
01276 if (save_idx &&
01277 nxt_line_type != Comment_Line) {
01278
01279 stmt_buf_EOS = save_idx;
01280 idx = save_idx;
01281 while ((nxt_line[NXT_COL(idx)] == semi_colon) |
01282 (nxt_line[NXT_COL(idx)] == blank) |
01283 (nxt_line[NXT_COL(idx)] == tab)) {
01284 idx++;
01285 }
01286
01287
01288
01289 starting_pt = idx;
01290 nxt_line_type = Regular_Line;
01291 continuation_count = 0;
01292 include_found = FALSE;
01293 include_complete = FALSE;
01294 }
01295 else {
01296 stmt_buf_EOS = nxt_line_EOL;
01297 starting_pt = NULL_IDX;
01298 }
01299
01300
01301
01302
01303 if ((stmt_buf_type != EOF_Line) &&
01304 (starting_pt == NULL_IDX)) {
01305
01306
01307 do {
01308 nxt_line_type = Regular_Line;
01309
01310 if (get_nxt_line ()) {
01311
01312 if (include_switch) {
01313 update_global_line();
01314 include_switch = FALSE;
01315 }
01316
01317 if (issue_pound_exit_line) {
01318 OUTPUT_POUND_INCLUDE_EXIT_LINE(curr_glb_line);
01319 issue_pound_exit_line = FALSE;
01320 }
01321
01322 nxt_line_mp_line = FALSE;
01323
01324 if (nxt_line_type != Cond_Comp_Line) {
01325 PP_ORIG_SIZE = line_size;
01326 classify_line();
01327 }
01328
01329 if (on_off_flags.save_dot_i) {
01330
01331 if (ignore_source_line ||
01332 nxt_line_type == Cond_Comp_Line ||
01333 nxt_line_type == Include_Line) {
01334
01335
01336 fprintf(dot_i_fptr, "\n");
01337 previous_global_line++;
01338 }
01339 else {
01340 print_nxt_line();
01341 }
01342 }
01343
01344 switch (nxt_line_type) {
01345 case Comment_Line:
01346 break;
01347
01348 case Cond_Comp_Line:
01349 if (parse_cc_line()) {
01350
01351
01352
01353 nxt_line_type = Include_Line;
01354 include_stmt_file_line = SRC_STK_FILE_LINE(src_stk_idx);
01355
01356 if (open_include_file (TRUE)) {
01357 include_found = TRUE;
01358 include_switch = TRUE;
01359 }
01360 }
01361 else {
01362 nxt_line_type = Comment_Line;
01363 }
01364 angle_brkt_include = FALSE;
01365 break;
01366
01367 case Dir_Line:
01368 case Regular_Line:
01369 continuation_count = 0;
01370 include_found = FALSE;
01371 include_complete = FALSE;
01372 break;
01373
01374 case Continuation_Line:
01375 case Dir_Continuation_Line:
01376
01377 if (++continuation_count == MAX_ANSI_FIXED_LINES) {
01378
01379
01380
01381 ntr_msg_queue(nxt_line_num, 52, Ansi,
01382 CONTINUE_COLUMN,
01383 "fixed",
01384 (MAX_ANSI_FIXED_LINES - 1),
01385 ARG_STR_ARG);
01386 }
01387
01388 if (continuation_count == MAX_FIXED_LINES) {
01389
01390
01391
01392 ntr_msg_queue(nxt_line_num, 524, Error,
01393 CONTINUE_COLUMN,
01394 (char *)NULL,
01395 0,
01396 NO_ARG);
01397 }
01398
01399 if (continuation_count >= MAX_FIXED_LINES) {
01400 nxt_line_type = Comment_Line;
01401 break;
01402 }
01403
01404 if (stmt_buf_type == Dir_Line &&
01405 nxt_line_type == Continuation_Line) {
01406
01407
01408
01409 ntr_msg_queue(nxt_line_num, 51, Error,
01410 CONTINUE_COLUMN,
01411 (char *)NULL,
01412 0,
01413 NO_ARG);
01414 }
01415
01416 if (include_found) {
01417 include_found = FALSE;
01418
01419
01420
01421 ntr_msg_queue(nxt_line_num, 53, Error,
01422 CONTINUE_COLUMN,
01423 (char *)NULL,
01424 0,
01425 NO_ARG);
01426 }
01427
01428 if (include_complete) {
01429 include_complete = FALSE;
01430
01431
01432
01433 ntr_msg_queue(nxt_line_num, 54, Error,
01434 CONTINUE_COLUMN,
01435 (char *)NULL,
01436 0,
01437 NO_ARG);
01438 }
01439
01440 if (cif_flags & MISC_RECS) {
01441 cif_cont_line_rec(
01442 (nxt_line_type == Continuation_Line) ? 0 : 1,
01443 nxt_line_num);
01444 }
01445
01446 break;
01447
01448 case Pound_Src_Line:
01449 break;
01450
01451 case Pound_Include_Exit_Line:
01452 include_complete = TRUE;
01453 nxt_line_type = Comment_Line;
01454 curr_glb_line--;
01455 SRC_STK_FILE_LINE(src_stk_idx)--;
01456 GL_SOURCE_LINES(SRC_STK_GLOBAL_LINE_IDX(src_stk_idx)) =
01457 SRC_STK_FILE_LINE(src_stk_idx);
01458 set_related_gl_source_lines(
01459 SRC_STK_GLOBAL_LINE_IDX(src_stk_idx));
01460
01461 if (source_form != SRC_STK_PREV_SRC_FORM(src_stk_idx)) {
01462 change_source_form = TRUE;
01463 }
01464 POP_SRC;
01465 include_switch = TRUE;
01466 break;
01467
01468 case Pound_Include_Enter_Line:
01469 case Include_Line:
01470
01471 include_stmt_file_line = SRC_STK_FILE_LINE(src_stk_idx);
01472
01473 if (open_include_file (FALSE)) {
01474 include_found = TRUE;
01475 include_switch = TRUE;
01476 }
01477
01478 break;
01479 }
01480 }
01481 else {
01482
01483
01484
01485 if (cmd_line_flags.pp_macro_expansion) {
01486 pp_line_idx++;
01487 }
01488
01489
01490
01491 if (src_stk_idx > SRC_STK_BASE_IDX) {
01492 include_complete = TRUE;
01493 nxt_line_type = Comment_Line;
01494 nxt_line_EOL = 2;
01495 curr_glb_line--;
01496
01497 GL_SOURCE_LINES(SRC_STK_GLOBAL_LINE_IDX(src_stk_idx)) =
01498 SRC_STK_FILE_LINE(src_stk_idx);
01499 set_related_gl_source_lines(
01500 SRC_STK_GLOBAL_LINE_IDX(src_stk_idx));
01501
01502 if (source_form != SRC_STK_PREV_SRC_FORM(src_stk_idx)) {
01503 change_source_form = TRUE;
01504 }
01505 POP_SRC;
01506 include_switch = TRUE;
01507 issue_pound_exit_line = TRUE;
01508 break;
01509 }
01510 else {
01511 GL_SOURCE_LINES(SRC_STK_GLOBAL_LINE_IDX(src_stk_idx)) =
01512 SRC_STK_FILE_LINE(src_stk_idx);
01513 set_related_gl_source_lines(
01514 SRC_STK_GLOBAL_LINE_IDX(src_stk_idx));
01515 nxt_line_type = EOF_Line;
01516 nxt_line_EOL = 2;
01517 }
01518 }
01519 }
01520 while (nxt_line_type == Comment_Line |
01521 nxt_line_type == Include_Line |
01522 nxt_line_type == Pound_Include_Enter_Line);
01523
01524 }
01525 }
01526 while (nxt_line_type == Continuation_Line ||
01527 nxt_line_type == Dir_Continuation_Line);
01528
01529 if (prev_statement_number != statement_number) {
01530 loc_stmt_num = statement_number;
01531 statement_number = prev_statement_number;
01532 prev_statement_number = loc_stmt_num;
01533 }
01534
01535 stmt_buf_EOS_idx = stmt_line_start_idx[lines_in_buf] + stmt_buf_EOS - 1;
01536 stmt_EOS_la_ch.line = stmt_line_num[lines_in_buf];
01537 stmt_EOS_la_ch.column = stmt_buf_col[stmt_buf_EOS_idx];
01538 stmt_EOS_la_ch.stmt_buf_idx = stmt_buf_EOS_idx;
01539 stmt_EOS_la_ch.stmt_num = statement_number;
01540
01541 stmt_buf_idx = stmt_line_offset[1] + 1;
01542 stmt_line_idx = SRC_STK_BASE_IDX;
01543
01544 PRINT_STMT_SRC();
01545
01546 TRACE (Func_Exit, "fixed_get_stmt", NULL);
01547
01548 return;
01549
01550 }
01551
01552
01553
01554
01555
01556
01557
01558
01559
01560
01561
01562
01563
01564
01565
01566
01567
01568
01569 boolean read_line (boolean cc_continuation_line)
01570
01571 {
01572 int ch;
01573 int i;
01574 int k;
01575 int limit;
01576 boolean result = TRUE;
01577
01578
01579 TRACE (Func_Entry, "read_line", NULL);
01580
01581 if (extra_nxt_line != 0 &&
01582 nxt_line_num_lines == 0) {
01583
01584
01585
01586 nxt_line_num_lines++;
01587
01588 if (pp_nxt_line_type[extra_nxt_line] == EOF_Line) {
01589 nxt_line_start_idx[1] = 1;
01590 nxt_line_end_idx[1] = 2;
01591 nxt_line[1] = EOF;
01592 nxt_line[2] = eos;
01593 pp_nxt_line_length[1] = 1;
01594 pp_nxt_line_type[1] = EOF_Line;
01595 pp_nxt_line_idx[1] = NULL_IDX;
01596 result = FALSE;
01597 }
01598 else {
01599 k = 0;
01600 for (i = nxt_line_start_idx[extra_nxt_line];
01601 i <= nxt_line_end_idx[extra_nxt_line];
01602 i++) {
01603
01604 nxt_line[++k] = (nxt_line[i] & 0xFF);
01605 nxt_line_col[k] = nxt_line_col[i];
01606 }
01607 nxt_line_start_idx[1] = 1;
01608 nxt_line_end_idx[1] = k;
01609 pp_nxt_line_length[1] = k-1;
01610 }
01611
01612 pp_nxt_line_num[1] = pp_nxt_line_num[extra_nxt_line];
01613 pp_nxt_line_mp_line[1] = pp_nxt_line_mp_line[extra_nxt_line];
01614
01615 if (pp_nxt_line_type[extra_nxt_line] == Include_Line) {
01616 nxt_line_type = Include_Line;
01617 }
01618
01619 extra_nxt_line = NULL_IDX;
01620
01621 goto EXIT;
01622 }
01623
01624
01625
01626 ch = getc(SRC_STK_FILE_PTR(src_stk_idx));
01627
01628 if (on_off_flags.preprocess &&
01629 ch != newline &&
01630 ch != EOF &&
01631 (ch == '#' || cc_continuation_line)) {
01632
01633 limit = MAX_STMT_CHAR_SIZE - 4;
01634
01635 if (! cc_continuation_line) {
01636 cc_stmt_buf_idx = NULL_IDX;
01637 cc_stmt_buf_num_lines = 0;
01638 }
01639
01640 cc_stmt_buf_line[++cc_stmt_buf_num_lines].line = ++curr_glb_line;
01641 cc_stmt_buf_line[cc_stmt_buf_num_lines].start_idx = cc_stmt_buf_idx;
01642 SRC_STK_FILE_LINE(src_stk_idx)++;
01643
01644 cc_stmt_buf[++cc_stmt_buf_idx] = ch;
01645
01646 while ((ch = getc(SRC_STK_FILE_PTR(src_stk_idx))) != newline &&
01647 ch != EOF){
01648
01649 if (limit > 0) {
01650 cc_stmt_buf[++cc_stmt_buf_idx] = ch;
01651 limit--;
01652 }
01653 }
01654
01655 cc_stmt_buf[++cc_stmt_buf_idx] = newline;
01656 cc_stmt_buf[++cc_stmt_buf_idx] = eos;
01657
01658 nxt_line_type = Cond_Comp_Line;
01659
01660 goto EXIT;
01661 }
01662
01663 nxt_line_start_idx[nxt_line_num_lines + 1] =
01664 nxt_line_end_idx[nxt_line_num_lines] + 1;
01665
01666 nxt_line_num_lines++;
01667
01668 for (i = nxt_line_start_idx[nxt_line_num_lines] - 1;
01669 i <= nxt_line_start_idx[nxt_line_num_lines] + line_size;
01670 i++) {
01671 nxt_line_col[i] = (i - nxt_line_start_idx[nxt_line_num_lines]) + 1;
01672 }
01673
01674 nxt_line_idx = nxt_line_start_idx[nxt_line_num_lines] - 1;
01675
01676 if (ch != newline && ch != EOF) {
01677 limit = nxt_line_idx + FREE_SRC_LINE_SIZE;
01678
01679 nxt_line[++nxt_line_idx] = ch;
01680
01681 while ((ch = getc(SRC_STK_FILE_PTR(src_stk_idx))) != newline &&
01682 ch != EOF){
01683
01684 if (nxt_line_idx < limit) {
01685 nxt_line[++nxt_line_idx] = ch;
01686 }
01687 }
01688 }
01689
01690
01691 if (nxt_line_idx >
01692 (nxt_line_start_idx[nxt_line_num_lines] - 1) + line_size) {
01693
01694 nxt_line_idx = (nxt_line_start_idx[nxt_line_num_lines] - 1) + line_size;
01695 }
01696
01697 if (nxt_line_idx == nxt_line_start_idx[nxt_line_num_lines] - 1 &&
01698 ch == EOF) {
01699
01700 nxt_line[nxt_line_start_idx[nxt_line_num_lines]] = EOF;
01701 nxt_line[nxt_line_start_idx[nxt_line_num_lines] + 1] = eos;
01702 pp_nxt_line_length[nxt_line_num_lines] = 1;
01703 nxt_line_end_idx[nxt_line_num_lines] =
01704 nxt_line_start_idx[nxt_line_num_lines] + 1;
01705 pp_nxt_line_num[nxt_line_num_lines] = ++curr_glb_line;
01706 pp_nxt_line_type[nxt_line_num_lines] = EOF_Line;
01707 pp_nxt_line_idx[nxt_line_num_lines] = NULL_IDX;
01708 result = FALSE;
01709 }
01710 else {
01711 if (source_form == Fixed_Form) {
01712
01713 while (nxt_line_idx <
01714 (nxt_line_start_idx[nxt_line_num_lines] - 1) + CONTINUE_COLUMN) {
01715 nxt_line[++nxt_line_idx] = blank;
01716 }
01717 }
01718
01719 pp_nxt_line_num[nxt_line_num_lines] = ++curr_glb_line;
01720 SRC_STK_FILE_LINE(src_stk_idx)++;
01721
01722 nxt_line[++nxt_line_idx] = newline;
01723 pp_nxt_line_length[nxt_line_num_lines] = nxt_line_idx -
01724 (nxt_line_start_idx[nxt_line_num_lines] - 1);
01725 nxt_line[++nxt_line_idx] = eos;
01726 nxt_line_end_idx[nxt_line_num_lines] = nxt_line_idx;
01727
01728 if (pp_nxt_line_length[nxt_line_num_lines] > 73 &&
01729 source_form == Fixed_Form &&
01730 ! have_issued_msg_37 &&
01731 issue_classify_msg) {
01732 have_issued_msg_37 = TRUE;
01733 ntr_next_msg_queue(curr_glb_line, 37, Ansi,
01734 0,
01735 (char *)NULL,
01736 0,
01737 NO_ARG);
01738 }
01739
01740
01741 # if 0
01742
01743
01744
01745
01746
01747
01748
01749
01750
01751
01752 if (ch == EOF) {
01753 PRINTMSG (curr_glb_line, 55, Warning, 0);
01754 }
01755
01756 # endif
01757
01758
01759 }
01760
01761 EXIT:
01762
01763 TRACE (Func_Exit, "read_line", NULL);
01764
01765 return (result);
01766
01767 }
01768
01769
01770
01771
01772
01773
01774
01775
01776
01777
01778
01779
01780
01781
01782
01783
01784
01785 static boolean is_pound_line_dir(void)
01786
01787 {
01788 int ch;
01789 boolean dir = FALSE;
01790 int idx;
01791
01792 TRACE (Func_Entry, "is_pound_line_dir", NULL);
01793
01794 ch = nxt_line[NXT_COL(1)];
01795
01796 if (ch == pound) {
01797 idx = NXT_COL(2);
01798 ch = nxt_line[idx];
01799
01800 while (ch == blank | ch == tab) {
01801 idx++;
01802 ch = nxt_line[idx];
01803 }
01804
01805 if (isdigit(ch)) {
01806 dir = TRUE;
01807 }
01808 }
01809
01810 TRACE (Func_Exit, "is_pound_line_dir", NULL);
01811
01812 return(dir);
01813
01814 }
01815
01816
01817
01818
01819
01820
01821
01822
01823
01824
01825
01826
01827
01828
01829
01830
01831
01832
01833
01834 static void fixed_classify_line (void)
01835
01836 {
01837 int ch;
01838 char form[4] = " ";
01839 char ch_tmp;
01840 int cont_col;
01841 char delim;
01842 char err_str[2];
01843 int i;
01844 int ich;
01845 int idx;
01846 int incl_idx;
01847 boolean label;
01848 int line_num;
01849 char line_num_str[24];
01850 int nxt_idx;
01851 int save_curr_glb_line;
01852
01853 TRACE (Func_Entry, "fixed_classify_line", NULL);
01854
01855 PP_EOL = nxt_line_end_idx[pp_line_idx] - 1;
01856
01857 START:
01858
01859 cont_col = NXT_COL(CONTINUE_COLUMN);
01860
01861 PP_IDX = NXT_COL(0);
01862 PP_LABEL = FALSE;
01863
01864 ch = nxt_line[NXT_COL(1)];
01865
01866 # ifdef _FRONTEND_CONDITIONAL_COMP
01867 if (ch == pound &&
01868 on_off_flags.preprocess) {
01869
01870 PP_LINE_TYPE = Cond_Comp_Line;
01871 } else
01872 # endif
01873 if (is_pound_line_dir()) {
01874 PP_IDX = NXT_COL(2);
01875 ch = nxt_line[PP_IDX];
01876
01877 while (ch == blank | ch == tab) {
01878 PP_IDX++;
01879 ch = nxt_line[PP_IDX];
01880 }
01881
01882 if (isdigit(ch)) {
01883 idx = 0;
01884 line_num_str[idx++] = ch;
01885 ch = nxt_line[++PP_IDX];
01886 while (isdigit(ch)) {
01887 line_num_str[idx++] = ch;
01888 ch = nxt_line[++PP_IDX];
01889 }
01890
01891 line_num_str[idx] = '\0';
01892 line_num = atoi(line_num_str);
01893
01894 while (ch == blank | ch == tab) {
01895 PP_IDX++;
01896 ch = nxt_line[PP_IDX];
01897 }
01898
01899 if (ch == quote | ch == db_quote) {
01900 char_delim = ch;
01901 ch = nxt_line[++PP_IDX];
01902
01903 idx = 0;
01904 while (ch != char_delim) {
01905 include_file[idx++] = ch;
01906 ch = nxt_line[++PP_IDX];
01907 }
01908 include_file[idx] = '\0';
01909
01910 ch = nxt_line[++PP_IDX];
01911 while (ch == blank | ch == tab) {
01912 PP_IDX++;
01913 ch = nxt_line[PP_IDX];
01914 }
01915
01916 if (ch == '1') {
01917 PP_LINE_TYPE = Pound_Include_Enter_Line;
01918 }
01919 else if (ch == '2') {
01920 PP_LINE_TYPE = Pound_Include_Exit_Line;
01921 }
01922 else {
01923 PP_LINE_TYPE = Comment_Line;
01924
01925
01926
01927
01928 save_curr_glb_line = curr_glb_line;
01929 curr_glb_line = line_num + GL_GLOBAL_LINE(global_line_tbl_idx) -
01930 GL_FILE_LINE(global_line_tbl_idx);
01931 curr_glb_line--;
01932
01933 if (first_pound_line) {
01934 PP_LINE_TYPE = Pound_Src_Line;
01935 change_orig_src_file = TRUE;
01936 strcpy(pound_file, include_file);
01937 }
01938 else {
01939 SRC_STK_FILE_LINE(src_stk_idx) +=
01940 curr_glb_line - save_curr_glb_line;
01941 }
01942 }
01943
01944 first_pound_line = FALSE;
01945
01946 }
01947 else if (ch == newline) {
01948
01949 PP_LINE_TYPE = Comment_Line;
01950
01951
01952
01953
01954 save_curr_glb_line = curr_glb_line;
01955 curr_glb_line = line_num + GL_GLOBAL_LINE(global_line_tbl_idx) -
01956 GL_FILE_LINE(global_line_tbl_idx);
01957 curr_glb_line--;
01958
01959 SRC_STK_FILE_LINE(src_stk_idx) +=
01960 curr_glb_line - save_curr_glb_line;
01961
01962 first_pound_line = FALSE;
01963 }
01964 else {
01965 PP_LINE_TYPE = Comment_Line;
01966 }
01967 }
01968 else {
01969 PP_LINE_TYPE = Comment_Line;
01970 }
01971 }
01972 else if (ignore_source_line) {
01973 PP_LINE_TYPE = Comment_Line;
01974 }
01975 # ifdef _D_LINES_SUPPORTED
01976 else if (ch == uc_d | ch == lc_d) {
01977
01978
01979 if (on_off_flags.d_lines) {
01980 nxt_line[NXT_COL(1)] = ' ';
01981 goto START;
01982 }
01983 else {
01984 PP_LINE_TYPE = Comment_Line;
01985 }
01986 }
01987 # endif
01988 else if (ch == uc_c | ch == lc_c | ch == bang | ch == star) {
01989
01990 if (((ch = nxt_line[NXT_COL(2)]) == uc_d || ch == lc_d) &&
01991 ((ch = nxt_line[NXT_COL(3)]) == uc_i || ch == lc_i) &&
01992 ((ch = nxt_line[NXT_COL(4)]) == uc_r || ch == lc_r) &&
01993 ((ch = nxt_line[NXT_COL(5)]) == dollar || ch == at_sign)) {
01994
01995 PP_PREFIX_LEN = 4;
01996
01997 first_line = FALSE;
01998
01999
02000 MARK_CHAR_CONST(nxt_line[NXT_COL(5)]);
02001
02002
02003 if (nxt_line[NXT_COL(6)] == zero) {
02004 nxt_line[NXT_COL(6)] = blank;
02005 }
02006
02007 if ((ch = nxt_line[NXT_COL(6)]) != blank && ch != tab) {
02008
02009 if (IS_DIR_CONTINUATION(Cdir_Dir)) {
02010
02011 PP_LINE_TYPE = Dir_Continuation_Line;
02012 PP_ACTUAL_DIR_PREFIX = Cdir_Dir;
02013 in_format = FALSE;
02014 PP_IDX = NXT_COL(6);
02015 }
02016 else {
02017 PP_LINE_TYPE = Comment_Line;
02018 }
02019 }
02020 else {
02021 PP_IDX = NXT_COL(2);
02022 PP_LINE_TYPE = Dir_Line;
02023 PP_DIR_PREFIX = Cdir_Dir;
02024 PP_ACTUAL_DIR_PREFIX = Cdir_Dir;
02025 in_format = FALSE;
02026 idx = NXT_COL(6);
02027 do {
02028 ch = nxt_line[++idx];
02029 }
02030 while (ch == blank | ch == tab);
02031
02032 if (ch == lc_f | ch == uc_f) {
02033 i = 0;
02034 while (i < 4) {
02035 ch = nxt_line[++idx];
02036
02037 if (ch == newline) {
02038 break;
02039 }
02040
02041 if (! (ch == blank | ch == tab)) {
02042 if (islower(ch)) {
02043 form[i] = TOUPPER(ch);
02044 }
02045 else {
02046 form[i] = ch;
02047 }
02048 i++;
02049 }
02050 }
02051
02052 if (strncmp(form, "REE ", 4) == 0 &&
02053 !disregard_directive[Tok_Dir_Free-Tok_Dir_Start]) {
02054 PP_CHANGE_SOURCE_FORM = TRUE;
02055 }
02056 }
02057 }
02058 }
02059 else if (((ch = nxt_line[NXT_COL(2)]) == uc_m || ch == lc_m) &&
02060 ((ch = nxt_line[NXT_COL(3)]) == uc_i || ch == lc_i) &&
02061 ((ch = nxt_line[NXT_COL(4)]) == uc_c || ch == lc_c) &&
02062 ((ch = nxt_line[NXT_COL(5)]) == dollar || ch == at_sign)) {
02063
02064 PP_PREFIX_LEN = 4;
02065
02066 first_line = FALSE;
02067
02068
02069 MARK_CHAR_CONST(nxt_line[NXT_COL(5)]);
02070
02071
02072 if ((ch = nxt_line[NXT_COL(6)]) != blank && ch != tab) {
02073
02074 if (IS_DIR_CONTINUATION(Cmic_Dir)) {
02075
02076 PP_LINE_TYPE = Dir_Continuation_Line;
02077 PP_ACTUAL_DIR_PREFIX = Cmic_Dir;
02078 in_format = FALSE;
02079 PP_IDX = NXT_COL(6);
02080 }
02081 else {
02082 PP_LINE_TYPE = Comment_Line;
02083 }
02084 }
02085 else {
02086
02087 PP_IDX = NXT_COL(2);
02088 in_format = FALSE;
02089 PP_LINE_TYPE = Dir_Line;
02090 PP_DIR_PREFIX = Cmic_Dir;
02091 PP_ACTUAL_DIR_PREFIX = Cmic_Dir;
02092
02093 idx = NXT_COL(6);
02094 }
02095 }
02096 else if (((ch = nxt_line[NXT_COL(2)]) == dollar) &&
02097 ((ch = nxt_line[NXT_COL(3)]) == uc_o || ch == lc_o) &&
02098 ((ch = nxt_line[NXT_COL(4)]) == uc_m || ch == lc_m) &&
02099 ((ch = nxt_line[NXT_COL(5)]) == uc_p || ch == lc_p)) {
02100
02101
02102
02103 PP_PREFIX_LEN = 4;
02104
02105 first_line = FALSE;
02106
02107
02108 MARK_CHAR_CONST(nxt_line[NXT_COL(2)]);
02109
02110 if (nxt_line[NXT_COL(6)] == zero) {
02111 nxt_line[NXT_COL(6)] = blank;
02112 }
02113
02114 if ((ch = nxt_line[NXT_COL(6)]) != blank && ch != tab) {
02115
02116 if (IS_DIR_CONTINUATION(Comp_Dir)) {
02117
02118 PP_LINE_TYPE = Dir_Continuation_Line;
02119 PP_ACTUAL_DIR_PREFIX = Comp_Dir;
02120 in_format = FALSE;
02121 PP_IDX = NXT_COL(6);
02122 }
02123 else {
02124 PP_LINE_TYPE = Comment_Line;
02125 }
02126 }
02127 else {
02128
02129 PP_IDX = NXT_COL(2);
02130 in_format = FALSE;
02131 PP_LINE_TYPE = Dir_Line;
02132 PP_DIR_PREFIX = Comp_Dir;
02133 PP_ACTUAL_DIR_PREFIX = Comp_Dir;
02134
02135 idx = NXT_COL(6);
02136
02137 # if ! defined(_TARGET_OS_MAX)
02138 if (! dump_flags.open_mp &&
02139 ! on_off_flags.preprocess_only) {
02140 PP_LINE_TYPE = Comment_Line;
02141 }
02142 # endif
02143 }
02144 }
02145 # if defined(GENERATE_WHIRL)
02146 else if (((ch = nxt_line[NXT_COL(2)]) == dollar) &&
02147 ((ch = nxt_line[NXT_COL(3)]) == uc_s || ch == lc_s) &&
02148 ((ch = nxt_line[NXT_COL(4)]) == uc_g || ch == lc_g) &&
02149 ((ch = nxt_line[NXT_COL(5)]) == uc_i || ch == lc_i)) {
02150
02151
02152
02153 PP_PREFIX_LEN = 4;
02154
02155 first_line = FALSE;
02156
02157
02158 MARK_CHAR_CONST(nxt_line[NXT_COL(2)]);
02159
02160 if (nxt_line[NXT_COL(6)] == zero) {
02161 nxt_line[NXT_COL(6)] = blank;
02162 }
02163
02164 if ((ch = nxt_line[NXT_COL(6)]) != blank && ch != tab) {
02165
02166 if (IS_DIR_CONTINUATION(Comp_Dir)) {
02167
02168 PP_LINE_TYPE = Dir_Continuation_Line;
02169 PP_ACTUAL_DIR_PREFIX = Csgi_Dir;
02170 in_format = FALSE;
02171 PP_IDX = NXT_COL(6);
02172 }
02173 else {
02174 PP_LINE_TYPE = Comment_Line;
02175 }
02176 }
02177 else {
02178
02179 PP_IDX = NXT_COL(2);
02180 in_format = FALSE;
02181 PP_LINE_TYPE = Dir_Line;
02182 PP_DIR_PREFIX = Comp_Dir;
02183 PP_ACTUAL_DIR_PREFIX = Csgi_Dir;
02184
02185 idx = NXT_COL(6);
02186
02187 if (! dump_flags.open_mp &&
02188 ! on_off_flags.preprocess_only) {
02189 PP_LINE_TYPE = Comment_Line;
02190 }
02191 }
02192 }
02193 else if (((ch = nxt_line[NXT_COL(2)]) == dollar) &&
02194 ((ch = nxt_line[NXT_COL(3)]) == uc_o || ch == lc_o) &&
02195 ((ch = nxt_line[NXT_COL(4)]) == uc_p || ch == lc_p) &&
02196 ((ch = nxt_line[NXT_COL(5)]) == uc_e || ch == lc_e) &&
02197 ((ch = nxt_line[NXT_COL(6)]) == uc_n || ch == lc_n) &&
02198 ((ch = nxt_line[NXT_COL(7)]) == uc_a || ch == lc_a) &&
02199 ((ch = nxt_line[NXT_COL(8)]) == uc_d || ch == lc_d)) {
02200
02201
02202
02203
02204 PP_PREFIX_LEN = 7;
02205
02206 first_line = FALSE;
02207
02208
02209 MARK_CHAR_CONST(nxt_line[NXT_COL(2)]);
02210
02211 if (nxt_line[NXT_COL(9)] == zero) {
02212 nxt_line[NXT_COL(9)] = blank;
02213 }
02214
02215 if ((ch = nxt_line[NXT_COL(9)]) != blank && ch != tab) {
02216
02217 if (IS_DIR_CONTINUATION(Copenad_Dir)) {
02218
02219 PP_LINE_TYPE = Dir_Continuation_Line;
02220 PP_ACTUAL_DIR_PREFIX = Copenad_Dir;
02221 in_format = FALSE;
02222 PP_IDX = NXT_COL(9);
02223 }
02224 else {
02225 PP_LINE_TYPE = Comment_Line;
02226 }
02227 }
02228 else {
02229
02230 PP_IDX = NXT_COL(2);
02231 in_format = FALSE;
02232 PP_LINE_TYPE = Dir_Line;
02233 PP_DIR_PREFIX = Copenad_Dir;
02234 PP_ACTUAL_DIR_PREFIX = Copenad_Dir;
02235
02236 idx = NXT_COL(9);
02237 }
02238 }
02239 # endif
02240 else if (((ch = nxt_line[NXT_COL(2)]) == dollar) &&
02241 ((ch = nxt_line[NXT_COL(3)]) == uc_p || ch == lc_p) &&
02242 ((ch = nxt_line[NXT_COL(4)]) == uc_a || ch == lc_a) &&
02243 ((ch = nxt_line[NXT_COL(5)]) == uc_r || ch == lc_r)) {
02244
02245
02246
02247 PP_PREFIX_LEN = 4;
02248
02249 first_line = FALSE;
02250
02251
02252 MARK_CHAR_CONST(nxt_line[NXT_COL(2)]);
02253
02254 if ((ch = nxt_line[NXT_COL(6)]) == amp) {
02255
02256 if (IS_DIR_CONTINUATION(Cpar_Dir)) {
02257
02258 PP_LINE_TYPE = Dir_Continuation_Line;
02259 PP_ACTUAL_DIR_PREFIX = Cpar_Dir;
02260 in_format = FALSE;
02261 PP_IDX = NXT_COL(6);
02262 }
02263 else {
02264 PP_LINE_TYPE = Comment_Line;
02265 }
02266 }
02267 else {
02268
02269 PP_IDX = NXT_COL(2);
02270 in_format = FALSE;
02271 PP_LINE_TYPE = Dir_Line;
02272 PP_DIR_PREFIX = Cpar_Dir;
02273 PP_ACTUAL_DIR_PREFIX = Cpar_Dir;
02274
02275 idx = NXT_COL(6);
02276
02277 if ((! dump_flags.mp &&
02278 ! on_off_flags.preprocess_only) ||
02279 ! is_par_directive(idx)) {
02280 PP_LINE_TYPE = Comment_Line;
02281 }
02282 }
02283 }
02284 else if (((ch = nxt_line[NXT_COL(2)]) == star) &&
02285 ((ch = nxt_line[NXT_COL(3)]) == dollar) &&
02286 ((ch = nxt_line[NXT_COL(4)]) == star)) {
02287
02288
02289
02290 PP_PREFIX_LEN = 3;
02291
02292 first_line = FALSE;
02293
02294
02295 MARK_CHAR_CONST(nxt_line[NXT_COL(3)]);
02296
02297
02298 if ((ch = nxt_line[NXT_COL(5)]) == amp) {
02299
02300 if (IS_DIR_CONTINUATION(Cstar_Dir)) {
02301
02302 PP_LINE_TYPE = Dir_Continuation_Line;
02303 PP_ACTUAL_DIR_PREFIX = Cstar_Dir;
02304 in_format = FALSE;
02305 PP_IDX = NXT_COL(5);
02306 }
02307 else {
02308 PP_LINE_TYPE = Comment_Line;
02309 }
02310 }
02311 else {
02312
02313 PP_IDX = NXT_COL(2);
02314 in_format = FALSE;
02315 PP_LINE_TYPE = Dir_Line;
02316 PP_DIR_PREFIX = Cstar_Dir;
02317 PP_ACTUAL_DIR_PREFIX = Cstar_Dir;
02318
02319 idx = NXT_COL(5);
02320
02321 # if defined(GENERATE_WHIRL)
02322 if (! is_star_directive(idx)) {
02323 PP_LINE_TYPE = Comment_Line;
02324 }
02325 # else
02326 if ((! dump_flags.mp &&
02327 ! on_off_flags.preprocess_only) ||
02328 ! is_star_directive(idx)) {
02329 PP_LINE_TYPE = Comment_Line;
02330 }
02331 # endif
02332 }
02333 }
02334 else if ((ch = nxt_line[NXT_COL(2)]) == dollar) {
02335
02336
02337
02338 PP_PREFIX_LEN = 1;
02339
02340 first_line = FALSE;
02341
02342
02343 MARK_CHAR_CONST(nxt_line[NXT_COL(2)]);
02344
02345
02346 if ((ch = nxt_line[NXT_COL(3)]) == amp &&
02347 dump_flags.mp) {
02348
02349 if (IS_DIR_CONTINUATION(Cdollar_Dir)) {
02350
02351 PP_LINE_TYPE = Dir_Continuation_Line;
02352 PP_ACTUAL_DIR_PREFIX = Cdollar_Dir;
02353 in_format = FALSE;
02354 PP_IDX = NXT_COL(3);
02355 }
02356 else {
02357 PP_LINE_TYPE = Comment_Line;
02358 }
02359 }
02360 else {
02361
02362 PP_IDX = NXT_COL(2);
02363 in_format = FALSE;
02364 PP_LINE_TYPE = Dir_Line;
02365 PP_DIR_PREFIX = Cdollar_Dir;
02366 PP_ACTUAL_DIR_PREFIX = Cdollar_Dir;
02367
02368 idx = NXT_COL(3);
02369
02370 if (dump_flags.mp &&
02371 is_dollar_directive(idx)) {
02372
02373 }
02374 else {
02375
02376 ch = nxt_line[NXT_COL(3)];
02377
02378 if (ch == ' ' ||
02379 ch == '\t' ||
02380 isdigit(ch)) {
02381
02382 PP_MP_LINE = TRUE;
02383 }
02384
02385 if ((dump_flags.mp ||
02386 dump_flags.open_mp ||
02387 on_off_flags.preprocess_only) &&
02388 ! cmd_line_flags.disregard_conditional_omp &&
02389 PP_MP_LINE) {
02390
02391 nxt_line[NXT_COL(1)] = ' ';
02392 nxt_line[NXT_COL(2)] = ' ';
02393 goto START;
02394 }
02395 else {
02396 PP_LINE_TYPE = Comment_Line;
02397 PP_MP_LINE = FALSE;
02398 }
02399 }
02400 }
02401 }
02402 # ifdef _DEBUG
02403 else if (((ch = nxt_line[NXT_COL(2)]) == uc_d || ch == lc_d) &&
02404 ((ch = nxt_line[NXT_COL(3)]) == uc_b || ch == lc_b) &&
02405 ((ch = nxt_line[NXT_COL(4)]) == uc_g || ch == lc_g) &&
02406 ((ch = nxt_line[NXT_COL(5)]) == dollar)) {
02407
02408 PP_PREFIX_LEN = 4;
02409
02410 first_line = FALSE;
02411
02412
02413
02414 MARK_CHAR_CONST(nxt_line[NXT_COL(5)]);
02415
02416 if ((ch = nxt_line[NXT_COL(6)]) != blank && ch != tab) {
02417
02418 if (IS_DIR_CONTINUATION(Cdbg_Dir)) {
02419
02420 PP_LINE_TYPE = Dir_Continuation_Line;
02421 PP_ACTUAL_DIR_PREFIX = Cdbg_Dir;
02422 in_format = FALSE;
02423 PP_IDX = NXT_COL(6);
02424 }
02425 else {
02426 PP_LINE_TYPE = Comment_Line;
02427 }
02428 }
02429 else {
02430
02431 PP_IDX = NXT_COL(2);
02432 in_format = FALSE;
02433 PP_LINE_TYPE = Dir_Line;
02434 PP_DIR_PREFIX = Cdbg_Dir;
02435 PP_ACTUAL_DIR_PREFIX = Cdbg_Dir;
02436
02437 idx = NXT_COL(6);
02438 }
02439 }
02440 # endif
02441 else {
02442 PP_LINE_TYPE = Comment_Line;
02443 }
02444 }
02445 else if (ch == star) {
02446 if ((ch = nxt_line[NXT_COL(2)]) == dollar &&
02447 (ch = nxt_line[NXT_COL(3)]) == star) {
02448
02449
02450
02451 PP_PREFIX_LEN = 3;
02452
02453 first_line = FALSE;
02454
02455
02456 MARK_CHAR_CONST(nxt_line[NXT_COL(2)]);
02457
02458
02459 if ((ch = nxt_line[NXT_COL(4)]) == amp) {
02460
02461 if (IS_DIR_CONTINUATION(Cstar_Dir)) {
02462
02463 PP_LINE_TYPE = Dir_Continuation_Line;
02464 PP_ACTUAL_DIR_PREFIX = Cstar_Dir;
02465 in_format = FALSE;
02466 PP_IDX = NXT_COL(4);
02467 }
02468 else {
02469 PP_LINE_TYPE = Comment_Line;
02470 }
02471 }
02472 else {
02473
02474 PP_IDX = NXT_COL(1);
02475 in_format = FALSE;
02476 PP_LINE_TYPE = Dir_Line;
02477 PP_DIR_PREFIX = Cstar_Dir;
02478 PP_ACTUAL_DIR_PREFIX = Cstar_Dir;
02479
02480 idx = NXT_COL(4);
02481
02482 # if defined(GENERATE_WHIRL)
02483 if (! is_star_directive(idx)) {
02484 PP_LINE_TYPE = Comment_Line;
02485 }
02486 # else
02487 if ((! dump_flags.mp &&
02488 ! on_off_flags.preprocess_only) ||
02489 ! is_star_directive(idx)) {
02490 PP_LINE_TYPE = Comment_Line;
02491 }
02492 # endif
02493 }
02494 }
02495 else {
02496 PP_LINE_TYPE = Comment_Line;
02497 }
02498 }
02499 else if (ch == bang | ch == star) {
02500 PP_LINE_TYPE = Comment_Line;
02501 }
02502 else {
02503
02504 do {
02505 if (nxt_line[++PP_IDX] == tab) {
02506
02507
02508
02509
02510
02511
02512
02513
02514 if (IS_1TO9(nxt_line[PP_IDX+1])) {
02515 cont_col = PP_IDX+1;
02516 }
02517 else {
02518 cont_col = PP_IDX;
02519 }
02520 }
02521 }
02522 while (PP_IDX < cont_col);
02523
02524 if (nxt_line[cont_col] == zero) {
02525 nxt_line[cont_col] = blank;
02526 }
02527
02528 PP_IDX = NXT_COL(NULL_IDX);
02529
02530 do {
02531 ch = nxt_line[++PP_IDX];
02532 }
02533 while (ch == blank | ch == tab);
02534
02535 if (ch == newline) {
02536 PP_EOL = PP_IDX;
02537 PP_LINE_TYPE = Comment_Line;
02538 }
02539 else if (ch == bang) {
02540 if (PP_IDX == cont_col) {
02541 PP_LINE_TYPE = Continuation_Line;
02542 }
02543 else {
02544 PP_LINE_TYPE = Comment_Line;
02545 }
02546 }
02547 else if (PP_IDX > cont_col) {
02548 PP_IDX--;
02549 PP_LINE_TYPE = Regular_Line;
02550 format_idx = -1;
02551 in_format = FALSE;
02552 }
02553 else if (PP_IDX < cont_col) {
02554
02555 label = TRUE;
02556
02557
02558 i = PP_IDX;
02559 while (i < cont_col) {
02560
02561 if (nxt_line[i] == blank ||
02562 nxt_line[i] == tab ||
02563 (nxt_line[i] >= zero && nxt_line[i] <= nine)) {
02564
02565 i++;
02566 }
02567 else {
02568 label = FALSE;
02569 break;
02570 }
02571 }
02572
02573 if (label) {
02574
02575 if (nxt_line[cont_col] != blank &&
02576 nxt_line[cont_col] != tab) {
02577
02578
02579
02580 if (issue_classify_msg) {
02581 ntr_next_msg_queue(PP_LINE_NUM, 56, Error,
02582 nxt_line_col[PP_IDX],
02583 (char *)NULL,
02584 0,
02585 NO_ARG);
02586 }
02587
02588 PP_IDX = cont_col;
02589 PP_LINE_TYPE = Continuation_Line;
02590 }
02591 else {
02592 PP_LABEL = TRUE;
02593 PP_IDX--;
02594 PP_LINE_TYPE = Regular_Line;
02595 format_idx = 0;
02596 in_format = FALSE;
02597 }
02598 }
02599 else {
02600
02601
02602
02603 if (issue_classify_msg) {
02604 ntr_next_msg_queue(PP_LINE_NUM, 400, Error,
02605 nxt_line_col[PP_IDX],
02606 (char *)NULL,
02607 0,
02608 NO_ARG);
02609 }
02610
02611 if (nxt_line[cont_col] != blank &&
02612 nxt_line[cont_col] != tab) {
02613 PP_IDX = cont_col;
02614 PP_LINE_TYPE = Continuation_Line;
02615 }
02616 else {
02617 PP_IDX = cont_col;
02618 PP_LINE_TYPE = Regular_Line;
02619 format_idx = -1;
02620 in_format = FALSE;
02621 }
02622 }
02623 }
02624 else {
02625 PP_LINE_TYPE = Continuation_Line;
02626
02627 if (! valid_f90_char[nxt_line[cont_col]] &&
02628 issue_classify_msg) {
02629 err_str[0] = nxt_line[cont_col];
02630 err_str[1] = '\0';
02631 ntr_next_msg_queue(PP_LINE_NUM, 799, Ansi,
02632 nxt_line_col[cont_col],
02633 err_str,
02634 0,
02635 STR_ARG);
02636 }
02637 }
02638
02639 if (first_line && PP_LINE_TYPE != Comment_Line) {
02640
02641 if (PP_LINE_TYPE == Continuation_Line && issue_classify_msg) {
02642 ntr_next_msg_queue(PP_LINE_NUM, 211, Error,
02643 nxt_line_col[cont_col],
02644 (char *)NULL,
02645 0,
02646 NO_ARG);
02647 }
02648
02649 first_line = FALSE;
02650 }
02651 }
02652
02653 if (PP_LINE_TYPE == Regular_Line |
02654 PP_LINE_TYPE == Dir_Line |
02655 PP_LINE_TYPE == Dir_Continuation_Line |
02656 PP_LINE_TYPE == Continuation_Line) {
02657 idx = NXT_COL(0);
02658
02659 if (PP_LINE_TYPE != Continuation_Line &&
02660 PP_LINE_TYPE != Dir_Continuation_Line) {
02661 previous_char = 0;
02662 }
02663
02664
02665
02666
02667
02668
02669
02670
02671 if (format_idx >= 0) {
02672
02673 if (PP_IDX > cont_col) {
02674 idx = PP_IDX;
02675 }
02676 else {
02677 idx = cont_col;
02678 }
02679
02680 ich = nxt_line[idx];
02681 while ((format_idx < 7) && (ich)) {
02682
02683 do {
02684 ich = nxt_line[++idx];
02685 }
02686 while (ich == blank | ich == tab);
02687
02688 if ((ich == newline) | (ich == bang)) {
02689 PP_EOL = idx;
02690 break;
02691 }
02692 if (! ((ich == format_str[format_idx][0]) |
02693 (ich == format_str[format_idx][1]))) {
02694 format_idx = -1;
02695 idx--;
02696 break;
02697 }
02698 format_idx++;
02699
02700 }
02701
02702 if (format_idx == 7) {
02703
02704 in_format = TRUE;
02705 format_idx = -1;
02706 previous_char = ich;
02707 }
02708 }
02709
02710
02711 if (format_idx < 0) {
02712
02713 if (PP_LINE_TYPE != Continuation_Line &&
02714 PP_LINE_TYPE != Dir_Continuation_Line) {
02715 char_delim = 0;
02716 digit_start = 0;
02717 seen_lp_eq_slash = FALSE;
02718 }
02719
02720 if (idx == NXT_COL(0)) {
02721 idx = PP_IDX;
02722 }
02723
02724 if (PP_LINE_TYPE == Continuation_Line &&
02725 prev_char_delim != 0 &&
02726 idx == cont_col &&
02727 nxt_line[idx + 1] == prev_char_delim) {
02728
02729
02730
02731
02732 if (nxt_line_num_lines > 1) {
02733 MARK_CHAR_CONST(nxt_line[prev_char_delim_idx]);
02734 }
02735 else {
02736 MARK_CHAR_CONST(stmt_buf[stmt_line_start_idx[lines_in_buf] +
02737 prev_char_delim_idx - 1]);
02738 }
02739 idx++;
02740 MARK_CHAR_CONST(nxt_line[idx]);
02741 nxt_line[idx] |= (1 << 9);
02742
02743
02744
02745
02746 char_delim = prev_char_delim;
02747 }
02748
02749 prev_char_delim = 0;
02750
02751
02752
02753
02754
02755 do {
02756 while (char_delim == 0) {
02757 ich = nxt_line[++idx];
02758
02759
02760
02761 while ((ich == blank) |
02762 (ich == tab)) {
02763 ich = nxt_line[++idx];
02764 }
02765
02766
02767
02768
02769 if ((ich == newline) |
02770 (ich == bang)) {
02771 PP_EOL = idx;
02772 idx = 0;
02773 break;
02774 }
02775
02776 else if (ich == semi_colon) {
02777 digit_start = 0;
02778 in_format = FALSE;
02779 seen_lp_eq_slash = FALSE;
02780 }
02781
02782 else if ((ich == quote) |
02783 (ich == db_quote)) {
02784 char_delim = ich;
02785 digit_start = 0;
02786 }
02787
02788 else if ((in_format) && (ich == star)) {
02789 char_delim = ich;
02790 digit_start = 0;
02791 }
02792
02793 else if (ich != EOF &&
02794 ch_class[(char)ich] == Ch_Class_Digit) {
02795
02796 if (digit_start == 0) {
02797
02798 if (PP_LINE_TYPE != Continuation_Line &&
02799 PP_LINE_TYPE != Dir_Continuation_Line) {
02800 digit_start = idx;
02801 }
02802 else if (nxt_line_num_lines > 1) {
02803 digit_start = idx;
02804 }
02805 else {
02806 digit_start = stmt_line_end_idx[lines_in_buf] + idx;
02807 }
02808 num_idx = 0;
02809 }
02810 else {
02811 num_idx++;
02812 }
02813 if (num_idx <= 4) {
02814 num_str[num_idx] = ich;
02815 num_str[num_idx + 1] = '\0';
02816 }
02817
02818
02819 continue;
02820 }
02821
02822 else if ((ich == lparen) |
02823 (ich == equal) |
02824 (ich == slash)) {
02825 seen_lp_eq_slash = TRUE;
02826 digit_start = 0;
02827 }
02828
02829
02830
02831 else if ((digit_start) && (previous_char)) {
02832 if (in_format) {
02833 if ((ich == lc_h) | (ich == uc_h)) {
02834
02835 sscanf(num_str, "%d",&char_delim);
02836 char_delim = - char_delim;
02837 }
02838 }
02839 else if ((ich == lc_h) |
02840 (ich == lc_r) |
02841 (ich == lc_l) |
02842 (ich == uc_h) |
02843 (ich == uc_r) |
02844 (ich == uc_l)) {
02845
02846 if (previous_char == star) {
02847
02848 if (seen_lp_eq_slash) {
02849 sscanf(num_str,"%d",&char_delim);
02850 char_delim = - char_delim;
02851 }
02852 }
02853 else if (previous_char == EOF) {
02854
02855
02856
02857 sscanf(num_str,"%d",&char_delim);
02858 char_delim = - char_delim;
02859 }
02860 else if (ch_class[previous_char] != Ch_Class_Letter &&
02861 previous_char != dollar &&
02862 previous_char != at_sign &&
02863 previous_char != underscore) {
02864 sscanf(num_str,"%d",&char_delim);
02865 char_delim = - char_delim;
02866 }
02867 }
02868 digit_start = 0;
02869
02870 }
02871
02872
02873
02874 previous_char = ich;
02875
02876 }
02877
02878
02879
02880
02881 if (char_delim) {
02882 previous_char = ' ';
02883
02884
02885
02886 if (char_delim < 0) {
02887
02888
02889 for (; char_delim < 0; char_delim++) {
02890 if (nxt_line[++idx] == newline) {
02891 if (idx <= NXT_COL(PP_ORIG_SIZE)) {
02892 shift_to_line_size((NXT_COL(PP_ORIG_SIZE)-idx)+1);
02893 nxt_line[idx] = marked_blank;
02894 for (i = idx + 1; i <= NXT_COL(PP_ORIG_SIZE); i++) {
02895 nxt_line[i] = blank;
02896 }
02897 nxt_line[i] = newline;
02898 PP_EOL = NXT_COL(PP_ORIG_SIZE) + 1;
02899 }
02900 else {
02901 PP_EOL = idx;
02902 idx = 0;
02903 break;
02904 }
02905 }
02906 else {
02907 MARK_CHAR_CONST(nxt_line[idx]);
02908 }
02909 }
02910 }
02911 else {
02912
02913
02914
02915 while (TRUE) {
02916 if (nxt_line[++idx] == newline) {
02917 if (idx <= NXT_COL(PP_ORIG_SIZE)) {
02918 shift_to_line_size((NXT_COL(PP_ORIG_SIZE)-idx)+1);
02919
02920 for (; idx <= NXT_COL(PP_ORIG_SIZE); idx++) {
02921 nxt_line[idx] = marked_blank;
02922 }
02923 nxt_line[idx] = newline;
02924 }
02925 PP_EOL = NXT_COL(PP_ORIG_SIZE) + 1;
02926 idx = 0;
02927 break;
02928 }
02929 else if (nxt_line[idx] == char_delim) {
02930 if (nxt_line[idx + 1] == char_delim) {
02931 MARK_CHAR_CONST(nxt_line[idx]);
02932 ++idx;
02933 MARK_CHAR_CONST(nxt_line[idx]);
02934 nxt_line[idx] |= (1 << 9);
02935 }
02936 else if (nxt_line[idx + 1] == newline &&
02937 idx == NXT_COL(PP_ORIG_SIZE)) {
02938
02939 prev_char_delim = char_delim;
02940 prev_char_delim_idx = idx;
02941 char_delim = 0;
02942 break;
02943 }
02944 else {
02945
02946 char_delim = 0;
02947 break;
02948 }
02949 } else {
02950 MARK_CHAR_CONST(nxt_line[idx]);
02951 }
02952 }
02953 }
02954
02955 }
02956 }
02957 while (idx);
02958
02959 }
02960 }
02961
02962
02963 if (PP_LINE_TYPE == Regular_Line) {
02964 nxt_idx = cont_col;
02965
02966 do {
02967 ch = nxt_line[++nxt_idx];
02968 }
02969 while (ch == blank | ch == tab);
02970
02971 if (ch == uc_i | ch == lc_i) {
02972 incl_idx = NULL_IDX;
02973
02974 do {
02975 ch_tmp = ch;
02976 if (islower(ch_tmp)) {
02977 ch = TOUPPER(ch_tmp);
02978 }
02979 include_file[incl_idx++] = ch;
02980
02981 do {
02982 ch = nxt_line[++nxt_idx];
02983 }
02984 while (ch == blank | ch == tab);
02985 }
02986 while (incl_idx < 7 && ch != eos);
02987
02988 include_file[incl_idx] = EOS;
02989
02990 if (EQUAL_STRS(include_file, "INCLUDE")) {
02991 if (ch == quote | ch == db_quote) {
02992 PP_LINE_TYPE = Comment_Line;
02993
02994
02995 delim = ch;
02996 incl_idx = NULL_IDX;
02997
02998 while ((ch = nxt_line[++nxt_idx]) != delim && ch != eos) {
02999 if (incl_idx < MAX_FILE_NAME_SIZE) {
03000 include_file[incl_idx++] = ch;
03001 }
03002 else if (incl_idx == MAX_FILE_NAME_SIZE) {
03003
03004
03005
03006 ntr_next_msg_queue(PP_LINE_NUM, 57, Error,
03007 nxt_line_col[nxt_idx],
03008 (char *)NULL,
03009 (MAX_FILE_NAME_SIZE - 1),
03010 ARG_ARG);
03011 }
03012 }
03013 include_file[incl_idx] = eos;
03014
03015 if (incl_idx == NULL_IDX) {
03016 ntr_next_msg_queue(PP_LINE_NUM, 58, Error,
03017 nxt_line_col[nxt_idx],
03018 (char *)NULL,
03019 0,
03020 NO_ARG);
03021 }
03022 else if (ch == eos) {
03023 ntr_next_msg_queue(PP_LINE_NUM, 59, Error,
03024 nxt_line_col[NXT_COL(PP_ORIG_SIZE)],
03025 (char *)NULL,
03026 0,
03027 NO_ARG);
03028 }
03029 else {
03030
03031 do {
03032 ch = nxt_line[++nxt_idx];
03033 }
03034 while (ch == blank | ch == tab);
03035
03036 if (ch != newline && ch != bang) {
03037
03038
03039
03040 ntr_next_msg_queue(PP_LINE_NUM, 60, Error,
03041 nxt_line_col[nxt_idx],
03042 (char *)NULL,
03043 0,
03044 NO_ARG);
03045 }
03046 else if (PP_IDX < cont_col) {
03047
03048
03049
03050 ntr_next_msg_queue(PP_LINE_NUM, 61, Error,
03051 nxt_line_col[PP_IDX],
03052 (char *)NULL,
03053 0,
03054 NO_ARG);
03055 }
03056 else {
03057 PP_LINE_TYPE = Include_Line;
03058 }
03059 }
03060 }
03061 }
03062 }
03063 }
03064
03065 if (!issue_obsolete_src_form_msg && !PP_CHANGE_SOURCE_FORM &&
03066 issue_classify_msg) {
03067 issue_obsolete_src_form_msg = TRUE;
03068 ntr_next_msg_queue(PP_LINE_NUM, 1582, Comment, 0,
03069 (char *)NULL,
03070 0,
03071 NO_ARG);
03072 }
03073
03074 TRACE (Func_Exit, "fixed_classify_line", line_type_str[PP_LINE_TYPE]);
03075
03076 return;
03077
03078 }
03079
03080
03081
03082
03083
03084
03085
03086
03087
03088
03089
03090
03091
03092
03093
03094
03095
03096
03097
03098
03099
03100
03101
03102
03103
03104 static void free_get_stmt (void)
03105
03106 {
03107 int idx;
03108 int line_counter = 1;
03109 int loc_stmt_num;
03110 int save_idx;
03111 int stmt_buf_EOS;
03112
03113 TRACE (Func_Entry, "free_get_stmt", NULL);
03114
03115
03116
03117 issue_deferred_msgs();
03118
03119
03120 if (stmt_buf_type == EOF_Line) {
03121
03122 PRINTMSG (0, 50, Internal, 0);
03123 }
03124
03125 stmt_line_idx = NULL_IDX;
03126 stmt_buf_idx = NULL_IDX;
03127 lines_in_buf = 0;
03128 label_ok = TRUE;
03129
03130
03131 do {
03132
03133 save_idx = 0;
03134
03135
03136
03137 stmt_line_num[++stmt_line_idx] = nxt_line_num;
03138
03139
03140
03141 if (starting_pt) {
03142 stmt_line_offset[stmt_line_idx] = starting_pt - 2;
03143 }
03144 else {
03145 stmt_line_offset[stmt_line_idx] = nxt_line_idx - 1;
03146 }
03147
03148
03149
03150 stmt_line_start_idx[stmt_line_idx] = line_counter;
03151
03152
03153
03154 stmt_line_end_idx[stmt_line_idx] = nxt_line_EOL + line_counter - 1;
03155
03156
03157
03158 if (nxt_line_type != Continuation_Line &&
03159 nxt_line_type != Dir_Continuation_Line) {
03160 stmt_buf_type = nxt_line_type;
03161
03162 if (nxt_line_type == Dir_Line) {
03163 stmt_prefix_len = nxt_line_prefix_len;
03164 stmt_buf_dir_prefix = nxt_line_dir_prefix;
03165 }
03166
03167 if (stmt_buf_type != Comment_Line &&
03168 stmt_buf_type != Pound_Src_Line &&
03169 stmt_buf_type != Pound_Include_Exit_Line) {
03170 INCREMENT_STATEMENT_NUMBER;
03171 }
03172 }
03173
03174 if (stmt_buf_type == Dir_Line) {
03175 line_dir_prefix[stmt_line_idx] = nxt_line_actual_dir_prefix;
03176 }
03177
03178 move_up_next_msg_queue();
03179
03180
03181
03182 stmt_buf_idx = line_counter + nxt_line_EOL - 1;
03183 line_counter += nxt_line_EOL;
03184
03185 for (idx = nxt_line_EOL; idx > 0; idx --) {
03186 stmt_buf[stmt_buf_idx] = nxt_line[NXT_COL(idx)];
03187 stmt_buf_col[stmt_buf_idx] = nxt_line_col[NXT_COL(idx)];
03188 stmt_buf_idx--;
03189
03190 if (havent_issued_tab_ansi &&
03191 idx < nxt_line_EOL &&
03192 nxt_line[NXT_COL(idx)] == tab) {
03193 havent_issued_tab_ansi = FALSE;
03194 ntr_msg_queue(nxt_line_num, 899, Ansi,
03195 nxt_line_col[NXT_COL(idx)],
03196 (char *)NULL,
03197 0,
03198 NO_ARG);
03199 }
03200
03201 if (nxt_line[NXT_COL(idx)] == semi_colon &&
03202 stmt_buf_type != Dir_Line) {
03203 if ((idx > starting_pt) && (idx < nxt_line_EOL)) {
03204 save_idx = idx;
03205 }
03206 }
03207 }
03208
03209 lines_in_buf++;
03210
03211
03212
03213
03214
03215
03216
03217
03218 if (save_idx &&
03219 nxt_line_type != Comment_Line) {
03220
03221 stmt_buf_EOS = save_idx;
03222 idx = save_idx;
03223 while ((nxt_line[NXT_COL(idx)] == semi_colon) |
03224 (nxt_line[NXT_COL(idx)] == blank) |
03225 (nxt_line[NXT_COL(idx)] == tab)) {
03226 idx++;
03227 }
03228
03229
03230
03231 starting_pt = idx;
03232 nxt_line_type = Regular_Line;
03233 continuation_count = 0;
03234 include_found = FALSE;
03235 include_complete = FALSE;
03236 }
03237 else {
03238 stmt_buf_EOS = nxt_line_EOL;
03239 starting_pt = NULL_IDX;
03240 }
03241
03242
03243
03244
03245
03246 if ((stmt_buf_type != EOF_Line) &&
03247 (starting_pt == NULL_IDX)) {
03248
03249
03250 do {
03251
03252 nxt_line_type = Regular_Line;
03253
03254 if (get_nxt_line ()) {
03255
03256 if (include_switch) {
03257 update_global_line ();
03258 include_switch = FALSE;
03259 }
03260
03261 if (issue_pound_exit_line) {
03262 OUTPUT_POUND_INCLUDE_EXIT_LINE(curr_glb_line);
03263 issue_pound_exit_line = FALSE;
03264 }
03265
03266 nxt_line_mp_line = FALSE;
03267
03268 if (nxt_line_type != Cond_Comp_Line) {
03269 PP_ORIG_SIZE = line_size;
03270 classify_line();
03271 }
03272
03273 if (on_off_flags.save_dot_i) {
03274
03275 if (ignore_source_line ||
03276 nxt_line_type == Cond_Comp_Line ||
03277 nxt_line_type == Include_Line) {
03278
03279
03280 fprintf(dot_i_fptr, "\n");
03281 previous_global_line++;
03282 }
03283 else {
03284 print_nxt_line();
03285 }
03286 }
03287
03288 switch (nxt_line_type) {
03289 case Comment_Line:
03290 break;
03291
03292 case Cond_Comp_Line:
03293 if (parse_cc_line()) {
03294
03295
03296
03297 nxt_line_type = Include_Line;
03298 include_stmt_file_line = SRC_STK_FILE_LINE(src_stk_idx);
03299
03300 if (open_include_file (TRUE)) {
03301 include_found = TRUE;
03302 include_switch = TRUE;
03303 }
03304 }
03305 else {
03306 nxt_line_type = Comment_Line;
03307 }
03308 angle_brkt_include = FALSE;
03309 break;
03310
03311 case Dir_Line:
03312 case Regular_Line:
03313 continuation_count = 0;
03314 include_found = FALSE;
03315 include_complete = FALSE;
03316 break;
03317
03318 case Continuation_Line:
03319 case Dir_Continuation_Line:
03320
03321 if (++continuation_count == MAX_ANSI_FREE_LINES) {
03322
03323
03324
03325 ntr_msg_queue(nxt_line_num, 52, Ansi,
03326 nxt_line_idx,
03327 "free",
03328 (MAX_ANSI_FREE_LINES - 1),
03329 ARG_STR_ARG);
03330 }
03331
03332 if (continuation_count == MAX_FREE_LINES) {
03333
03334
03335
03336 ntr_msg_queue(nxt_line_num, 525, Error,
03337 CONTINUE_COLUMN,
03338 (char *)NULL,
03339 0,
03340 NO_ARG);
03341 }
03342
03343 if (continuation_count >= MAX_FREE_LINES) {
03344 nxt_line_type = Comment_Line;
03345 break;
03346 }
03347
03348 if (include_found) {
03349
03350
03351
03352 ntr_msg_queue(nxt_line_num, 53, Error,
03353 nxt_line_idx,
03354 (char *)NULL,
03355 0,
03356 NO_ARG);
03357
03358 include_found = FALSE;
03359 }
03360
03361 if (include_complete) {
03362
03363
03364
03365 ntr_msg_queue(nxt_line_num, 54, Error,
03366 nxt_line_idx,
03367 (char *)NULL,
03368 0,
03369 NO_ARG);
03370
03371 include_complete = FALSE;
03372 }
03373
03374 if (cif_flags & MISC_RECS) {
03375 cif_cont_line_rec(
03376 (nxt_line_type == Continuation_Line) ? 0 : 1,
03377 nxt_line_num);
03378 }
03379
03380 break;
03381
03382 case Pound_Src_Line:
03383 break;
03384
03385 case Pound_Include_Exit_Line:
03386 include_complete = TRUE;
03387 nxt_line_type = Comment_Line;
03388 curr_glb_line--;
03389 SRC_STK_FILE_LINE(src_stk_idx)--;
03390 GL_SOURCE_LINES(SRC_STK_GLOBAL_LINE_IDX(src_stk_idx)) =
03391 SRC_STK_FILE_LINE(src_stk_idx);
03392 set_related_gl_source_lines(
03393 SRC_STK_GLOBAL_LINE_IDX(src_stk_idx));
03394
03395 if (source_form != SRC_STK_PREV_SRC_FORM(src_stk_idx)) {
03396 change_source_form = TRUE;
03397 }
03398 POP_SRC;
03399 include_switch = TRUE;
03400 break;
03401
03402 case Pound_Include_Enter_Line:
03403 case Include_Line:
03404
03405 include_stmt_file_line = SRC_STK_FILE_LINE(src_stk_idx);
03406
03407 if (open_include_file (FALSE)) {
03408 include_found = TRUE;
03409 include_switch = TRUE;
03410 }
03411 break;
03412 }
03413 }
03414 else {
03415
03416
03417
03418 if (cmd_line_flags.pp_macro_expansion) {
03419 pp_line_idx++;
03420 }
03421
03422 if (expected_line == Continuation_Line) {
03423 ntr_msg_queue(stmt_line_num[lines_in_buf], 539, Error,
03424 stmt_line_end_idx[lines_in_buf] -
03425 stmt_line_start_idx[lines_in_buf] + 1,
03426 (char *)NULL,
03427 0,
03428 NO_ARG);
03429 }
03430
03431
03432
03433 if (src_stk_idx > SRC_STK_BASE_IDX) {
03434 include_complete = TRUE;
03435 nxt_line_type = Comment_Line;
03436 nxt_line_EOL = 2;
03437 curr_glb_line--;
03438
03439 GL_SOURCE_LINES(SRC_STK_GLOBAL_LINE_IDX(src_stk_idx)) =
03440 SRC_STK_FILE_LINE(src_stk_idx);
03441 set_related_gl_source_lines(
03442 SRC_STK_GLOBAL_LINE_IDX(src_stk_idx));
03443
03444 if (source_form != SRC_STK_PREV_SRC_FORM(src_stk_idx)) {
03445 change_source_form = TRUE;
03446 }
03447 POP_SRC;
03448 include_switch = TRUE;
03449 issue_pound_exit_line = TRUE;
03450 break;
03451 }
03452 else {
03453 GL_SOURCE_LINES(SRC_STK_GLOBAL_LINE_IDX(src_stk_idx)) =
03454 SRC_STK_FILE_LINE(src_stk_idx);
03455 set_related_gl_source_lines(
03456 SRC_STK_GLOBAL_LINE_IDX(src_stk_idx));
03457 nxt_line_type = EOF_Line;
03458 nxt_line_EOL = 2;
03459 }
03460 }
03461 }
03462 while (nxt_line_type == Comment_Line |
03463 nxt_line_type == Include_Line |
03464 nxt_line_type == Pound_Include_Enter_Line);
03465 }
03466 }
03467 while (nxt_line_type == Continuation_Line ||
03468 nxt_line_type == Dir_Continuation_Line);
03469
03470 if (prev_statement_number != statement_number) {
03471 loc_stmt_num = statement_number;
03472 statement_number = prev_statement_number;
03473 prev_statement_number = loc_stmt_num;
03474 }
03475
03476 stmt_buf_EOS_idx = stmt_line_start_idx[lines_in_buf] + stmt_buf_EOS - 1;
03477 stmt_EOS_la_ch.line = stmt_line_num[lines_in_buf];
03478 stmt_EOS_la_ch.column = stmt_buf_col[stmt_buf_EOS_idx];
03479 stmt_EOS_la_ch.stmt_buf_idx = stmt_buf_EOS_idx;
03480 stmt_EOS_la_ch.stmt_num = statement_number;
03481
03482 stmt_buf_idx = stmt_line_offset[1] + 1;
03483 stmt_line_idx = SRC_STK_BASE_IDX;
03484
03485 PRINT_STMT_SRC();
03486
03487 TRACE (Func_Exit, "free_get_stmt", NULL);
03488
03489 return;
03490
03491 }
03492
03493
03494
03495
03496
03497
03498
03499
03500
03501
03502
03503
03504
03505
03506
03507
03508
03509
03510 static void free_classify_line (void)
03511
03512 {
03513 int ch;
03514 char delim;
03515 char form[5] = " ";
03516 boolean had_amp = FALSE;
03517 int i;
03518 int ich;
03519 int idx;
03520 int incl_idx;
03521 boolean label_found = FALSE;
03522 int line_num;
03523 char line_num_str[24];
03524 int save_curr_glb_line;
03525 int src_idx;
03526 int sv_amp;
03527
03528
03529
03530 TRACE (Func_Entry, "free_classify_line", NULL);
03531
03532 PP_EOL = nxt_line_end_idx[pp_line_idx] - 1;
03533 PP_EXPECTED_LINE = expected_line;
03534
03535
03536 START:
03537
03538 ch = nxt_line[NXT_COL(1)];
03539
03540 # ifdef _FRONTEND_CONDITIONAL_COMP
03541 if (ch == pound &&
03542 on_off_flags.preprocess) {
03543
03544 PP_LINE_TYPE = Cond_Comp_Line;
03545 } else
03546 # endif
03547 if (is_pound_line_dir()) {
03548 PP_IDX = NXT_COL(2);
03549 ch = nxt_line[PP_IDX];
03550
03551 while (ch == blank | ch == tab) {
03552 PP_IDX++;
03553 ch = nxt_line[PP_IDX];
03554 }
03555
03556 if (isdigit(ch)) {
03557 idx = 0;
03558 line_num_str[idx++] = ch;
03559 ch = nxt_line[++PP_IDX];
03560 while (isdigit(ch)) {
03561 line_num_str[idx++] = ch;
03562 ch = nxt_line[++PP_IDX];
03563 }
03564
03565 line_num_str[idx] = '\0';
03566 line_num = atoi(line_num_str);
03567
03568 while (ch == blank | ch == tab) {
03569 PP_IDX++;
03570 ch = nxt_line[PP_IDX];
03571 }
03572
03573 if (ch == quote | ch == db_quote) {
03574 char_delim = ch;
03575 ch = nxt_line[++PP_IDX];
03576
03577 idx = 0;
03578 while (ch != char_delim) {
03579 include_file[idx++] = ch;
03580 ch = nxt_line[++PP_IDX];
03581 }
03582 include_file[idx] = '\0';
03583
03584 ch = nxt_line[++PP_IDX];
03585 while (ch == blank | ch == tab) {
03586 PP_IDX++;
03587 ch = nxt_line[PP_IDX];
03588 }
03589
03590 if (ch == '1') {
03591 PP_LINE_TYPE = Pound_Include_Enter_Line;
03592 }
03593 else if (ch == '2') {
03594 PP_LINE_TYPE = Pound_Include_Exit_Line;
03595 }
03596 else {
03597 PP_LINE_TYPE = Comment_Line;
03598
03599
03600
03601
03602 save_curr_glb_line = curr_glb_line;
03603 curr_glb_line = line_num + GL_GLOBAL_LINE(global_line_tbl_idx) -
03604 GL_FILE_LINE(global_line_tbl_idx);
03605 curr_glb_line--;
03606
03607 if (first_pound_line) {
03608 PP_LINE_TYPE = Pound_Src_Line;
03609 change_orig_src_file = TRUE;
03610 strcpy(pound_file, include_file);
03611 }
03612 else {
03613 SRC_STK_FILE_LINE(src_stk_idx) +=
03614 curr_glb_line - save_curr_glb_line;
03615 }
03616 }
03617
03618 first_pound_line = FALSE;
03619
03620 }
03621 else if (ch == newline) {
03622
03623 PP_LINE_TYPE = Comment_Line;
03624
03625
03626
03627
03628 save_curr_glb_line = curr_glb_line;
03629 curr_glb_line = line_num + GL_GLOBAL_LINE(global_line_tbl_idx) -
03630 GL_FILE_LINE(global_line_tbl_idx);
03631 curr_glb_line--;
03632
03633 SRC_STK_FILE_LINE(src_stk_idx) +=
03634 curr_glb_line - save_curr_glb_line;
03635
03636 first_pound_line = FALSE;
03637 }
03638 else {
03639 PP_LINE_TYPE = Comment_Line;
03640 }
03641 }
03642 else {
03643 PP_LINE_TYPE = Comment_Line;
03644 }
03645 }
03646 else if (ignore_source_line) {
03647 PP_LINE_TYPE = Comment_Line;
03648 }
03649 else {
03650
03651 PP_IDX = NXT_COL(