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
00044
00045 static char USMID[] = "\n@(#)5.0_pl/sources/p_utils.c 5.5 09/09/99 12:47:48\n";
00046
00047 # include "defines.h"
00048
00049 # include "host.m"
00050 # include "host.h"
00051 # include "target.m"
00052 # include "target.h"
00053
00054 # include "globals.m"
00055 # include "tokens.m"
00056 # include "sytb.m"
00057 # include "p_globals.m"
00058 # include "debug.m"
00059
00060 # include "globals.h"
00061 # include "tokens.h"
00062 # include "sytb.h"
00063 # include "p_globals.h"
00064
00065
00066
00067
00068
00069
00070 static boolean create_kwd_text(opnd_type *, boolean);
00071 static void check_cmic_blk_branches(int, int, int, int);
00072 static void block_err_string(operator_type, char *, int *);
00073
00074 extern boolean star_expected;
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094 boolean matched_specific_token (token_values_type specific_token,
00095 token_class_type token_class)
00096 {
00097 boolean match = FALSE;
00098 la_type save_la;
00099 token_type save_token;
00100 boolean valid_token;
00101
00102
00103 TRACE (Func_Entry, "matched_specific_token", NULL);
00104
00105 if (LA_CH_CLASS == Ch_Class_EOS && specific_token != Tok_EOS) {
00106
00107
00108
00109
00110 match = FALSE;
00111 }
00112 else {
00113 save_token = token;
00114 save_la = la_ch;
00115 valid_token = get_token (token_class);
00116
00117 if (valid_token && TOKEN_VALUE(token) == specific_token) {
00118 match = TRUE;
00119 }
00120 else {
00121 token = save_token;
00122 la_ch = save_la;
00123 reset_src_input(LA_CH_BUF_IDX, LA_CH_STMT_NUM);
00124 }
00125 }
00126
00127 TRACE (Func_Exit, "matched_specific_token",
00128 (match ? TOKEN_STR(token) : NULL));
00129 return (match);
00130
00131 }
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182 boolean parse_err_flush (search_type rule,
00183 char *str)
00184
00185 {
00186 #ifdef KEY
00187 boolean found_end = FALSE;
00188 #else
00189 boolean found_end;
00190 #endif
00191 char *new_str;
00192 int paren_level;
00193 boolean found;
00194
00195
00196 TRACE (Func_Entry, "parse_err_flush", search_str[rule]);
00197
00198 if (str != NULL) {
00199 LA_CH_TO_ERR_STR(new_str, la_ch);
00200 PRINTMSG(LA_CH_LINE, 197, Error, LA_CH_COLUMN, str, new_str);
00201 }
00202
00203 if (rule == Find_EOS) {
00204 flush_LA_to_EOS();
00205 found_end = TRUE;
00206 }
00207 else if (rule != Find_None) {
00208
00209
00210 paren_level = 0;
00211 found = FALSE;
00212 found_end = FALSE;
00213
00214 if (rule == Find_Ref_End) {
00215
00216 if (LA_CH_CLASS != Ch_Class_Symbol &&
00217 LA_CH_VALUE != EOS) {
00218 flush_LA_to_symbol();
00219 }
00220 paren_level = 0;
00221 }
00222
00223 do {
00224
00225 if (rule == Find_Ref_End && paren_level == 0) {
00226 found = TRUE;
00227 }
00228
00229 switch (LA_CH_VALUE) {
00230 case RPAREN:
00231 if (paren_level == 0) {
00232
00233
00234
00235
00236 if (rule == Find_Rparen || rule == Find_Comma_Rparen ||
00237 rule == Find_Expr_End) {
00238 found = TRUE;
00239 }
00240 }
00241 else {
00242 paren_level--;
00243
00244 if (paren_level == 0 && rule == Find_Matching_Rparen) {
00245 found = TRUE;
00246 }
00247 else if (rule == Find_Ref_End) {
00248 found = FALSE;
00249 }
00250 }
00251 break;
00252
00253 case LPAREN:
00254 if (rule == Find_Lparen) {
00255 found = TRUE;
00256 }
00257 else {
00258 paren_level++;
00259
00260 if (rule == Find_Ref_End) {
00261 found = FALSE;
00262 }
00263 }
00264 break;
00265
00266 case COMMA:
00267 if (paren_level == 0 && rule >= Find_Comma) {
00268 found = TRUE;
00269 }
00270 break;
00271
00272 case SLASH:
00273
00274
00275
00276 if (paren_level == 0 && rule == Find_Comma_Slash) {
00277 found = TRUE;
00278 }
00279 else if (rule == Find_Expr_End &&
00280 paren_level == 0 &&
00281 matched_specific_token(Tok_Punct_Rbrkt,
00282 Tok_Class_Punct)) {
00283 found = TRUE;
00284 reset_lex(TOKEN_BUF_IDX(token), TOKEN_STMT_NUM(token));
00285 }
00286 break;
00287
00288 case COLON:
00289 if (rule == Find_Expr_End &&
00290 matched_specific_token(Tok_Punct_Colon,
00291 Tok_Class_Punct)) {
00292 found = TRUE;
00293 reset_lex(TOKEN_BUF_IDX(token), TOKEN_STMT_NUM(token));
00294 }
00295 else if (colon_recovery &&
00296 matched_specific_token(Tok_Punct_Colon_Colon,
00297 Tok_Class_Punct)) {
00298 found = TRUE;
00299 found_end = TRUE;
00300 reset_lex(TOKEN_BUF_IDX(token), TOKEN_STMT_NUM(token));
00301 }
00302 break;
00303
00304 case EOS:
00305 found = TRUE;
00306 found_end = TRUE;
00307 break;
00308
00309 case PERCENT:
00310 case USCORE:
00311 case DOLLAR:
00312 case AT_SIGN:
00313
00314 if (rule == Find_Ref_End) {
00315 found = FALSE;
00316 }
00317 break;
00318
00319 }
00320
00321 if (!found) {
00322 flush_LA_to_symbol();
00323 }
00324 }
00325 while (!found);
00326 }
00327
00328 TRACE (Func_Exit, "parse_err_flush", &LA_CH_VALUE);
00329
00330 return(!found_end);
00331
00332 }
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351 static boolean create_kwd_text(opnd_type *result_opnd,
00352 boolean function_call)
00353
00354 {
00355 int attr_idx;
00356 int ir_idx;
00357 int kwd_idx;
00358 opnd_type opnd;
00359 boolean parsed_ok = TRUE;
00360 la_type save_la;
00361 int type_idx;
00362
00363
00364 TRACE (Func_Entry, "create_kwd_text", NULL);
00365
00366
00367
00368 # ifdef _DEBUG
00369 if (LA_CH_VALUE != EQUAL) {
00370 PRINTMSG(TOKEN_LINE(token), 295, Internal, TOKEN_COLUMN(token),
00371 "create_kwd_text", "EQUAL");
00372 }
00373 # endif
00374
00375 NTR_IR_TBL(kwd_idx);
00376 OPND_FLD((*result_opnd)) = IR_Tbl_Idx;
00377 OPND_IDX((*result_opnd)) = kwd_idx;
00378 IR_FLD_L(kwd_idx) = CN_Tbl_Idx;
00379 IR_OPR(kwd_idx) = Kwd_Opr;
00380 IR_TYPE_IDX(kwd_idx) = TYPELESS_DEFAULT_TYPE;
00381
00382 IR_LINE_NUM(kwd_idx) = LA_CH_LINE;
00383 IR_COL_NUM(kwd_idx) = LA_CH_COLUMN;
00384
00385 IR_LINE_NUM_L(kwd_idx) = TOKEN_LINE(token);
00386 IR_COL_NUM_L(kwd_idx) = TOKEN_COLUMN(token);
00387
00388
00389
00390 CLEAR_TBL_NTRY(type_tbl, TYP_WORK_IDX);
00391 TYP_TYPE(TYP_WORK_IDX) = Character;
00392 TYP_LINEAR(TYP_WORK_IDX) = CHARACTER_DEFAULT_TYPE;
00393 TYP_CHAR_CLASS(TYP_WORK_IDX) = Const_Len_Char;
00394 TYP_FLD(TYP_WORK_IDX) = CN_Tbl_Idx;
00395 TYP_IDX(TYP_WORK_IDX) = C_INT_TO_CN(CG_INTEGER_DEFAULT_TYPE,
00396 TOKEN_LEN(token));
00397 type_idx = ntr_type_tbl();
00398 IR_IDX_L(kwd_idx) = ntr_const_tbl(type_idx,
00399 TRUE,
00400 (long_type *)&(TOKEN_STR_WD(token,0)));
00401
00402 NEXT_LA_CH;
00403
00404
00405
00406
00407 if (LA_CH_VALUE == STAR && !function_call) {
00408 NEXT_LA_CH;
00409
00410 if (LA_CH_CLASS == Ch_Class_Digit &&
00411 MATCHED_TOKEN_CLASS(Tok_Class_Label) &&
00412 ! TOKEN_ERR(token)) {
00413
00414 attr_idx = check_label_ref();
00415
00416 IR_FLD_R(kwd_idx) = AT_Tbl_Idx;
00417 IR_IDX_R(kwd_idx) = attr_idx;
00418 IR_LINE_NUM_R(kwd_idx) = TOKEN_LINE(token);
00419 IR_COL_NUM_R(kwd_idx) = TOKEN_COLUMN(token);
00420 }
00421 else if (TOKEN_ERR(token)) {
00422 parse_err_flush(Find_Comma_Rparen, NULL);
00423 parsed_ok = FALSE;
00424 }
00425 else {
00426 parse_err_flush(Find_Comma_Rparen, "LABEL");
00427 parsed_ok = FALSE;
00428 }
00429 }
00430 else {
00431
00432 if (LA_CH_VALUE == PERCENT) {
00433 save_la = la_ch;
00434 NEXT_LA_CH;
00435
00436 MATCHED_TOKEN_CLASS(Tok_Class_Id);
00437
00438 if (TOKEN_LEN(token) == 3 &&
00439 strncmp(TOKEN_STR(token), "VAL", 3) == 0 &&
00440 LA_CH_VALUE == LPAREN) {
00441
00442 NEXT_LA_CH;
00443
00444 NTR_IR_TBL(ir_idx);
00445 IR_OPR(ir_idx) = Percent_Val_Opr;
00446 IR_LINE_NUM(ir_idx) = save_la.line;
00447 IR_COL_NUM(ir_idx) = save_la.column;
00448 IR_FLD_R(kwd_idx) = IR_Tbl_Idx;
00449 IR_IDX_R(kwd_idx) = ir_idx;
00450
00451 parsed_ok = parse_expr(&opnd) && parsed_ok;
00452 COPY_OPND(IR_OPND_L(ir_idx), opnd);
00453
00454 if (LA_CH_VALUE != RPAREN) {
00455 parse_err_flush(Find_EOS,")");
00456 parsed_ok = FALSE;
00457 }
00458 else {
00459 NEXT_LA_CH;
00460 }
00461 }
00462 else {
00463 reset_lex(save_la.stmt_buf_idx, save_la.stmt_num);
00464 parsed_ok = parse_expr(&opnd) && parsed_ok;
00465 COPY_OPND(IR_OPND_R(kwd_idx), opnd);
00466 }
00467 }
00468 else {
00469 parsed_ok = parse_expr(&opnd) && parsed_ok;
00470 COPY_OPND(IR_OPND_R(kwd_idx), opnd);
00471 }
00472 }
00473
00474 TRACE (Func_Exit, "create_kwd_text", NULL);
00475
00476 return(parsed_ok);
00477
00478 }
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498 boolean parse_actual_arg_spec (opnd_type *result_opnd,
00499 boolean function_call,
00500 int pgm_attr_idx)
00501
00502 {
00503 int arg_cnt = 0;
00504 int attr_idx;
00505 boolean had_keyword = FALSE;
00506 int ir_idx;
00507 boolean issued_msg_128 = FALSE;
00508 int list_idx;
00509 int list2_idx;
00510 opnd_type opnd;
00511 boolean parsed_ok = TRUE;
00512 la_type save_la;
00513
00514
00515 TRACE (Func_Entry, "parse_actual_arg_spec", NULL);
00516
00517 # ifdef _DEBUG
00518 if (LA_CH_VALUE != LPAREN) {
00519
00520 PRINTMSG(TOKEN_LINE(token), 295, Internal, TOKEN_COLUMN(token),
00521 "parse_actual_arg_spec", "LPAREN");
00522 }
00523 # endif
00524
00525 OPND_FLD((*result_opnd)) = IL_Tbl_Idx;
00526 OPND_IDX((*result_opnd)) = NULL_IDX;
00527 list2_idx = NULL_IDX;
00528
00529 do {
00530 NEXT_LA_CH;
00531
00532 if (LA_CH_VALUE == RPAREN && arg_cnt == 0) {
00533 break;
00534 }
00535
00536 NTR_IR_LIST_TBL(list_idx);
00537 IL_ARG_DESC_VARIANT(list_idx) = TRUE;
00538
00539 if (list2_idx == NULL_IDX) {
00540 OPND_IDX((*result_opnd)) = list_idx;
00541 }
00542 else {
00543 IL_NEXT_LIST_IDX(list2_idx) = list_idx;
00544 }
00545 list2_idx = list_idx;
00546
00547 if (LA_CH_VALUE == STAR && !function_call) {
00548
00549 NEXT_LA_CH;
00550
00551 if (LA_CH_CLASS == Ch_Class_Digit &&
00552 MATCHED_TOKEN_CLASS(Tok_Class_Label) &&
00553 ! TOKEN_ERR(token)) {
00554
00555 attr_idx = check_label_ref();
00556 if (AT_OBJ_CLASS(pgm_attr_idx) == Pgm_Unit) {
00557 ATP_HAS_ALT_RETURN(pgm_attr_idx) = TRUE;
00558 }
00559
00560 IL_FLD(list_idx) = AT_Tbl_Idx;
00561 IL_IDX(list_idx) = attr_idx;
00562 IL_LINE_NUM(list_idx) = TOKEN_LINE(token);
00563 IL_COL_NUM(list_idx) = TOKEN_COLUMN(token);
00564 }
00565 else if (TOKEN_ERR(token)) {
00566 parse_err_flush(Find_Comma_Rparen, NULL);
00567 parsed_ok = FALSE;
00568 }
00569 else {
00570 parse_err_flush(Find_Comma_Rparen, "LABEL");
00571 parsed_ok = FALSE;
00572 }
00573 }
00574 else if (next_arg_is_kwd_equal()) {
00575 MATCHED_TOKEN_CLASS(Tok_Class_Id);
00576
00577
00578 had_keyword = TRUE;
00579
00580 parsed_ok = create_kwd_text(&opnd, function_call) && parsed_ok;
00581 COPY_OPND(IL_OPND(list_idx), opnd);
00582 }
00583 else {
00584
00585 if (had_keyword) {
00586
00587
00588 if (! issued_msg_128) {
00589 PRINTMSG(LA_CH_LINE, 128, Error,
00590 LA_CH_COLUMN,NULL);
00591 issued_msg_128 = TRUE;
00592 parsed_ok = FALSE;
00593 }
00594 }
00595
00596 if (LA_CH_VALUE == PERCENT) {
00597 save_la = la_ch;
00598 NEXT_LA_CH;
00599
00600 MATCHED_TOKEN_CLASS(Tok_Class_Id);
00601
00602 if (TOKEN_LEN(token) == 3 &&
00603 strncmp(TOKEN_STR(token), "VAL", 3) == 0 &&
00604 LA_CH_VALUE == LPAREN) {
00605
00606 NEXT_LA_CH;
00607
00608 NTR_IR_TBL(ir_idx);
00609 IR_OPR(ir_idx) = Percent_Val_Opr;
00610 IR_LINE_NUM(ir_idx) = save_la.line;
00611 IR_COL_NUM(ir_idx) = save_la.column;
00612 IL_FLD(list_idx) = IR_Tbl_Idx;
00613 IL_IDX(list_idx) = ir_idx;
00614
00615 parsed_ok = parse_expr(&opnd) && parsed_ok;
00616 COPY_OPND(IR_OPND_L(ir_idx), opnd);
00617
00618 if (LA_CH_VALUE != RPAREN) {
00619 parse_err_flush(Find_EOS,")");
00620 parsed_ok = FALSE;
00621 }
00622 else {
00623 NEXT_LA_CH;
00624 }
00625 }
00626 else {
00627 reset_lex(save_la.stmt_buf_idx, save_la.stmt_num);
00628 parsed_ok = parse_expr(&opnd) && parsed_ok;
00629 COPY_OPND(IL_OPND(list_idx), opnd);
00630 }
00631 }
00632 else {
00633 parsed_ok = parse_expr(&opnd) && parsed_ok;
00634 COPY_OPND(IL_OPND(list_idx), opnd);
00635 }
00636 }
00637
00638 arg_cnt++;
00639 }
00640 while (LA_CH_VALUE == COMMA);
00641
00642 OPND_LIST_CNT((*result_opnd)) = arg_cnt;
00643
00644
00645
00646 if (arg_cnt > max_call_list_size) {
00647 max_call_list_size = arg_cnt;
00648 }
00649
00650 if (LA_CH_VALUE != RPAREN) {
00651 parse_err_flush(Find_EOS,", or )");
00652 parsed_ok = FALSE;
00653 }
00654 else {
00655 NEXT_LA_CH;
00656 }
00657
00658 TRACE (Func_Exit, "parse_actual_arg_spec", NULL);
00659
00660 return(parsed_ok);
00661
00662 }
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682 boolean parse_deref (opnd_type *result_opnd,
00683 int struct_type_idx)
00684
00685 {
00686
00687 boolean ambiguous_ref = FALSE;
00688 int amb_attr_idx;
00689 int array_idx;
00690 int attr_idx;
00691 token_type attr_name;
00692 int check_attr;
00693 int col;
00694 int host_attr_idx;
00695 int host_name_idx;
00696 int i;
00697 int j;
00698 int ir_idx;
00699 int line;
00700 int list_idx;
00701 int list2_idx;
00702 int list3_idx;
00703 int name_idx;
00704 int new_attr_idx;
00705 int num_dims;
00706 opnd_type opnd;
00707 boolean parsed_ok = TRUE;
00708 int rank;
00709 int rslt_idx;
00710 int save_curr_scp_idx;
00711 int sn_idx;
00712 int struct_idx = NULL_IDX;
00713 int subs_idx = NULL_IDX;
00714 int substring_idx;
00715 token_type tmp_token;
00716 int trip_idx;
00717 int type_idx;
00718
00719
00720 TRACE (Func_Entry, "parse_deref", NULL);
00721
00722 attr_name = token;
00723
00724 if (struct_type_idx) {
00725 sn_idx = ATT_FIRST_CPNT_IDX(struct_type_idx);
00726 attr_idx = srch_linked_sn(TOKEN_STR(token),
00727 TOKEN_LEN(token),
00728 &sn_idx);
00729
00730 if (attr_idx == NULL_IDX) {
00731
00732 if (!AT_DCL_ERR(struct_type_idx)) {
00733 PRINTMSG(TOKEN_LINE(token), 213, Error,
00734 TOKEN_COLUMN(token), TOKEN_STR(token),
00735 AT_OBJ_NAME_PTR(struct_type_idx));
00736 }
00737 else {
00738 SH_ERR_FLG(curr_stmt_sh_idx) = TRUE;
00739 }
00740
00741 parse_err_flush(Find_Ref_End, NULL);
00742 parsed_ok = FALSE;
00743 goto EXIT;
00744 }
00745
00746 if (AT_USE_ASSOCIATED(struct_type_idx) &&
00747 ATT_PRIVATE_CPNT(struct_type_idx)) {
00748
00749 if (!AT_DCL_ERR(struct_type_idx)) {
00750 PRINTMSG(TOKEN_LINE(token), 882, Error,
00751 TOKEN_COLUMN(token),
00752 AT_OBJ_NAME_PTR(struct_type_idx),
00753 TOKEN_STR(token));
00754 }
00755 else {
00756 SH_ERR_FLG(curr_stmt_sh_idx) = TRUE;
00757 }
00758
00759 parse_err_flush(Find_Ref_End, NULL);
00760 parsed_ok = FALSE;
00761 goto EXIT;
00762 }
00763
00764
00765
00766
00767
00768 AT_LOCKED_IN(struct_type_idx) = TRUE;
00769 amb_attr_idx = attr_idx;
00770
00771 struct_idx = OPND_IDX((*result_opnd));
00772 IR_FLD_R(struct_idx) = AT_Tbl_Idx;
00773 IR_IDX_R(struct_idx) = attr_idx;
00774 IR_LINE_NUM_R(struct_idx) = TOKEN_LINE(token);
00775 IR_COL_NUM_R(struct_idx) = TOKEN_COLUMN(token);
00776 }
00777 else {
00778 attr_idx = srch_sym_tbl(TOKEN_STR(attr_name),
00779 TOKEN_LEN(attr_name),
00780 &name_idx);
00781
00782 if (attr_idx != NULL_IDX) {
00783
00784
00785 #ifdef KEY
00786 if (LA_CH_VALUE == LPAREN &&
00787 AT_REFERENCED(attr_idx) == Not_Referenced &&
00788 !AT_NAMELIST_OBJ(attr_idx) &&
00789 ((AT_OBJ_CLASS(attr_idx) == Pgm_Unit &&
00790 strncasecmp(TOKEN_STR(attr_name), "omp_",4) == 0) ||
00791 (AT_OBJ_CLASS(attr_idx) == Data_Obj &&
00792 ATD_CLASS(attr_idx) == Atd_Unknown &&
00793 !ATD_ALLOCATABLE(attr_idx) &&
00794 !ATD_TARGET(attr_idx) &&
00795 !ATD_POINTER(attr_idx) &&
00796 ATD_ARRAY_IDX(attr_idx) == NULL_IDX &&
00797 (TYP_TYPE(ATD_TYPE_IDX(attr_idx)) != Character ||
00798 ! is_substring_ref())))) {
00799 #else
00800 if (LA_CH_VALUE == LPAREN &&
00801 AT_REFERENCED(attr_idx) == Not_Referenced &&
00802 !AT_NAMELIST_OBJ(attr_idx) &&
00803 AT_OBJ_CLASS(attr_idx) == Data_Obj &&
00804 ATD_CLASS(attr_idx) == Atd_Unknown &&
00805 !ATD_ALLOCATABLE(attr_idx) &&
00806 !ATD_TARGET(attr_idx) &&
00807 !ATD_POINTER(attr_idx) &&
00808 ATD_ARRAY_IDX(attr_idx) == NULL_IDX &&
00809 (TYP_TYPE(ATD_TYPE_IDX(attr_idx)) != Character ||
00810 ! is_substring_ref())) {
00811 #endif
00812
00813
00814 save_curr_scp_idx = curr_scp_idx;
00815 curr_scp_idx = INTRINSIC_SCP_IDX;
00816 host_attr_idx = srch_sym_tbl(TOKEN_STR(attr_name),
00817 TOKEN_LEN(attr_name),
00818 &host_name_idx);
00819 curr_scp_idx = save_curr_scp_idx;
00820
00821 if (host_attr_idx != NULL_IDX) {
00822
00823 if (AT_IS_INTRIN(host_attr_idx) &&
00824 ATI_FIRST_SPECIFIC_IDX(host_attr_idx) == NULL_IDX) {
00825 complete_intrinsic_definition(host_attr_idx);
00826
00827 attr_idx = srch_sym_tbl(TOKEN_STR(attr_name),
00828 TOKEN_LEN(attr_name),
00829 &name_idx);
00830 }
00831
00832 type_idx = (AT_TYPED(attr_idx)) ? ATD_TYPE_IDX(attr_idx) :
00833 NULL_IDX;
00834
00835 COPY_VARIANT_ATTR_INFO(host_attr_idx,
00836 attr_idx,
00837 AT_OBJ_CLASS(host_attr_idx));
00838
00839 ATD_TYPE_IDX(attr_idx) = type_idx;
00840 AT_IS_INTRIN(attr_idx) = AT_IS_INTRIN(host_attr_idx);
00841 AT_ELEMENTAL_INTRIN(attr_idx)=AT_ELEMENTAL_INTRIN(host_attr_idx);
00842 host_attr_idx = NULL_IDX;
00843 }
00844 }
00845
00846 amb_attr_idx = attr_idx;
00847
00848 if (!LN_DEF_LOC(name_idx)) {
00849 ambiguous_ref = TRUE;
00850
00851 while (AT_ATTR_LINK(amb_attr_idx) != NULL_IDX) {
00852 amb_attr_idx = AT_ATTR_LINK(amb_attr_idx);
00853 }
00854 }
00855 }
00856 else {
00857
00858 ambiguous_ref = TRUE;
00859
00860
00861 #ifdef KEY
00862 if (strncasecmp(TOKEN_STR(attr_name), "omp_",4) == 0){
00863 save_curr_scp_idx = curr_scp_idx;
00864 curr_scp_idx = INTRINSIC_SCP_IDX;
00865 host_attr_idx = srch_sym_tbl(TOKEN_STR(attr_name),
00866 TOKEN_LEN(attr_name),
00867 &host_name_idx);
00868 curr_scp_idx = save_curr_scp_idx;
00869 if (!host_attr_idx)
00870 host_attr_idx = srch_host_sym_tbl(TOKEN_STR(attr_name),
00871 TOKEN_LEN(attr_name),
00872 &host_name_idx,
00873 TRUE);
00874 }
00875 else
00876 #endif
00877 host_attr_idx = srch_host_sym_tbl(TOKEN_STR(attr_name),
00878 TOKEN_LEN(attr_name),
00879 &host_name_idx,
00880 TRUE);
00881
00882
00883 if (host_attr_idx != NULL_IDX && IS_STMT_ENTITY(host_attr_idx)) {
00884
00885
00886
00887 host_attr_idx = NULL_IDX;
00888 }
00889
00890
00891
00892 if (host_attr_idx != NULL_IDX) {
00893 if (LA_CH_VALUE != LPAREN &&
00894 AT_IS_INTRIN(host_attr_idx) &&
00895 AT_OBJ_CLASS(host_attr_idx) == Interface) {
00896 host_attr_idx = NULL_IDX;
00897 }
00898 }
00899
00900 if (host_attr_idx != NULL_IDX) {
00901
00902
00903
00904 attr_idx = ntr_host_in_sym_tbl(&attr_name,
00905 name_idx,
00906 host_attr_idx,
00907 host_name_idx,
00908 TRUE);
00909
00910 amb_attr_idx = host_attr_idx;
00911
00912 while (AT_ATTR_LINK(amb_attr_idx) != NULL_IDX) {
00913 amb_attr_idx = AT_ATTR_LINK(amb_attr_idx);
00914 }
00915
00916 if (LA_CH_VALUE == LPAREN &&
00917 AT_IS_INTRIN(amb_attr_idx) &&
00918 AT_OBJ_CLASS(amb_attr_idx) == Interface) {
00919
00920
00921
00922
00923 if (AT_IS_INTRIN(host_attr_idx) &&
00924 ATI_FIRST_SPECIFIC_IDX(host_attr_idx) == NULL_IDX) {
00925 complete_intrinsic_definition(host_attr_idx);
00926 }
00927 COPY_ATTR_NTRY(attr_idx, amb_attr_idx);
00928 AT_CIF_SYMBOL_ID(attr_idx) = 0;
00929 AT_ATTR_LINK(attr_idx) = NULL_IDX;
00930 host_attr_idx = NULL_IDX;
00931 amb_attr_idx = attr_idx;
00932 AT_DEF_LINE(attr_idx) = TOKEN_LINE(token);
00933 AT_DEF_COLUMN(attr_idx) = TOKEN_COLUMN(token);
00934 }
00935 }
00936 else {
00937 attr_idx = ntr_sym_tbl(&attr_name, name_idx);
00938 amb_attr_idx = attr_idx;
00939
00940 if (LA_CH_VALUE == LPAREN && ! is_substring_ref()) {
00941
00942
00943
00944 AT_OBJ_CLASS(attr_idx) = Pgm_Unit;
00945 ATP_PROC(attr_idx) = Unknown_Proc;
00946 ATP_PGM_UNIT(attr_idx) = Function;
00947 ATP_SCP_IDX(attr_idx) = curr_scp_idx;
00948 MAKE_EXTERNAL_NAME(attr_idx,
00949 AT_NAME_IDX(attr_idx),
00950 AT_NAME_LEN(attr_idx));
00951
00952 CREATE_FUNC_RSLT(attr_idx, new_attr_idx);
00953
00954 if (expr_mode == Specification_Expr ||
00955 expr_mode == Initialization_Expr ||
00956 expr_mode == Stmt_Func_Expr) {
00957 AT_REFERENCED(new_attr_idx) = Dcl_Bound_Ref;
00958 }
00959 else {
00960 AT_REFERENCED(new_attr_idx) = Referenced;
00961 }
00962 SET_IMPL_TYPE(new_attr_idx);
00963 }
00964 else {
00965 SET_IMPL_TYPE(attr_idx);
00966 }
00967 }
00968 }
00969
00970 if (AT_OBJ_CLASS(amb_attr_idx) == Interface) {
00971
00972 if (ATI_FIRST_SPECIFIC_IDX(amb_attr_idx) == NULL_IDX) {
00973 check_attr = NULL_IDX;
00974 }
00975 else {
00976 check_attr = SN_ATTR_IDX(ATI_FIRST_SPECIFIC_IDX(amb_attr_idx));
00977 }
00978 }
00979 else {
00980 check_attr = amb_attr_idx;
00981 }
00982
00983 if (check_attr != NULL_IDX &&
00984 AT_OBJ_CLASS(check_attr) == Pgm_Unit &&
00985 ATP_NON_ANSI_INTRIN(check_attr)) {
00986 PRINTMSG(TOKEN_LINE(attr_name),
00987 787,
00988 Ansi,
00989 TOKEN_COLUMN(attr_name),
00990 TOKEN_STR(attr_name));
00991 }
00992
00993
00994
00995 OPND_FLD((*result_opnd)) = AT_Tbl_Idx;
00996 OPND_IDX((*result_opnd)) = attr_idx;
00997 OPND_LINE_NUM((*result_opnd)) = TOKEN_LINE(token);
00998 OPND_COL_NUM((*result_opnd)) = TOKEN_COLUMN(token);
00999
01000 if (in_implied_do) {
01001
01002 if (IS_STMT_ENTITY(attr_idx) &&
01003 ATD_FIRST_SEEN_IL_IDX(attr_idx) == NULL_IDX) {
01004
01005
01006
01007 NTR_IR_LIST_TBL(ATD_FIRST_SEEN_IL_IDX(attr_idx));
01008 IL_LINE_NUM(ATD_FIRST_SEEN_IL_IDX(attr_idx)) = TOKEN_LINE(token);
01009 IL_COL_NUM(ATD_FIRST_SEEN_IL_IDX(attr_idx)) = TOKEN_COLUMN(token);
01010 }
01011
01012 if (AT_OBJ_CLASS(attr_idx) == Data_Obj) {
01013 ATD_SEEN_IN_IMP_DO(attr_idx) = TRUE;
01014 }
01015 }
01016 else if (AT_OBJ_CLASS(attr_idx) == Data_Obj) {
01017 ATD_SEEN_OUTSIDE_IMP_DO(attr_idx) = TRUE;
01018 }
01019 }
01020
01021
01022
01023 if (AT_DCL_ERR(attr_idx)) {
01024 SH_ERR_FLG(curr_stmt_sh_idx) = TRUE;
01025
01026 parse_err_flush(Find_Ref_End, NULL);
01027 parsed_ok = FALSE;
01028 goto EXIT;
01029 }
01030
01031
01032
01033 if (! ambiguous_ref &&
01034 AT_NOT_VISIBLE(attr_idx)) {
01035
01036 PRINTMSG(TOKEN_LINE(token), 486, Error, TOKEN_COLUMN(token),
01037 AT_OBJ_NAME_PTR(attr_idx),
01038 AT_OBJ_NAME_PTR(AT_MODULE_IDX((attr_idx))));
01039 parse_err_flush(Find_Ref_End, NULL);
01040 parsed_ok = FALSE;
01041 goto EXIT;
01042 }
01043
01044
01045
01046 switch (AT_OBJ_CLASS(amb_attr_idx)) {
01047 case Data_Obj :
01048
01049 if (ATD_SYMBOLIC_CONSTANT(amb_attr_idx)) {
01050
01051 if (AT_DEF_LINE(amb_attr_idx) == 0) {
01052 AT_DEF_LINE(amb_attr_idx) = TOKEN_LINE(token);
01053 AT_DEF_COLUMN(amb_attr_idx) = TOKEN_LINE(token);
01054 }
01055 }
01056 break;
01057
01058 case Pgm_Unit :
01059
01060 if (ATP_SCP_ALIVE(amb_attr_idx) &&
01061 ATP_PGM_UNIT(amb_attr_idx) == Function) {
01062 rslt_idx = ATP_RSLT_IDX(amb_attr_idx);
01063
01064 if (ATP_RSLT_NAME(amb_attr_idx) ||
01065 (LA_CH_VALUE == LPAREN &&
01066 TYP_TYPE(ATD_TYPE_IDX(rslt_idx)) != Structure &&
01067 ATD_ARRAY_IDX(rslt_idx) == NULL_IDX &&
01068 (TYP_TYPE(ATD_TYPE_IDX(rslt_idx)) != Character ||
01069 ! is_substring_ref()))) {
01070
01071
01072
01073 if (LA_CH_VALUE != LPAREN &&
01074 LA_CH_VALUE != PERCENT) {
01075
01076
01077 goto EXIT;
01078 }
01079 else if (LA_CH_VALUE != LPAREN) {
01080
01081
01082 PRINTMSG(TOKEN_LINE(token), 722, Error, TOKEN_COLUMN(token),
01083 AT_OBJ_NAME_PTR(attr_idx));
01084 parse_err_flush(Find_Ref_End, NULL);
01085 parsed_ok = FALSE;
01086 goto EXIT;
01087 }
01088 else {
01089 NTR_IR_TBL(ir_idx);
01090 IR_OPR(ir_idx) = Call_Opr;
01091 IR_FLD_L(ir_idx) = AT_Tbl_Idx;
01092 IR_IDX_L(ir_idx) = attr_idx;
01093 IR_LINE_NUM(ir_idx) = TOKEN_LINE(token);
01094 IR_COL_NUM(ir_idx) = TOKEN_COLUMN(token);
01095 IR_LINE_NUM_L(ir_idx) = TOKEN_LINE(token);
01096 IR_COL_NUM_L(ir_idx) = TOKEN_COLUMN(token);
01097 OPND_FLD((*result_opnd)) = IR_Tbl_Idx;
01098 OPND_IDX((*result_opnd)) = ir_idx;
01099
01100 parsed_ok = parse_actual_arg_spec(&opnd, TRUE, attr_idx);
01101 COPY_OPND(IR_OPND_R(ir_idx), opnd);
01102 goto EXIT;
01103 }
01104 }
01105 else {
01106
01107 attr_idx = rslt_idx;
01108 amb_attr_idx = attr_idx;
01109 OPND_IDX((*result_opnd)) = attr_idx;
01110
01111
01112 }
01113 }
01114 else if (LA_CH_VALUE == LPAREN) {
01115
01116 if (! ambiguous_ref &&
01117 ATP_PGM_UNIT(attr_idx) == Pgm_Unknown &&
01118 ATP_DCL_EXTERNAL(attr_idx)) {
01119
01120
01121
01122
01123 ATP_PGM_UNIT(attr_idx) = Function;
01124 CREATE_FUNC_RSLT(attr_idx, new_attr_idx);
01125
01126 SET_IMPL_TYPE(new_attr_idx);
01127 }
01128
01129 NTR_IR_TBL(ir_idx);
01130 IR_OPR(ir_idx) = Call_Opr;
01131 IR_FLD_L(ir_idx) = AT_Tbl_Idx;
01132 IR_IDX_L(ir_idx) = attr_idx;
01133 IR_LINE_NUM(ir_idx) = TOKEN_LINE(token);
01134 IR_COL_NUM(ir_idx) = TOKEN_COLUMN(token);
01135 IR_LINE_NUM_L(ir_idx) = TOKEN_LINE(token);
01136 IR_COL_NUM_L(ir_idx) = TOKEN_COLUMN(token);
01137 OPND_FLD((*result_opnd)) = IR_Tbl_Idx;
01138 OPND_IDX((*result_opnd)) = ir_idx;
01139
01140 parsed_ok = parse_actual_arg_spec(&opnd, TRUE, attr_idx);
01141 COPY_OPND(IR_OPND_R(ir_idx), opnd);
01142 goto EXIT;
01143 }
01144 else {
01145 goto EXIT;
01146 }
01147
01148 break;
01149
01150 case Label :
01151
01152 parsed_ok = FALSE;
01153 goto EXIT;
01154
01155 case Derived_Type :
01156
01157 if (LA_CH_VALUE == LPAREN) {
01158
01159
01160
01161
01162
01163 NTR_IR_TBL(ir_idx);
01164 IR_OPR(ir_idx) = Struct_Construct_Opr;
01165 IR_FLD_L(ir_idx) = AT_Tbl_Idx;
01166 IR_IDX_L(ir_idx) = attr_idx;
01167 IR_LINE_NUM(ir_idx) = TOKEN_LINE(token);
01168 IR_COL_NUM(ir_idx) = TOKEN_COLUMN(token);
01169 IR_LINE_NUM_L(ir_idx) = TOKEN_LINE(token);
01170 IR_COL_NUM_L(ir_idx) = TOKEN_COLUMN(token);
01171 OPND_FLD((*result_opnd)) = IR_Tbl_Idx;
01172 OPND_IDX((*result_opnd)) = ir_idx;
01173
01174 parsed_ok = parse_actual_arg_spec(&opnd, TRUE, attr_idx);
01175 COPY_OPND(IR_OPND_R(ir_idx), opnd);
01176 }
01177 else if (ambiguous_ref) {
01178
01179
01180 PRINTMSG(TOKEN_LINE(token), 322, Error, TOKEN_COLUMN(token),
01181 AT_OBJ_NAME_PTR(attr_idx));
01182 parse_err_flush(Find_Ref_End, NULL);
01183 parsed_ok = FALSE;
01184 }
01185 else {
01186
01187
01188 PRINTMSG(TOKEN_LINE(token), 151, Error, TOKEN_COLUMN(token),
01189 AT_OBJ_NAME_PTR(attr_idx));
01190 parse_err_flush(Find_Ref_End, NULL);
01191 parsed_ok = FALSE;
01192 }
01193
01194 goto EXIT;
01195
01196 case Interface :
01197
01198 if (LA_CH_VALUE != LPAREN && AT_IS_INTRIN(amb_attr_idx)) {
01199
01200 if (!ATI_INTRIN_PASSABLE(amb_attr_idx)) {
01201 PRINTMSG(TOKEN_LINE(token),
01202 860,
01203 Error,
01204 TOKEN_COLUMN(token),
01205 AT_OBJ_NAME_PTR(amb_attr_idx));
01206 AT_DCL_ERR(amb_attr_idx) = TRUE;
01207 goto EXIT;
01208 }
01209
01210
01211
01212 tmp_token = initial_token;
01213 TOKEN_COLUMN(tmp_token) = 1;
01214 TOKEN_LINE(tmp_token) = 1;
01215
01216 for (i = 0; i < MAX_INTRIN_MAP_SIZE; i++) {
01217 if ((strcmp(AT_OBJ_NAME_PTR(attr_idx),
01218 (char *)&intrin_map[i].id_str) == 0)) {
01219
01220 #ifdef KEY
01221
01222
01223 if (0 == strcmp(AT_OBJ_NAME_PTR(attr_idx), "NINT")) {
01224 tmp_token = initial_token;
01225 TOKEN_COLUMN(tmp_token) = 1;
01226 TOKEN_LINE(tmp_token) = 1;
01227 strcat(
01228 strcpy((char *)&(TOKEN_STR(tmp_token)[0]),
01229 (char *) ((INTEGER_DEFAULT_TYPE == Integer_4) ?
01230 &intrin_map[i].mapped_4 :
01231 &intrin_map[i].mapped_8)),
01232 ((REAL_DEFAULT_TYPE == Real_4) ?
01233 "" :
01234 "_d")
01235 );
01236 break;
01237 }
01238 #endif
01239
01240 if (INTEGER_DEFAULT_TYPE == Integer_1 ||
01241 INTEGER_DEFAULT_TYPE == Integer_2 ||
01242 INTEGER_DEFAULT_TYPE == Integer_4) {
01243 if (intrin_map[i].id_str.string[0] == 'I' ||
01244 intrin_map[i].id_str.string[0] == 'N' ||
01245 intrin_map[i].id_str.string[0] == 'M' ||
01246 intrin_map[i].id_str.string[0] == 'L') {
01247 tmp_token = initial_token;
01248 TOKEN_COLUMN(tmp_token) = 1;
01249 TOKEN_LINE(tmp_token) = 1;
01250 strcpy((char *)&(TOKEN_STR(tmp_token)[0]),
01251 (char *)&intrin_map[i].mapped_4);
01252 }
01253 }
01254
01255 if (INTEGER_DEFAULT_TYPE == Integer_8) {
01256 if (intrin_map[i].id_str.string[0] == 'I' ||
01257 intrin_map[i].id_str.string[0] == 'N' ||
01258 intrin_map[i].id_str.string[0] == 'M' ||
01259 intrin_map[i].id_str.string[0] == 'L') {
01260 tmp_token = initial_token;
01261 TOKEN_COLUMN(tmp_token) = 1;
01262 TOKEN_LINE(tmp_token) = 1;
01263 strcpy((char *)&(TOKEN_STR(tmp_token)[0]),
01264 (char *)&intrin_map[i].mapped_8);
01265 }
01266 }
01267
01268 if (REAL_DEFAULT_TYPE == Real_4) {
01269 if (strcmp(AT_OBJ_NAME_PTR(attr_idx), "DIM") == 0 ||
01270 strcmp(AT_OBJ_NAME_PTR(attr_idx), "DPROD") == 0) {
01271 tmp_token = initial_token;
01272 TOKEN_COLUMN(tmp_token) = 1;
01273 TOKEN_LINE(tmp_token) = 1;
01274 strcpy((char *)&(TOKEN_STR(tmp_token)[0]),
01275 (char *)&intrin_map[i].mapped_4);
01276 }
01277 else if (intrin_map[i].id_str.string[0] != 'I' &&
01278 intrin_map[i].id_str.string[0] != 'N' &&
01279 intrin_map[i].id_str.string[0] != 'M' &&
01280 intrin_map[i].id_str.string[0] != 'D' &&
01281 intrin_map[i].id_str.string[0] != 'L') {
01282 tmp_token = initial_token;
01283 TOKEN_COLUMN(tmp_token) = 1;
01284 TOKEN_LINE(tmp_token) = 1;
01285 strcpy((char *)&(TOKEN_STR(tmp_token)[0]),
01286 (char *)&intrin_map[i].mapped_4);
01287 }
01288 }
01289
01290 if (REAL_DEFAULT_TYPE == Real_8) {
01291 if (strcmp(AT_OBJ_NAME_PTR(attr_idx), "DIM") == 0 ||
01292 strcmp(AT_OBJ_NAME_PTR(attr_idx), "DPROD") == 0) {
01293 tmp_token = initial_token;
01294 TOKEN_COLUMN(tmp_token) = 1;
01295 TOKEN_LINE(tmp_token) = 1;
01296 strcpy((char *)&(TOKEN_STR(tmp_token)[0]),
01297 (char *)&intrin_map[i].mapped_8);
01298 }
01299 else if (intrin_map[i].id_str.string[0] != 'I' &&
01300 intrin_map[i].id_str.string[0] != 'N' &&
01301 intrin_map[i].id_str.string[0] != 'M' &&
01302 intrin_map[i].id_str.string[0] != 'D' &&
01303 intrin_map[i].id_str.string[0] != 'L') {
01304 tmp_token = initial_token;
01305 TOKEN_COLUMN(tmp_token) = 1;
01306 TOKEN_LINE(tmp_token) = 1;
01307 strcpy((char *)&(TOKEN_STR(tmp_token)[0]),
01308 (char *)&intrin_map[i].mapped_8);
01309 }
01310 }
01311
01312 if (DOUBLE_DEFAULT_TYPE == Real_8) {
01313 if (intrin_map[i].id_str.string[0] == 'D' &&
01314 strcmp(AT_OBJ_NAME_PTR(attr_idx), "DPROD") != 0 &&
01315 strcmp(AT_OBJ_NAME_PTR(attr_idx), "DIM") != 0) {
01316 tmp_token = initial_token;
01317 TOKEN_COLUMN(tmp_token) = 1;
01318 TOKEN_LINE(tmp_token) = 1;
01319 strcpy((char *)&(TOKEN_STR(tmp_token)[0]),
01320 (char *)&intrin_map[i].mapped_4);
01321 }
01322 }
01323
01324 if (DOUBLE_DEFAULT_TYPE == Real_16) {
01325 if (intrin_map[i].id_str.string[0] == 'D' &&
01326 strcmp(AT_OBJ_NAME_PTR(attr_idx), "DPROD") != 0 &&
01327 strcmp(AT_OBJ_NAME_PTR(attr_idx), "DIM") != 0) {
01328 tmp_token = initial_token;
01329 TOKEN_COLUMN(tmp_token) = 1;
01330 TOKEN_LINE(tmp_token) = 1;
01331 strcpy((char *)&(TOKEN_STR(tmp_token)[0]),
01332 (char *)&intrin_map[i].mapped_8);
01333 }
01334 }
01335
01336 break;
01337 }
01338 }
01339
01340 TOKEN_LEN(tmp_token) = strlen((char *)&(TOKEN_STR(tmp_token)[0]));
01341 TOKEN_VALUE(tmp_token) = Tok_Id;
01342
01343 attr_idx = srch_sym_tbl(TOKEN_STR(tmp_token),
01344 TOKEN_LEN(tmp_token),
01345 &name_idx);
01346
01347 if (attr_idx == NULL_IDX) {
01348 attr_idx = ntr_sym_tbl(&tmp_token, name_idx);
01349 LN_DEF_LOC(name_idx) = TRUE;
01350 }
01351
01352 AT_OBJ_CLASS(attr_idx) = Pgm_Unit;
01353 ATP_PROC(attr_idx) = Intrin_Proc;
01354 ATP_PGM_UNIT(attr_idx) = Function;
01355 ATP_SCP_IDX(attr_idx) = curr_scp_idx;
01356 AT_IS_INTRIN(attr_idx) = TRUE;
01357 MAKE_EXTERNAL_NAME(attr_idx,
01358 AT_NAME_IDX(attr_idx),
01359 AT_NAME_LEN(attr_idx));
01360 ATP_INTERFACE_IDX(attr_idx) = amb_attr_idx;
01361
01362 CREATE_FUNC_RSLT(attr_idx, rslt_idx);
01363
01364 if (AT_TYPED(amb_attr_idx)) {
01365 ATD_TYPE_IDX(rslt_idx) = ATD_TYPE_IDX(amb_attr_idx);
01366 }
01367 else {
01368 j = ATI_INTRIN_TBL_IDX(amb_attr_idx)+1;
01369
01370 if (intrin_tbl[j].data_type == Real_16 ||
01371 intrin_tbl[j].data_type == Complex_16) {
01372 if (cmd_line_flags.s_default64 ||
01373 cmd_line_flags.s_float64) {
01374
01375 }
01376 else {
01377 j = j + 1;
01378 while (intrin_tbl[j].intrin_enum == 0 &&
01379 intrin_tbl[j].external == 0) {
01380 j = j + 1;
01381 }
01382 }
01383 }
01384
01385 ATD_TYPE_IDX(rslt_idx) = intrin_tbl[j].data_type;
01386
01387 # ifdef _TARGET64
01388
01389
01390
01391
01392 switch (intrin_tbl[j].data_type) {
01393 case Real_4 :
01394 ATD_TYPE_IDX(rslt_idx) =
01395 REAL_DEFAULT_TYPE;
01396 break;
01397 case Real_8 :
01398 ATD_TYPE_IDX(rslt_idx) =
01399 DOUBLE_DEFAULT_TYPE;
01400 break;
01401 case Complex_4 :
01402 ATD_TYPE_IDX(rslt_idx) =
01403 COMPLEX_DEFAULT_TYPE;
01404 break;
01405 case Complex_8 :
01406 ATD_TYPE_IDX(rslt_idx) =
01407 DOUBLE_COMPLEX_DEFAULT_TYPE;
01408 break;
01409 case Integer_4 :
01410 ATD_TYPE_IDX(rslt_idx) =
01411 INTEGER_DEFAULT_TYPE;
01412 break;
01413 }
01414 # endif
01415
01416
01417 # ifdef _TARGET32
01418
01419 switch (intrin_tbl[j].data_type) {
01420 case Real_4 :
01421 if (REAL_DEFAULT_TYPE == Real_8) {
01422 ATD_TYPE_IDX(rslt_idx) =
01423 REAL_DEFAULT_TYPE;
01424 }
01425 break;
01426 case Real_8 :
01427 if (DOUBLE_DEFAULT_TYPE == Real_16) {
01428 ATD_TYPE_IDX(rslt_idx) =
01429 DOUBLE_DEFAULT_TYPE;
01430 }
01431 break;
01432 case Complex_4 :
01433 if (COMPLEX_DEFAULT_TYPE == Complex_8) {
01434 ATD_TYPE_IDX(rslt_idx) =
01435 COMPLEX_DEFAULT_TYPE;
01436 }
01437 break;
01438 case Complex_8 :
01439 if (COMPLEX_DEFAULT_TYPE == Complex_16) {
01440 ATD_TYPE_IDX(rslt_idx) =
01441 DOUBLE_COMPLEX_DEFAULT_TYPE;
01442 }
01443 break;
01444 case Integer_4 :
01445 if (INTEGER_DEFAULT_TYPE == Integer_8) {
01446 ATD_TYPE_IDX(rslt_idx) =
01447 INTEGER_DEFAULT_TYPE;
01448 }
01449 break;
01450 }
01451
01452
01453
01454 if ((ATD_TYPE_IDX(rslt_idx) == Real_8 ||
01455 ATD_TYPE_IDX(rslt_idx) == Complex_8 ||
01456 ATD_TYPE_IDX(rslt_idx) == Real_16 ||
01457 ATD_TYPE_IDX(rslt_idx) == Complex_16) &&
01458 !on_off_flags.enable_double_precision) {
01459 j = j + 1;
01460 while (intrin_tbl[j].intrin_enum == 0 &&
01461 intrin_tbl[j].external == 0) {
01462 j = j + 1;
01463 }
01464 ATD_TYPE_IDX(rslt_idx) = intrin_tbl[j].data_type;
01465 }
01466 # endif
01467
01468 }
01469
01470 OPND_FLD((*result_opnd)) = AT_Tbl_Idx;
01471 OPND_IDX((*result_opnd)) = attr_idx;
01472 }
01473 else if (LA_CH_VALUE == LPAREN) {
01474
01475 NTR_IR_TBL(ir_idx);
01476 IR_OPR(ir_idx) = Call_Opr;
01477 IR_FLD_L(ir_idx) = AT_Tbl_Idx;
01478 IR_IDX_L(ir_idx) = attr_idx;
01479 IR_LINE_NUM(ir_idx) = TOKEN_LINE(token);
01480 IR_COL_NUM(ir_idx) = TOKEN_COLUMN(token);
01481 IR_LINE_NUM_L(ir_idx) = TOKEN_LINE(token);
01482 IR_COL_NUM_L(ir_idx) = TOKEN_COLUMN(token);
01483 OPND_FLD((*result_opnd)) = IR_Tbl_Idx;
01484 OPND_IDX((*result_opnd)) = ir_idx;
01485
01486 parsed_ok = parse_actual_arg_spec(&opnd, TRUE, attr_idx);
01487 COPY_OPND(IR_OPND_R(ir_idx), opnd);
01488
01489 }
01490 goto EXIT;
01491
01492 case Namelist_Grp :
01493
01494 if (ambiguous_ref && LA_CH_VALUE == LPAREN) {
01495 NTR_IR_TBL(ir_idx);
01496 IR_OPR(ir_idx) = Call_Opr;
01497 IR_FLD_L(ir_idx) = AT_Tbl_Idx;
01498 IR_IDX_L(ir_idx) = attr_idx;
01499 IR_LINE_NUM(ir_idx) = TOKEN_LINE(token);
01500 IR_COL_NUM(ir_idx) = TOKEN_COLUMN(token);
01501 IR_LINE_NUM_L(ir_idx) = TOKEN_LINE(token);
01502 IR_COL_NUM_L(ir_idx) = TOKEN_COLUMN(token);
01503 OPND_FLD((*result_opnd)) = IR_Tbl_Idx;
01504 OPND_IDX((*result_opnd)) = ir_idx;
01505
01506 parsed_ok = parse_actual_arg_spec(&opnd, TRUE, attr_idx);
01507 COPY_OPND(IR_OPND_R(ir_idx), opnd);
01508 }
01509 else {
01510 OPND_FLD((*result_opnd)) = AT_Tbl_Idx;
01511 OPND_IDX((*result_opnd)) = attr_idx;
01512 OPND_LINE_NUM((*result_opnd)) = TOKEN_LINE(token);
01513 OPND_COL_NUM((*result_opnd)) = TOKEN_COLUMN(token);
01514 }
01515 goto EXIT;
01516
01517 case Stmt_Func :
01518
01519 if (LA_CH_VALUE == LPAREN) {
01520 NTR_IR_TBL(ir_idx);
01521 IR_OPR(ir_idx) = Stmt_Func_Call_Opr;
01522 IR_FLD_L(ir_idx) = AT_Tbl_Idx;
01523 IR_IDX_L(ir_idx) = attr_idx;
01524 IR_LINE_NUM(ir_idx) = TOKEN_LINE(token);
01525 IR_COL_NUM(ir_idx) = TOKEN_COLUMN(token);
01526 IR_LINE_NUM_L(ir_idx) = TOKEN_LINE(token);
01527 IR_COL_NUM_L(ir_idx) = TOKEN_COLUMN(token);
01528 OPND_FLD((*result_opnd)) = IR_Tbl_Idx;
01529 OPND_IDX((*result_opnd)) = ir_idx;
01530
01531 parsed_ok = parse_actual_arg_spec(&opnd, TRUE, attr_idx);
01532 COPY_OPND(IR_OPND_R(ir_idx), opnd);
01533 }
01534 else {
01535 parse_err_flush(Find_Ref_End, "(");
01536 }
01537
01538 goto EXIT;
01539 }
01540
01541 # ifdef _F_MINUS_MINUS
01542 if (LA_CH_VALUE != PERCENT && LA_CH_VALUE != LPAREN &&
01543 ((!cmd_line_flags.co_array_fortran) || LA_CH_VALUE != LBRKT))
01544 # else
01545 if (LA_CH_VALUE != PERCENT && LA_CH_VALUE != LPAREN)
01546 # endif
01547 {
01548
01549
01550
01551
01552
01553 goto EXIT;
01554 }
01555
01556
01557 if (LA_CH_VALUE == LPAREN) {
01558
01559 array_idx = ATD_ARRAY_IDX(amb_attr_idx);
01560
01561 if (array_idx) {
01562
01563 rank = 0;
01564 NTR_IR_TBL(subs_idx);
01565
01566
01567
01568 COPY_OPND(IR_OPND_L(subs_idx), (*result_opnd));
01569
01570
01571 OPND_FLD((*result_opnd)) = IR_Tbl_Idx;
01572 OPND_IDX((*result_opnd)) = subs_idx;
01573
01574
01575 IR_LINE_NUM(subs_idx) = LA_CH_LINE;
01576 IR_COL_NUM(subs_idx) = LA_CH_COLUMN;
01577
01578 IR_OPR(subs_idx) = Subscript_Opr;
01579 IR_FLD_R(subs_idx) = IL_Tbl_Idx;
01580
01581 list_idx = NULL_IDX;
01582
01583 do {
01584 NEXT_LA_CH;
01585
01586 if (ambiguous_ref) {
01587
01588 if (LA_CH_VALUE == RPAREN) {
01589
01590 break;
01591 }
01592 else if (next_arg_is_kwd_equal ()) {
01593 MATCHED_TOKEN_CLASS(Tok_Class_Id);
01594
01595 parsed_ok = create_kwd_text(&opnd, TRUE) && parsed_ok;
01596
01597 if (list_idx == NULL_IDX) {
01598 NTR_IR_LIST_TBL(list_idx);
01599 IR_IDX_R(subs_idx) = list_idx;
01600 }
01601 else {
01602 NTR_IR_LIST_TBL(IL_NEXT_LIST_IDX(list_idx));
01603 IL_PREV_LIST_IDX(IL_NEXT_LIST_IDX(list_idx)) = list_idx;
01604 list_idx = IL_NEXT_LIST_IDX(list_idx);
01605 }
01606
01607 COPY_OPND(IL_OPND(list_idx), opnd);
01608 rank++;
01609 continue;
01610 }
01611 }
01612
01613 if (list_idx == NULL_IDX) {
01614 NTR_IR_LIST_TBL(list_idx);
01615 IR_IDX_R(subs_idx) = list_idx;
01616 }
01617 else {
01618 NTR_IR_LIST_TBL(IL_NEXT_LIST_IDX(list_idx));
01619 IL_PREV_LIST_IDX(IL_NEXT_LIST_IDX(list_idx)) = list_idx;
01620 list_idx = IL_NEXT_LIST_IDX(list_idx);
01621 }
01622
01623 if (LA_CH_VALUE != COLON) {
01624 parsed_ok = parse_expr(&opnd) && parsed_ok;
01625 COPY_OPND(IL_OPND(list_idx), opnd);
01626 }
01627
01628
01629
01630 if (LA_CH_VALUE == COLON) {
01631
01632 NTR_IR_TBL(trip_idx);
01633 IR_LINE_NUM(trip_idx) = LA_CH_LINE;
01634 IR_COL_NUM(trip_idx) = LA_CH_COLUMN;
01635
01636 NEXT_LA_CH;
01637
01638 IR_OPR(trip_idx) = Triplet_Opr;
01639 IR_FLD_L(trip_idx) = IL_Tbl_Idx;
01640 IR_LIST_CNT_L(trip_idx) = 3;
01641 NTR_IR_LIST_TBL(list2_idx);
01642 IR_IDX_L(trip_idx) = list2_idx;
01643 IL_OPND(list2_idx) = IL_OPND(list_idx);
01644 IL_FLD(list_idx) = IR_Tbl_Idx;
01645 IL_IDX(list_idx) = trip_idx;
01646 NTR_IR_LIST_TBL(list3_idx);
01647 IL_NEXT_LIST_IDX(list2_idx) = list3_idx;
01648 IL_PREV_LIST_IDX(list3_idx) = list2_idx;
01649
01650 if (LA_CH_VALUE != COLON &&
01651 LA_CH_VALUE != COMMA &&
01652 LA_CH_VALUE != RPAREN) {
01653 parsed_ok = parse_expr(&opnd) && parsed_ok;
01654 COPY_OPND(IL_OPND(list3_idx), opnd);
01655 }
01656
01657 NTR_IR_LIST_TBL(list2_idx);
01658 IL_NEXT_LIST_IDX(list3_idx) = list2_idx;
01659 IL_PREV_LIST_IDX(list2_idx) = list3_idx;
01660
01661 if (LA_CH_VALUE == COLON) {
01662 NEXT_LA_CH;
01663 parsed_ok = parse_expr(&opnd) && parsed_ok;
01664 COPY_OPND(IL_OPND(list2_idx), opnd);
01665 }
01666 }
01667 rank++;
01668 }
01669 while (LA_CH_VALUE == COMMA);
01670
01671 if (! matched_specific_token(Tok_Punct_Rparen, Tok_Class_Punct)) {
01672 parse_err_flush(Find_Comma_Rparen, ")");
01673 parsed_ok = FALSE;
01674 goto EXIT;
01675 }
01676
01677 IR_LIST_CNT_R(subs_idx) = rank;
01678
01679 }
01680
01681
01682
01683 if (LA_CH_VALUE == LPAREN) {
01684
01685 if (is_substring_ref ()) {
01686
01687 if (TYP_TYPE(ATD_TYPE_IDX(amb_attr_idx)) != Character) {
01688 PRINTMSG(TOKEN_LINE(token), 508, Error, TOKEN_COLUMN(token));
01689 parsed_ok = FALSE;
01690 parse_err_flush(Find_Ref_End, NULL);
01691 goto EXIT;
01692 }
01693
01694 NTR_IR_TBL(substring_idx);
01695 IR_OPR(substring_idx) = Substring_Opr;
01696 IR_LINE_NUM(substring_idx) = LA_CH_LINE;
01697 IR_COL_NUM(substring_idx) = LA_CH_COLUMN;
01698
01699 COPY_OPND(IR_OPND_L(substring_idx), (*result_opnd));
01700
01701
01702 OPND_FLD((*result_opnd)) = IR_Tbl_Idx;
01703 OPND_IDX((*result_opnd)) = substring_idx;
01704
01705 IR_FLD_R(substring_idx) = IL_Tbl_Idx;
01706 IR_LIST_CNT_R(substring_idx) = 2;
01707 NTR_IR_LIST_TBL(list_idx);
01708 NTR_IR_LIST_TBL(list2_idx);
01709 IR_IDX_R(substring_idx) = list_idx;
01710 IL_NEXT_LIST_IDX(list_idx) = list2_idx;
01711 IL_PREV_LIST_IDX(list2_idx) = list_idx;
01712
01713
01714 NEXT_LA_CH;
01715
01716 if (LA_CH_VALUE != COLON) {
01717 parsed_ok = parse_expr(&opnd) && parsed_ok;
01718 COPY_OPND(IL_OPND(list_idx), opnd);
01719 }
01720
01721 if (LA_CH_VALUE != COLON) {
01722 if (parse_err_flush(Find_Rparen, ":")) {
01723 NEXT_LA_CH;
01724 }
01725 parsed_ok = FALSE;
01726 goto EXIT;
01727 }
01728 else {
01729 NEXT_LA_CH;
01730 }
01731
01732 if (LA_CH_VALUE != RPAREN) {
01733 parsed_ok = parse_expr(&opnd) && parsed_ok;
01734 COPY_OPND(IL_OPND(list2_idx), opnd);
01735 }
01736
01737 if (LA_CH_VALUE != RPAREN) {
01738
01739 if (parse_err_flush(Find_Rparen, ")")) {
01740 NEXT_LA_CH;
01741 }
01742 parsed_ok = FALSE;
01743 goto EXIT;
01744 }
01745 else {
01746 NEXT_LA_CH;
01747 }
01748 goto EXIT;
01749 }
01750 }
01751
01752 if (LA_CH_VALUE != PERCENT) {
01753
01754 if (subs_idx ||
01755 struct_type_idx) {
01756
01757
01758 }
01759 else {
01760
01761
01762
01763 if (ambiguous_ref) {
01764
01765 NTR_IR_TBL(ir_idx);
01766 IR_OPR(ir_idx) = Call_Opr;
01767 IR_FLD_L(ir_idx) = AT_Tbl_Idx;
01768 IR_IDX_L(ir_idx) = attr_idx;
01769 IR_LINE_NUM(ir_idx) = TOKEN_LINE(token);
01770 IR_COL_NUM(ir_idx) = TOKEN_COLUMN(token);
01771 IR_LINE_NUM_L(ir_idx) = TOKEN_LINE(token);
01772 IR_COL_NUM_L(ir_idx) = TOKEN_COLUMN(token);
01773 OPND_FLD((*result_opnd)) = IR_Tbl_Idx;
01774 OPND_IDX((*result_opnd)) = ir_idx;
01775
01776 parsed_ok = parse_actual_arg_spec(&opnd, TRUE, attr_idx);
01777 COPY_OPND(IR_OPND_R(ir_idx), opnd);
01778
01779 goto EXIT;
01780
01781 }
01782 else if (AT_USE_ASSOCIATED(attr_idx)) {
01783
01784 PRINTMSG(TOKEN_LINE(token), 898, Error, TOKEN_COLUMN(token),
01785 AT_OBJ_NAME_PTR(attr_idx));
01786 parse_err_flush(Find_Ref_End, NULL);
01787 parsed_ok = FALSE;
01788 goto EXIT;
01789 }
01790 else if (expr_mode == Stmt_Func_Expr &&
01791 AT_OBJ_CLASS(attr_idx) == Data_Obj &&
01792 ATD_CLASS(attr_idx) == Dummy_Argument &&
01793 ATD_SF_DARG(attr_idx)) {
01794
01795 PRINTMSG(TOKEN_LINE(token), 1094, Error, TOKEN_COLUMN(token),
01796 AT_OBJ_NAME_PTR(attr_idx));
01797 parse_err_flush(Find_Ref_End, NULL);
01798 parsed_ok = FALSE;
01799 goto EXIT;
01800 }
01801 else if (AT_REFERENCED(attr_idx) == Not_Referenced) {
01802
01803 if (!fnd_semantic_err(Obj_Use_Extern_Func,
01804 TOKEN_LINE(token),
01805 TOKEN_COLUMN(token),
01806 attr_idx,
01807 TRUE)) {
01808
01809 if (ATD_ARRAY_IDX(attr_idx) != NULL_IDX) {
01810 PRINTMSG(AT_DEF_LINE(attr_idx), 914, Error,
01811 AT_DEF_COLUMN(attr_idx),
01812 AT_OBJ_NAME_PTR(attr_idx));
01813 AT_DCL_ERR(attr_idx) = TRUE;
01814 }
01815 else if (ATD_POINTER(attr_idx)) {
01816 PRINTMSG(AT_DEF_LINE(attr_idx), 915, Error,
01817 AT_DEF_COLUMN(attr_idx),
01818 AT_OBJ_NAME_PTR(attr_idx));
01819 AT_DCL_ERR(attr_idx) = TRUE;
01820 }
01821 else if (ATD_CLASS(attr_idx) != Dummy_Argument &&
01822 TYP_TYPE(ATD_TYPE_IDX(attr_idx)) == Character &&
01823 TYP_CHAR_CLASS(ATD_TYPE_IDX(attr_idx)) ==
01824 Assumed_Size_Char) {
01825 PRINTMSG(AT_DEF_LINE(attr_idx), 939, Error,
01826 AT_DEF_COLUMN(attr_idx),
01827 AT_OBJ_NAME_PTR(attr_idx));
01828 AT_DCL_ERR(attr_idx) = TRUE;
01829 }
01830
01831
01832
01833
01834 chg_data_obj_to_pgm_unit(attr_idx, Function, Extern_Proc);
01835
01836 NTR_IR_TBL(ir_idx);
01837 IR_OPR(ir_idx) = Call_Opr;
01838 IR_FLD_L(ir_idx) = AT_Tbl_Idx;
01839 IR_IDX_L(ir_idx) = attr_idx;
01840 IR_LINE_NUM(ir_idx) = TOKEN_LINE(token);
01841 IR_COL_NUM(ir_idx) = TOKEN_COLUMN(token);
01842 IR_LINE_NUM_L(ir_idx) = TOKEN_LINE(token);
01843 IR_COL_NUM_L(ir_idx) = TOKEN_COLUMN(token);
01844 OPND_FLD((*result_opnd)) = IR_Tbl_Idx;
01845 OPND_IDX((*result_opnd)) = ir_idx;
01846
01847 parsed_ok = parse_actual_arg_spec(&opnd, TRUE, attr_idx);
01848 COPY_OPND(IR_OPND_R(ir_idx), opnd);
01849
01850 goto EXIT;
01851 }
01852 else {
01853 parse_err_flush(Find_Ref_End, NULL);
01854 parsed_ok = FALSE;
01855 goto EXIT;
01856 }
01857 }
01858 else {
01859
01860 goto EXIT;
01861 }
01862 }
01863 }
01864 }
01865
01866 # ifdef _F_MINUS_MINUS
01867 if (LA_CH_VALUE == LBRKT &&
01868 cmd_line_flags.co_array_fortran &&
01869 struct_type_idx == NULL_IDX &&
01870 AT_OBJ_CLASS(amb_attr_idx) == Data_Obj) {
01871
01872 if (ATD_PE_ARRAY_IDX(amb_attr_idx) == NULL_IDX) {
01873
01874 PRINTMSG(LA_CH_LINE, 1245, Error, LA_CH_COLUMN,
01875 AT_OBJ_NAME_PTR(amb_attr_idx));
01876 parsed_ok = FALSE;
01877 parse_err_flush(Find_Ref_End, NULL);
01878 goto EXIT;
01879 }
01880
01881 if (stmt_type == Data_Stmt) {
01882 PRINTMSG(LA_CH_LINE, 1578, Error, LA_CH_COLUMN,
01883 AT_OBJ_NAME_PTR(amb_attr_idx), "DATA");
01884 parsed_ok = FALSE;
01885
01886
01887 }
01888
01889 if (subs_idx == NULL_IDX) {
01890 NTR_IR_TBL(subs_idx);
01891
01892
01893 IR_LINE_NUM(subs_idx) = LA_CH_LINE;
01894 IR_COL_NUM(subs_idx) = LA_CH_COLUMN;
01895
01896 IR_OPR(subs_idx) = Subscript_Opr;
01897 IR_FLD_R(subs_idx) = IL_Tbl_Idx;
01898 IR_LIST_CNT_R(subs_idx) = 0;
01899
01900 if (OPND_FLD((*result_opnd)) == AT_Tbl_Idx) {
01901 COPY_OPND(IR_OPND_L(subs_idx), (*result_opnd));
01902
01903
01904 OPND_FLD((*result_opnd)) = IR_Tbl_Idx;
01905 OPND_IDX((*result_opnd)) = subs_idx;
01906 }
01907 else if (OPND_FLD((*result_opnd)) == IR_Tbl_Idx &&
01908 IR_OPR(OPND_IDX((*result_opnd))) == Substring_Opr) {
01909
01910 COPY_OPND(IR_OPND_L(subs_idx), IR_OPND_L(OPND_IDX((*result_opnd))));
01911
01912 IR_FLD_L(OPND_IDX((*result_opnd))) = IR_Tbl_Idx;
01913 IR_IDX_L(OPND_IDX((*result_opnd))) = subs_idx;
01914 }
01915 # ifdef _DEBUG
01916 else {
01917 PRINTMSG(LA_CH_LINE, 626, Internal, LA_CH_COLUMN,
01918 "AT_Tbl_Idx", "parse_deref");
01919 }
01920 # endif
01921
01922 list_idx = NULL_IDX;
01923 }
01924 else {
01925
01926 list_idx = IR_IDX_R(subs_idx);
01927
01928 while (IL_NEXT_LIST_IDX(list_idx) != NULL_IDX) {
01929 list_idx = IL_NEXT_LIST_IDX(list_idx);
01930 }
01931 }
01932
01933 num_dims = 0;
01934
01935 do {
01936 NEXT_LA_CH;
01937 num_dims++;
01938
01939 if (list_idx == NULL_IDX) {
01940 NTR_IR_LIST_TBL(list_idx);
01941 IR_IDX_R(subs_idx) = list_idx;
01942 }
01943 else {
01944 NTR_IR_LIST_TBL(IL_NEXT_LIST_IDX(list_idx));
01945 IL_PREV_LIST_IDX(IL_NEXT_LIST_IDX(list_idx)) = list_idx;
01946 list_idx = IL_NEXT_LIST_IDX(list_idx);
01947 }
01948
01949 IL_PE_SUBSCRIPT(list_idx) = TRUE;
01950
01951 if (LA_CH_VALUE != COLON &&
01952 (! star_expected || LA_CH_VALUE != STAR)) {
01953 parsed_ok = parse_expr(&opnd) && parsed_ok;
01954 COPY_OPND(IL_OPND(list_idx), opnd);
01955 }
01956
01957
01958
01959 if (LA_CH_VALUE == COLON) {
01960
01961 NTR_IR_TBL(trip_idx);
01962 IR_LINE_NUM(trip_idx) = LA_CH_LINE;
01963 IR_COL_NUM(trip_idx) = LA_CH_COLUMN;
01964
01965 NEXT_LA_CH;
01966
01967 IR_OPR(trip_idx) = Triplet_Opr;
01968 IR_FLD_L(trip_idx) = IL_Tbl_Idx;
01969 IR_LIST_CNT_L(trip_idx) = 3;
01970 NTR_IR_LIST_TBL(list2_idx);
01971 IR_IDX_L(trip_idx) = list2_idx;
01972 IL_OPND(list2_idx) = IL_OPND(list_idx);
01973 IL_FLD(list_idx) = IR_Tbl_Idx;
01974 IL_IDX(list_idx) = trip_idx;
01975 NTR_IR_LIST_TBL(list3_idx);
01976 IL_NEXT_LIST_IDX(list2_idx) = list3_idx;
01977 IL_PREV_LIST_IDX(list3_idx) = list2_idx;
01978
01979 if (star_expected &&
01980 num_dims == BD_RANK(ATD_PE_ARRAY_IDX(amb_attr_idx)) &&
01981 LA_CH_VALUE != STAR) {
01982
01983 PRINTMSG(LA_CH_LINE, 1594, Error, LA_CH_COLUMN);
01984 parsed_ok = FALSE;
01985 }
01986
01987 if (star_expected && LA_CH_VALUE == STAR) {
01988
01989
01990 if (num_dims != BD_RANK(ATD_PE_ARRAY_IDX(amb_attr_idx))) {
01991 PRINTMSG(LA_CH_LINE, 116, Error, LA_CH_COLUMN);
01992 parsed_ok = FALSE;
01993 }
01994 NEXT_LA_CH;
01995 }
01996 else if (LA_CH_VALUE != COLON &&
01997 LA_CH_VALUE != COMMA &&
01998 LA_CH_VALUE != RBRKT) {
01999 parsed_ok = parse_expr(&opnd) && parsed_ok;
02000 COPY_OPND(IL_OPND(list3_idx), opnd);
02001 }
02002
02003 NTR_IR_LIST_TBL(list2_idx);
02004 IL_NEXT_LIST_IDX(list3_idx) = list2_idx;
02005 IL_PREV_LIST_IDX(list2_idx) = list3_idx;
02006
02007 if (LA_CH_VALUE == COLON) {
02008 NEXT_LA_CH;
02009 parsed_ok = parse_expr(&opnd) && parsed_ok;
02010 COPY_OPND(IL_OPND(list2_idx), opnd);
02011 }
02012 }
02013 else if (star_expected &&
02014 num_dims == BD_RANK(ATD_PE_ARRAY_IDX(amb_attr_idx)) &&
02015 IL_FLD(list_idx) != NO_Tbl_Idx) {
02016
02017 find_opnd_line_and_column(&(IL_OPND(list_idx)), &line, &col);
02018 PRINTMSG(line, 1594, Error, col);
02019 parsed_ok = FALSE;
02020 }
02021 else if (star_expected && LA_CH_VALUE == STAR) {
02022
02023
02024 if (num_dims != BD_RANK(ATD_PE_ARRAY_IDX(amb_attr_idx))) {
02025 PRINTMSG(LA_CH_LINE, 116, Error, LA_CH_COLUMN);
02026 parsed_ok = FALSE;
02027 }
02028 NEXT_LA_CH;
02029 }
02030
02031 (IR_LIST_CNT_R(subs_idx))++;
02032 }
02033 while (LA_CH_VALUE == COMMA);
02034
02035 if (LA_CH_VALUE != RBRKT) {
02036 parse_err_flush(Find_EOS, "]");
02037 parsed_ok = FALSE;
02038 goto EXIT;
02039 }
02040 else {
02041
02042 NEXT_LA_CH;
02043 }
02044 }
02045 # endif
02046
02047 if (LA_CH_VALUE == PERCENT) {
02048
02049
02050
02051 if (TYP_TYPE(ATD_TYPE_IDX(amb_attr_idx)) != Structure) {
02052
02053 if (SCP_IMPL_NONE(curr_scp_idx) && !AT_TYPED(amb_attr_idx) &&
02054 !AT_DCL_ERR(amb_attr_idx)) {
02055 AT_DCL_ERR(amb_attr_idx) = TRUE;
02056 PRINTMSG(TOKEN_LINE(attr_name), 113, Error,
02057 TOKEN_COLUMN(attr_name),
02058 TOKEN_STR(attr_name));
02059 }
02060 else {
02061 PRINTMSG(TOKEN_LINE(attr_name), 212, Error,
02062 TOKEN_COLUMN(attr_name),
02063 TOKEN_STR(attr_name),
02064 get_basic_type_str(ATD_TYPE_IDX(amb_attr_idx)));
02065 }
02066
02067 parse_err_flush(Find_Ref_End, NULL);
02068 parsed_ok = FALSE;
02069 goto EXIT;
02070 }
02071 line = LA_CH_LINE;
02072 col = LA_CH_COLUMN;
02073 NEXT_LA_CH;
02074
02075 if (MATCHED_TOKEN_CLASS(Tok_Class_Id)) {
02076 NTR_IR_TBL(ir_idx);
02077 IR_OPR(ir_idx) = Struct_Opr;
02078 IR_LINE_NUM(ir_idx) = line;
02079 IR_COL_NUM(ir_idx) = col;
02080
02081 COPY_OPND(IR_OPND_L(ir_idx), (*result_opnd));
02082
02083 OPND_FLD((*result_opnd)) = IR_Tbl_Idx;
02084 OPND_IDX((*result_opnd)) = ir_idx;
02085
02086 parsed_ok = parse_deref(result_opnd,
02087 TYP_IDX(ATD_TYPE_IDX(amb_attr_idx)));
02088 }
02089 else {
02090
02091
02092
02093 parse_err_flush(Find_Ref_End, "IDENTIFIER");
02094 parsed_ok = FALSE;
02095 }
02096 }
02097
02098 EXIT:
02099
02100 if (parsed_ok) {
02101
02102 if (ambiguous_ref &&
02103 AT_REFERENCED(attr_idx) == Not_Referenced &&
02104 AT_OBJ_CLASS(attr_idx) == Data_Obj &&
02105 OPND_FLD((*result_opnd)) == IR_Tbl_Idx &&
02106 IR_OPR(OPND_IDX((*result_opnd))) == Call_Opr) {
02107
02108
02109 chg_data_obj_to_pgm_unit(attr_idx, Function, Extern_Proc);
02110 }
02111
02112 if (stmt_type != Data_Stmt) {
02113
02114 if (expr_mode == Specification_Expr ||
02115 expr_mode == Initialization_Expr ||
02116 expr_mode == Stmt_Func_Expr) {
02117 AT_REFERENCED(attr_idx) = Dcl_Bound_Ref;
02118 }
02119 else {
02120 AT_REFERENCED(attr_idx) = Referenced;
02121 }
02122
02123 if (AT_OBJ_CLASS(attr_idx) == Pgm_Unit &&
02124 ATP_PGM_UNIT(attr_idx) != Module &&
02125 ATP_RSLT_IDX(attr_idx) != NULL_IDX) {
02126 AT_REFERENCED(ATP_RSLT_IDX(attr_idx)) = AT_REFERENCED(attr_idx);
02127 }
02128 }
02129 }
02130
02131 TRACE (Func_Exit, "parse_deref", NULL);
02132
02133 return(parsed_ok);
02134
02135 }
02136
02137
02138
02139
02140
02141
02142
02143
02144
02145
02146
02147
02148
02149
02150
02151
02152
02153
02154 boolean parse_imp_do (opnd_type *result_opnd)
02155
02156 {
02157 int buf_idx;
02158 int col;
02159 boolean had_equal = FALSE;
02160 int imp_do_start_line;
02161 int imp_do_start_col;
02162 int ir_idx;
02163 int line;
02164 int list_idx;
02165 int list2_idx = NULL_IDX;
02166 char next_char;
02167 opnd_type opnd;
02168 int paren_level = 0;
02169 boolean parsed_ok = TRUE;
02170 boolean save_in_implied_do;
02171 int stmt_num;
02172
02173
02174 TRACE (Func_Entry, "parse_imp_do", NULL);
02175
02176 # ifdef _DEBUG
02177 if (LA_CH_VALUE != LPAREN) {
02178
02179 PRINTMSG(TOKEN_LINE(token), 295, Internal, TOKEN_COLUMN(token),
02180 "parse_imp_do", "LPAREN");
02181 }
02182 # endif
02183
02184 NTR_IR_TBL(ir_idx);
02185 IR_OPR(ir_idx) = Implied_Do_Opr;
02186 IR_TYPE_IDX(ir_idx) = TYPELESS_DEFAULT_TYPE;
02187 IR_LINE_NUM(ir_idx) = LA_CH_LINE;
02188 IR_COL_NUM(ir_idx) = LA_CH_COLUMN;
02189 OPND_FLD((*result_opnd)) = IR_Tbl_Idx;
02190 OPND_IDX((*result_opnd)) = ir_idx;
02191
02192
02193 imp_do_start_line = LA_CH_LINE;
02194 imp_do_start_col = LA_CH_COLUMN;
02195 save_in_implied_do = in_implied_do;
02196 in_implied_do = TRUE;
02197
02198 do {
02199 NEXT_LA_CH;
02200
02201 START:
02202
02203 if (LA_CH_VALUE == LPAREN) {
02204
02205 if (next_tok_is_paren_slash ()) {
02206
02207 parsed_ok = parse_expr(&opnd) && parsed_ok;
02208
02209 }
02210 else if (is_implied_do ()) {
02211
02212 if (! (parsed_ok = parse_imp_do(&opnd))) {
02213
02214 if (LA_CH_VALUE != EOS) {
02215 parse_err_flush(Find_Rparen, NULL);
02216 NEXT_LA_CH;
02217 }
02218
02219 goto EXIT;
02220 }
02221 }
02222 else {
02223 next_char = scan_thru_close_paren(0,0,1);
02224
02225 if (next_char == COMMA ||
02226 next_char == EOS ||
02227 next_char == RPAREN) {
02228
02229 line = LA_CH_LINE;
02230 col = LA_CH_COLUMN;
02231 buf_idx = LA_CH_BUF_IDX;
02232 stmt_num = LA_CH_STMT_NUM;
02233
02234 NEXT_LA_CH;
02235
02236 if (LA_CH_VALUE == LPAREN ||
02237 LA_CH_VALUE == RPAREN ||
02238 LA_CH_VALUE == EOS) {
02239
02240 paren_level++;
02241 goto START;
02242 }
02243 else if (paren_grp_is_cplx_const()) {
02244
02245 reset_lex(buf_idx,stmt_num);
02246 parsed_ok = parse_expr(&opnd) && parsed_ok;
02247 }
02248 else {
02249
02250 reset_lex(buf_idx,stmt_num);
02251 NEXT_LA_CH;
02252 paren_level++;
02253 goto START;
02254 }
02255 }
02256 else {
02257
02258 if (list2_idx == NULL_IDX) {
02259 strcpy(parse_operand_insert, "implied-do-object");
02260 }
02261 else {
02262 strcpy(parse_operand_insert,
02263 "implied-do-object or do-variable");
02264 }
02265
02266 parsed_ok = parse_expr(&opnd) && parsed_ok;
02267
02268 if (stmt_type == Read_Stmt ||
02269 stmt_type == Decode_Stmt ||
02270 stmt_type == Data_Stmt) {
02271
02272 mark_attr_defined(&opnd);
02273 }
02274 }
02275 }
02276 }
02277 else {
02278
02279 if (list2_idx == NULL_IDX) {
02280 strcpy(parse_operand_insert, "implied-do-object");
02281 }
02282 else {
02283 strcpy(parse_operand_insert, "implied-do-object or do-variable");
02284 }
02285
02286 parsed_ok = parse_expr(&opnd) && parsed_ok;
02287
02288 if (stmt_type == Read_Stmt ||
02289 stmt_type == Decode_Stmt ||
02290 stmt_type == Data_Stmt) {
02291 mark_attr_defined(&opnd);
02292 }
02293
02294 if (LA_CH_VALUE == EQUAL) {
02295
02296 if (IR_FLD_L(ir_idx) == NO_Tbl_Idx) {
02297 find_opnd_line_and_column(&opnd, &line, &col);
02298
02299
02300
02301 PRINTMSG(line, 872, Error, col);
02302 parsed_ok = FALSE;
02303 }
02304
02305 had_equal = TRUE;
02306
02307
02308
02309
02310 if (OPND_FLD(opnd) == IR_Tbl_Idx) {
02311 find_opnd_line_and_column(&opnd, &line, &col);
02312 PRINTMSG(line, 199, Error, col);
02313 parsed_ok = FALSE;
02314 }
02315
02316 IR_FLD_R(ir_idx) = IL_Tbl_Idx;
02317 NTR_IR_LIST_TBL(list_idx);
02318 IR_IDX_R(ir_idx) = list_idx;
02319 COPY_OPND(IL_OPND(list_idx), opnd);
02320 mark_attr_defined(&opnd);
02321
02322
02323 if (OPND_FLD(opnd) == AT_Tbl_Idx &&
02324 AT_OBJ_CLASS(OPND_IDX(opnd)) == Data_Obj) {
02325
02326 ATD_SEEN_AS_LCV(OPND_IDX(opnd)) = TRUE;
02327
02328 if (ATD_FIRST_SEEN_IL_IDX(OPND_IDX(opnd)) != NULL_IDX) {
02329
02330 if (ATD_SEEN_IN_IMP_DO(OPND_IDX(opnd)) &&
02331 (IL_LINE_NUM(ATD_FIRST_SEEN_IL_IDX(OPND_IDX(opnd)))
02332 > imp_do_start_line ||
02333 (IL_LINE_NUM(ATD_FIRST_SEEN_IL_IDX(OPND_IDX(opnd))) ==
02334 imp_do_start_line &&
02335 IL_COL_NUM(ATD_FIRST_SEEN_IL_IDX(OPND_IDX(opnd)))
02336 > imp_do_start_col))) {
02337
02338
02339
02340 ATD_SEEN_IN_IMP_DO(OPND_IDX(opnd)) = FALSE;
02341 }
02342
02343 FREE_IR_LIST_NODE(ATD_FIRST_SEEN_IL_IDX(OPND_IDX(opnd)));
02344 ATD_FIRST_SEEN_IL_IDX(OPND_IDX(opnd)) = NULL_IDX;
02345 }
02346 else if (ATD_SEEN_IN_IMP_DO(OPND_IDX(opnd)) &&
02347 (AT_DEF_LINE(OPND_IDX(opnd)) > imp_do_start_line ||
02348 (AT_DEF_LINE(OPND_IDX(opnd)) == imp_do_start_line &&
02349 AT_DEF_COLUMN(OPND_IDX(opnd)) > imp_do_start_col))) {
02350
02351
02352
02353 ATD_SEEN_IN_IMP_DO(OPND_IDX(opnd)) = FALSE;
02354 }
02355 }
02356
02357
02358
02359
02360 NTR_IR_LIST_TBL(list2_idx);
02361 IL_NEXT_LIST_IDX(list_idx) = list2_idx;
02362 IL_PREV_LIST_IDX(list2_idx) = list_idx;
02363 NEXT_LA_CH;
02364 strcpy(parse_operand_insert, "operand");
02365 parsed_ok = parse_expr(&opnd) && parsed_ok;
02366 COPY_OPND(IL_OPND(list2_idx), opnd);
02367
02368 if (LA_CH_VALUE != COMMA) {
02369 parsed_ok = FALSE;
02370 parse_err_flush(Find_Rparen, ",");
02371 continue;
02372 }
02373
02374
02375
02376
02377
02378 NEXT_LA_CH;
02379
02380 NTR_IR_LIST_TBL(list_idx);
02381 IL_NEXT_LIST_IDX(list2_idx) = list_idx;
02382 IL_PREV_LIST_IDX(list_idx) = list2_idx;
02383 parsed_ok = parse_expr(&opnd) && parsed_ok;
02384 COPY_OPND(IL_OPND(list_idx), opnd);
02385
02386
02387
02388
02389 if (LA_CH_VALUE == COMMA) {
02390 NEXT_LA_CH;
02391 NTR_IR_LIST_TBL(list2_idx);
02392 IL_NEXT_LIST_IDX(list_idx) = list2_idx;
02393 IL_PREV_LIST_IDX(list2_idx) = list_idx;
02394 parsed_ok = parse_expr(&opnd) && parsed_ok;
02395 COPY_OPND(IL_OPND(list2_idx), opnd);
02396 IR_LIST_CNT_R(ir_idx) = 4;
02397 }
02398 else {
02399 IR_LIST_CNT_R(ir_idx) = 3;
02400 }
02401
02402 break;
02403 }
02404 }
02405
02406 if (IR_IDX_L(ir_idx) == NULL_IDX) {
02407 NTR_IR_LIST_TBL(list_idx);
02408 COPY_OPND(IL_OPND(list_idx), opnd);
02409 IR_FLD_L(ir_idx) = IL_Tbl_Idx;
02410 IR_IDX_L(ir_idx) = list_idx;
02411 IR_LIST_CNT_L(ir_idx) = 1;
02412 list2_idx = list_idx;
02413 }
02414 else {
02415 NTR_IR_LIST_TBL(list_idx);
02416 IL_NEXT_LIST_IDX(list2_idx) = list_idx;
02417 IL_PREV_LIST_IDX(list_idx) = list2_idx;
02418 COPY_OPND(IL_OPND(list_idx), opnd);
02419 ++IR_LIST_CNT_L(ir_idx);
02420 list2_idx = list_idx;
02421 }
02422
02423 while (LA_CH_VALUE == RPAREN && paren_level) {
02424 NEXT_LA_CH;
02425 paren_level--;
02426 }
02427 }
02428 while (LA_CH_VALUE == COMMA);
02429
02430 in_implied_do = save_in_implied_do;
02431
02432 if (paren_level) {
02433 parse_err_flush(Find_EOS, ")");
02434 goto EXIT;
02435 }
02436 else if (LA_CH_VALUE != RPAREN) {
02437
02438 if (had_equal) {
02439 parse_err_flush(Find_EOS,
02440 (IR_LIST_CNT_R(ir_idx) == 3) ? ", or )" : ")");
02441 }
02442 else {
02443 if (IL_FLD(list2_idx) == AT_Tbl_Idx) {
02444 parse_err_flush(Find_EOS, "=, comma, or '(subscript-list)'");
02445 }
02446 else {
02447 parse_err_flush(Find_EOS, ",");
02448 }
02449 }
02450
02451 parsed_ok = FALSE;
02452 goto EXIT;
02453 }
02454
02455 NEXT_LA_CH;
02456
02457 EXIT:
02458
02459 strcpy(parse_operand_insert, "operand");
02460
02461 TRACE (Func_Exit, "parse_imp_do", NULL);
02462
02463 return(parsed_ok);
02464
02465 }
02466
02467
02468
02469
02470
02471
02472
02473
02474
02475
02476
02477
02478
02479
02480
02481
02482
02483
02484
02485
02486
02487
02488
02489
02490
02491
02492
02493
02494
02495
02496
02497
02498
02499
02500
02501
02502
02503
02504
02505
02506
02507
02508
02509
02510
02511
02512
02513
02514
02515
02516
02517
02518
02519 int check_label_ref(void)
02520
02521 {
02522 int blk_idx;
02523 int cmic_blk_sh_idx = NULL_IDX;
02524 int lbl_attr_idx;
02525 int name_idx;
02526
02527
02528 TRACE (Func_Entry, "check_label_ref", NULL);
02529
02530 lbl_attr_idx = srch_sym_tbl(TOKEN_STR(token), TOKEN_LEN(token), &name_idx);
02531
02532 if (lbl_attr_idx == NULL_IDX) {
02533 lbl_attr_idx = ntr_sym_tbl(&token, name_idx);
02534 AT_REFERENCED(lbl_attr_idx) = Referenced;
02535 AT_OBJ_CLASS(lbl_attr_idx) = Label;
02536 LN_DEF_LOC(name_idx) = TRUE;
02537 }
02538
02539 if (AT_DEFINED(lbl_attr_idx)) {
02540
02541
02542
02543
02544
02545 if (stmt_label_idx != NULL_IDX &&
02546 (ATL_DEF_STMT_IDX(lbl_attr_idx) == curr_stmt_sh_idx ||
02547 if_stmt_lbl_idx != NULL_IDX)) {
02548 ATL_EXECUTABLE(lbl_attr_idx) = TRUE;
02549 }
02550
02551 if ( ! SH_ERR_FLG(curr_stmt_sh_idx) ) {
02552
02553 blk_idx = blk_stk_idx;
02554
02555 while (blk_idx > 0) {
02556 if (BLK_IS_PARALLEL_REGION(blk_idx)) {
02557 cmic_blk_sh_idx = BLK_FIRST_SH_IDX(blk_idx);
02558 break;
02559 }
02560
02561 blk_idx--;
02562 }
02563
02564 check_cmic_blk_branches(cmic_blk_sh_idx,
02565 lbl_attr_idx,
02566 TOKEN_LINE(token),
02567 TOKEN_COLUMN(token));
02568
02569 blk_idx = blk_stk_idx;
02570
02571 while (BLK_IS_PARALLEL_REGION(blk_idx) ||
02572 BLK_TYPE(blk_idx) == Do_Parallel_Blk ||
02573 BLK_TYPE(blk_idx) == Wait_Blk ||
02574 BLK_TYPE(blk_idx) == SGI_Region_Blk) {
02575
02576 blk_idx--;
02577 }
02578
02579 label_ref_semantics(lbl_attr_idx, Branch_Context,
02580 (BLK_TYPE(blk_idx) > Interface_Body_Blk) ?
02581 BLK_FIRST_SH_IDX(blk_idx) : NULL_IDX,
02582 TOKEN_LINE(token), TOKEN_COLUMN(token));
02583 }
02584 }
02585 else {
02586 build_fwd_ref_entry(lbl_attr_idx, Branch_Context);
02587 }
02588
02589 if (cif_flags & XREF_RECS) {
02590 cif_usage_rec(lbl_attr_idx, AT_Tbl_Idx,
02591 TOKEN_LINE(token), TOKEN_COLUMN(token),
02592 CIF_Label_Referenced_As_Branch_Target);
02593 }
02594
02595 TRACE (Func_Exit, "check_label_ref", NULL);
02596
02597 return(lbl_attr_idx);
02598
02599 }
02600
02601
02602
02603
02604
02605
02606
02607
02608
02609
02610
02611
02612
02613
02614
02615
02616
02617
02618
02619
02620
02621
02622
02623
02624
02625
02626
02627
02628
02629
02630 void label_ref_semantics(int attr_idx,
02631 lbl_ref_type context,
02632 int ref_blk_idx,
02633 int ref_line_num,
02634 int ref_col_num)
02635 {
02636 stmt_type_type check_stmt_type;
02637 int lbl_blk_idx;
02638 stmt_type_type lbl_stmt_type;
02639 int line_num;
02640 char stmt_str[10];
02641 boolean valid_branch_target = TRUE;
02642
02643
02644 TRACE (Func_Entry, "label_ref_semantics", NULL);
02645
02646
02647
02648
02649 if (AT_DCL_ERR(attr_idx)) {
02650 goto EXIT;
02651 }
02652
02653
02654
02655
02656
02657
02658
02659
02660
02661 if (AT_DEFINED(attr_idx)) {
02662 lbl_stmt_type = SH_STMT_TYPE(ATL_DEF_STMT_IDX(attr_idx));
02663 }
02664 else {
02665 lbl_stmt_type = stmt_type;
02666 }
02667
02668
02669
02670
02671
02672
02673
02674 if ( ! ATL_EXECUTABLE(attr_idx) ) {
02675
02676 if (context == Branch_Context) {
02677 PRINTMSG(ref_line_num, 144, Error, ref_col_num, AT_DEF_LINE(attr_idx));
02678 }
02679 else if (lbl_stmt_type != Format_Stmt) {
02680 PRINTMSG(ref_line_num, 345, Error, ref_col_num,
02681 AT_OBJ_NAME_PTR(attr_idx));
02682 }
02683
02684 goto EXIT;
02685 }
02686
02687 stmt_str[0] = '\0';
02688
02689 switch (lbl_stmt_type) {
02690 case Case_Stmt:
02691 valid_branch_target = FALSE;
02692 strcpy(stmt_str, "CASE");
02693 break;
02694
02695 case Else_Stmt:
02696 valid_branch_target = FALSE;
02697 strcpy(stmt_str, "ELSE");
02698 break;
02699
02700 case Else_If_Stmt:
02701 valid_branch_target = FALSE;
02702 strcpy(stmt_str, "ELSE IF");
02703 break;
02704
02705 case Else_Where_Stmt:
02706 valid_branch_target = FALSE;
02707 strcpy(stmt_str, "ELSEWHERE");
02708 break;
02709
02710 case End_Where_Stmt:
02711 valid_branch_target = FALSE;
02712 strcpy(stmt_str, "END WHERE");
02713 break;
02714
02715 case End_Forall_Stmt:
02716 valid_branch_target = FALSE;
02717 strcpy(stmt_str, "END FORALL");
02718 break;
02719
02720 case Then_Stmt:
02721 valid_branch_target = FALSE;
02722 strcpy(stmt_str, "THEN");
02723 break;
02724 }
02725
02726 if ( ! valid_branch_target ) {
02727 PRINTMSG(ref_line_num,
02728 (context == Branch_Context) ? 145 : 346,
02729 Error, ref_col_num, stmt_str,
02730 AT_DEF_LINE(attr_idx));
02731 goto EXIT;
02732 }
02733
02734
02735
02736
02737 if (SH_STMT_TYPE(ATL_BLK_STMT_IDX(attr_idx)) == Where_Cstrct_Stmt ||
02738 SH_STMT_TYPE(ATL_BLK_STMT_IDX(attr_idx)) == Else_Where_Stmt) {
02739
02740 if (context == Branch_Context) {
02741 PRINTMSG(ref_line_num, 147, Error, ref_col_num,
02742 SH_GLB_LINE(ATL_BLK_STMT_IDX(attr_idx)));
02743 }
02744 else {
02745 PRINTMSG(ref_line_num, 347, Warning, ref_col_num,
02746 AT_OBJ_NAME_PTR(attr_idx),
02747 SH_GLB_LINE(ATL_BLK_STMT_IDX(attr_idx)));
02748 }
02749
02750 goto EXIT;
02751 }
02752
02753
02754
02755 if (SH_STMT_TYPE(ATL_BLK_STMT_IDX(attr_idx)) == Forall_Cstrct_Stmt) {
02756
02757 if (context == Branch_Context) {
02758 PRINTMSG(ref_line_num, 1595, Error, ref_col_num,
02759 SH_GLB_LINE(ATL_BLK_STMT_IDX(attr_idx)));
02760 }
02761 else {
02762 PRINTMSG(ref_line_num, 1596, Warning, ref_col_num,
02763 AT_OBJ_NAME_PTR(attr_idx),
02764 SH_GLB_LINE(ATL_BLK_STMT_IDX(attr_idx)));
02765 }
02766
02767 goto EXIT;
02768 }
02769
02770
02771
02772
02773
02774 if (context != Branch_Context) {
02775 goto EXIT;
02776 }
02777
02778
02779
02780
02781
02782
02783
02784
02785 if (ATL_BLK_STMT_IDX(attr_idx) == NULL_IDX ||
02786 ATL_BLK_STMT_IDX(attr_idx) == ref_blk_idx) {
02787 goto EXIT;
02788 }
02789
02790
02791
02792
02793
02794
02795
02796
02797
02798
02799 lbl_blk_idx = NULL_IDX;
02800
02801 if (ref_blk_idx != NULL_IDX) {
02802 lbl_blk_idx = SH_PARENT_BLK_IDX(ref_blk_idx);
02803
02804 while (lbl_blk_idx != NULL_IDX) {
02805
02806 if (lbl_blk_idx == ATL_BLK_STMT_IDX(attr_idx)) {
02807 break;
02808 }
02809 else {
02810 lbl_blk_idx = SH_PARENT_BLK_IDX(lbl_blk_idx);
02811 }
02812 }
02813 }
02814
02815 if (lbl_blk_idx != NULL_IDX) {
02816 goto EXIT;
02817 }
02818
02819
02820
02821
02822
02823
02824
02825
02826
02827
02828 if (lbl_stmt_type == End_Do_Stmt) {
02829 PRINTMSG(ref_line_num, 150, Error, ref_col_num);
02830 goto EXIT;
02831 }
02832
02833 if (lbl_stmt_type == End_Select_Stmt) {
02834 PRINTMSG(ref_line_num, 153, Error, ref_col_num);
02835 goto EXIT;
02836 }
02837
02838 if (lbl_stmt_type == End_If_Stmt) {
02839 PRINTMSG(ref_line_num, 1567, Ansi, ref_col_num);
02840
02841 if (SH_PARENT_BLK_IDX(ATL_BLK_STMT_IDX(attr_idx)) != NULL_IDX) {
02842
02843 if (SH_PARENT_BLK_IDX(ATL_BLK_STMT_IDX(attr_idx)) != ref_blk_idx) {
02844 check_stmt_type =
02845 SH_STMT_TYPE(SH_PARENT_BLK_IDX(ATL_BLK_STMT_IDX(attr_idx)));
02846 line_num =
02847 SH_GLB_LINE(SH_PARENT_BLK_IDX(ATL_BLK_STMT_IDX(attr_idx)));
02848 }
02849 else {
02850 goto EXIT;
02851 }
02852 }
02853 else {
02854 goto EXIT;
02855 }
02856 }
02857 else {
02858 check_stmt_type = SH_STMT_TYPE(ATL_BLK_STMT_IDX(attr_idx));
02859 line_num = SH_GLB_LINE(ATL_BLK_STMT_IDX(attr_idx));
02860 }
02861
02862 switch (check_stmt_type) {
02863
02864 case Case_Stmt:
02865 PRINTMSG(ref_line_num, 148, Error, ref_col_num, line_num);
02866 goto EXIT;
02867
02868 case Do_Iterative_Stmt:
02869 case Do_While_Stmt:
02870 case Do_Infinite_Stmt:
02871 PRINTMSG(ref_line_num, 154, Warning, ref_col_num, line_num);
02872 PRINTMSG(ref_line_num, 155, Ansi, ref_col_num, line_num);
02873 goto EXIT;
02874
02875 case Else_Stmt:
02876 strcpy(stmt_str, "ELSE");
02877 break;
02878
02879 case Else_If_Stmt:
02880 strcpy(stmt_str, "ELSE IF");
02881 break;
02882
02883 case Then_Stmt:
02884 strcpy(stmt_str, "THEN");
02885 break;
02886
02887 case Directive_Stmt:
02888 case Parallel_Case_Stmt:
02889
02890 goto EXIT;
02891 }
02892
02893 PRINTMSG(ref_line_num, 156, Warning, ref_col_num, stmt_str, line_num);
02894 PRINTMSG(ref_line_num, 157, Ansi, ref_col_num, stmt_str, line_num);
02895
02896 EXIT:
02897
02898 TRACE (Func_Entry, "label_ref_semantics", NULL);
02899
02900 return;
02901
02902 }
02903
02904
02905
02906
02907
02908
02909
02910
02911
02912
02913
02914
02915
02916
02917
02918
02919
02920
02921
02922
02923
02924
02925
02926
02927
02928
02929
02930
02931
02932
02933
02934
02935
02936
02937
02938
02939
02940
02941
02942
02943
02944
02945
02946
02947
02948
02949
02950
02951
02952
02953
02954
02955
02956
02957
02958
02959
02960
02961 void build_fwd_ref_entry(int lbl_attr_idx,
02962 lbl_ref_type fwd_ref_cntxt)
02963
02964 {
02965 int blk_idx;
02966 int cmic_sh_idx = NULL_IDX;
02967 int curr_fwd_ref_idx;
02968 int fwd_ref_idx1;
02969 int fwd_ref_idx2;
02970 int new_fwd_ref_idx;
02971
02972
02973 TRACE (Func_Entry, "build_fwd_ref_entry", NULL);
02974
02975 curr_fwd_ref_idx = ATL_FWD_REF_IDX(lbl_attr_idx);
02976
02977 NTR_IR_LIST_TBL(new_fwd_ref_idx);
02978
02979 ATL_FWD_REF_IDX(lbl_attr_idx) = new_fwd_ref_idx;
02980 IL_NEXT_LIST_IDX(new_fwd_ref_idx) = curr_fwd_ref_idx;
02981
02982 if (curr_fwd_ref_idx != NULL_IDX) {
02983 IL_PREV_LIST_IDX(curr_fwd_ref_idx) = new_fwd_ref_idx;
02984 }
02985
02986 IL_LINE_NUM(new_fwd_ref_idx) = TOKEN_LINE(token);
02987 IL_COL_NUM(new_fwd_ref_idx) = TOKEN_COLUMN(token);
02988
02989
02990 switch (fwd_ref_cntxt) {
02991
02992 case Branch_Context:
02993 IL_FLD(new_fwd_ref_idx) = SH_Tbl_Idx;
02994
02995 blk_idx = blk_stk_idx;
02996
02997 while (BLK_IS_PARALLEL_REGION(blk_idx) ||
02998 BLK_TYPE(blk_idx) == Do_Parallel_Blk ||
02999 BLK_TYPE(blk_idx) == Wait_Blk ||
03000 BLK_TYPE(blk_idx) == SGI_Region_Blk) {
03001
03002 blk_idx--;
03003 }
03004
03005 if (BLK_TYPE(blk_idx) > Interface_Body_Blk) {
03006 IL_IDX(new_fwd_ref_idx) = BLK_FIRST_SH_IDX(blk_idx);
03007 }
03008
03009
03010
03011
03012 blk_idx = blk_stk_idx;
03013
03014 while (blk_idx > 0) {
03015
03016 if (BLK_IS_PARALLEL_REGION(blk_idx)) {
03017 cmic_sh_idx = BLK_FIRST_SH_IDX(blk_idx);
03018 break;
03019 }
03020
03021 blk_idx--;
03022 }
03023
03024 if (cmic_sh_idx != NULL_IDX) {
03025 NTR_IR_LIST_TBL(fwd_ref_idx1);
03026 NTR_IR_LIST_TBL(fwd_ref_idx2);
03027 IL_NEXT_LIST_IDX(fwd_ref_idx1) = fwd_ref_idx2;
03028 IL_PREV_LIST_IDX(fwd_ref_idx2) = fwd_ref_idx1;
03029 IL_LINE_NUM(fwd_ref_idx1) = TOKEN_LINE(token);
03030 IL_COL_NUM(fwd_ref_idx1) = TOKEN_COLUMN(token);
03031 IL_LINE_NUM(fwd_ref_idx2) = TOKEN_LINE(token);
03032 IL_COL_NUM(fwd_ref_idx2) = TOKEN_COLUMN(token);
03033
03034 IL_FLD(fwd_ref_idx1) = SH_Tbl_Idx;
03035 IL_FLD(fwd_ref_idx2) = SH_Tbl_Idx;
03036
03037 IL_IDX(fwd_ref_idx1) = IL_IDX(new_fwd_ref_idx);
03038 IL_IDX(fwd_ref_idx2) = cmic_sh_idx;
03039
03040 IL_FLD(new_fwd_ref_idx) = IL_Tbl_Idx;
03041 IL_LIST_CNT(new_fwd_ref_idx) = 2;
03042 IL_IDX(new_fwd_ref_idx) = fwd_ref_idx1;
03043 }
03044
03045 break;
03046
03047 case Assign_Ref:
03048 IL_FORWARD_REF(new_fwd_ref_idx) = From_Assign_Stmt;
03049 break;
03050
03051 case Do_Ref:
03052 IL_FORWARD_REF(new_fwd_ref_idx) = From_Do_Stmt;
03053 break;
03054
03055 case Format_Ref:
03056 IL_FORWARD_REF(new_fwd_ref_idx) = To_Format_Stmt;
03057 break;
03058
03059 default:
03060 PRINTMSG(stmt_start_line, 179, Internal, stmt_start_col,
03061 "build_fwd_ref_entry");
03062 }
03063
03064 TRACE (Func_Exit, "build_fwd_ref_entry", NULL);
03065
03066 }
03067
03068
03069
03070
03071
03072
03073
03074
03075
03076
03077
03078
03079
03080
03081
03082
03083
03084
03085
03086
03087
03088
03089
03090
03091
03092
03093 void resolve_fwd_lbl_refs (void)
03094
03095 {
03096 int fwd_ref_idx;
03097 int next_fwd_ref_idx;
03098
03099
03100 TRACE (Func_Entry, "resolve_fwd_lbl_refs", NULL);
03101
03102 fwd_ref_idx = ATL_FWD_REF_IDX(stmt_label_idx);
03103
03104 if ( ! AT_DCL_ERR(stmt_label_idx) ) {
03105
03106
03107
03108
03109
03110 if (stmt_type == Format_Stmt) {
03111
03112 while (fwd_ref_idx != NULL_IDX) {
03113
03114 if (IL_FLD(fwd_ref_idx) == SH_Tbl_Idx) {
03115 PRINTMSG(IL_LINE_NUM(fwd_ref_idx), 144, Error,
03116 IL_COL_NUM(fwd_ref_idx), stmt_start_line);
03117 }
03118 else if (IL_FLD(fwd_ref_idx) == IL_Tbl_Idx) {
03119 PRINTMSG(IL_LINE_NUM(IL_IDX(fwd_ref_idx)), 144, Error,
03120 IL_COL_NUM(IL_IDX(fwd_ref_idx)), stmt_start_line);
03121 }
03122
03123 next_fwd_ref_idx = IL_NEXT_LIST_IDX(fwd_ref_idx);
03124
03125 if (IL_FLD(fwd_ref_idx) == IL_Tbl_Idx) {
03126 FREE_IR_LIST_NODE(IL_NEXT_LIST_IDX(IL_IDX(fwd_ref_idx)));
03127 FREE_IR_LIST_NODE(IL_IDX(fwd_ref_idx));
03128 }
03129 FREE_IR_LIST_NODE(fwd_ref_idx);
03130 fwd_ref_idx = next_fwd_ref_idx;
03131 }
03132
03133 }
03134 else {
03135
03136 while (fwd_ref_idx != NULL_IDX) {
03137
03138 if (IL_FLD(fwd_ref_idx) == NO_Tbl_Idx) {
03139
03140 if (IL_FORWARD_REF(fwd_ref_idx) == To_Format_Stmt) {
03141 PRINTMSG(IL_LINE_NUM(fwd_ref_idx), 328, Error,
03142 IL_COL_NUM(fwd_ref_idx),
03143 AT_OBJ_NAME_PTR(stmt_label_idx));
03144 }
03145 else if (IL_FORWARD_REF(fwd_ref_idx) == From_Assign_Stmt) {
03146 label_ref_semantics(stmt_label_idx, Assign_Ref,
03147 IL_IDX(fwd_ref_idx),
03148 IL_LINE_NUM(fwd_ref_idx),
03149 IL_COL_NUM(fwd_ref_idx));
03150 }
03151 }
03152 else if (IL_FLD(fwd_ref_idx) == IL_Tbl_Idx) {
03153
03154 check_cmic_blk_branches(IL_IDX(IL_NEXT_LIST_IDX(
03155 IL_IDX(fwd_ref_idx))),
03156 stmt_label_idx,
03157 IL_LINE_NUM(IL_IDX(fwd_ref_idx)),
03158 IL_COL_NUM(IL_IDX(fwd_ref_idx)));
03159
03160 label_ref_semantics(stmt_label_idx, Branch_Context,
03161 IL_IDX(IL_IDX(fwd_ref_idx)),
03162 IL_LINE_NUM(IL_IDX(fwd_ref_idx)),
03163 IL_COL_NUM(IL_IDX(fwd_ref_idx)));
03164 }
03165 else {
03166
03167 check_cmic_blk_branches(NULL_IDX,
03168 stmt_label_idx,
03169 IL_LINE_NUM(fwd_ref_idx),
03170 IL_COL_NUM(fwd_ref_idx));
03171
03172 label_ref_semantics(stmt_label_idx, Branch_Context,
03173 IL_IDX(fwd_ref_idx),
03174 IL_LINE_NUM(fwd_ref_idx),
03175 IL_COL_NUM(fwd_ref_idx));
03176 }
03177
03178 next_fwd_ref_idx = IL_NEXT_LIST_IDX(fwd_ref_idx);
03179
03180 if (IL_FLD(fwd_ref_idx) == IL_Tbl_Idx) {
03181 FREE_IR_LIST_NODE(IL_NEXT_LIST_IDX(IL_IDX(fwd_ref_idx)));
03182 FREE_IR_LIST_NODE(IL_IDX(fwd_ref_idx));
03183 }
03184 FREE_IR_LIST_NODE(fwd_ref_idx);
03185 fwd_ref_idx = next_fwd_ref_idx;
03186 }
03187
03188 }
03189
03190 AT_DEFINED(stmt_label_idx) = TRUE;
03191 ATL_DEF_STMT_IDX(stmt_label_idx) =
03192 (SH_STMT_TYPE(curr_stmt_sh_idx) != Then_Stmt) ? curr_stmt_sh_idx :
03193 SH_PARENT_BLK_IDX(curr_stmt_sh_idx);
03194 }
03195 else {
03196
03197
03198
03199 while (fwd_ref_idx != NULL_IDX) {
03200 next_fwd_ref_idx = IL_NEXT_LIST_IDX(fwd_ref_idx);
03201
03202 if (IL_FLD(fwd_ref_idx) == IL_Tbl_Idx) {
03203 FREE_IR_LIST_NODE(IL_NEXT_LIST_IDX(IL_IDX(fwd_ref_idx)));
03204 FREE_IR_LIST_NODE(IL_IDX(fwd_ref_idx));
03205 }
03206 FREE_IR_LIST_NODE(fwd_ref_idx);
03207 fwd_ref_idx = next_fwd_ref_idx;
03208 }
03209
03210 ATL_FWD_REF_IDX(stmt_label_idx) = NULL_IDX;
03211 AT_DEFINED(stmt_label_idx) = TRUE;
03212 }
03213
03214 TRACE (Func_Exit, "resolve_fwd_lbl_refs", NULL);
03215
03216 return;
03217
03218 }
03219
03220
03221
03222
03223
03224
03225
03226
03227
03228
03229
03230
03231
03232
03233
03234
03235
03236
03237
03238
03239
03240 static void check_cmic_blk_branches(int ref_blk_sh_idx,
03241 int label_attr,
03242 int line,
03243 int col)
03244
03245 {
03246
03247 char str1[32];
03248 char str2[8];
03249 int msg_num;
03250
03251 TRACE (Func_Entry, "check_cmic_blk_branches", NULL);
03252
03253 if (ATL_CLASS(label_attr) == Lbl_User &&
03254 ref_blk_sh_idx != ATL_CMIC_BLK_STMT_IDX(label_attr)) {
03255
03256 if (ATL_CMIC_BLK_STMT_IDX(label_attr) != NULL_IDX) {
03257
03258 block_err_string(IR_OPR(SH_IR_IDX(ATL_CMIC_BLK_STMT_IDX(label_attr))),
03259 str1,
03260 &msg_num);
03261
03262 strcpy(str2, "into");
03263 }
03264 else {
03265 block_err_string(IR_OPR(SH_IR_IDX(ref_blk_sh_idx)),
03266 str1,
03267 &msg_num);
03268
03269 strcpy(str2, "out of");
03270 }
03271
03272 PRINTMSG(line, msg_num, Error, col, str2, str1);
03273 }
03274
03275 TRACE (Func_Exit, "check_cmic_blk_branches", NULL);
03276
03277 return;
03278
03279 }
03280
03281
03282
03283
03284
03285
03286
03287
03288
03289
03290
03291
03292
03293
03294
03295
03296
03297 static void block_err_string(operator_type opr,
03298 char *str,
03299 int *msg_num)
03300
03301 {
03302
03303
03304 TRACE (Func_Entry, "block_err_string", NULL);
03305 switch (opr) {
03306 case Parallel_Cmic_Opr:
03307 strcpy(str, "PARALLEL");
03308 *msg_num = 1220;
03309 break;
03310
03311 case Doall_Cmic_Opr:
03312 strcpy(str, "DOALL");
03313 *msg_num = 1220;
03314 break;
03315
03316 case Guard_Cmic_Opr:
03317 strcpy(str, "GUARD");
03318 *msg_num = 1220;
03319 break;
03320
03321 case Case_Cmic_Opr:
03322 strcpy(str, "CASE");
03323 *msg_num = 1220;
03324 break;
03325
03326 case Parallel_Open_Mp_Opr:
03327 strcpy(str, "!$OMP PARALLEL");
03328 *msg_num = 1503;
03329 break;
03330
03331 case Do_Open_Mp_Opr:
03332 strcpy(str, "!$OMP DO");
03333 *msg_num = 1503;
03334 break;
03335
03336 case Parallelsections_Open_Mp_Opr:
03337 case Sections_Open_Mp_Opr:
03338 case Section_Open_Mp_Opr:
03339 strcpy(str, "!$OMP SECTION");
03340 *msg_num = 1503;
03341 break;
03342
03343 case Single_Open_Mp_Opr:
03344 strcpy(str, "!$OMP SINGLE");
03345 *msg_num = 1503;
03346 break;
03347
03348 case Paralleldo_Open_Mp_Opr:
03349 strcpy(str, "!$OMP PARALLEL DO");
03350 *msg_num = 1503;
03351 break;
03352
03353 case Master_Open_Mp_Opr:
03354 strcpy(str, "!$OMP MASTER");
03355 *msg_num = 1503;
03356 break;
03357
03358 case Critical_Open_Mp_Opr:
03359 strcpy(str, "!$OMP CRITICAL");
03360 *msg_num = 1503;
03361 break;
03362
03363 case Ordered_Open_Mp_Opr:
03364 strcpy(str, "!$OMP ORDERED");
03365 *msg_num = 1503;
03366 break;
03367
03368 case Doacross_Dollar_Opr:
03369 strcpy(str, "!$ DOACROSS");
03370 *msg_num = 1504;
03371 break;
03372
03373 case Psection_Par_Opr:
03374 strcpy(str, "!$PAR PSECTION");
03375 *msg_num = 1504;
03376 break;
03377
03378 case Section_Par_Opr:
03379 strcpy(str, "!$PAR SECTION");
03380 *msg_num = 1504;
03381 break;
03382
03383 case Pdo_Par_Opr:
03384 strcpy(str, "!$PAR PDO");
03385 *msg_num = 1504;
03386 break;
03387
03388 case Parallel_Do_Par_Opr:
03389 strcpy(str, "!$PAR PARALLEL DO");
03390 *msg_num = 1504;
03391 break;
03392
03393 case Parallel_Par_Opr:
03394 strcpy(str, "!$PAR PARALLEL");
03395 *msg_num = 1504;
03396 break;
03397
03398 case Critical_Section_Par_Opr:
03399 strcpy(str, "!$PAR CRITICAL SECTION");
03400 *msg_num = 1504;
03401 break;
03402
03403 case Singleprocess_Par_Opr:
03404 strcpy(str, "!$PAR SINGLE PROCESS");
03405 *msg_num = 1504;
03406 break;
03407
03408 default:
03409 # ifdef _DEBUG
03410 PRINTMSG(1, 626, Internal, 1,
03411 "directive operator", "block_err_string");
03412 # endif
03413 break;
03414 }
03415
03416
03417 TRACE (Func_Exit, "block_err_string", NULL);
03418
03419 return;
03420
03421 }
03422
03423
03424
03425
03426
03427
03428
03429
03430
03431
03432
03433
03434
03435
03436
03437
03438
03439
03440
03441 void mark_attr_defined(opnd_type *opnd)
03442
03443 {
03444 opnd_type l_opnd;
03445
03446 TRACE (Func_Entry, "mark_attr_defined", NULL);
03447
03448 COPY_OPND(l_opnd, (*opnd));
03449
03450 while (OPND_FLD(l_opnd) == IR_Tbl_Idx) {
03451 COPY_OPND(l_opnd, IR_OPND_L(OPND_IDX(l_opnd)));
03452 }
03453
03454 if (OPND_FLD(l_opnd) == AT_Tbl_Idx &&
03455 AT_OBJ_CLASS(OPND_IDX(l_opnd)) == Data_Obj) {
03456
03457 AT_DEFINED(OPND_IDX(l_opnd)) = TRUE;
03458
03459 if (ATD_CLASS(OPND_IDX(l_opnd)) == Function_Result) {
03460 AT_DEFINED(ATD_FUNC_IDX(OPND_IDX(l_opnd))) = TRUE;
03461 }
03462
03463 }
03464
03465
03466 TRACE (Func_Exit, "mark_attr_defined", NULL);
03467
03468 return;
03469
03470 }
03471
03472
03473
03474
03475
03476
03477
03478
03479
03480
03481
03482
03483
03484
03485
03486
03487
03488
03489
03490
03491 boolean paren_grp_is_cplx_const(void)
03492
03493 {
03494 int cx_l = NULL_IDX;
03495 int cx_r = NULL_IDX;
03496 expr_arg_type exp_desc;
03497 boolean is_constant = FALSE;
03498 boolean parsed_ok;
03499 opnd_type the_opnd;
03500
03501
03502 TRACE (Func_Entry, "paren_grp_is_cplx_const", NULL);
03503
03504
03505
03506 if (LA_CH_VALUE == SLASH) {
03507
03508 goto EXIT;
03509 }
03510 else if (!parse_expr(&the_opnd)) {
03511 goto EXIT;
03512 }
03513 else if (LA_CH_VALUE != COMMA) {
03514 goto EXIT;
03515 }
03516
03517
03518 if (OPND_FLD(the_opnd) == CN_Tbl_Idx) {
03519 cx_l = OPND_IDX(the_opnd);
03520 }
03521 else if (OPND_FLD(the_opnd) == AT_Tbl_Idx &&
03522 AT_OBJ_CLASS(OPND_IDX(the_opnd)) == Data_Obj &&
03523 ATD_CLASS(OPND_IDX(the_opnd)) == Constant &&
03524 ATD_FLD(OPND_IDX(the_opnd)) == CN_Tbl_Idx) {
03525
03526 cx_l = ATD_CONST_IDX(OPND_IDX(the_opnd));
03527 }
03528 else if (OPND_FLD(the_opnd) == IR_Tbl_Idx &&
03529 (IR_OPR(OPND_IDX(the_opnd)) == Uplus_Opr ||
03530 IR_OPR(OPND_IDX(the_opnd)) == Uminus_Opr) &&
03531 (IR_FLD_L(OPND_IDX(the_opnd)) == CN_Tbl_Idx ||
03532 (IR_FLD_L(OPND_IDX(the_opnd)) == AT_Tbl_Idx &&
03533 AT_OBJ_CLASS(IR_IDX_L(OPND_IDX(the_opnd))) == Data_Obj &&
03534 ATD_CLASS(IR_IDX_L(OPND_IDX(the_opnd))) == Constant &&
03535 ATD_FLD(IR_IDX_L(OPND_IDX(the_opnd))) == CN_Tbl_Idx))) {
03536
03537 exp_desc.rank = 0;
03538 xref_state = CIF_No_Usage_Rec;
03539 comp_gen_expr = TRUE;
03540 parsed_ok = expr_semantics(&the_opnd, &exp_desc);
03541 comp_gen_expr = FALSE;
03542
03543 if (parsed_ok &&
03544 OPND_FLD(the_opnd) == CN_Tbl_Idx) {
03545 cx_l = OPND_IDX(the_opnd);
03546 }
03547 }
03548
03549 if (cx_l &&
03550 (TYP_TYPE(CN_TYPE_IDX(cx_l)) == Real ||
03551 TYP_TYPE(CN_TYPE_IDX(cx_l)) == Integer)) {
03552
03553
03554 NEXT_LA_CH;
03555
03556 if (!parse_expr(&the_opnd)) {
03557 goto EXIT;
03558 }
03559 else if (LA_CH_VALUE != RPAREN) {
03560 goto EXIT;
03561 }
03562 else {
03563
03564 if (OPND_FLD(the_opnd) == CN_Tbl_Idx) {
03565 cx_r = OPND_IDX(the_opnd);
03566 }
03567 else if (OPND_FLD(the_opnd) == AT_Tbl_Idx &&
03568 AT_OBJ_CLASS(OPND_IDX(the_opnd)) == Data_Obj &&
03569 ATD_CLASS(OPND_IDX(the_opnd)) == Constant &&
03570 ATD_FLD(OPND_IDX(the_opnd)) == CN_Tbl_Idx) {
03571
03572 cx_r = ATD_CONST_IDX(OPND_IDX(the_opnd));
03573 }
03574 else if (OPND_FLD(the_opnd) == IR_Tbl_Idx &&
03575 (IR_OPR(OPND_IDX(the_opnd)) == Uplus_Opr ||
03576 IR_OPR(OPND_IDX(the_opnd)) == Uminus_Opr) &&
03577 (IR_FLD_L(OPND_IDX(the_opnd)) == CN_Tbl_Idx ||
03578 (IR_FLD_L(OPND_IDX(the_opnd)) == AT_Tbl_Idx &&
03579 AT_OBJ_CLASS(IR_IDX_L(OPND_IDX(the_opnd))) == Data_Obj &&
03580 ATD_CLASS(IR_IDX_L(OPND_IDX(the_opnd))) == Constant &&
03581 ATD_FLD(IR_IDX_L(OPND_IDX(the_opnd))) == CN_Tbl_Idx))) {
03582
03583 exp_desc.rank = 0;
03584 xref_state = CIF_No_Usage_Rec;
03585 comp_gen_expr = TRUE;
03586 parsed_ok = expr_semantics(&the_opnd, &exp_desc);
03587 comp_gen_expr = FALSE;
03588
03589 if (parsed_ok &&
03590 OPND_FLD(the_opnd) == CN_Tbl_Idx) {
03591 cx_r = OPND_IDX(the_opnd);
03592 }
03593 }
03594
03595
03596 if (cx_r &&
03597 (TYP_TYPE(CN_TYPE_IDX(cx_r)) == Real ||
03598 TYP_TYPE(CN_TYPE_IDX(cx_r)) == Integer)) {
03599
03600 is_constant = TRUE;
03601 }
03602 }
03603 }
03604
03605
03606 EXIT:
03607
03608 TRACE (Func_Exit, "paren_grp_is_cplx_const", NULL);
03609
03610 return(is_constant);
03611
03612 }
03613
03614
03615
03616
03617
03618
03619
03620
03621
03622
03623
03624
03625
03626
03627
03628
03629
03630 void check_for_vestigial_task_blks(void)
03631
03632 {
03633
03634 TRACE (Func_Entry, "check_for_vestigial_task_blks", NULL);
03635
03636 while (blk_stk_idx > 1 &&
03637 (BLK_TYPE(blk_stk_idx) == Do_Parallel_Blk ||
03638 BLK_TYPE(blk_stk_idx) == SGI_Pdo_Blk ||
03639 BLK_TYPE(blk_stk_idx) == Open_Mp_Do_Blk ||
03640 BLK_TYPE(blk_stk_idx) == Open_Mp_Parallel_Do_Blk)) {
03641
03642 POP_BLK_STK;
03643
03644 switch (CURR_BLK) {
03645 case Do_Parallel_Blk:
03646 CLEAR_DIRECTIVE_STATE(Do_Parallel_Region);
03647 break;
03648
03649 case SGI_Pdo_Blk:
03650 CLEAR_DIRECTIVE_STATE(Pdo_Region);
03651 break;
03652
03653 case Open_Mp_Do_Blk:
03654 CLEAR_DIRECTIVE_STATE(Open_Mp_Do_Region);
03655 break;
03656
03657 case Open_Mp_Parallel_Do_Blk:
03658 CLEAR_DIRECTIVE_STATE(Open_Mp_Parallel_Do_Region);
03659 break;
03660
03661 }
03662 }
03663
03664 TRACE (Func_Exit, "check_for_vestigial_task_blks", NULL);
03665
03666 return;
03667
03668 }
03669
03670
03671
03672
03673
03674
03675
03676
03677
03678
03679
03680
03681
03682
03683
03684
03685
03686 void set_up_fake_dt_blk(int dt_idx)
03687
03688 {
03689
03690
03691 TRACE (Func_Entry, "set_up_fake_dt_blk", NULL);
03692
03693 if (dt_idx == NULL_IDX) {
03694 if (blk_stk_idx > 0) {
03695 POP_BLK_STK;
03696 }
03697 }
03698 else {
03699 PUSH_BLK_STK(Derived_Type_Blk);
03700 CURR_BLK_NAME = dt_idx;
03701 }
03702
03703 TRACE (Func_Exit, "set_up_fake_dt_blk", NULL);
03704
03705 return;
03706
03707 }