Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
00001 /* 00002 00003 Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. 00004 00005 This program is free software; you can redistribute it and/or modify it 00006 under the terms of version 2 of the GNU General Public License as 00007 published by the Free Software Foundation. 00008 00009 This program is distributed in the hope that it would be useful, but 00010 WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 00013 Further, this software is distributed without any warranty that it is 00014 free of the rightful claim of any third person regarding infringement 00015 or the like. Any license provided herein, whether implied or 00016 otherwise, applies only to this software file. Patent licenses, if 00017 any, provided herein do not apply to combinations of this program with 00018 other software, or any other product whatsoever. 00019 00020 You should have received a copy of the GNU General Public License along 00021 with this program; if not, write the Free Software Foundation, Inc., 59 00022 Temple Place - Suite 330, Boston MA 02111-1307, USA. 00023 00024 Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, 00025 Mountain View, CA 94043, or: 00026 00027 http://www.sgi.com 00028 00029 For further information regarding this notice, see: 00030 00031 http://oss.sgi.com/projects/GenInfo/NoticeExplan 00032 00033 */ 00034 00035 00036 00037 static char USMID[] = "\n@(#)5.0_pl/sources/nameres.c 5.3 06/01/99 13:21:01\n"; 00038 00039 # include "defines.h" /* Machine dependent ifdefs */ 00040 00041 # include "host.m" /* Host machine dependent macros.*/ 00042 # include "host.h" /* Host machine dependent header.*/ 00043 # include "target.m" /* Target machine dependent macros.*/ 00044 # include "target.h" /* Target machine dependent header.*/ 00045 00046 # include "globals.m" 00047 # include "tokens.m" 00048 # include "sytb.m" 00049 # include "debug.m" 00050 # include "p_globals.m" 00051 00052 # include "globals.h" 00053 # include "tokens.h" 00054 # include "sytb.h" 00055 # include "nameres.h" 00056 # include "p_globals.h" 00057 00058 00059 /*****************************************************************\ 00060 |* function prototypes of static functions declared in this file *| 00061 \*****************************************************************/ 00062 00063 00064 /******************************************************************************\ 00065 |* *| 00066 |* Description: *| 00067 |* Assumes that the attr in attr_idx has correct flag and field *| 00068 |* combinations set. This routine checks to see if the new_obj attribute*| 00069 |* or name or whatever can be added to the current attr. If it finds an *| 00070 |* error it issues it and returns FALSE. AT_DCL_ERR is set TRUE, if this*| 00071 |* is a declaration check as opposed to a use check. new_obj is an enum *| 00072 |* that covers most of what something can be declared as or used as. It *| 00073 |* resides in globals.h. This routine uses a series of 3 bit vector *| 00074 |* tables. Every obj_type has an entry in the attribute semantic table, *| 00075 |* the name semantic table, and the other semantic table. An obj_type *| 00076 |* entry in any of the tables is a long, that is a series of bits. Each *| 00077 |* bit represents an enum in the table. (ie-> The attribute semantic *| 00078 |* table has an attr enum declared in sytb.h.) There is one bit on an *| 00079 |* object entry for each item in the attr enum.) So all this routine *| 00080 |* does is go through the attr entry, checking to see if what is already *| 00081 |* declared on the attr entry is compatible with the new declaration or *| 00082 |* use of that attr. To check something, is just a table look up. (And *| 00083 |* then a mask and a shift.) If a 1 pops up, it's an illegal combination*| 00084 |* and an error is issued. See more details in nameres.h. and the *| 00085 |* actual tables. *| 00086 |* *| 00087 |* Input parameters: *| 00088 |* new_obj -> An enum describing what is to be added to the attr entry.*| 00089 |* line -> A line number where the addition or use is taking place. *| 00090 |* Used to issue error messages. *| 00091 |* column -> A line number where the addition or use is taking place. *| 00092 |* Used to issue error messages. *| 00093 |* attr_idx -> The attribute to add the new thing to (or to use it.) *| 00094 |* issue_msg -> TRUE if message should be issued. FALSE if fnd_semantic *| 00095 |* _err should just check if this combination is allowed. *| 00096 |* *| 00097 |* Output parameters: *| 00098 |* NONE *| 00099 |* *| 00100 |* Returns: *| 00101 |* TRUE if it found an error. *| 00102 |* *| 00103 \******************************************************************************/ 00104 00105 boolean fnd_semantic_err(obj_type new_obj, 00106 int line, 00107 int column, 00108 int attr_idx, 00109 boolean issue_msg) 00110 00111 { 00112 int array_idx; 00113 long attr_obj_ntry; 00114 long dir_obj_ntry; 00115 int func_idx; 00116 int msg_num = 0; 00117 char *msg_str = NULL; 00118 long name_obj_ntry; 00119 long other_obj_ntry; 00120 int rslt_idx; 00121 boolean set_dcl_err = issue_msg; 00122 00123 00124 TRACE (Func_Entry, "fnd_semantic_err", obj_type_str[new_obj]); 00125 00126 attr_obj_ntry = obj_to_attr[new_obj]; 00127 dir_obj_ntry = obj_to_dir[new_obj]; 00128 name_obj_ntry = obj_to_name[new_obj]; 00129 other_obj_ntry = obj_to_other[new_obj]; 00130 00131 if (AT_OBJ_CLASS(attr_idx) == Data_Obj && ATD_SYMBOLIC_CONSTANT(attr_idx)) { 00132 00133 if (other_obj_ntry & (1 << Other_Npes)) { 00134 msg_num = other_msg_num[new_obj][Other_Npes]; 00135 00136 if (new_obj == Obj_Use_Init_Expr && issue_msg) { 00137 PRINTMSG(line, 1212, Error, column, 00138 AT_OBJ_NAME_PTR(attr_idx)); 00139 00140 /* This will prevent the msg from being issued twice, but */ 00141 /* will still cause fnd_semantic_err to return FALSE. */ 00142 00143 issue_msg = FALSE; 00144 goto ISSUE_ERR; 00145 } 00146 goto ISSUE_ERR; 00147 } 00148 /* If there is an error a message will be printed. If no error */ 00149 /* msg_num is set to zero, so message issuing will be bypassed */ 00150 /* and control will exit this routine. */ 00151 } 00152 00153 if (AT_REFERENCED(attr_idx) == Char_Rslt_Bound_Ref) { 00154 00155 /* This may end up not being host associated. */ 00156 00157 if (other_obj_ntry & (1 << Other_Use_Char_Rslt)) { 00158 msg_num = other_msg_num[new_obj][Other_Use_Char_Rslt]; 00159 goto ISSUE_ERR; 00160 } 00161 } 00162 else if (AT_ATTR_LINK(attr_idx) != NULL_IDX) { /* Host associated item */ 00163 00164 if ((other_obj_ntry & (1 << Other_Host_Assoc)) && 00165 !(AT_OBJ_CLASS(AT_ATTR_LINK(attr_idx)) == Pgm_Unit && 00166 ATP_PROC(AT_ATTR_LINK(attr_idx)) == Intrin_Proc)) { 00167 msg_num = other_msg_num[new_obj][Other_Host_Assoc]; 00168 goto ISSUE_ERR; 00169 } 00170 } 00171 00172 if (AT_USE_ASSOCIATED(attr_idx)) { 00173 00174 if (other_obj_ntry & (1 << Other_Use_Assoc)) { 00175 00176 if (AT_OBJ_CLASS(attr_idx) != Pgm_Unit || 00177 ATP_PGM_UNIT(attr_idx) != Module) { 00178 msg_num = other_msg_num[new_obj][Other_Use_Assoc]; 00179 goto ISSUE_ERR; 00180 } 00181 } 00182 00183 if (AT_NOT_VISIBLE(attr_idx)) { 00184 msg_num = 486; 00185 00186 if (issue_msg) { 00187 PRINTMSG(line, 486, Error, column, 00188 AT_OBJ_NAME_PTR(attr_idx), 00189 AT_OBJ_NAME_PTR(AT_MODULE_IDX((attr_idx)))); 00190 00191 /* This will prevent the msg from being issued twice, but */ 00192 /* will still cause fnd_semantic_err to return FALSE. */ 00193 00194 issue_msg = FALSE; 00195 goto ISSUE_ERR; 00196 } 00197 } 00198 } 00199 00200 switch (AT_OBJ_CLASS(attr_idx)) { 00201 case Data_Obj: 00202 00203 switch (ATD_CLASS(attr_idx)) { 00204 case Atd_Unknown: 00205 if ((AT_REFERENCED(attr_idx) >= Dcl_Bound_Ref || 00206 AT_DEFINED(attr_idx)) && 00207 (other_obj_ntry & (1 << Other_Use_Variable))) { 00208 msg_num = other_msg_num[new_obj][Other_Use_Variable]; 00209 goto ISSUE_ERR; 00210 } 00211 else if (ATD_AUXILIARY(attr_idx) && 00212 (dir_obj_ntry & (1 << Dir_Auxiliary))) { 00213 msg_num = dir_msg_num[new_obj][Dir_Auxiliary]; 00214 msg_str = dir_str[Dir_Auxiliary]; 00215 goto ISSUE_ERR; 00216 } 00217 break; 00218 00219 case Variable: 00220 00221 /* Only a variable can be data initialized, equivalenced, */ 00222 /* in a common block, in auxiliary or saved. */ 00223 00224 # if 0 00225 00226 if (name_obj_ntry & (1 << Name_Variable))) { 00227 msg_num = name_msg_num[new_obj][Name_Variable]; 00228 msg_str = name_str[Name_Variable]; 00229 goto ISSUE_ERR; 00230 } 00231 # endif 00232 if (ATD_DATA_INIT(attr_idx) && 00233 (attr_obj_ntry & (1 << Attr_Data_Init))) { 00234 msg_num = attr_msg_num[new_obj][Attr_Data_Init]; 00235 msg_str = attr_str[Attr_Data_Init]; 00236 goto ISSUE_ERR; 00237 } 00238 else if (ATD_EQUIV(attr_idx) && 00239 (attr_obj_ntry & (1 << Attr_Equivalence))) { 00240 msg_num = attr_msg_num[new_obj][Attr_Equivalence]; 00241 msg_str = attr_str[Attr_Equivalence]; 00242 goto ISSUE_ERR; 00243 } 00244 else if (ATD_SAVED(attr_idx) && 00245 (attr_obj_ntry & (1 << Attr_Save))) { 00246 msg_num = attr_msg_num[new_obj][Attr_Save]; 00247 msg_str = attr_str[Attr_Save]; 00248 goto ISSUE_ERR; 00249 } 00250 else if (ATD_IN_COMMON(attr_idx) && 00251 (name_obj_ntry & (1 << Name_Common_Obj))) { 00252 msg_num = name_msg_num[new_obj][Name_Common_Obj]; 00253 msg_str = name_str[Name_Common_Obj]; 00254 00255 if (issue_msg) { 00256 00257 if (new_obj == Obj_Common_Obj) { 00258 00259 /* duplicate entry in common block*/ 00260 00261 PRINTMSG(line, name_msg_num[Obj_Common_Obj][Name_Common_Obj], 00262 Error, column, 00263 AT_OBJ_NAME_PTR(attr_idx), 00264 SB_NAME_PTR(ATD_STOR_BLK_IDX(attr_idx))); 00265 00266 /* This will prevent the msg from being issued twice, but */ 00267 /* will still cause fnd_semantic_err to return FALSE. */ 00268 00269 issue_msg = FALSE; 00270 } 00271 } 00272 goto ISSUE_ERR; 00273 } 00274 else if (ATD_AUXILIARY(attr_idx) && 00275 (dir_obj_ntry & (1 << Dir_Auxiliary))) { 00276 msg_num = dir_msg_num[new_obj][Dir_Auxiliary]; 00277 msg_str = dir_str[Dir_Auxiliary]; 00278 goto ISSUE_ERR; 00279 } 00280 else if (ATD_SYMMETRIC(attr_idx) && 00281 (dir_obj_ntry & (1 << Dir_Symmetric))) { 00282 msg_num = dir_msg_num[new_obj][Dir_Symmetric]; 00283 msg_str = dir_str[Dir_Symmetric]; 00284 goto ISSUE_ERR; 00285 } 00286 else if ((AT_REFERENCED(attr_idx) >= Dcl_Bound_Ref || 00287 AT_DEFINED(attr_idx)) && 00288 (other_obj_ntry & (1 << Other_Use_Variable))) { 00289 msg_num = other_msg_num[new_obj][Other_Use_Variable]; 00290 goto ISSUE_ERR; 00291 } 00292 break; /* End Variable case */ 00293 00294 case Dummy_Argument: 00295 00296 /* Make sure it has been declared as a DARG before issuing msg */ 00297 /* It may just have OPTIONAL or INTENT declared. */ 00298 00299 if (AT_IS_DARG(attr_idx) && 00300 (name_obj_ntry & (1 << Name_Dummy_Arg))) { 00301 msg_num = name_msg_num[new_obj][Name_Dummy_Arg]; 00302 msg_str = name_str[Name_Dummy_Arg]; 00303 goto ISSUE_ERR; 00304 } 00305 else if (AT_OPTIONAL(attr_idx) && 00306 (attr_obj_ntry & (1 << Attr_Optional) ) ) { 00307 msg_num = attr_msg_num[new_obj][Attr_Optional]; 00308 msg_str = attr_str[Attr_Optional]; 00309 goto ISSUE_ERR; 00310 } 00311 else if (ATD_INTENT(attr_idx) != Intent_Unseen && 00312 (attr_obj_ntry & (1 << Attr_Intent)) ) { 00313 msg_num = attr_msg_num[new_obj][Attr_Intent]; 00314 msg_str = attr_str[Attr_Intent]; 00315 goto ISSUE_ERR; 00316 } 00317 else if (ATD_AUXILIARY(attr_idx) && 00318 (dir_obj_ntry & (1 << Dir_Auxiliary))) { 00319 msg_num = dir_msg_num[new_obj][Dir_Auxiliary]; 00320 msg_str = dir_str[Dir_Auxiliary]; 00321 goto ISSUE_ERR; 00322 } 00323 else if (ATD_IGNORE_TKR(attr_idx) && 00324 (dir_obj_ntry & (1 << Dir_Ignore_TKR)) ) { 00325 msg_num = dir_msg_num[new_obj][Dir_Ignore_TKR]; 00326 msg_str = dir_str[Dir_Ignore_TKR]; 00327 goto ISSUE_ERR; 00328 } 00329 else if ((AT_REFERENCED(attr_idx) >= Dcl_Bound_Ref || 00330 AT_DEFINED(attr_idx)) && 00331 (other_obj_ntry & (1 << Other_Use_Dummy_Arg))) { 00332 msg_num = other_msg_num[new_obj][Other_Use_Dummy_Arg]; 00333 goto ISSUE_ERR; 00334 } 00335 break; /* End Dummy_Arg case */ 00336 00337 case Function_Result: 00338 00339 if (name_obj_ntry & (1 << Name_Func_Result)) { 00340 msg_num = name_msg_num[new_obj][Name_Func_Result]; 00341 msg_str = name_str[Name_Func_Result]; 00342 goto ISSUE_ERR; 00343 } 00344 00345 func_idx = ATD_FUNC_IDX(attr_idx); 00346 00347 if (AT_ATTR_LINK(func_idx) != NULL_IDX) { /* Host associated item */ 00348 00349 if ((other_obj_ntry & (1 << Other_Host_Assoc)) && 00350 !(AT_OBJ_CLASS(AT_ATTR_LINK(func_idx)) == Pgm_Unit && 00351 ATP_PROC(AT_ATTR_LINK(func_idx)) == Intrin_Proc)) { 00352 msg_num = other_msg_num[new_obj][Other_Host_Assoc]; 00353 goto ISSUE_ERR; 00354 } 00355 } 00356 00357 if (!ATP_EXPL_ITRFC(func_idx)) { 00358 00359 if (ATP_VFUNCTION(func_idx) && 00360 (dir_obj_ntry & (1<<Dir_Vfunction))) { 00361 msg_num = dir_msg_num[new_obj][Dir_Vfunction]; 00362 msg_str = dir_str[Dir_Vfunction]; 00363 goto ISSUE_ERR; 00364 } 00365 00366 if (ATP_NOSIDE_EFFECTS(func_idx) && 00367 (dir_obj_ntry & (1 << Dir_No_Side_Effects)) ) { 00368 msg_num = dir_msg_num[new_obj][Dir_No_Side_Effects]; 00369 msg_str = dir_str[Dir_No_Side_Effects]; 00370 goto ISSUE_ERR; 00371 } 00372 00373 if (ATP_DCL_EXTERNAL(func_idx) && 00374 attr_obj_ntry & (1 << Attr_External)) { 00375 msg_num = attr_msg_num[new_obj][Attr_External]; 00376 msg_str = attr_str[Attr_External]; 00377 goto ISSUE_ERR; 00378 } 00379 00380 if (AT_OPTIONAL(func_idx) && attr_obj_ntry & (1 << Attr_Optional)) { 00381 msg_num = attr_msg_num[new_obj][Attr_Optional]; 00382 msg_str = attr_str[Attr_Optional]; 00383 goto ISSUE_ERR; 00384 } 00385 } 00386 00387 break; /* End Function_Result case */ 00388 00389 case CRI__Pointee: 00390 00391 if (TYP_TYPE(ATD_TYPE_IDX(attr_idx)) == Character && 00392 AT_TYPED(attr_idx) && 00393 (name_obj_ntry & (1 << Name_Cri_Ch_Pointee))) { 00394 msg_num = name_msg_num[new_obj][Name_Cri_Ch_Pointee]; 00395 msg_str = name_str[Name_Cri_Ch_Pointee]; 00396 goto ISSUE_ERR; 00397 } 00398 else if (name_obj_ntry & (1 << Name_Cri_Pointee)) { 00399 msg_num = name_msg_num[new_obj][Name_Cri_Pointee]; 00400 msg_str = name_str[Name_Cri_Pointee]; 00401 goto ISSUE_ERR; 00402 } 00403 break; /* End CRI__Pointee case */ 00404 00405 case Constant: 00406 if (attr_obj_ntry & (1 << Attr_Parameter)) { 00407 msg_num = attr_msg_num[new_obj][Attr_Parameter]; 00408 msg_str = attr_str[Attr_Parameter]; 00409 goto ISSUE_ERR; 00410 } 00411 break; /* End constant case */ 00412 00413 case Compiler_Tmp: 00414 case Struct_Component: 00415 break; 00416 00417 } /* End switch */ 00418 00419 if (ATD_VOLATILE(attr_idx) && (attr_obj_ntry & (1 << Attr_Volatile))) { 00420 msg_num = attr_msg_num[new_obj][Attr_Volatile]; 00421 msg_str = attr_str[Attr_Volatile]; 00422 goto ISSUE_ERR; 00423 } 00424 00425 if ((ATD_COPY_ASSUMED_SHAPE(attr_idx) || 00426 (SCP_COPY_ASSUMED_SHAPE(curr_scp_idx) && 00427 ATD_ARRAY_IDX(attr_idx) != NULL_IDX && 00428 BD_ARRAY_CLASS(ATD_ARRAY_IDX(attr_idx)) == Assumed_Shape)) && 00429 dir_obj_ntry & (1 << Dir_Copy_Assumed_Shape)) { 00430 msg_num = dir_msg_num[new_obj][Dir_Copy_Assumed_Shape]; 00431 msg_str = dir_str[Dir_Copy_Assumed_Shape]; 00432 goto ISSUE_ERR; 00433 } 00434 00435 if (ATD_ALLOCATABLE(attr_idx) && 00436 (attr_obj_ntry & (1 << Attr_Allocatable))) { 00437 msg_num = attr_msg_num[new_obj][Attr_Allocatable]; 00438 msg_str = attr_str[Attr_Allocatable]; 00439 goto ISSUE_ERR; 00440 } 00441 00442 if (ATD_STACK(attr_idx) && 00443 (attr_obj_ntry & (1 << Attr_Automatic))) { 00444 msg_num = attr_msg_num[new_obj][Attr_Automatic]; 00445 msg_str = attr_str[Attr_Automatic]; 00446 goto ISSUE_ERR; 00447 } 00448 00449 if (ATD_FILL_SYMBOL(attr_idx) && 00450 dir_obj_ntry & (1 << Dir_Fill_Symbol)) { 00451 msg_num = dir_msg_num[new_obj][Dir_Fill_Symbol]; 00452 msg_str = dir_str[Dir_Fill_Symbol]; 00453 goto ISSUE_ERR; 00454 } 00455 00456 if (ATD_ALIGN_SYMBOL(attr_idx) && 00457 dir_obj_ntry & (1 << Dir_Align_Symbol)) { 00458 msg_num = dir_msg_num[new_obj][Dir_Align_Symbol]; 00459 msg_str = dir_str[Dir_Align_Symbol]; 00460 goto ISSUE_ERR; 00461 } 00462 00463 if (ATD_SECTION_GP(attr_idx) && 00464 dir_obj_ntry & (1 << Dir_Section_Gp)) { 00465 msg_num = dir_msg_num[new_obj][Dir_Section_Gp]; 00466 msg_str = dir_str[Dir_Section_Gp]; 00467 goto ISSUE_ERR; 00468 } 00469 00470 if (ATD_SECTION_NON_GP(attr_idx) && 00471 dir_obj_ntry & (1 << Dir_Section_Non_Gp)) { 00472 msg_num = dir_msg_num[new_obj][Dir_Section_Non_Gp]; 00473 msg_str = dir_str[Dir_Section_Non_Gp]; 00474 goto ISSUE_ERR; 00475 } 00476 00477 array_idx = ATD_ARRAY_IDX(attr_idx); 00478 00479 if (array_idx != NULL_IDX) { 00480 00481 if (attr_obj_ntry & (1 << Attr_Dimension)) { 00482 msg_num = attr_msg_num[new_obj][Attr_Dimension]; 00483 msg_str = attr_str[Attr_Dimension]; 00484 goto ISSUE_ERR; 00485 } 00486 00487 switch (BD_ARRAY_CLASS(array_idx)) { 00488 case Explicit_Shape: 00489 00490 switch (BD_ARRAY_SIZE(array_idx)) { 00491 case Unknown_Size: 00492 case Constant_Size: 00493 case Symbolic_Constant_Size: 00494 00495 if (attr_obj_ntry & (1 << Attr_Explicit_Shp_Arr)) { 00496 msg_num = attr_msg_num[new_obj][Attr_Explicit_Shp_Arr]; 00497 msg_str = attr_str[Attr_Explicit_Shp_Arr]; 00498 goto ISSUE_ERR; 00499 } 00500 break; 00501 00502 case Var_Len_Array: 00503 00504 if (other_obj_ntry & (1 << Other_Var_Len_Arr)) { 00505 msg_num = other_msg_num[new_obj][Other_Var_Len_Arr]; 00506 goto ISSUE_ERR; 00507 } 00508 break; 00509 00510 } 00511 break; 00512 00513 case Assumed_Size: 00514 if (attr_obj_ntry & (1 << Attr_Assumed_Size_Arr)) { 00515 msg_num = attr_msg_num[new_obj][Attr_Assumed_Size_Arr]; 00516 msg_str = attr_str[Attr_Assumed_Size_Arr]; 00517 goto ISSUE_ERR; 00518 } 00519 break; 00520 00521 case Deferred_Shape: 00522 if (attr_obj_ntry & (1 << Attr_Deferred_Shp_Arr)) { 00523 msg_num = attr_msg_num[new_obj][Attr_Deferred_Shp_Arr]; 00524 msg_str = attr_str[Attr_Deferred_Shp_Arr]; 00525 goto ISSUE_ERR; 00526 } 00527 break; 00528 00529 case Assumed_Shape: 00530 if (attr_obj_ntry & (1 << Attr_Assumed_Shp_Arr)) { 00531 msg_num = attr_msg_num[new_obj][Attr_Assumed_Shp_Arr]; 00532 msg_str = attr_str[Attr_Assumed_Shp_Arr]; 00533 goto ISSUE_ERR; 00534 } 00535 break; 00536 00537 # ifdef _DEBUG 00538 default: 00539 PRINTMSG(AT_DEF_LINE(attr_idx), 179, Internal, 00540 AT_DEF_COLUMN(attr_idx), "fnd_semantic_err"); 00541 break; 00542 # endif 00543 } /* End switch */ 00544 } 00545 00546 # ifdef COARRAY_FORTRAN 00547 array_idx = ATD_PE_ARRAY_IDX(attr_idx); 00548 00549 if (array_idx != NULL_IDX) { 00550 if (attr_obj_ntry & (1 << Attr_Co_Array)) { 00551 msg_num = attr_msg_num[new_obj][Attr_Co_Array]; 00552 msg_str = attr_str[Attr_Co_Array]; 00553 goto ISSUE_ERR; 00554 } 00555 } 00556 # endif 00557 00558 if (AT_TYPED(attr_idx)) { 00559 00560 if (ATD_TYPE_IDX(attr_idx) == CRI_Ptr_8 || 00561 ATD_TYPE_IDX(attr_idx) == CRI_Ch_Ptr_8) { 00562 00563 if (name_obj_ntry & (1 << Name_Cri_Pointer)) { 00564 msg_num = name_msg_num[new_obj][Name_Cri_Pointer]; 00565 msg_str = name_str[Name_Cri_Pointer]; 00566 goto ISSUE_ERR; 00567 } 00568 } 00569 else if (attr_obj_ntry & (1 << Attr_Type)) { 00570 msg_num = attr_msg_num[new_obj][Attr_Type]; 00571 msg_str = get_basic_type_str(ATD_TYPE_IDX(attr_idx)); 00572 00573 if (new_obj == Obj_Typed) { 00574 00575 /* Try to get a real nice message. Check to see if this is */ 00576 /* being retyped as the same type. If it is, use a better */ 00577 /* message. */ 00578 00579 if (strcmp(msg_str, obj_str[new_obj]) == 0) { 00580 msg_num = 554; /* Retype as same type message */ 00581 } 00582 } 00583 00584 goto ISSUE_ERR; 00585 } 00586 else if (TYP_TYPE(ATD_TYPE_IDX(attr_idx)) == Character) { 00587 00588 if (TYP_CHAR_CLASS(ATD_TYPE_IDX(attr_idx)) == Assumed_Size_Char) { 00589 00590 if (attr_obj_ntry & (1 << Attr_Assumed_Type_Ch)) { 00591 msg_num = attr_msg_num[new_obj][Attr_Assumed_Type_Ch]; 00592 msg_str = attr_str[Attr_Assumed_Type_Ch]; 00593 goto ISSUE_ERR; 00594 } 00595 } 00596 else if (TYP_CHAR_CLASS(ATD_TYPE_IDX(attr_idx)) == Var_Len_Char) { 00597 00598 if (other_obj_ntry & (1 << Other_Var_Len_Ch)) { 00599 msg_num = other_msg_num[new_obj][Other_Var_Len_Ch]; 00600 goto ISSUE_ERR; 00601 } 00602 } 00603 } 00604 } 00605 00606 if (ATD_POINTER(attr_idx) && (attr_obj_ntry & (1 << Attr_Pointer))) { 00607 msg_num = attr_msg_num[new_obj][Attr_Pointer]; 00608 msg_str = attr_str[Attr_Pointer]; 00609 goto ISSUE_ERR; 00610 } 00611 else if (ATD_TARGET(attr_idx) && (attr_obj_ntry & (1 << Attr_Target))) { 00612 msg_num = attr_msg_num[new_obj][Attr_Target]; 00613 msg_str = attr_str[Attr_Target]; 00614 goto ISSUE_ERR; 00615 } 00616 else if (AT_NAMELIST_OBJ(attr_idx) && 00617 (name_obj_ntry & (1 << Name_Namelist_Group_Obj))) { 00618 msg_num = name_msg_num[new_obj][Name_Namelist_Group_Obj]; 00619 msg_str = name_str[Name_Namelist_Group_Obj]; 00620 goto ISSUE_ERR; 00621 } 00622 break; 00623 00624 00625 case Pgm_Unit: 00626 00627 switch (ATP_PGM_UNIT(attr_idx)) { 00628 case Program: 00629 if (name_obj_ntry & (1 << Name_Program)) { 00630 msg_num = name_msg_num[new_obj][Name_Program]; 00631 msg_str = name_str[Name_Program]; 00632 goto ISSUE_ERR; 00633 } 00634 break; 00635 00636 case Blockdata: 00637 if (name_obj_ntry & (1 << Name_Blockdata)) { 00638 msg_num = name_msg_num[new_obj][Name_Blockdata]; 00639 msg_str = name_str[Name_Blockdata]; 00640 goto ISSUE_ERR; 00641 } 00642 break; 00643 00644 case Module: 00645 if (name_obj_ntry & (1 << Name_Module)) { 00646 msg_num = name_msg_num[new_obj][Name_Module]; 00647 msg_str = name_str[Name_Module]; 00648 goto ISSUE_ERR; 00649 } 00650 break; 00651 00652 case Subroutine: 00653 00654 /* Check if this is the current pgm unit, because the current pgm */ 00655 /* unit will always have ATP_EXPL_ITRFC set. It's okay to define */ 00656 /* things in the current program unit, just not in other scoping */ 00657 /* units. Need to check scope alive with alternate entry to make */ 00658 /* sure this is a current alternate entry and not one that was */ 00659 /* declared in a previous module procedure within this module. */ 00660 00661 if (attr_idx == SCP_ATTR_IDX(curr_scp_idx) || 00662 (ATP_ALT_ENTRY(attr_idx) && ATP_SCP_ALIVE(attr_idx))) { 00663 00664 if (name_obj_ntry & (1 << Name_Curr_Subr)) { 00665 msg_num = name_msg_num[new_obj][Name_Curr_Subr]; 00666 msg_str = name_str[Name_Curr_Subr]; 00667 goto ISSUE_ERR; 00668 } 00669 } 00670 else { 00671 switch (ATP_PROC(attr_idx)) { 00672 case Dummy_Proc: 00673 if (ATP_EXPL_ITRFC(attr_idx)) { 00674 00675 if (other_obj_ntry & (1 << Other_Expl_Interface)) { 00676 msg_num = other_msg_num[new_obj][Other_Expl_Interface]; 00677 goto ISSUE_ERR; 00678 } 00679 } 00680 else if (ATP_DCL_EXTERNAL(attr_idx)) { 00681 00682 if (attr_obj_ntry & (1 << Attr_External)) { 00683 msg_num = attr_msg_num[new_obj][Attr_External]; 00684 msg_str = attr_str[Attr_External]; 00685 goto ISSUE_ERR; 00686 } 00687 } 00688 else if (AT_OPTIONAL(attr_idx) && 00689 attr_obj_ntry & (1 << Attr_Optional)) { 00690 msg_num = attr_msg_num[new_obj][Attr_Optional]; 00691 msg_str = attr_str[Attr_Optional]; 00692 goto ISSUE_ERR; 00693 } 00694 else if (AT_REFERENCED(attr_idx) >= Dcl_Bound_Ref || 00695 other_obj_ntry & (1 << Other_Use_Subr)) { 00696 msg_num = other_msg_num[new_obj][Other_Use_Subr]; 00697 goto ISSUE_ERR; 00698 } 00699 break; 00700 00701 case Extern_Proc: 00702 if (ATP_EXPL_ITRFC(attr_idx)) { 00703 00704 if (other_obj_ntry & (1 << Other_Expl_Interface)) { 00705 msg_num = other_msg_num[new_obj][Other_Expl_Interface]; 00706 goto ISSUE_ERR; 00707 } 00708 } 00709 else if (ATP_DCL_EXTERNAL(attr_idx)) { 00710 00711 if (attr_obj_ntry & (1 << Attr_External)) { 00712 msg_num = attr_msg_num[new_obj][Attr_External]; 00713 msg_str = attr_str[Attr_External]; 00714 goto ISSUE_ERR; 00715 } 00716 } 00717 else if (AT_REFERENCED(attr_idx) >= Dcl_Bound_Ref || 00718 other_obj_ntry & (1 << Other_Use_Subr)) { 00719 msg_num = other_msg_num[new_obj][Other_Use_Subr]; 00720 goto ISSUE_ERR; 00721 } 00722 break; 00723 00724 00725 case Intrin_Proc: 00726 00727 if (name_obj_ntry & (1 << Name_Intrinsic_Subr)) { 00728 msg_num = name_msg_num[new_obj][Name_Intrinsic_Subr]; 00729 msg_str = name_str[Name_Intrinsic_Subr]; 00730 goto ISSUE_ERR; 00731 } 00732 break; 00733 00734 case Module_Proc: 00735 00736 if (ATP_EXPL_ITRFC(attr_idx)) { 00737 00738 if (other_obj_ntry & (1 << Other_Expl_Interface)) { 00739 msg_num = other_msg_num[new_obj][Other_Expl_Interface]; 00740 goto ISSUE_ERR; 00741 } 00742 } 00743 else if (name_obj_ntry & (1 << Name_Module_Proc)) { 00744 msg_num = name_msg_num[new_obj][Name_Module_Proc]; 00745 msg_str = name_str[Name_Module_Proc]; 00746 goto ISSUE_ERR; 00747 } 00748 break; 00749 00750 case Intern_Proc: 00751 if (name_obj_ntry & (1 << Name_Internal_Subr)) { 00752 msg_num = name_msg_num[new_obj][Name_Internal_Subr]; 00753 msg_str = name_str[Name_Internal_Subr]; 00754 goto ISSUE_ERR; 00755 } 00756 break; 00757 00758 case Unknown_Proc: 00759 if (other_obj_ntry & (1 << Other_Use_Subr)) { 00760 msg_num = other_msg_num[new_obj][Other_Use_Subr]; 00761 goto ISSUE_ERR; 00762 } 00763 break; 00764 } /* End switch */ 00765 00766 00767 if (ATP_VFUNCTION(attr_idx) && 00768 (dir_obj_ntry & (1 << Dir_Vfunction)) ) { 00769 msg_num = dir_msg_num[new_obj][Dir_Vfunction]; 00770 msg_str = dir_str[Dir_Vfunction]; 00771 goto ISSUE_ERR; 00772 } 00773 else if (ATP_NOSIDE_EFFECTS(attr_idx) && 00774 (dir_obj_ntry & (1 << Dir_No_Side_Effects)) ) { 00775 msg_num = dir_msg_num[new_obj][Dir_No_Side_Effects]; 00776 msg_str = dir_str[Dir_No_Side_Effects]; 00777 goto ISSUE_ERR; 00778 } 00779 else if (ATP_NAME_IN_STONE(attr_idx) && 00780 (dir_obj_ntry & (1 << Dir_Name)) ) { 00781 msg_num = dir_msg_num[new_obj][Dir_Name]; 00782 msg_str = dir_str[Dir_Name]; 00783 goto ISSUE_ERR; 00784 } 00785 else if ((ATP_INLINE_ALWAYS(attr_idx) || 00786 ATP_INLINE_NEVER(attr_idx))&& 00787 (dir_obj_ntry & (1 << Dir_Inline)) ) { 00788 msg_num = dir_msg_num[new_obj][Dir_Inline]; 00789 msg_str = dir_str[Dir_Inline]; 00790 goto ISSUE_ERR; 00791 } 00792 } 00793 break; 00794 00795 00796 case Function: 00797 00798 /* Check if this is the current pgm unit, because the current pgm */ 00799 /* unit will always have ATP_EXPL_ITRFC set. It's okay to define */ 00800 /* things in the current program unit, just not in other scoping */ 00801 /* units. Need to check scope alive with alternate entry to make */ 00802 /* sure this is a current alternate entry and not one that was */ 00803 /* declared in a previous module procedure within this module. */ 00804 00805 if (attr_idx == SCP_ATTR_IDX(curr_scp_idx) || 00806 (ATP_ALT_ENTRY(attr_idx) && ATP_SCP_ALIVE(attr_idx))) { 00807 00808 if (name_obj_ntry & (1 << Name_Curr_Func)) { 00809 msg_num = name_msg_num[new_obj][Name_Curr_Func]; 00810 msg_str = name_str[Name_Curr_Func]; 00811 goto ISSUE_ERR; 00812 } 00813 } 00814 else { 00815 00816 switch (ATP_PROC(attr_idx)) { 00817 case Dummy_Proc: 00818 if (ATP_EXPL_ITRFC(attr_idx)) { 00819 00820 if (other_obj_ntry & (1 << Other_Expl_Interface)) { 00821 msg_num = other_msg_num[new_obj][Other_Expl_Interface]; 00822 goto ISSUE_ERR; 00823 } 00824 } 00825 else if (ATP_DCL_EXTERNAL(attr_idx)) { 00826 00827 if (attr_obj_ntry & (1 << Attr_External)) { 00828 msg_num = attr_msg_num[new_obj][Attr_External]; 00829 msg_str = attr_str[Attr_External]; 00830 goto ISSUE_ERR; 00831 } 00832 } 00833 else if (AT_OPTIONAL(attr_idx) && 00834 attr_obj_ntry & (1 << Attr_Optional)) { 00835 msg_num = attr_msg_num[new_obj][Attr_Optional]; 00836 msg_str = attr_str[Attr_Optional]; 00837 goto ISSUE_ERR; 00838 } 00839 else if ((AT_REFERENCED(attr_idx) >= Dcl_Bound_Ref || 00840 AT_DEFINED(attr_idx)) && 00841 (other_obj_ntry & (1 << Other_Use_Func))) { 00842 msg_num = other_msg_num[new_obj][Other_Use_Func]; 00843 goto ISSUE_ERR; 00844 } 00845 break; 00846 00847 case Extern_Proc: 00848 if (ATP_EXPL_ITRFC(attr_idx)) { 00849 00850 if (other_obj_ntry & (1 << Other_Expl_Interface)) { 00851 msg_num = other_msg_num[new_obj][Other_Expl_Interface]; 00852 goto ISSUE_ERR; 00853 } 00854 } 00855 else if (ATP_DCL_EXTERNAL(attr_idx)) { 00856 00857 if (attr_obj_ntry & (1 << Attr_External)) { 00858 msg_num = attr_msg_num[new_obj][Attr_External]; 00859 msg_str = attr_str[Attr_External]; 00860 goto ISSUE_ERR; 00861 } 00862 } 00863 else if ((AT_REFERENCED(attr_idx) >= Dcl_Bound_Ref || 00864 AT_DEFINED(attr_idx)) && 00865 (other_obj_ntry & (1 << Other_Use_Func))) { 00866 msg_num = other_msg_num[new_obj][Other_Use_Func]; 00867 goto ISSUE_ERR; 00868 } 00869 break; 00870 00871 case Intrin_Proc: 00872 00873 if (name_obj_ntry & (1 << Name_Intrinsic_Func)) { 00874 msg_num = name_msg_num[new_obj][Name_Intrinsic_Func]; 00875 msg_str = name_str[Name_Intrinsic_Func]; 00876 goto ISSUE_ERR; 00877 } 00878 break; 00879 00880 case Module_Proc: 00881 00882 if (ATP_EXPL_ITRFC(attr_idx)) { 00883 00884 if (other_obj_ntry & (1 << Other_Expl_Interface)) { 00885 msg_num = other_msg_num[new_obj][Other_Expl_Interface]; 00886 goto ISSUE_ERR; 00887 } 00888 } 00889 else if (name_obj_ntry & (1 << Name_Module_Proc)) { 00890 msg_num = name_msg_num[new_obj][Name_Module_Proc]; 00891 msg_str = name_str[Name_Module_Proc]; 00892 goto ISSUE_ERR; 00893 } 00894 break; 00895 00896 case Intern_Proc: 00897 if (name_obj_ntry & (1 << Name_Internal_Func)) { 00898 msg_num = name_msg_num[new_obj][Name_Internal_Func]; 00899 msg_str = name_str[Name_Internal_Func]; 00900 goto ISSUE_ERR; 00901 } 00902 break; 00903 00904 case Unknown_Proc: 00905 00906 if ((AT_REFERENCED(attr_idx) >= Dcl_Bound_Ref || 00907 AT_DEFINED(attr_idx)) && 00908 (other_obj_ntry & (1 << Other_Use_Func))) { 00909 msg_num = other_msg_num[new_obj][Other_Use_Func]; 00910 goto ISSUE_ERR; 00911 } 00912 break; 00913 } /* End switch */ 00914 00915 if (ATP_VFUNCTION(attr_idx) && 00916 (dir_obj_ntry & (1 << Dir_Vfunction)) ) { 00917 msg_num = dir_msg_num[new_obj][Dir_Vfunction]; 00918 msg_str = dir_str[Dir_Vfunction]; 00919 goto ISSUE_ERR; 00920 } 00921 else if (ATP_NOSIDE_EFFECTS(attr_idx) && 00922 (dir_obj_ntry & (1 << Dir_No_Side_Effects)) ) { 00923 msg_num = dir_msg_num[new_obj][Dir_No_Side_Effects]; 00924 msg_str = dir_str[Dir_No_Side_Effects]; 00925 goto ISSUE_ERR; 00926 } 00927 else if (ATP_NAME_IN_STONE(attr_idx) && 00928 (dir_obj_ntry & (1 << Dir_Name)) ) { 00929 msg_num = dir_msg_num[new_obj][Dir_Name]; 00930 msg_str = dir_str[Dir_Name]; 00931 goto ISSUE_ERR; 00932 } 00933 else if (name_obj_ntry & (1 << Name_Function)) { 00934 msg_num = name_msg_num[new_obj][Name_Function]; 00935 msg_str = name_str[Name_Function]; 00936 goto ISSUE_ERR; 00937 } 00938 } 00939 00940 rslt_idx = ATP_RSLT_IDX(attr_idx); 00941 array_idx = ATD_ARRAY_IDX(rslt_idx); 00942 00943 if (array_idx != NULL_IDX) { 00944 00945 if (attr_obj_ntry & (1 << Attr_Dimension)) { 00946 msg_num = attr_msg_num[new_obj][Attr_Dimension]; 00947 msg_str = attr_str[Attr_Dimension]; 00948 goto ISSUE_ERR; 00949 } 00950 00951 switch (BD_ARRAY_CLASS(array_idx)) { 00952 case Explicit_Shape: 00953 00954 switch (BD_ARRAY_SIZE(array_idx)) { 00955 case Unknown_Size: 00956 case Constant_Size: 00957 case Symbolic_Constant_Size: 00958 if (attr_obj_ntry & (1 << Attr_Explicit_Shp_Arr)) { 00959 msg_num = attr_msg_num[new_obj][Attr_Explicit_Shp_Arr]; 00960 msg_str = attr_str[Attr_Explicit_Shp_Arr]; 00961 goto ISSUE_ERR; 00962 } 00963 break; 00964 00965 case Var_Len_Array: 00966 if (other_obj_ntry & (1 << Other_Var_Len_Arr)) { 00967 msg_num = other_msg_num[new_obj][Other_Var_Len_Arr]; 00968 goto ISSUE_ERR; 00969 } 00970 break; 00971 } /* End switch */ 00972 break; 00973 00974 case Deferred_Shape: 00975 if (attr_obj_ntry & (1 << Attr_Deferred_Shp_Arr)) { 00976 msg_num = attr_msg_num[new_obj][Attr_Deferred_Shp_Arr]; 00977 msg_str = attr_str[Attr_Deferred_Shp_Arr]; 00978 goto ISSUE_ERR; 00979 } 00980 break; 00981 } /* End switch */ 00982 } 00983 00984 if (AT_TYPED(rslt_idx)) { 00985 00986 if (attr_obj_ntry & (1 << Attr_Type)) { 00987 msg_num = attr_msg_num[new_obj][Attr_Type]; 00988 msg_str = get_basic_type_str(ATD_TYPE_IDX(rslt_idx)); 00989 00990 if (new_obj == Obj_Typed) { 00991 00992 /* Try to get a real nice message. Check to see if this is */ 00993 /* being retyped as the same type. If it is, use a better */ 00994 /* message. */ 00995 00996 if (strcmp(msg_str, obj_str[new_obj]) == 0) { 00997 msg_num = 554; /* Retype as same type message */ 00998 } 00999 } 01000 goto ISSUE_ERR; 01001 } 01002 else if (TYP_TYPE(ATD_TYPE_IDX(rslt_idx)) == Character) { 01003 01004 if (TYP_CHAR_CLASS(ATD_TYPE_IDX(rslt_idx)) == Assumed_Size_Char){ 01005 01006 if (attr_obj_ntry & (1 << Attr_Assumed_Type_Ch)) { 01007 msg_num = attr_msg_num[new_obj][Attr_Assumed_Type_Ch]; 01008 msg_str = attr_str[Attr_Assumed_Type_Ch]; 01009 goto ISSUE_ERR; 01010 } 01011 } 01012 else if (TYP_CHAR_CLASS(ATD_TYPE_IDX(rslt_idx)) == Var_Len_Char){ 01013 01014 if (other_obj_ntry & (1 << Other_Var_Len_Ch)) { 01015 msg_num = other_msg_num[new_obj][Other_Var_Len_Ch]; 01016 goto ISSUE_ERR; 01017 } 01018 } 01019 } 01020 } 01021 01022 if (ATD_POINTER(rslt_idx) && (attr_obj_ntry & (1 << Attr_Pointer))){ 01023 msg_num = attr_msg_num[new_obj][Attr_Pointer]; 01024 msg_str = attr_str[Attr_Pointer]; 01025 goto ISSUE_ERR; 01026 } 01027 else if (ATD_TARGET(rslt_idx) && (attr_obj_ntry & (1 << Attr_Target))){ 01028 msg_num = attr_msg_num[new_obj][Attr_Target]; 01029 msg_str = attr_str[Attr_Target]; 01030 goto ISSUE_ERR; 01031 } 01032 break; 01033 01034 01035 case Pgm_Unknown: 01036 01037 switch (ATP_PROC(attr_idx)) { 01038 case Dummy_Proc: 01039 case Extern_Proc: 01040 if (ATP_DCL_EXTERNAL(attr_idx)) { 01041 01042 if (attr_obj_ntry & (1 << Attr_External)) { 01043 msg_num = attr_msg_num[new_obj][Attr_External]; 01044 msg_str = attr_str[Attr_External]; 01045 goto ISSUE_ERR; 01046 } 01047 } 01048 else if (AT_OPTIONAL(attr_idx) && 01049 attr_obj_ntry & (1 << Attr_Optional)) { 01050 msg_num = attr_msg_num[new_obj][Attr_Optional]; 01051 msg_str = attr_str[Attr_Optional]; 01052 goto ISSUE_ERR; 01053 } 01054 else if (ATP_NAME_IN_STONE(attr_idx) && 01055 (dir_obj_ntry & (1 << Dir_Name)) ) { 01056 msg_num = dir_msg_num[new_obj][Dir_Name]; 01057 msg_str = dir_str[Dir_Name]; 01058 goto ISSUE_ERR; 01059 } 01060 else if ((ATP_INLINE_ALWAYS(attr_idx) || 01061 ATP_INLINE_NEVER(attr_idx))&& 01062 (dir_obj_ntry & (1 << Dir_Inline)) ) { 01063 msg_num = dir_msg_num[new_obj][Dir_Inline]; 01064 msg_str = dir_str[Dir_Inline]; 01065 goto ISSUE_ERR; 01066 } 01067 break; 01068 01069 case Intrin_Proc: 01070 break; 01071 01072 case Module_Proc: 01073 01074 if (name_obj_ntry & (1 << Name_Module_Proc)) { 01075 msg_num = name_msg_num[new_obj][Name_Module_Proc]; 01076 msg_str = name_str[Name_Module_Proc]; 01077 goto ISSUE_ERR; 01078 } 01079 break; 01080 # ifdef _DEBUG 01081 default: 01082 # if 0 01083 PRINTMSG(line, 257, Internal, column, 01084 ATP_PROC(attr_idx), "ATP_PROC"); 01085 # endif 01086 break; 01087 # endif 01088 } /* End switch */ 01089 01090 if (ATP_VFUNCTION(attr_idx) && (dir_obj_ntry & (1 << Dir_Vfunction))) { 01091 msg_num = dir_msg_num[new_obj][Dir_Vfunction]; 01092 msg_str = dir_str[Dir_Vfunction]; 01093 goto ISSUE_ERR; 01094 } 01095 else if (ATP_NOSIDE_EFFECTS(attr_idx) && 01096 (dir_obj_ntry & (1 << Dir_No_Side_Effects)) ) { 01097 msg_num = dir_msg_num[new_obj][Dir_No_Side_Effects]; 01098 msg_str = dir_str[Dir_No_Side_Effects]; 01099 goto ISSUE_ERR; 01100 } 01101 else if ((ATP_INLINE_ALWAYS(attr_idx) || 01102 ATP_INLINE_NEVER(attr_idx))&& 01103 (dir_obj_ntry & (1 << Dir_Inline)) ) { 01104 msg_num = dir_msg_num[new_obj][Dir_Inline]; 01105 msg_str = dir_str[Dir_Inline]; 01106 goto ISSUE_ERR; 01107 } 01108 break; 01109 01110 } /* End switch */ 01111 01112 if (ATP_OPTIONAL_DIR(attr_idx) && (dir_obj_ntry & (1 << Dir_Optional)) ) { 01113 msg_num = dir_msg_num[new_obj][Dir_Optional]; 01114 msg_str = dir_str[Dir_Optional]; 01115 goto ISSUE_ERR; 01116 } 01117 01118 break; 01119 01120 01121 case Label: 01122 01123 # ifdef _DEBUG 01124 if (ATL_DEBUG_CLASS(attr_idx) != Ldbg_Construct_Name) { 01125 PRINTMSG(line, 257, Internal, column, 01126 ATL_CLASS(attr_idx), "ATL_CLASS"); 01127 } 01128 # endif 01129 01130 if (name_obj_ntry & (1 << Name_Construct)) { 01131 msg_num = name_msg_num[new_obj][Name_Construct]; 01132 msg_str = name_str[Name_Construct]; 01133 goto ISSUE_ERR; 01134 } 01135 break; 01136 01137 case Derived_Type: 01138 01139 if (name_obj_ntry & (1 << Name_Derived_Type)) { 01140 msg_num = name_msg_num[new_obj][Name_Derived_Type]; 01141 msg_str = name_str[Name_Derived_Type]; 01142 goto ISSUE_ERR; 01143 } 01144 break; 01145 01146 case Interface: 01147 01148 if (AT_IS_INTRIN(attr_idx) && !ATI_USER_SPECIFIED(attr_idx)) { 01149 01150 if (ATI_DCL_INTRINSIC(attr_idx) && 01151 (attr_obj_ntry & (1 << Attr_Intrinsic))) { 01152 msg_num = attr_msg_num[new_obj][Attr_Intrinsic]; 01153 msg_str = attr_str[Attr_Intrinsic]; 01154 goto ISSUE_ERR; 01155 } 01156 01157 if (ATI_INTERFACE_CLASS(attr_idx) == Generic_Subroutine_Interface) { 01158 01159 if (name_obj_ntry & (1 << Name_Intrinsic_Subr)) { 01160 msg_num = name_msg_num[new_obj][Name_Intrinsic_Subr]; 01161 msg_str = name_str[Name_Intrinsic_Subr]; 01162 goto ISSUE_ERR; 01163 } 01164 } 01165 else if (name_obj_ntry & (1 << Name_Intrinsic_Func)) { 01166 msg_num = name_msg_num[new_obj][Name_Intrinsic_Func]; 01167 msg_str = name_str[Name_Intrinsic_Func]; 01168 goto ISSUE_ERR; 01169 } 01170 } 01171 else { 01172 01173 if (name_obj_ntry & (1 << Name_Generic_Interface)) { 01174 msg_num = name_msg_num[new_obj][Name_Generic_Interface]; 01175 msg_str = name_str[Name_Generic_Interface]; 01176 goto ISSUE_ERR; 01177 } 01178 } 01179 01180 if (AT_TYPED(attr_idx) && (attr_obj_ntry & (1 << Attr_Type))) { 01181 msg_num = attr_msg_num[new_obj][Attr_Type]; 01182 msg_str = get_basic_type_str(ATD_TYPE_IDX(attr_idx)); 01183 01184 if (new_obj == Obj_Typed) { 01185 01186 /* Try to get a real nice message. Check to see if this is */ 01187 /* being retyped as the same type. If it is, use a better */ 01188 /* message. */ 01189 01190 if (strcmp(msg_str, obj_str[new_obj]) == 0) { 01191 msg_num = 554; /* Retype as same type message */ 01192 } 01193 } 01194 goto ISSUE_ERR; 01195 } 01196 01197 break; 01198 01199 case Namelist_Grp: 01200 01201 if (name_obj_ntry & (1 << Name_Namelist_Group)) { 01202 msg_num = name_msg_num[new_obj][Name_Namelist_Group]; 01203 msg_str = name_str[Name_Namelist_Group]; 01204 goto ISSUE_ERR; 01205 } 01206 break; 01207 01208 case Stmt_Func: 01209 01210 if (name_obj_ntry & (1 << Name_Statement_Func)) { 01211 msg_num = name_msg_num[new_obj][Name_Statement_Func]; 01212 msg_str = name_str[Name_Statement_Func]; 01213 goto ISSUE_ERR; 01214 } 01215 01216 if (AT_TYPED(attr_idx) && (attr_obj_ntry & (1 << Attr_Type))) { 01217 msg_num = attr_msg_num[new_obj][Attr_Type]; 01218 msg_str = get_basic_type_str(ATD_TYPE_IDX(attr_idx)); 01219 01220 if (new_obj == Obj_Typed) { 01221 01222 /* Try to get a real nice message. Check to see if this is */ 01223 /* being retyped as the same type. If it is, use a better */ 01224 /* message. */ 01225 01226 if (strcmp(msg_str, obj_str[new_obj]) == 0) { 01227 msg_num = 554; /* Retype as same type message */ 01228 } 01229 } 01230 goto ISSUE_ERR; 01231 } 01232 01233 break; 01234 01235 } /* End switch */ 01236 01237 if ((attr_obj_ntry & (1 << Attr_Public)) || 01238 (attr_obj_ntry & (1 << Attr_Private))) { 01239 01240 if (ATP_PGM_UNIT(SCP_ATTR_IDX(curr_scp_idx)) == Module && 01241 AT_ACCESS_SET(attr_idx)) { /* Access only in module */ 01242 01243 if (AT_PRIVATE(attr_idx)) { 01244 msg_num = attr_msg_num[new_obj][Attr_Private]; 01245 msg_str = attr_str[Attr_Private]; 01246 } 01247 else { 01248 msg_num = attr_msg_num[new_obj][Attr_Public]; 01249 msg_str = attr_str[Attr_Public]; 01250 } 01251 } 01252 } 01253 01254 ISSUE_ERR: 01255 01256 if (msg_num != 0) { 01257 01258 if (issue_msg) { 01259 01260 if (msg_str == NULL) { /* This is an Other. Does not need msg_str. */ 01261 PRINTMSG(line, msg_num, Error, column, 01262 AT_OBJ_NAME_PTR(attr_idx), 01263 obj_str[new_obj]); 01264 } 01265 else if (new_obj > Obj_Name_Done) { 01266 PRINTMSG(line, msg_num, Error, column, 01267 AT_OBJ_NAME_PTR(attr_idx), 01268 msg_str); 01269 } 01270 else { 01271 PRINTMSG(line, msg_num, Error, column, 01272 AT_OBJ_NAME_PTR(attr_idx), 01273 msg_str, 01274 obj_str[new_obj]); 01275 } 01276 } 01277 01278 if (set_dcl_err) { 01279 01280 switch (new_obj) { 01281 01282 case Obj_Use_Extern_Func: 01283 case Obj_Use_Extern_Subr: 01284 case Obj_Use_In_Expr: 01285 case Obj_Use_Spec_Expr: 01286 case Obj_Use_Init_Expr: 01287 break; 01288 01289 default: 01290 AT_DCL_ERR(attr_idx) = TRUE; 01291 break; 01292 01293 } /* End switch */ 01294 } 01295 } 01296 01297 TRACE (Func_Exit, "fnd_semantic_err", NULL); 01298 01299 return(msg_num); 01300 01301 } /* fnd_semantic_err */ 01302 # ifdef _DEBUG 01303 01304 /******************************************************************************\ 01305 |* *| 01306 |* Description: *| 01307 |* This is called from main initialization of the compiler to verify *| 01308 |* that every bit set in obj_to_attr, obj_to_name, and obj_to_other *| 01309 |* has a msg number in attr_msg_num, name_msg_num, and other_msg_num. *| 01310 |* It also checks the reverse combination. If it a missing message, *| 01311 |* or too many messages, it issues a fatal error for each one it finds. *| 01312 |* Then after it has gone thru the complete tables, it will issue an. *| 01313 |* internal abort. *| 01314 |* *| 01315 |* Input parameters: *| 01316 |* NONE *| 01317 |* *| 01318 |* Output parameters: *| 01319 |* NONE *| 01320 |* *| 01321 |* Returns: *| 01322 |* TRUE if it found an error. *| 01323 |* *| 01324 \******************************************************************************/ 01325 void verify_semantic_tbls() 01326 { 01327 01328 long attr_entry; 01329 long dir_entry; 01330 boolean found_err = FALSE; 01331 long idx; 01332 long j; 01333 long name_entry; 01334 long other_entry; 01335 01336 01337 TRACE (Func_Entry, "verify_semantic_tbls", NULL); 01338 01339 for (idx = 0; idx < Obj_Done; idx++) { 01340 attr_entry = obj_to_attr[idx]; 01341 dir_entry = obj_to_dir[idx]; 01342 name_entry = obj_to_name[idx]; 01343 other_entry = obj_to_other[idx]; 01344 01345 for (j = 0; j < Attr_Done; j++) { 01346 01347 if ((1 & attr_entry) != 0) { 01348 01349 if (attr_msg_num[idx][j] == 0) { 01350 PRINTMSG(1, 225, Error, 0, obj_type_str[idx], 01351 attr_obj_type_str[j], "obj_to_attr"); 01352 found_err = TRUE; 01353 } 01354 } 01355 else if (attr_msg_num[idx][j] != 0) { 01356 PRINTMSG(1, 227, Error, 0, obj_type_str[idx], 01357 attr_obj_type_str[j], "attr_msg_num", 01358 attr_msg_num[idx][j]); 01359 found_err = TRUE; 01360 } 01361 attr_entry = attr_entry >> 1; 01362 } 01363 01364 for (j = 0; j < Dir_Done; j++) { 01365 01366 if ((1 & dir_entry) != 0) { 01367 01368 if (dir_msg_num[idx][j] == 0) { 01369 PRINTMSG(1, 225, Error, 0, obj_type_str[idx], 01370 dir_obj_type_str[j], "obj_to_dir"); 01371 found_err = TRUE; 01372 } 01373 } 01374 else if (dir_msg_num[idx][j] != 0) { 01375 PRINTMSG(1, 227, Error, 0, obj_type_str[idx], 01376 dir_obj_type_str[j], "dir_msg_num", 01377 dir_msg_num[idx][j]); 01378 found_err = TRUE; 01379 } 01380 dir_entry = dir_entry >> 1; 01381 } 01382 01383 for (j = 0; j < Name_Done; j++) { 01384 01385 if ((1 & name_entry) != 0) { 01386 01387 if (name_msg_num[idx][j] == 0) { 01388 PRINTMSG(1, 225, Error, 0, obj_type_str[idx], 01389 name_obj_type_str[j], "obj_to_name"); 01390 found_err = TRUE; 01391 } 01392 } 01393 else if (name_msg_num[idx][j] != 0) { 01394 PRINTMSG(1, 227, Error, 0, obj_type_str[idx], 01395 name_obj_type_str[j], "name_msg_num", 01396 name_msg_num[idx][j]); 01397 found_err = TRUE; 01398 } 01399 name_entry = name_entry >> 1; 01400 } 01401 01402 for (j = 0; j < Other_Done; j++) { 01403 01404 if ((1 & other_entry) != 0) { 01405 01406 if (other_msg_num[idx][j] == 0) { 01407 PRINTMSG(1, 225, Error, 0, obj_type_str[idx], 01408 other_obj_type_str[j], "obj_to_other"); 01409 found_err = TRUE; 01410 } 01411 } 01412 else if (other_msg_num[idx][j] != 0) { 01413 PRINTMSG(1, 227, Error, 0, obj_type_str[idx], 01414 other_obj_type_str[j], "other_msg_num", 01415 other_msg_num[idx][j]); 01416 found_err = TRUE; 01417 } 01418 other_entry = other_entry >> 1; 01419 } 01420 } 01421 01422 if (found_err) { /* If problems - halt compilation */ 01423 PRINTMSG(1, 226, Internal, 0); 01424 } 01425 01426 TRACE (Func_Exit, "verify_semantic_tbls", NULL); 01427 01428 return; 01429 01430 } /* verify_semantic_tbls */ 01431 # endif