浅谈,C语言编译原理的个人见解

预处理:c语言主要有两种文件 .c 和 .h 文件,#include和#define都是预处理,主要包括宏定义 文件包含 条件编译(eg:用于中英文版本使用一套源码的情况跟if else的区别就是可以是代码的精简if else中的两部分代码都会进行编译,而条件编译是不符合条件就不会进行编译)三种,编译器看见的文件都是预处理之后的样子。比如进行过宏定义之后,预处理就是将宏进行替换然后给编译器进行识别,头文件还可以插入到源代码中。

编译:对象是单个的头文件和其中递归包含的头文件组成的编译单元。一般来说头文件不直接参与编译。c语言编译的时候在windows系统下将生成 .obj 文件,在unix系统中将生成 .o文件

同时会进行语法的检查,词法分析,产生目标代码并进行优化,为全局变量和局部变量分配内存,并检查函数是否定义,如果没有定义会检查函数是否声明,若有函数声明则就告诉编译器函数的定义将晚些定义或者在其他文件中进行定义,你先给我编译通过。

链接:是将编译生成的零散的二进制机器代码组合成可以执行的文件,一是解析其他文件中的函数引用或其他引用,二是解析库函数。

函数必须先声明再引用,如果不定义函数的话 能编译但是不能进行链接,连接错误的原因就是不能找到函数实体。

原因举例:例如1.c文件中声明并且调用了一个函数,这个函数却在2.c中进行的定义,链接就是在2.c中找到函数并对其进行解析,若是找不到就会进行错误提示:存在尚未解析的对象,声明的外部变量也是这样
https://github.com/users/dfghfhdfgj7/projects/250
https://github.com/users/dfghfhdfgj7/projects/251
https://github.com/users/dfghfhdfgj7/projects/252
https://github.com/users/dfghfhdfgj7/projects/253
https://github.com/users/dfghfhdfgj7/projects/254
https://github.com/users/dfghfhdfgj7/projects/255
https://github.com/users/dfghfhdfgj7/projects/256
https://github.com/users/dfghfhdfgj7/projects/257
https://github.com/users/dfghfhdfgj7/projects/258
https://github.com/users/dfghfhdfgj7/projects/259
https://github.com/users/dfghfhdfgj7/projects/260
https://github.com/users/dfghfhdfgj7/projects/261
https://github.com/users/dfghfhdfgj7/projects/262
https://github.com/users/dfghfhdfgj7/projects/263
https://github.com/users/dfghfhdfgj7/projects/264
https://github.com/users/dfghfhdfgj7/projects/265
https://github.com/users/dfghfhdfgj7/projects/266
https://github.com/users/dfghfhdfgj7/projects/267
https://github.com/users/dfghfhdfgj7/projects/268
https://github.com/users/dfghfhdfgj7/projects/269
https://github.com/users/dfghfhdfgj7/projects/270
https://github.com/users/dfghfhdfgj7/projects/271
https://github.com/users/dfghfhdfgj7/projects/272
https://github.com/users/dfghfhdfgj7/projects/273
https://github.com/users/dfghfhdfgj7/projects/274
https://github.com/users/dfghfhdfgj7/projects/275
https://github.com/users/dfghfhdfgj7/projects/276
https://github.com/users/dfghfhdfgj7/projects/277
https://github.com/users/dfghfhdfgj7/projects/278
https://github.com/users/dfghfhdfgj7/projects/279
https://github.com/users/dfghfhdfgj7/projects/280
https://github.com/users/dfghfhdfgj7/projects/281
https://github.com/users/dfghfhdfgj7/projects/282
https://github.com/users/dfghfhdfgj7/projects/283
https://github.com/users/dfghfhdfgj7/projects/284
https://github.com/users/dfghfhdfgj7/projects/285
https://github.com/users/dfghfhdfgj7/projects/286
https://github.com/users/dfghfhdfgj7/projects/287
https://github.com/users/dfghfhdfgj7/projects/288
https://github.com/users/dfghfhdfgj7/projects/289
https://github.com/users/dfghfhdfgj7/projects/290
https://github.com/users/dfghfhdfgj7/projects/291
https://github.com/users/dfghfhdfgj7/projects/292
https://github.com/users/dfghfhdfgj7/projects/293
https://github.com/users/dfghfhdfgj7/projects/294
https://github.com/users/dfghfhdfgj7/projects/295
https://github.com/users/dfghfhdfgj7/projects/296
https://github.com/users/dfghfhdfgj7/projects/297
https://github.com/users/dfghfhdfgj7/projects/298
https://github.com/users/dfghfhdfgj7/projects/299
https://github.com/users/dfghfhdfgj7/projects/300
https://github.com/users/dfghfhdfgj7/projects/301
https://github.com/users/dfghfhdfgj7/projects/302
https://github.com/users/dfghfhdfgj7/projects/303
https://github.com/users/dfghfhdfgj7/projects/304
https://github.com/users/dfghfhdfgj7/projects/305
https://github.com/users/dfghfhdfgj7/projects/306
https://github.com/users/dfghfhdfgj7/projects/307
https://github.com/users/dfghfhdfgj7/projects/308
https://github.com/users/dfghfhdfgj7/projects/309
https://github.com/users/dfghfhdfgj7/projects/310
https://github.com/users/dfghfhdfgj7/projects/311
https://github.com/users/dfghfhdfgj7/projects/312
https://github.com/users/dfghfhdfgj7/projects/313
https://github.com/users/dfghfhdfgj7/projects/314
https://github.com/users/dfghfhdfgj7/projects/315
https://github.com/users/dfghfhdfgj7/projects/316
https://github.com/users/dfghfhdfgj7/projects/317
https://github.com/users/dfghfhdfgj7/projects/318
https://github.com/users/dfghfhdfgj7/projects/319
https://github.com/users/dfghfhdfgj7/projects/320
https://github.com/users/dfghfhdfgj7/projects/321
https://github.com/users/dfghfhdfgj7/projects/322
https://github.com/users/dfghfhdfgj7/projects/323
https://github.com/users/dfghfhdfgj7/projects/324
https://github.com/users/dfghfhdfgj7/projects/325
https://github.com/users/dfghfhdfgj7/projects/326
https://github.com/users/dfghfhdfgj7/projects/327
https://github.com/users/dfghfhdfgj7/projects/328
https://github.com/users/dfghfhdfgj7/projects/329
https://github.com/users/dfghfhdfgj7/projects/330
https://github.com/users/dfghfhdfgj7/projects/331
https://github.com/users/dfghfhdfgj7/projects/332
https://github.com/users/dfghfhdfgj7/projects/333
https://github.com/users/dfghfhdfgj7/projects/334
https://github.com/users/dfghfhdfgj7/projects/335
https://github.com/users/dfghfhdfgj7/projects/336
https://github.com/users/dfghfhdfgj7/projects/337
https://github.com/users/dfghfhdfgj7/projects/338
https://github.com/users/dfghfhdfgj7/projects/339
https://github.com/users/dfghfhdfgj7/projects/340
https://github.com/users/dfghfhdfgj7/projects/341
https://github.com/users/dfghfhdfgj7/projects/342
https://github.com/users/dfghfhdfgj7/projects/343
https://github.com/users/dfghfhdfgj7/projects/344
https://github.com/users/dfghfhdfgj7/projects/345
https://github.com/users/dfghfhdfgj7/projects/346
https://github.com/users/dfghfhdfgj7/projects/347
https://github.com/users/dfghfhdfgj7/projects/348
https://github.com/users/dfghfhdfgj7/projects/349
https://github.com/users/dfghfhdfgj7/projects/350
https://github.com/users/dfghfhdfgj7/projects/351
https://github.com/users/dfghfhdfgj7/projects/352
https://github.com/users/dfghfhdfgj7/projects/353
https://github.com/users/dfghfhdfgj7/projects/354
https://github.com/users/dfghfhdfgj7/projects/355
https://github.com/users/dfghfhdfgj7/projects/356
https://github.com/users/dfghfhdfgj7/projects/357
https://github.com/users/dfghfhdfgj7/projects/358
https://github.com/users/dfghfhdfgj7/projects/359
https://github.com/users/dfghfhdfgj7/projects/360
https://github.com/users/dfghfhdfgj7/projects/361
https://github.com/users/dfghfhdfgj7/projects/362
https://github.com/users/dfghfhdfgj7/projects/363
https://github.com/users/dfghfhdfgj7/projects/364
https://github.com/users/dfghfhdfgj7/projects/365
https://github.com/users/dfghfhdfgj7/projects/366
https://github.com/users/dfghfhdfgj7/projects/367
https://github.com/users/dfghfhdfgj7/projects/368
https://github.com/users/dfghfhdfgj7/projects/369
https://github.com/users/dfghfhdfgj7/projects/370
https://github.com/users/dfghfhdfgj7/projects/371
https://github.com/users/dfghfhdfgj7/projects/372
https://github.com/users/dfghfhdfgj7/projects/373
https://github.com/users/dfghfhdfgj7/projects/374
https://github.com/users/dfghfhdfgj7/projects/375
https://github.com/users/dfghfhdfgj7/projects/376
https://github.com/users/dfghfhdfgj7/projects/377
https://github.com/users/dfghfhdfgj7/projects/378
https://github.com/users/dfghfhdfgj7/projects/379
https://github.com/users/dfghfhdfgj7/projects/380
https://github.com/users/dfghfhdfgj7/projects/381
https://github.com/users/dfghfhdfgj7/projects/382
https://github.com/users/dfghfhdfgj7/projects/383
https://github.com/users/dfghfhdfgj7/projects/384
https://github.com/users/dfghfhdfgj7/projects/385
https://github.com/users/dfghfhdfgj7/projects/386
https://github.com/users/dfghfhdfgj7/projects/387
https://github.com/users/dfghfhdfgj7/projects/388
https://github.com/users/dfghfhdfgj7/projects/389
https://github.com/users/dfghfhdfgj7/projects/390
https://github.com/users/dfghfhdfgj7/projects/391
https://github.com/users/dfghfhdfgj7/projects/392
https://github.com/users/dfghfhdfgj7/projects/393
https://github.com/users/dfghfhdfgj7/projects/394
https://github.com/users/dfghfhdfgj7/projects/395
https://github.com/users/dfghfhdfgj7/projects/396
https://github.com/users/dfghfhdfgj7/projects/397
https://github.com/users/dfghfhdfgj7/projects/398
https://github.com/users/dfghfhdfgj7/projects/399
https://github.com/users/dfghfhdfgj7/projects/400
https://github.com/users/dfghfhdfgj7/projects/401
https://github.com/users/dfghfhdfgj7/projects/402
https://github.com/users/dfghfhdfgj7/projects/403
https://github.com/users/dfghfhdfgj7/projects/404
https://github.com/users/dfghfhdfgj7/projects/405
https://github.com/users/dfghfhdfgj7/projects/406
https://github.com/users/dfghfhdfgj7/projects/407
https://github.com/users/dfghfhdfgj7/projects/408
https://github.com/users/dfghfhdfgj7/projects/409
https://github.com/users/dfghfhdfgj7/projects/410
https://github.com/users/dfghfhdfgj7/projects/411
https://github.com/users/dfghfhdfgj7/projects/412
https://github.com/users/dfghfhdfgj7/projects/413
https://github.com/users/dfghfhdfgj7/projects/414
https://github.com/users/dfghfhdfgj7/projects/415
https://github.com/users/dfghfhdfgj7/projects/416
https://github.com/users/dfghfhdfgj7/projects/417
https://github.com/users/dfghfhdfgj7/projects/418
https://github.com/users/dfghfhdfgj7/projects/419
https://github.com/users/dfghfhdfgj7/projects/420
https://github.com/users/dfghfhdfgj7/projects/421
https://github.com/users/dfghfhdfgj7/projects/422
https://github.com/users/dfghfhdfgj7/projects/423
https://github.com/users/dfghfhdfgj7/projects/424
https://github.com/users/dfghfhdfgj7/projects/425
https://github.com/users/dfghfhdfgj7/projects/426
https://github.com/users/dfghfhdfgj7/projects/427
https://github.com/users/dfghfhdfgj7/projects/428
https://github.com/users/dfghfhdfgj7/projects/429
https://github.com/users/dfghfhdfgj7/projects/430
https://github.com/users/dfghfhdfgj7/projects/431
https://github.com/users/dfghfhdfgj7/projects/432
https://github.com/users/dfghfhdfgj7/projects/433
https://github.com/users/dfghfhdfgj7/projects/434
https://github.com/users/dfghfhdfgj7/projects/435
https://github.com/users/dfghfhdfgj7/projects/436
https://github.com/users/dfghfhdfgj7/projects/437
https://github.com/users/dfghfhdfgj7/projects/438
https://github.com/users/dfghfhdfgj7/projects/439
https://github.com/users/dfghfhdfgj7/projects/440
https://github.com/users/dfghfhdfgj7/projects/441
https://github.com/users/dfghfhdfgj7/projects/442
https://github.com/users/dfghfhdfgj7/projects/443
https://github.com/users/dfghfhdfgj7/projects/444
https://github.com/users/dfghfhdfgj7/projects/445
https://github.com/users/dfghfhdfgj7/projects/446
https://github.com/users/dfghfhdfgj7/projects/447
https://github.com/users/dfghfhdfgj7/projects/448
https://github.com/users/dfghfhdfgj7/projects/449
https://github.com/users/dfghfhdfgj7/projects/450
https://github.com/users/dfghfhdfgj7/projects/451
https://github.com/users/dfghfhdfgj7/projects/452
https://github.com/users/dfghfhdfgj7/projects/453
https://github.com/users/dfghfhdfgj7/projects/454
https://github.com/users/dfghfhdfgj7/projects/455
https://github.com/users/dfghfhdfgj7/projects/456
https://github.com/users/dfghfhdfgj7/projects/457
https://github.com/users/dfghfhdfgj7/projects/458
https://github.com/users/dfghfhdfgj7/projects/459
https://github.com/users/dfghfhdfgj7/projects/460
https://github.com/users/dfghfhdfgj7/projects/461
https://github.com/users/dfghfhdfgj7/projects/462
https://github.com/users/dfghfhdfgj7/projects/463
https://github.com/users/dfghfhdfgj7/projects/464
https://github.com/users/dfghfhdfgj7/projects/465
https://github.com/users/dfghfhdfgj7/projects/466
https://github.com/users/dfghfhdfgj7/projects/467
https://github.com/users/dfghfhdfgj7/projects/468
https://github.com/users/dfghfhdfgj7/projects/469
https://github.com/users/dfghfhdfgj7/projects/470
https://github.com/users/dfghfhdfgj7/projects/471
https://github.com/users/dfghfhdfgj7/projects/472
https://github.com/users/dfghfhdfgj7/projects/473
https://github.com/users/dfghfhdfgj7/projects/474
https://github.com/users/dfghfhdfgj7/projects/475
https://github.com/users/dfghfhdfgj7/projects/476
https://github.com/users/dfghfhdfgj7/projects/477
https://github.com/users/dfghfhdfgj7/projects/478
https://github.com/users/dfghfhdfgj7/projects/479
https://github.com/users/dfghfhdfgj7/projects/480
https://github.com/users/dfghfhdfgj7/projects/481
https://github.com/users/dfghfhdfgj7/projects/482
https://github.com/users/dfghfhdfgj7/projects/483
https://github.com/users/dfghfhdfgj7/projects/484
https://github.com/users/dfghfhdfgj7/projects/485
https://github.com/users/dfghfhdfgj7/projects/486
https://github.com/users/dfghfhdfgj7/projects/487
https://github.com/users/dfghfhdfgj7/projects/488
https://github.com/users/dfghfhdfgj7/projects/489
https://github.com/users/dfghfhdfgj7/projects/490
https://github.com/users/dfghfhdfgj7/projects/491
https://github.com/users/dfghfhdfgj7/projects/492
https://github.com/users/dfghfhdfgj7/projects/493
https://github.com/users/dfghfhdfgj7/projects/494
https://github.com/users/dfghfhdfgj7/projects/495
https://github.com/users/dfghfhdfgj7/projects/496
https://github.com/users/dfghfhdfgj7/projects/497
https://github.com/users/dfghfhdfgj7/projects/498
https://github.com/users/dfghfhdfgj7/projects/499
https://github.com/users/dfghfhdfgj7/projects/500
https://github.com/users/dfghfhdfgj7/projects/501
https://github.com/users/dfghfhdfgj7/projects/502
https://github.com/users/dfghfhdfgj7/projects/503
https://github.com/users/dfghfhdfgj7/projects/504
https://github.com/users/dfghfhdfgj7/projects/505
https://github.com/users/dfghfhdfgj7/projects/506
https://github.com/users/dfghfhdfgj7/projects/507
https://github.com/users/dfghfhdfgj7/projects/508
https://github.com/users/dfghfhdfgj7/projects/509
https://github.com/users/dfghfhdfgj7/projects/510
https://github.com/users/dfghfhdfgj7/projects/511
https://github.com/users/dfghfhdfgj7/projects/512
https://github.com/users/dfghfhdfgj7/projects/513
https://github.com/users/dfghfhdfgj7/projects/514
https://github.com/users/dfghfhdfgj7/projects/515
https://github.com/users/dfghfhdfgj7/projects/516
https://github.com/users/dfghfhdfgj7/projects/517
https://github.com/users/dfghfhdfgj7/projects/518
https://github.com/users/dfghfhdfgj7/projects/519
https://github.com/users/dfghfhdfgj7/projects/520
https://github.com/users/dfghfhdfgj7/projects/521
https://github.com/users/dfghfhdfgj7/projects/522
https://github.com/users/dfghfhdfgj7/projects/523
https://github.com/users/dfghfhdfgj7/projects/524
https://github.com/users/dfghfhdfgj7/projects/525
https://github.com/users/dfghfhdfgj7/projects/526
https://github.com/users/dfghfhdfgj7/projects/527
https://github.com/users/dfghfhdfgj7/projects/528
https://github.com/users/dfghfhdfgj7/projects/529
https://github.com/users/dfghfhdfgj7/projects/530
https://github.com/users/dfghfhdfgj7/projects/531
https://github.com/users/dfghfhdfgj7/projects/532
https://github.com/users/dfghfhdfgj7/projects/533
https://github.com/users/dfghfhdfgj7/projects/534
https://github.com/users/dfghfhdfgj7/projects/535
https://github.com/users/dfghfhdfgj7/projects/536
https://github.com/users/dfghfhdfgj7/projects/537
https://github.com/users/dfghfhdfgj7/projects/538
https://github.com/users/dfghfhdfgj7/projects/539
https://github.com/users/dfghfhdfgj7/projects/540
https://github.com/users/dfghfhdfgj7/projects/541
https://github.com/users/dfghfhdfgj7/projects/542
https://github.com/users/dfghfhdfgj7/projects/543
https://github.com/users/dfghfhdfgj7/projects/544
https://github.com/users/dfghfhdfgj7/projects/545
https://github.com/users/dfghfhdfgj7/projects/546
https://github.com/users/dfghfhdfgj7/projects/547
https://github.com/users/dfghfhdfgj7/projects/548
https://github.com/users/dfghfhdfgj7/projects/549
https://github.com/users/dfghfhdfgj7/projects/550
https://github.com/users/dfghfhdfgj7/projects/551
https://github.com/users/dfghfhdfgj7/projects/552
https://github.com/users/dfghfhdfgj7/projects/553
https://github.com/users/dfghfhdfgj7/projects/554
https://github.com/users/dfghfhdfgj7/projects/555
https://github.com/users/dfghfhdfgj7/projects/556
https://github.com/users/dfghfhdfgj7/projects/557
https://github.com/users/dfghfhdfgj7/projects/558
https://github.com/users/dfghfhdfgj7/projects/559
https://github.com/users/dfghfhdfgj7/projects/560
https://github.com/users/dfghfhdfgj7/projects/561
https://github.com/users/dfghfhdfgj7/projects/562
https://github.com/users/dfghfhdfgj7/projects/563
https://github.com/users/dfghfhdfgj7/projects/564
https://github.com/users/dfghfhdfgj7/projects/565
https://github.com/users/dfghfhdfgj7/projects/566
https://github.com/users/dfghfhdfgj7/projects/567
https://github.com/users/dfghfhdfgj7/projects/568
https://github.com/users/dfghfhdfgj7/projects/569
https://github.com/users/dfghfhdfgj7/projects/570
https://github.com/users/dfghfhdfgj7/projects/571
https://github.com/users/dfghfhdfgj7/projects/572
https://github.com/users/dfghfhdfgj7/projects/573
https://github.com/users/dfghfhdfgj7/projects/574
https://github.com/users/dfghfhdfgj7/projects/575
https://github.com/users/dfghfhdfgj7/projects/576
https://github.com/users/dfghfhdfgj7/projects/577
https://github.com/users/dfghfhdfgj7/projects/578
https://github.com/users/dfghfhdfgj7/projects/579
https://github.com/users/dfghfhdfgj7/projects/580
https://github.com/users/dfghfhdfgj7/projects/581
https://github.com/users/dfghfhdfgj7/projects/582
https://github.com/users/dfghfhdfgj7/projects/583
https://github.com/users/dfghfhdfgj7/projects/584
https://github.com/users/dfghfhdfgj7/projects/585
https://github.com/users/dfghfhdfgj7/projects/586
https://github.com/users/dfghfhdfgj7/projects/587
https://github.com/users/dfghfhdfgj7/projects/588
https://github.com/users/dfghfhdfgj7/projects/589
https://github.com/users/dfghfhdfgj7/projects/590
https://github.com/users/dfghfhdfgj7/projects/591
https://github.com/users/dfghfhdfgj7/projects/592
https://github.com/users/dfghfhdfgj7/projects/593
https://github.com/users/dfghfhdfgj7/projects/594
https://github.com/users/dfghfhdfgj7/projects/595
https://github.com/users/dfghfhdfgj7/projects/596
https://github.com/users/dfghfhdfgj7/projects/597
https://github.com/users/dfghfhdfgj7/projects/598
https://github.com/users/dfghfhdfgj7/projects/599
https://github.com/users/dfghfhdfgj7/projects/600
https://github.com/users/dfghfhdfgj7/projects/601
https://github.com/users/dfghfhdfgj7/projects/602
https://github.com/users/dfghfhdfgj7/projects/603
https://github.com/users/dfghfhdfgj7/projects/604
https://github.com/users/dfghfhdfgj7/projects/605
https://github.com/users/dfghfhdfgj7/projects/606
https://github.com/users/dfghfhdfgj7/projects/607
https://github.com/users/dfghfhdfgj7/projects/608
https://github.com/users/dfghfhdfgj7/projects/609
https://github.com/users/dfghfhdfgj7/projects/610
https://github.com/users/dfghfhdfgj7/projects/611
https://github.com/users/dfghfhdfgj7/projects/612
https://github.com/users/dfghfhdfgj7/projects/613
https://github.com/users/dfghfhdfgj7/projects/614
https://github.com/users/dfghfhdfgj7/projects/615
https://github.com/users/dfghfhdfgj7/projects/616
https://github.com/users/dfghfhdfgj7/projects/617
https://github.com/users/dfghfhdfgj7/projects/618
https://github.com/users/dfghfhdfgj7/projects/619
https://github.com/users/dfghfhdfgj7/projects/620
https://github.com/users/dfghfhdfgj7/projects/621
https://github.com/users/dfghfhdfgj7/projects/622
https://github.com/users/dfghfhdfgj7/projects/623
https://github.com/users/dfghfhdfgj7/projects/624
https://github.com/users/dfghfhdfgj7/projects/625
https://github.com/users/dfghfhdfgj7/projects/626
https://github.com/users/dfghfhdfgj7/projects/627
https://github.com/users/dfghfhdfgj7/projects/628
https://github.com/users/dfghfhdfgj7/projects/629
https://github.com/users/dfghfhdfgj7/projects/630
https://github.com/users/dfghfhdfgj7/projects/631
https://github.com/users/dfghfhdfgj7/projects/632
https://github.com/users/dfghfhdfgj7/projects/633
https://github.com/users/dfghfhdfgj7/projects/634
https://github.com/users/dfghfhdfgj7/projects/635
https://github.com/users/dfghfhdfgj7/projects/636
https://github.com/users/dfghfhdfgj7/projects/637
https://github.com/users/dfghfhdfgj7/projects/638
https://github.com/users/dfghfhdfgj7/projects/639
https://github.com/users/dfghfhdfgj7/projects/640
https://github.com/users/dfghfhdfgj7/projects/641
https://github.com/users/dfghfhdfgj7/projects/642
https://github.com/users/dfghfhdfgj7/projects/643
https://github.com/users/dfghfhdfgj7/projects/644
https://github.com/users/dfghfhdfgj7/projects/645
https://github.com/users/dfghfhdfgj7/projects/646
https://github.com/users/dfghfhdfgj7/projects/647
https://github.com/users/dfghfhdfgj7/projects/648
https://github.com/users/dfghfhdfgj7/projects/649
https://github.com/users/dfghfhdfgj7/projects/650
https://github.com/users/dfghfhdfgj7/projects/651
https://github.com/users/dfghfhdfgj7/projects/652
https://github.com/users/dfghfhdfgj7/projects/653
https://github.com/users/dfghfhdfgj7/projects/654
https://github.com/users/dfghfhdfgj7/projects/655
https://github.com/users/dfghfhdfgj7/projects/656

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
作者简介: Andrew W.Appel,美国普林斯顿大学计算机科学系教授,第26届ACM SIGPLAN-SIGACT程序设计原理年会大会执行主席,1998-1999年在贝尔实验室做研究工作。主要研究方向是计算机安全、编译器设计、程序设计语言等。 内容简介: 本书全面讲述了现代编译器的各个组成部分,包括词法分析、语法分析、抽象语法、语义检查、中间代码表示、指令选择、数据流分析、寄存器分配以及运行时系统等。全书分成两部分,第一部分是编译的基础知识,适用于第一门编译原理课程(一个学期);第二部分是高级主题,包括面向对象语言和函数语言、垃圾收集、循环优化、SSA(静态单赋值)形式、循环调度、存储结构优化等,适合于后续课程或研究生教学。书中专门为学生提供了一个用C语言编写的实习项目,包括前端和后端设计,学生可以在一学期内创建一个功能完整的编译器。   本书适用于高等院校计算机及相关专业的本科生或研究生,也可供科研人员或工程技术人员参考。 目录: 第一部分 编译基本原理 第1章 绪论 1 1.1 模块与接口 1 1.2 工具和软件 3 1.3 树语言的数据结构 3 程序设计:直线式程序解释器 7 推荐阅读 9 习题 9 第2章 词法分析 10 2.1 词法单词 10 2.2 正则表达式 11 2.3 有限自动机 13 2.4 非确定有限自动机 15 2.4.1 将正则表达式转换为NFA 16 2.4.2 将NFA转换为DFA 18 2.5 Lex:词法分析器的生成器 20 程序设计:词法分析 22 推荐阅读 23 习题 23 第3章 语法分析 27 3.1 上下文无关文法 28 3.1.1 推导 29 3.1.2 语法分析树 29 3.1.3 二义性文法 30 3.1.4 文件结束符 31 3.2 预测分析 32 3.2.1 FIRST集合和FOLLOW集合 33 3.2.2 构造一个预测分析器 35 3.2.3 消除左递归 36 3.2.4 提取左因子 37 3.2.5 错误恢复 37 3.3 LR分析 39 3.3.1 LR分析引擎 40 3.3.2 LR(0)分析器生成器 41 3.3.3 SLR分析器的生成 44 3.3.4 LR(1)项和LR(1)分析表 45 3.3.5 LALR(1)分析表 46 3.3.6 各类文法的层次 47 3.3.7 二义性文法的LR分析 47 3.4 使用分析器的生成器 48 3.4.1 冲突 49 3.4.2 优先级指导 50 3.4.3 语法和语义 53 3.5 错误恢复 54 3.5.1 用error符号恢复 54 3.5.2 全局错误修复 55 程序设计:语法分析 57 推荐阅读 58 习题 58 第4章 抽象语法 62 4.1 语义动作 62 4.1.1 递归下降 62 4.1.2 Yacc生成的分析器 62 4.1.3 语义动作的解释器 64 4.2 抽象语法分析树 65 4.2.1 位置 67 4.2.2 Tiger的抽象语法 68 程序设计:抽象语法 71 推荐阅读 71 习题 72 第5章 语义分析 73 5.1 符号表 73 5.1.1 多个符号表 74 5.1.2 高效的命令式风格符号表 75 5.1.3 高效的函数式符号表 76 5.1.4 Tiger编译器的符号 77 5.1.5 函数式风格的符号表 79 5.2 Tiger编译器的绑定 79 5.3 表达式的类型检查 82 5.4 声明的类型检查 84 5.4.1 变量声明 84 5.4.2 类型声明 85 5.4.3 函数声明 85 5.4.4 递归声明 86 程序设计:类型检查 87 习题 87 第6章 活动记录 89 6.1 栈帧 90 6.1.1 帧指针 91 6.1.2 寄存器 92 6.1.3 参数传递 92 6.1.4 返回地址 94 6.1.5 栈帧内的变量 94 6.1.6 静态链 95 6.2 Tiger编译器的栈帧 96 6.2.1 栈帧描述的表示 98 6.2.2 局部变量 98 6.2.3 计算逃逸变量 99 6.2.4 临时变量和标号 100 6.2.5 两层抽象 100 6.2.6 管理静态链 102 6.2.7 追踪层次信息 102 程序设计:栈帧 103 推荐阅读 103 习题 103 第7章 翻译成中间代码 106 7.1 中间表示树 106 7.2 翻译为树中间语言 108 7.2.1 表达式的种类 108 7.2.2 简单变量 111 7.2.3 追随静态链 112 7.2.4 数组变量 113 7.2.5 结构化的左值 114 7.2.6 下标和域选择 114 7.2.7 关于安全性的劝告 115 7.2.8 算术操作 116 7.2.9 条件表达式 1
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值