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 /* USMID: "\n@(#)5.0_pl/headers/s_driver.h 5.1 04/29/99 21:22:31\n" */ 00038 00039 00040 /*******************************************/ 00041 /* Globals used during the semantics phase */ 00042 /*******************************************/ 00043 00044 char *pgm_unit_str[] = {"EXTERNAL", 00045 "ERROR", 00046 "ERROR", 00047 "FUNCTION", 00048 "SUBROUTINE", 00049 "PROGRAM", 00050 "BLOCKDATA", 00051 "MODULE"}; 00052 00053 00054 /******************************************************************************/ 00063 /******************************************************************************/ 00064 00065 void (*stmt_semantics[]) () = { 00066 illegal_stmt_type, /* Illegal stmt type */ 00067 00068 no_semantics_routine, /* Allocatable_Stmt */ 00069 no_semantics_routine, /* Automatic_Stmt */ 00070 no_semantics_routine, /* Common_Stmt */ 00071 no_semantics_routine, /* Contains_Stmt */ 00072 no_semantics_routine, /* Cpnt_Decl_Stmt */ 00073 data_stmt_semantics, /* Data_Stmt */ 00074 no_semantics_routine, /* Derived_Type_Stmt */ 00075 no_semantics_routine, /* Dimension_Stmt */ 00076 directive_stmt_semantics, /* Directive_Stmt */ 00077 no_semantics_routine, /* Equivalence_Stmt */ 00078 no_semantics_routine, /* External_Stmt */ 00079 no_semantics_routine, /* Format_Stmt */ 00080 no_semantics_routine, /* Implicit_Stmt */ 00081 no_semantics_routine, /* Implicit_None_Stmt */ 00082 no_semantics_routine, /* Intent_Stmt */ 00083 no_semantics_routine, /* Interface_Stmt */ 00084 no_semantics_routine, /* Intrinsic_Stmt */ 00085 no_semantics_routine, /* Module_Proc_Stmt */ 00086 no_semantics_routine, /* Namelist_Stmt */ 00087 no_semantics_routine, /* Optional_Stmt */ 00088 no_semantics_routine, /* Parameter_Stmt */ 00089 no_semantics_routine, /* Pointer_Stmt */ 00090 no_semantics_routine, /* Private_Stmt */ 00091 no_semantics_routine, /* Public_Stmt */ 00092 no_semantics_routine, /* Save_Stmt */ 00093 no_semantics_routine, /* Sequence_Stmt */ 00094 no_semantics_routine, /* Stmt_Func_Stmt */ 00095 no_semantics_routine, /* Target_Stmt */ 00096 no_semantics_routine, /* Task_Common_Stmt */ 00097 no_semantics_routine, /* Type_Decl_Stmt */ 00098 00099 no_semantics_routine, /* Use_Stmt */ 00100 00101 blockdata_stmt_semantics, /* Blockdata_Stmt */ 00102 no_semantics_routine, /* Elemental_Stmt */ 00103 function_stmt_semantics, /* Function_Stmt */ 00104 module_stmt_semantics, /* Module_Stmt */ 00105 program_stmt_semantics, /* Program_Stmt */ 00106 no_semantics_routine, /* Pure_Stmt */ 00107 no_semantics_routine, /* Recursive_Stmt */ 00108 subroutine_stmt_semantics, /* Subroutine_Stmt */ 00109 00110 no_semantics_routine, /* End_Blockdata_Stmt */ 00111 no_semantics_routine, /* End_Do_Stmt */ 00112 end_function_semantics, /* End_Function_Stmt */ 00113 00114 #ifdef _HIGH_LEVEL_IF_FORM 00115 no_semantics_routine, /* End_If_Stmt */ 00116 #else 00117 end_if_semantics, /* End_If_Stmt */ 00118 #endif 00119 no_semantics_routine, /* End_Interface_Stmt */ 00120 no_semantics_routine, /* End_Module_Stmt */ 00121 end_stmt_semantics, /* End_Program_Stmt */ 00122 end_select_semantics, /* End_Select_Stmt */ 00123 end_stmt_semantics, /* End_Stmt */ 00124 end_subroutine_semantics, /* End_Subroutine_Stmt*/ 00125 no_semantics_routine, /* End_Type_Stmt */ 00126 end_where_semantics, /* End_Where_Stmt */ 00127 00128 allocate_stmt_semantics, /* Allocate_Stmt */ 00129 arith_if_stmt_semantics, /* Arith_If_Stmt */ 00130 assign_stmt_semantics, /* Assign_Stmt */ 00131 assignment_stmt_semantics, /* Assignment_Stmt */ 00132 backspace_stmt_semantics, /* Backspace_Stmt */ 00133 buffer_stmt_semantics, /* Buffer_Stmt */ 00134 call_stmt_semantics, /* Call_Stmt */ 00135 case_stmt_semantics, /* Case_Stmt */ 00136 close_stmt_semantics, /* Close_Stmt */ 00137 continue_stmt_semantics, /* Continue_Stmt */ 00138 no_semantics_routine, /* Cycle_Stmt */ 00139 deallocate_stmt_semantics, /* Deallocate_Stmt */ 00140 encode_decode_stmt_semantics, /* Decode_Stmt */ 00141 do_stmt_semantics, /* Do_Iterative_Stmt */ 00142 do_stmt_semantics, /* Do_While_Stmt */ 00143 do_stmt_semantics, /* Do_Infinite_Stmt */ 00144 else_stmt_semantics, /* Else_Stmt */ 00145 else_stmt_semantics, /* Else_If_Stmt */ 00146 else_stmt_semantics, /* Else_Where_Stmt */ 00147 encode_decode_stmt_semantics, /* Encode_Stmt */ 00148 endfile_stmt_semantics, /* Endfile_Stmt */ 00149 entry_stmt_semantics, /* Entry_Stmt */ 00150 no_semantics_routine, /* Exit_Stmt */ 00151 goto_stmt_semantics, /* Goto_Stmt */ 00152 if_stmt_semantics, /* If_Cstrct_Stmt */ 00153 if_stmt_semantics, /* If_Stmt */ 00154 inquire_stmt_semantics, /* Inquire_Stmt */ 00155 nullify_stmt_semantics, /* Nullify_Stmt */ 00156 open_stmt_semantics, /* Open_Stmt */ 00157 outmoded_if_stmt_semantics, /* Outmoded_If_Stmt */ 00158 stop_pause_stmt_semantics, /* Pause_Stmt */ 00159 print_stmt_semantics, /* Print_Stmt */ 00160 read_stmt_semantics, /* Read_Stmt */ 00161 return_stmt_semantics, /* Return_Stmt */ 00162 rewind_stmt_semantics, /* Rewind_Stmt */ 00163 select_stmt_semantics, /* Select_Stmt */ 00164 stop_pause_stmt_semantics, /* Stop_Stmt */ 00165 then_stmt_semantics, /* Then_Stmt */ 00166 where_stmt_semantics, /* Where_Cstrct_Stmt */ 00167 where_stmt_semantics, /* Where_Stmt */ 00168 write_stmt_semantics, /* Write_Stmt */ 00169 type_init_semantics, /* Type_Init_Stmt */ 00170 00171 label_def_stmt_semantics, /* Label_Def */ 00172 no_semantics_routine, /* Construct_Def */ 00173 no_semantics_routine, /* Automatic_Base_Calc*/ 00174 no_semantics_routine, /* Automatic_Base_Size*/ 00175 directive_stmt_semantics, /* End_Parallel_Stmt */ 00176 directive_stmt_semantics, /* End_Do_Parallel_Stmt */ 00177 directive_stmt_semantics, /* End_Parallel_Case_Stmt */ 00178 directive_stmt_semantics, /* Parallel_Case_Stmt */ 00179 directive_stmt_semantics, /* End_Guard_Stmt */ 00180 no_semantics_routine, /* Statement_Num_Stmt */ 00181 directive_stmt_semantics, /* SGI_Section_Stmt */ 00182 directive_stmt_semantics, /* SGI_End_Psection_Stmt */ 00183 directive_stmt_semantics, /* SGI_End_Pdo_Stmt */ 00184 directive_stmt_semantics, /* SGI_End_Parallel_Stmt */ 00185 directive_stmt_semantics, 00186 /* SGI_End_Critical_Section_Stmt */ 00187 directive_stmt_semantics, 00188 /* SGI_End_Single_Process_Stmt */ 00189 directive_stmt_semantics, /* SGI_Region_End_Stmt */ 00190 directive_stmt_semantics, 00191 /* Open_MP_Section_Stmt */ 00192 directive_stmt_semantics, 00193 /* Open_MP_End_Parallel_Stmt */ 00194 directive_stmt_semantics, 00195 /* Open_MP_End_Do_Stmt */ 00196 directive_stmt_semantics, 00197 /* Open_MP_End_Parallel_Sections_Stmt */ 00198 directive_stmt_semantics, 00199 /* Open_MP_End_Sections_Stmt */ 00200 directive_stmt_semantics, 00201 /* Open_MP_End_Section_Stmt */ 00202 directive_stmt_semantics, 00203 /* Open_MP_End_Single_Stmt */ 00204 directive_stmt_semantics, 00205 /* Open_MP_End_Parallel_Do_Stmt */ 00206 directive_stmt_semantics, 00207 /* Open_MP_End_Master_Stmt */ 00208 directive_stmt_semantics, 00209 /* Open_MP_End_Critical_Stmt */ 00210 directive_stmt_semantics, 00211 /* Open_MP_End_Ordered_Stmt */ 00212 directive_stmt_semantics, 00213 /* Open_MP_End_Parallel_Workshare_Stmt */ 00214 directive_stmt_semantics, 00215 /* Open_MP_End_Workshare_Stmt */ 00216 forall_semantics, /* Forall_Cstrct_Stmt */ 00217 forall_semantics, /* Forall_Stmt */ 00218 end_forall_semantics, /* End_Forall_Stmt */ 00219 else_stmt_semantics, /* Else_Where_Mask_Stmt */ 00220 no_semantics_routine /* Volatile_Stmt */ 00221 }; 00222 00223 /*********************************************************\ 00224 |* stmt_tmp_tbl points to lists of tmps that are reused. *| 00225 |* -1 => never reused. *| 00226 \*********************************************************/ 00227 00228 stmt_tmp_tbl_type stmt_tmp_tbl[Num_Linear_Types]; 00229 00230 stmt_tmp_tbl_type init_stmt_tmp_tbl[Num_Linear_Types] = 00231 { 00232 /* Err_Res */ -1, -1, 00233 {-1, -1, -1, -1, -1, -1, -1, -1}, 00234 {-1, -1, -1, -1, -1, -1, -1, -1}, 00235 00236 /* Short_Char_Const */ -1, -1, 00237 {-1, -1, -1, -1, -1, -1, -1, -1}, 00238 {-1, -1, -1, -1, -1, -1, -1, -1}, 00239 00240 /* Short_Typeless_Const */ -1, -1, 00241 {-1, -1, -1, -1, -1, -1, -1, -1}, 00242 {-1, -1, -1, -1, -1, -1, -1, -1}, 00243 00244 /* Typeless_1 */ -1, -1, 00245 {-1, -1, -1, -1, -1, -1, -1, -1}, 00246 {-1, -1, -1, -1, -1, -1, -1, -1}, 00247 00248 /* Typeless_2 */ -1, -1, 00249 {-1, -1, -1, -1, -1, -1, -1, -1}, 00250 {-1, -1, -1, -1, -1, -1, -1, -1}, 00251 00252 /* Typeless_4 */ -1, -1, 00253 {-1, -1, -1, -1, -1, -1, -1, -1}, 00254 {-1, -1, -1, -1, -1, -1, -1, -1}, 00255 00256 /* Typeless_8 */ -1, -1, 00257 {-1, -1, -1, -1, -1, -1, -1, -1}, 00258 {-1, -1, -1, -1, -1, -1, -1, -1}, 00259 00260 /* Long_Typeless */ -1, -1, 00261 {-1, -1, -1, -1, -1, -1, -1, -1}, 00262 {-1, -1, -1, -1, -1, -1, -1, -1}, 00263 00264 /* Integer_1 */ 0, 0, 00265 {0, 0, 0, 0, 0, 0, 0, 0}, 00266 {0, 0, 0, 0, 0, 0, 0, 0}, 00267 00268 /* Integer_2 */ 0, 0, 00269 {0, 0, 0, 0, 0, 0, 0, 0}, 00270 {0, 0, 0, 0, 0, 0, 0, 0}, 00271 00272 /* Integer_4 */ 0, 0, 00273 {0, 0, 0, 0, 0, 0, 0, 0}, 00274 {0, 0, 0, 0, 0, 0, 0, 0}, 00275 00276 /* Integer_8 */ 0, 0, 00277 {0, 0, 0, 0, 0, 0, 0, 0}, 00278 {0, 0, 0, 0, 0, 0, 0, 0}, 00279 00280 /* Real_4 */ 0, 0, 00281 {0, 0, 0, 0, 0, 0, 0, 0}, 00282 {0, 0, 0, 0, 0, 0, 0, 0}, 00283 00284 /* Real_8 */ 0, 0, 00285 {0, 0, 0, 0, 0, 0, 0, 0}, 00286 {0, 0, 0, 0, 0, 0, 0, 0}, 00287 00288 /* Real_16 */ 0, 0, 00289 {0, 0, 0, 0, 0, 0, 0, 0}, 00290 {0, 0, 0, 0, 0, 0, 0, 0}, 00291 00292 /* Complex_4 */ 0, 0, 00293 {0, 0, 0, 0, 0, 0, 0, 0}, 00294 {0, 0, 0, 0, 0, 0, 0, 0}, 00295 00296 /* Complex_8 */ 0, 0, 00297 {0, 0, 0, 0, 0, 0, 0, 0}, 00298 {0, 0, 0, 0, 0, 0, 0, 0}, 00299 00300 /* Complex_16 */ 0, 0, 00301 {0, 0, 0, 0, 0, 0, 0, 0}, 00302 {0, 0, 0, 0, 0, 0, 0, 0}, 00303 00304 /* CRI_Ptr_8 */ -1, -1, 00305 {-1, -1, -1, -1, -1, -1, -1, -1}, 00306 {-1, -1, -1, -1, -1, -1, -1, -1}, 00307 00308 /* Logical_1 */ 0, 0, 00309 {0, 0, 0, 0, 0, 0, 0, 0}, 00310 {0, 0, 0, 0, 0, 0, 0, 0}, 00311 00312 /* Logical_2 */ 0, 0, 00313 {0, 0, 0, 0, 0, 0, 0, 0}, 00314 {0, 0, 0, 0, 0, 0, 0, 0}, 00315 00316 /* Logical_4 */ 0, 0, 00317 {0, 0, 0, 0, 0, 0, 0, 0}, 00318 {0, 0, 0, 0, 0, 0, 0, 0}, 00319 00320 /* Logical_8 */ 0, 0, 00321 {0, 0, 0, 0, 0, 0, 0, 0}, 00322 {0, 0, 0, 0, 0, 0, 0, 0}, 00323 00324 /* Character_1 */ -1, -1, 00325 {-1, -1, -1, -1, -1, -1, -1, -1}, 00326 {-1, -1, -1, -1, -1, -1, -1, -1}, 00327 00328 /* Character_2 */ -1, -1, 00329 {-1, -1, -1, -1, -1, -1, -1, -1}, 00330 {-1, -1, -1, -1, -1, -1, -1, -1}, 00331 00332 /* Character_4 */ -1, -1, 00333 {-1, -1, -1, -1, -1, -1, -1, -1}, 00334 {-1, -1, -1, -1, -1, -1, -1, -1}, 00335 00336 /* CRI_Ch_Ptr_8 */ -1, -1, 00337 {-1, -1, -1, -1, -1, -1, -1, -1}, 00338 {-1, -1, -1, -1, -1, -1, -1, -1}, 00339 00340 /* Structure_Type */ -1, -1, 00341 {-1, -1, -1, -1, -1, -1, -1, -1}, 00342 {-1, -1, -1, -1, -1, -1, -1, -1}, 00343 00344 /* CRI_Parcel_Ptr_8 */ -1, -1, 00345 {-1, -1, -1, -1, -1, -1, -1, -1}, 00346 {-1, -1, -1, -1, -1, -1, -1, -1} 00347 };