⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 typ..c

📁 c 语言编译器 源代码- c compiler
💻 C
📖 第 1 页 / 共 5 页
字号:
#line 167 "../../src/typ.c"#line 173 "../../src/typ.c"case 126 : _type_tsizeof ( ( struct type * ) ( ( ( struct ptr * ) ( #line 173 "../../src/typ.c"_auto_t ) ) ) -> _ptr_typ ) ; } #line 176 "../../src/typ.c"{ #line 176 "../../src/typ.c"{ _auto__result = 'P' ; #line 176 "../../src/typ.c"return _auto__result ; } } #line 177 "../../src/typ.c"case 158 : errorFPC__E ( ( char * ) "reference operand for %s", _auto_s ) ; #line 178 "../../src/typ.c"{ #line 178 "../../src/typ.c"{ _auto__result = 'A' ; #line 178 "../../src/typ.c"return _auto__result ; } } #line 179 "../../src/typ.c"case 110 : if ( _auto_v != 'P' ) errorFPC__E ( ( char * ) "V operand for %s", #line 179 "../../src/typ.c"_auto_s ) ; #line 179 "../../src/typ.c"{ #line 179 "../../src/typ.c"{ _auto__result = 'P' ; #line 179 "../../src/typ.c"return _auto__result ; } } #line 180 "../../src/typ.c"case 97 : _auto_t = ( ( ( struct basetype * ) ( _auto_t ) ) #line 180 "../../src/typ.c") -> _basetype_b_name -> _expr__O2.__C2_tp ; #line 180 "../../src/typ.c"goto xx ; #line 181 "../../src/typ.c"case 108 : if ( _auto_v != 'P' ) errorFPC__E ( ( char * ) "F operand for %s", _auto_s ) ; #line 181 "../../src/typ.c"#line 181 "../../src/typ.c"{ #line 181 "../../src/typ.c"{ _auto__result = 108 ; #line 181 "../../src/typ.c"return _auto__result ; } } #line 182 "../../src/typ.c"case 6 : case 13 : errorFPC__E ( ( char * ) "%k operand for %s", _auto_this -> _node_base , #line 182 "../../src/typ.c"_auto_s ) ; #line 183 "../../src/typ.c"{ #line 183 "../../src/typ.c"{ _auto__result = 'A' ; #line 183 "../../src/typ.c"return _auto__result ; } } #line 184 "../../src/typ.c"default : errorFPC__E ( ( char * ) "%t operand for %s", _auto_this , _auto_s ) ; #line 184 "../../src/typ.c"{ #line 184 "../../src/typ.c"{ _auto__result = 'A' ; #line 184 "../../src/typ.c"return _auto__result ; } } } } ; #line 188 "../../src/typ.c"int _type_dcl ( _auto_this , _auto_tbl ) register struct type * _auto_this ; struct table * _auto_tbl ; #line 196 "../../src/typ.c"{ #line 196 "../../src/typ.c"Ptype _auto_t ; #line 197 "../../src/typ.c"_auto_t = ( struct type * ) _auto_this ; #line 199 "../../src/typ.c"if ( _auto_this == 0 ) errorFI_PC__E ( ( int ) 'i' , ( char * ) #line 199 "../../src/typ.c""type.dcl(this==0)") ; #line 200 "../../src/typ.c"if ( _auto_tbl -> _node_base != 142 ) errorFI_PC__E ( ( int ) 'i' , ( char * ) #line 200 "../../src/typ.c""type.dcl(%d)", _auto_tbl -> _node_base ) ; #line 202 "../../src/typ.c"xx : switch ( _auto_t -> _node_base ) { #line 203 "../../src/typ.c"case 125 : case 158 : { #line 206 "../../src/typ.c"Pptr _auto_p ; #line 206 "../../src/typ.c"_auto_p = ( ( ( struct ptr * ) ( _auto_t ) ) ) ; #line 207 "../../src/typ.c"_auto_t = _auto_p -> _ptr_typ ; #line 208 "../../src/typ.c"if ( _auto_t -> _node_base == 97 ) { #line 208 "../../src/typ.c"Ptype _auto_tt ; #line 209 "../../src/typ.c"_auto_tt = ( ( ( struct basetype * ) ( _auto_t ) ) ) -> _basetype_b_name -> _expr__O2.__C2_tp ; #line 209 "../../src/typ.c"#line 210 "../../src/typ.c"if ( _auto_tt -> _node_base == 108 ) _auto_p -> _ptr_typ = ( _auto_t = _auto_tt ) ; #line 211 "../../src/typ.c"{ #line 211 "../../src/typ.c"return ; } } #line 213 "../../src/typ.c"goto xx ; } #line 216 "../../src/typ.c"case 110 : { #line 217 "../../src/typ.c"Pvec _auto_v ; Pexpr _auto_e ; #line 217 "../../src/typ.c"_auto_v = ( ( ( struct vec * ) ( _auto_t ) ) ) ; #line 218 "../../src/typ.c"_auto_e = _auto_v -> _vec_dim ; #line 219 "../../src/typ.c"if ( _auto_e ) { #line 219 "../../src/typ.c"Ptype _auto_et ; #line 221 "../../src/typ.c"_auto_v -> _vec_dim = ( _auto_e = _expr_typ ( ( struct expr * ) _auto_e , _auto_tbl ) ) ; #line 222 "../../src/typ.c"_auto_et = _auto_e -> _expr__O2.__C2_tp ; #line 223 "../../src/typ.c"if ( ( _type_kind ( ( ( struct type * ) _auto_et ) , ( ( int #line 223 "../../src/typ.c") 0 ) , ( int ) 'I' ) ) == 'A' ) #line 223 "../../src/typ.c"{ #line 223 "../../src/typ.c"errorFPC__E ( ( #line 223 "../../src/typ.c"char * ) "UN in array dimension") ; } else #line 226 "../../src/typ.c"if ( ! new_type ) { #line 226 "../../src/typ.c"int _auto_i ; #line 228 "../../src/typ.c"Neval = 0 ; #line 229 "../../src/typ.c"_auto_i = _expr_eval ( ( struct expr * ) _auto_e ) ; #line 230 "../../src/typ.c"if ( Neval ) errorFPC__E ( ( char * ) "%s", Neval ) ; else #line 231 "../../src/typ.c"if ( _auto_i == 0 ) errorFI_PC__E ( ( int ) 'w' , ( char * #line 231 "../../src/typ.c") "array dimension == 0") ; else #line 233 "../../src/typ.c"if ( _auto_i < 0 ) { #line 233 "../../src/typ.c"errorFPC__E ( ( char * ) "negative array dimension") ; #line 233 "../../src/typ.c"#line 235 "../../src/typ.c"_auto_i = 1 ; } #line 237 "../../src/typ.c"_auto_v -> _vec_size = _auto_i ; #line 238 "../../src/typ.c"if ( _auto_v -> _vec_dim && ( _auto_v -> _vec_dim -> _node_permanent == 0 ) ) _expr_del ( ( struct #line 238 "../../src/typ.c"expr * ) _auto_v -> _vec_dim ) ; #line 239 "../../src/typ.c"_auto_v -> _vec_dim = 0 ; } } #line 242 "../../src/typ.c"_auto_t = _auto_v -> _vec_typ ; #line 243 "../../src/typ.c"llx : switch ( _auto_t -> _node_base ) { #line 244 "../../src/typ.c"case 97 : _auto_t = ( ( ( struct basetype * #line 244 "../../src/typ.c") ( _auto_t ) ) ) -> _basetype_b_name -> _expr__O2.__C2_tp ; #line 247 "../../src/typ.c"goto llx ; #line 248 "../../src/typ.c"case 108 : _auto_v -> _vec_typ = _auto_t ; #line 250 "../../src/typ.c"break ; #line 251 "../../src/typ.c"case 110 : if ( ( ( ( ( struct vec * ) ( _auto_t ) ) #line 251 "../../src/typ.c") -> _vec_dim == 0 ) && ( ( ( ( struct vec * ) ( #line 251 "../../src/typ.c"_auto_t ) ) ) -> _vec_size == 0 ) ) #line 252 "../../src/typ.c"errorFPC__E ( ( char * ) "null dimension (something like [][] seen)") #line 252 "../../src/typ.c"; } #line 254 "../../src/typ.c"goto xx ; } #line 257 "../../src/typ.c"case 108 : { #line 258 "../../src/typ.c"Pfct _auto_f ; Pname _auto_n ; #line 258 "../../src/typ.c"_auto_f = ( ( ( struct fct * ) ( _auto_t ) ) ) ; #line 260 "../../src/typ.c"for ( _auto_n = _auto_f -> _fct_argtype ;_auto_n ;( _auto_n = _auto_n -> _name_n_list ) ) _type_dcl ( ( struct type * ) #line 260 "../../src/typ.c"_auto_n -> _expr__O2.__C2_tp , _auto_tbl ) ; #line 261 "../../src/typ.c"_auto_t = _auto_f -> _fct_returns ; #line 262 "../../src/typ.c"goto xx ; } #line 265 "../../src/typ.c"case 114 : { #line 266 "../../src/typ.c"Pbase _auto_f ; Pexpr _auto_e ; int _auto_i ; Ptype _auto_et ; #line 266 "../../src/typ.c"_auto_f = ( ( ( struct basetype * ) ( _auto_t ) ) ) ; #line 267 "../../src/typ.c"_auto_e = ( ( ( struct expr * ) ( _auto_f -> _basetype_b_name ) ) ) ; #line 270 "../../src/typ.c"_auto_e = _expr_typ ( ( struct expr * ) _auto_e , _auto_tbl ) ; #line 271 "../../src/typ.c"_auto_f -> _basetype_b_name = ( ( ( struct name * ) ( _auto_e ) ) ) ; #line 272 "../../src/typ.c"_auto_et = _auto_e -> _expr__O2.__C2_tp ; #line 273 "../../src/typ.c"if ( ( _type_kind ( ( ( struct type * ) _auto_et ) , ( ( int #line 273 "../../src/typ.c") 0 ) , ( int ) 'I' ) ) == 'A' ) #line 273 "../../src/typ.c"{ #line 273 "../../src/typ.c"errorFPC__E ( ( #line 273 "../../src/typ.c"char * ) "UN in field size") ; #line 275 "../../src/typ.c"_auto_i = 1 ; } else #line 277 "../../src/typ.c"{ #line 277 "../../src/typ.c"Neval = 0 ; #line 279 "../../src/typ.c"_auto_i = _expr_eval ( ( struct expr * ) _auto_e ) ; #line 280 "../../src/typ.c"if ( Neval ) errorFPC__E ( ( char * ) "%s", Neval ) ; else #line 282 "../../src/typ.c"if ( _auto_i < 0 ) { #line 282 "../../src/typ.c"errorFPC__E ( ( char * ) "negative field size") ; #line 282 "../../src/typ.c"#line 284 "../../src/typ.c"_auto_i = 1 ; } else #line 286 "../../src/typ.c"if ( ( _type_tsizeof ( ( struct type * ) _auto_f -> _basetype__O1.__C1_b_fieldtype ) * BI_IN_BYTE ) #line 286 "../../src/typ.c"< _auto_i ) #line 287 "../../src/typ.c"errorFPC__E ( ( char * ) "field size > sizeof(%t)", _auto_f -> _basetype__O1.__C1_b_fieldtype ) ; #line 288 "../../src/typ.c"if ( _auto_e && ( _auto_e -> _node_permanent == 0 ) ) _expr_del ( ( struct expr * ) #line 288 "../../src/typ.c"_auto_e ) ; } #line 290 "../../src/typ.c"_auto_f -> _basetype_b_bits = _auto_i ; #line 291 "../../src/typ.c"_auto_f -> _basetype_b_name = 0 ; #line 292 "../../src/typ.c"break ; } } } ; #line 298 "../../src/typ.c"bit vrp_equiv ; #line 300 "../../src/typ.c"bit _type_check ( _auto_this , _auto_t , _auto_oper ) register struct type * _auto_this ; struct type * _auto_t ; int _auto_oper ; #line 316 "../../src/typ.c"{ #line 316 "../../src/typ.c"bit _auto__result ; Ptype _auto_t1 ; Ptype _auto_t2 ; TOK _auto_b1 ; TOK _auto_b2 ; bit _auto_first ; TOK _auto_r ; #line 317 "../../src/typ.c"_auto_t1 = ( struct type * ) _auto_this ; #line 318 "../../src/typ.c"_auto_t2 = _auto_t ; #line 320 "../../src/typ.c"_auto_first = 1 ; #line 323 "../../src/typ.c"if ( ( _auto_t1 == 0 ) || ( _auto_t2 == 0 ) ) errorFI_PC__E ( ( #line 323 "../../src/typ.c"int ) 'i' , ( char * ) "check(%d,%d,%d)", _auto_t1 , _auto_t2 , _auto_oper ) ; #line 325 "../../src/typ.c"vrp_equiv = 0 ; #line 327 "../../src/typ.c"while ( _auto_t1 && _auto_t2 ) { #line 327 "../../src/typ.c"top : if ( _auto_t1 == _auto_t2 ) { #line 330 "../../src/typ.c"{ _auto__result = 0 #line 330 "../../src/typ.c"; #line 330 "../../src/typ.c"return _auto__result ; } } #line 331 "../../src/typ.c"if ( ( _auto_t1 -> _node_base == 141 ) || ( _auto_t2 -> _node_base == 141 ) ) #line 331 "../../src/typ.c"#line 331 "../../src/typ.c"{ #line 331 "../../src/typ.c"{ _auto__result = 0 ; #line 331 "../../src/typ.c"return _auto__result ; } } #line 333 "../../src/typ.c"_auto_b1 = _auto_t1 -> _node_base ; #line 334 "../../src/typ.c"if ( _auto_b1 == 97 ) { #line 334 "../../src/typ.c"_auto_t1 = ( ( ( struct basetype * ) ( _auto_t1 ) #line 334 "../../src/typ.c") ) -> _basetype_b_name -> _expr__O2.__C2_tp ; #line 336 "../../src/typ.c"goto top ; } #line 339 "../../src/typ.c"_auto_b2 = _auto_t2 -> _node_base ; #line 340 "../../src/typ.c"if ( _auto_b2 == 97 ) { #line 340 "../../src/typ.c"_auto_t2 = ( ( ( struct basetype * ) ( _auto_t2 ) #line 340 "../../src/typ.c") ) -> _basetype_b_name -> _expr__O2.__C2_tp ; #line 342 "../../src/typ.c"goto top ; } #line 345 "../../src/typ.c"if ( _auto_b1 != _auto_b2 ) { #line 345 "../../src/typ.c"switch ( _auto_b1 ) { #line 346 "../../src/typ.c"case 125 : if ( #line 346 "../../src/typ.c"_auto_b1 != _auto_b2 ) #line 349 "../../src/typ.c"vrp_equiv = 1 ; #line 350 "../../src/typ.c"switch ( _auto_b2 ) { #line 350 "../../src/typ.c"case 125 : case 110 : _auto_t1 = ( ( ( struct ptr * #line 350 "../../src/typ.c") ( _auto_t1 ) ) ) -> _ptr_typ ; #line 355 "../../src/typ.c"_auto_t2 = ( ( ( struct vec * ) ( _auto_t2 ) ) ) -> _vec_typ ; #line 356 "../../src/typ.c"_auto_first = 0 ; #line 357 "../../src/typ.c"goto top ; #line 358 "../../src/typ.c"case 108 : _auto_t1 = ( ( ( struct ptr * ) ( _auto_t1 ) ) ) -> #line 358 "../../src/typ.c"_ptr_typ ; #line 360 "../../src/typ.c"if ( ( _auto_first == 0 ) || ( _auto_t1 -> _node_base != _auto_b2 ) ) { #line 360 "../../src/typ.c"{ #line 360 "../../src/typ.c"#line 360 "../../src/typ.c"_auto__result = 1 ; #line 360 "../../src/typ.c"return _auto__result ; } } #line 361 "../../src/typ.c"_auto_first = 0 ; #line 362 "../../src/typ.c"goto top ; } #line 364 "../../src/typ.c"_auto_first = 0 ; #line 365 "../../src/typ.c"break ; #line 366 "../../src/typ.c"case 110 : if ( _auto_b1 != _auto_b2 ) vrp_equiv = 1 ; #line 368 "../../src/typ.c"_auto_first = 0 ; #line 369 "../../src/typ.c"switch ( _auto_b2 ) { #line 369 "../../src/typ.c"case 125 : switch ( _auto_oper ) { #line 372 "../../src/typ.c"case 0 : case #line 372 "../../src/typ.c"136 : #line 375 "../../src/typ.c"case 70 : case 78 : break ; #line 378 "../../src/typ.c"case 76 : default : { #line 380 "../../src/typ.c"{ _auto__result = 1 ; #line 380 "../../src/typ.c"return _auto__result ; } } } #line 382 "../../src/typ.c"_auto_t1 = ( ( ( struct vec * ) ( _auto_t1 ) ) ) #line 382 "../../src/typ.c"-> _vec_typ ; #line 383 "../../src/typ.c"_auto_t2 = ( ( ( struct ptr * ) ( _auto_t2 ) ) ) -> _ptr_typ ; #line 384 "../../src/typ.c"goto top ; } #line 386 "../../src/typ.c"break ; } #line 391 "../../src/typ.c"goto base_check ; } #line 394 "../../src/typ.c"switch ( _auto_b1 ) { #line 394 "../../src/typ.c"case 110 : _auto_first = 0 ; #line 397 "../../src/typ.c"{ #line 397 "../../src/typ.c"Pvec _auto_v1 ; Pvec _auto_v2 ; #line 397 "../../src/typ.c"_auto_v1 = ( ( ( struct vec * ) ( _auto_t1 ) ) ) ; #line 398 "../../src/typ.c"_auto_v2 = ( ( ( struct vec * ) ( _auto_t2 ) ) ) ; #line 399 "../../src/typ.c"if ( _auto_v1 -> _vec_size != _auto_v2 -> _vec_size ) switch ( _auto_oper ) { #line 400 "../../src/typ.c"case 76 : case 78 : #line 400 "../../src/typ.c"#line 403 "../../src/typ.c"{ #line 403 "../../src/typ.c"{ _auto__result = 1 ; #line 403 "../../src/typ.c"return _auto__result ; } } } #line 405 "../../src/typ.c"_auto_t1 = _auto_v1 -> _vec_typ ; #line 406 "../../src/typ.c"_auto_t2 = _auto_v2 -> _vec_typ ; } #line 408 "../../src/typ.c"break ; #line 410 "../../src/typ.c"case 125 : case 158 : _auto_first = 0 ; #line 413 "../../src/typ.c"{ #line 413 "../../src/typ.c"Pptr _auto_p1 ; Pptr _auto_p2 ; #line 413 "../../src/typ.c"_auto_p1 = ( ( ( struct ptr * ) ( _auto_t1 ) ) ) ; #line 414 "../../src/typ.c"_auto_p2 = ( ( ( struct ptr * ) ( _auto_t2 ) ) ) ; #line 415 "../../src/typ.c"if ( _auto_p2 -> _ptr_rdo && ( _auto_p1 -> _ptr_rdo == 0 ) ) { #line 415 "../../src/typ.c"{ _auto__result = 1 ; #line 415 "../../src/typ.c"#line 415 "../../src/typ.c"return _auto__result ; } } #line 416 "../../src/typ.c"_auto_t1 = _auto_p1 -> _ptr_typ ; #line 417 "../../src/typ.c"_auto_t2 = _auto_p2 -> _ptr_typ ; } #line 419 "../../src/typ.c"break ; #line 421 "../../src/typ.c"case 108 : _auto_first = 0 ; #line 423 "../../src/typ.c"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -