算是考完了 真难啊。。 学弟学妹们看到了可以参考下 内有真题一套 稍有些混乱的复习笔记一堆 不建议全部相信 因为本人复习得比较拉胯。。
参考下是ok的 语雀链接食用体验更佳 戳这里~
考完来简单总结下
题目与往年差不太多
- 语法树
- FIRSTVT表 LASTVT集
- FIRST集 FOLLOW集 构造预测分析表
- 中间代码分析
- SLR(1)分析法
- 语义子程序的翻译
经验总结:ppt直接看根本看不懂 顺序也比较奇怪 建议先通读一遍ppt 有不懂的先跳过 然后重要知识点多百度一下 可以去bilibili听一些up主讲一下
我晕 图片因为是语雀导出的 所以链接有点问题 懒得改了 咱就是说 建议看语雀上的内容哈 戳这里~
变量是对一个(或若干个)存储单元的抽象,赋值语句则是修改存储单元内容的抽象。
![image.png](https://img-blog.csdnimg.cn/img_convert/4ea42b00770d306ab2d814f608d83c3d.png#clientId=u43ff57c7-d1bf-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=354&id=ufd028177&margin=[object Object]&name=image.png&originHeight=443&originWidth=921&originalType=binary&ratio=1&rotation=0&showTitle=false&size=60450&status=done&style=none&taskId=u97a96f7f-845d-488a-8fde-1b0e9da8cea&title=&width=736.8)
![image.png](https://img-blog.csdnimg.cn/img_convert/a29ee9edde321e691997abada95ea9cb.png#clientId=u43ff57c7-d1bf-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=102&id=ua5e9e170&margin=[object Object]&name=image.png&originHeight=127&originWidth=777&originalType=binary&ratio=1&rotation=0&showTitle=false&size=27477&status=done&style=none&taskId=ub53aec50-8eb1-4677-9517-ab5c982c9e7&title=&width=621.6)
![image.png](https://img-blog.csdnimg.cn/img_convert/a3958e7b07bc8dc20d26ed1b3ba756a3.png#clientId=u43ff57c7-d1bf-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=183&id=u8aae8fe3&margin=[object Object]&name=image.png&originHeight=229&originWidth=751&originalType=binary&ratio=1&rotation=0&showTitle=false&size=46256&status=done&style=none&taskId=ub08c3f54-1add-481c-b421-9ca447cb1b9&title=&width=600.8)
简答题~
填空题~
![image.png](https://img-blog.csdnimg.cn/img_convert/7897ffa1407d29a8f86b39154567ec04.png#clientId=u43ff57c7-d1bf-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=334&id=u76a6340b&margin=[object Object]&name=image.png&originHeight=417&originWidth=958&originalType=binary&ratio=1&rotation=0&showTitle=false&size=64229&status=done&style=none&taskId=uc14c57dc-64c5-45e4-a39b-d6bf6ba93ca&title=&width=766.4)
![image.png](https://img-blog.csdnimg.cn/img_convert/222c54acc3d7cf5b0d7882076fe757e0.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=237&id=ub1ec4e54&margin=[object Object]&name=image.png&originHeight=296&originWidth=945&originalType=binary&ratio=1&rotation=0&showTitle=false&size=89989&status=done&style=none&taskId=u356cb54e-7b02-4164-a2a0-be2d01c67b0&title=&width=756)
![image.png](https://img-blog.csdnimg.cn/img_convert/bd7a7f41b7170652423cd51d7f5d08bd.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=441&id=u364192c8&margin=[object Object]&name=image.png&originHeight=551&originWidth=902&originalType=binary&ratio=1&rotation=0&showTitle=false&size=97074&status=done&style=none&taskId=uc12038a7-3563-4926-b922-bf2acc13e0d&title=&width=721.6)
![image.png](https://img-blog.csdnimg.cn/img_convert/5ae8c0d480687bc024939988ac9cdb9b.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=374&id=u5ccef115&margin=[object Object]&name=image.png&originHeight=467&originWidth=893&originalType=binary&ratio=1&rotation=0&showTitle=false&size=99995&status=done&style=none&taskId=u257d2868-c304-434a-b651-0dfd3e7c0e9&title=&width=714.4)
![image.png](https://img-blog.csdnimg.cn/img_convert/c1eebe51aabfa1b86aa759a3fb347cba.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=65&id=u85ebdc94&margin=[object Object]&name=image.png&originHeight=157&originWidth=569&originalType=binary&ratio=1&rotation=0&showTitle=false&size=12334&status=done&style=none&taskId=u187fe682-37cb-4c0e-a00d-16dd696d688&title=&width=234.1875)
![image.png](https://img-blog.csdnimg.cn/img_convert/91b67fd3878c1ae2bf8cd4b213957663.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=165&id=ubedc469e&margin=[object Object]&name=image.png&originHeight=457&originWidth=918&originalType=binary&ratio=1&rotation=0&showTitle=false&size=72341&status=done&style=none&taskId=uff967589-fae9-4aab-a4aa-6b318f245a2&title=&width=331)
![image.png](https://img-blog.csdnimg.cn/img_convert/77321d14808c7a613711110208b6e6f8.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=231&id=ue298d98d&margin=[object Object]&name=image.png&originHeight=370&originWidth=551&originalType=binary&ratio=1&rotation=0&showTitle=false&size=23707&status=done&style=none&taskId=u31f95994-51ab-4676-b316-d53997f30c5&title=&width=343.796875)
![image.png](https://img-blog.csdnimg.cn/img_convert/072c73c5e124e0b4ea6eacbaeade6ae7.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=247&id=uec49d88a&margin=[object Object]&name=image.png&originHeight=600&originWidth=973&originalType=binary&ratio=1&rotation=0&showTitle=false&size=62611&status=done&style=none&taskId=uaaba7098-415d-44a1-a484-51ec8fec2f2&title=&width=400)
![image.png](https://img-blog.csdnimg.cn/img_convert/e9386c4b60aac0780dbf10c6d23887aa.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=81&id=ua0fa35f1&margin=[object Object]&name=image.png&originHeight=157&originWidth=781&originalType=binary&ratio=1&rotation=0&showTitle=false&size=19215&status=done&style=none&taskId=ud26a853d-eb9a-439d-b5fa-6e1fe302f38&title=&width=401)
![image.png](https://img-blog.csdnimg.cn/img_convert/cd74faefe1cf0687662e0c1c0487bc36.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=294&id=u38a9b680&margin=[object Object]&name=image.png&originHeight=368&originWidth=778&originalType=binary&ratio=1&rotation=0&showTitle=false&size=70921&status=done&style=none&taskId=u8034c626-00f1-44e2-a159-40782249e54&title=&width=622.4)
规定程序单元之间控制流程的机制
![image.png](https://img-blog.csdnimg.cn/img_convert/e6963813f665e34c775ad6fc776f3873.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=239&id=u688b1300&margin=[object Object]&name=image.png&originHeight=299&originWidth=427&originalType=binary&ratio=1&rotation=0&showTitle=false&size=23465&status=done&style=none&taskId=uc25848a9-e8ae-48ea-855c-59c8204e52d&title=&width=341.6)
int a;
int b = 666;
a = 666; —— a为非局部变量 可以这么理解?
![image.png](https://img-blog.csdnimg.cn/img_convert/b414159eac01b4368f63108d8cfe99f8.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=454&id=uc3f41212&margin=[object Object]&name=image.png&originHeight=567&originWidth=800&originalType=binary&ratio=1&rotation=0&showTitle=false&size=64726&status=done&style=none&taskId=u9d6a78d5-bb7f-426e-bad6-09b5fddca7b&title=&width=640)
![image.png](https://img-blog.csdnimg.cn/img_convert/0b5b364fcd9e166abc5dbf17375236f1.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=418&id=u6f5dccb5&margin=[object Object]&name=image.png&originHeight=523&originWidth=894&originalType=binary&ratio=1&rotation=0&showTitle=false&size=52180&status=done&style=none&taskId=ua1223ac1-44de-45ac-a582-37d1fb013ff&title=&width=715.2)
哪俩属于别名?
![image.png](https://img-blog.csdnimg.cn/img_convert/6da799257570f8c12851e297fad88831.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=478&id=u640b86ba&margin=[object Object]&name=image.png&originHeight=598&originWidth=757&originalType=binary&ratio=1&rotation=0&showTitle=false&size=36187&status=done&style=none&taskId=u2af28ad0-420e-4b8f-88a2-f967d813b2c&title=&width=605.6)
![image.png](https://img-blog.csdnimg.cn/img_convert/fadeb4946f80a3e3242b19f0693b21a5.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=458&id=ud28580e6&margin=[object Object]&name=image.png&originHeight=573&originWidth=969&originalType=binary&ratio=1&rotation=0&showTitle=false&size=65953&status=done&style=none&taskId=ua63169b4-23dd-4152-b97b-af667388c66&title=&width=775.2)
![image.png](https://img-blog.csdnimg.cn/img_convert/760c9831aedf7109c5f5fd1666a20943.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=426&id=uc02b90f5&margin=[object Object]&name=image.png&originHeight=532&originWidth=898&originalType=binary&ratio=1&rotation=0&showTitle=false&size=60809&status=done&style=none&taskId=u768a9a27-b237-4404-9fb7-71dd1c83e80&title=&width=718.4)
程序设计语言是用来描述计算机所执行的算法的形式表示;
![image.png](https://img-blog.csdnimg.cn/img_convert/f718579c80c1b0c3521ac83556bed5c7.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=118&id=u43109937&margin=[object Object]&name=image.png&originHeight=358&originWidth=1293&originalType=binary&ratio=1&rotation=0&showTitle=false&size=25025&status=done&style=none&taskId=u94151c07-f5dc-4222-b866-185e68a88d0&title=&width=425)
![image.png](https://img-blog.csdnimg.cn/img_convert/f1a8a771a00725f489372bb8191497b2.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=387&id=u3fb896f9&margin=[object Object]&name=image.png&originHeight=597&originWidth=816&originalType=binary&ratio=1&rotation=0&showTitle=false&size=69518&status=done&style=none&taskId=uc404048d-ae12-4117-a249-f2641650355&title=&width=528.7999877929688)
![image.png](https://img-blog.csdnimg.cn/img_convert/a60caebf194b477479b2fc2bea703fba.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=350&id=u2f1657ea&margin=[object Object]&name=image.png&originHeight=437&originWidth=758&originalType=binary&ratio=1&rotation=0&showTitle=false&size=56747&status=done&style=none&taskId=u22960806-f342-46d5-af02-300dc8e81f6&title=&width=606.4)
![image.png](https://img-blog.csdnimg.cn/img_convert/7e76816c8b43164cec47c72560c3654f.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=282&id=u7f7b6a4d&margin=[object Object]&name=image.png&originHeight=468&originWidth=934&originalType=binary&ratio=1&rotation=0&showTitle=false&size=45725&status=done&style=none&taskId=uc428b845-649f-42b4-bb77-e64b0cc3f32&title=&width=563.2000122070312)
![image.png](https://img-blog.csdnimg.cn/img_convert/fd4646dee97593183162bf56c44cee33.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=424&id=u54669f0a&margin=[object Object]&name=image.png&originHeight=530&originWidth=675&originalType=binary&ratio=1&rotation=0&showTitle=false&size=77163&status=done&style=none&taskId=ua77509a4-df0c-4999-b095-632b9aabf0f&title=&width=540)
用英文大写字母表示非终结符;小写字母表示终结符;希腊小写字母表示串
![image.png](https://img-blog.csdnimg.cn/img_convert/331e2dedba860ee2b8cf127bd383de9f.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=269&id=udef3ba5b&margin=[object Object]&name=image.png&originHeight=417&originWidth=817&originalType=binary&ratio=1&rotation=0&showTitle=false&size=28475&status=done&style=none&taskId=ub50e0a93-3294-42f1-bebf-c62bb634533&title=&width=527.6000366210938)
![image.png](https://img-blog.csdnimg.cn/img_convert/60a3610f2b828fe80d1937a04f721a1f.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=315&id=u1a375cc2&margin=[object Object]&name=image.png&originHeight=394&originWidth=791&originalType=binary&ratio=1&rotation=0&showTitle=false&size=34742&status=done&style=none&taskId=ubc6ae221-b7e5-4dcf-a576-b6fda1cdf39&title=&width=632.8)
![image.png](https://img-blog.csdnimg.cn/img_convert/042a7de27d1ee26f5927f51e715fca50.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=254&id=u761b4190&margin=[object Object]&name=image.png&originHeight=414&originWidth=971&originalType=binary&ratio=1&rotation=0&showTitle=false&size=49300&status=done&style=none&taskId=u09d083e2-0c16-4126-80cd-befa91d2e0a&title=&width=594.7999877929688)
![image.png](https://img-blog.csdnimg.cn/img_convert/9a1140a6569e7bd98fc6ba5eebd406fc.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=273&id=u59fee977&margin=[object Object]&name=image.png&originHeight=341&originWidth=842&originalType=binary&ratio=1&rotation=0&showTitle=false&size=49331&status=done&style=none&taskId=uc7080528-eb38-441d-84a9-cfbabb6e838&title=&width=673.6)
![image.png](https://img-blog.csdnimg.cn/img_convert/2517dec41cdc9b1522ff043b4ed0e57c.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=267&id=Mxi6C&margin=[object Object]&name=image.png&originHeight=334&originWidth=692&originalType=binary&ratio=1&rotation=0&showTitle=false&size=24343&status=done&style=none&taskId=u29a24ab4-e42c-4c99-834b-0a8f1221f70&title=&width=553.6)
![image.png](https://img-blog.csdnimg.cn/img_convert/1d4529c962e1fde24d8a493543843db9.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=159&id=u7a9ebf3d&margin=[object Object]&name=image.png&originHeight=199&originWidth=813&originalType=binary&ratio=1&rotation=0&showTitle=false&size=23648&status=done&style=none&taskId=u442ad452-6abb-47a1-bbf2-d679e21d536&title=&width=650.4)
![image.png](https://img-blog.csdnimg.cn/img_convert/2e4e748e773263d5e3c24bef100995a9.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=308&id=ub89fa06c&margin=[object Object]&name=image.png&originHeight=385&originWidth=552&originalType=binary&ratio=1&rotation=0&showTitle=false&size=18490&status=done&style=none&taskId=uc92a77f3-0666-4f37-837c-1d1bcbd6f4f&title=&width=441.6)
![image.png](https://img-blog.csdnimg.cn/img_convert/c27298832a6a7bcc0f090e0c45556afe.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=392&id=ucc3603d3&margin=[object Object]&name=image.png&originHeight=490&originWidth=388&originalType=binary&ratio=1&rotation=0&showTitle=false&size=20793&status=done&style=none&taskId=u741ffa9c-f3ee-4d5e-8024-0ddad519d6b&title=&width=310.4)
![image.png](https://img-blog.csdnimg.cn/img_convert/73f66c6ba2930e96ff4e904de059b468.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=222&id=ub38f0547&margin=[object Object]&name=image.png&originHeight=277&originWidth=729&originalType=binary&ratio=1&rotation=0&showTitle=false&size=36495&status=done&style=none&taskId=uf4265922-0b2e-4d54-8cbc-2c2e40ff22d&title=&width=583.2)
![image.png](https://img-blog.csdnimg.cn/img_convert/010e72803b14cd60543ce9cb2fdde33d.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=261&id=u7cc5f028&margin=[object Object]&name=image.png&originHeight=514&originWidth=1744&originalType=binary&ratio=1&rotation=0&showTitle=false&size=162522&status=done&style=none&taskId=u2b570d71-bd78-4179-b43c-796baae436f&title=&width=887.2000732421875)
字面意思~
![image.png](https://img-blog.csdnimg.cn/img_convert/49fb78a55400d1c802137355645ab243.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=322&id=ubc2d4f11&margin=[object Object]&name=image.png&originHeight=402&originWidth=855&originalType=binary&ratio=1&rotation=0&showTitle=false&size=33061&status=done&style=none&taskId=u465d51e3-f69b-4fbb-822c-3232734b18a&title=&width=684)
![image.png](https://img-blog.csdnimg.cn/img_convert/66a899536c553397a99a79f3d2589326.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=570&id=ub0adc1d6&margin=[object Object]&name=image.png&originHeight=712&originWidth=1004&originalType=binary&ratio=1&rotation=0&showTitle=false&size=94544&status=done&style=none&taskId=uffd152eb-77b6-49c3-af2e-0a99e1c1f2c&title=&width=803.2)
![image.png](https://img-blog.csdnimg.cn/img_convert/6b3da262bfab21da2b7ccc4a7a17237d.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=518&id=u0841fc97&margin=[object Object]&name=image.png&originHeight=648&originWidth=931&originalType=binary&ratio=1&rotation=0&showTitle=false&size=70378&status=done&style=none&taskId=u2593ee07-6eb8-4a33-80c6-623ca122f1e&title=&width=744.8)
![image.png](https://img-blog.csdnimg.cn/img_convert/8bfa9f70f5b85b6912acdc8bdc9c97cc.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=497&id=u126181dc&margin=[object Object]&name=image.png&originHeight=621&originWidth=893&originalType=binary&ratio=1&rotation=0&showTitle=false&size=79256&status=done&style=none&taskId=u6219a196-881b-4239-ab82-661bb39377f&title=&width=714.4)
翻译:将一种语言编写的程序转换成完全等效的另一种语言编写的程序的过程。在计算机中,翻译由一 个程序来实现,称为翻译程序
**宿主语言:**编写编译程序的语言。运行翻译程序的机称为宿主机
静态语言需要先进行编译,才能执行代码
![image.png](https://img-blog.csdnimg.cn/img_convert/692788931d22f11a854f3709e9c809e4.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=130&id=u524af629&margin=[object Object]&name=image.png&originHeight=320&originWidth=766&originalType=binary&ratio=1&rotation=0&showTitle=false&size=34683&status=done&style=none&taskId=uaf376318-3dfd-4994-b246-4d5bd20c73d&title=&width=310)
动态语言则是可以边解释 边执行代码
![image.png](https://img-blog.csdnimg.cn/img_convert/ec10684b070a25a77ff0f7f31c7fbc2e.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=217&id=u7ab9f48e&margin=[object Object]&name=image.png&originHeight=563&originWidth=867&originalType=binary&ratio=1&rotation=0&showTitle=false&size=113864&status=done&style=none&taskId=ub17f7c64-2e68-4b1d-b524-cac722c2322&title=&width=334)
![image.png](https://img-blog.csdnimg.cn/img_convert/51195f7e1e94a6f559a48ee165130664.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=509&id=u1de7bbc3&margin=[object Object]&name=image.png&originHeight=636&originWidth=931&originalType=binary&ratio=1&rotation=0&showTitle=false&size=83981&status=done&style=none&taskId=uadc51272-f6e0-4370-8b71-805d045caf5&title=&width=744.8)
扫描源程序的字符串,按照词法规则,识别出单词符号作为输出
对识别过程中发现的词法错误输出有关的错误信息。
词法分析器是子程序
![image.png](https://img-blog.csdnimg.cn/img_convert/7a780b85443a9d897fe341be98ad5b6f.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=194&id=Ktok7&margin=[object Object]&name=image.png&originHeight=243&originWidth=633&originalType=binary&ratio=1&rotation=0&showTitle=false&size=20425&status=done&style=none&taskId=ue65ae947-508b-46da-ad49-244943f1290&title=&width=506.4)
![image.png](https://img-blog.csdnimg.cn/img_convert/93908c56864e8e7e2a742edc35b84909.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=386&id=u83677bb9&margin=[object Object]&name=image.png&originHeight=483&originWidth=567&originalType=binary&ratio=1&rotation=0&showTitle=false&size=55812&status=done&style=none&taskId=u4debca2d-2623-4546-a1aa-8c083ba5c90&title=&width=453.6)
简称转换图,是一张有限方向图,是设计词法分析器的有效工具;它由如下成分构成:
1.结点(node):圆圈表示结点,代表状态(state)
2.有向边(弧):连接结点,边上的标记字符表示该状态下可能接收或识别的字符;
![image.png](https://img-blog.csdnimg.cn/img_convert/7af71e05b57eb78eb04672825dee8b84.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=183&id=u05fa2709&margin=[object Object]&name=image.png&originHeight=229&originWidth=785&originalType=binary&ratio=1&rotation=0&showTitle=false&size=31271&status=done&style=none&taskId=u5a75951d-eb61-4dd3-9d34-eed32bffe75&title=&width=628)
![image.png](https://img-blog.csdnimg.cn/img_convert/a27ba920d2ba371b89f36b539b77ca2d.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=290&id=u4cc05622&margin=[object Object]&name=image.png&originHeight=457&originWidth=874&originalType=binary&ratio=1&rotation=0&showTitle=false&size=44464&status=done&style=none&taskId=u9d970797-3027-4f12-8162-de8165638e9&title=&width=554.2000122070312)
![image.png](https://img-blog.csdnimg.cn/img_convert/b2481e3039e718e9cb7c21ad3004b69c.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=416&id=u204147bc&margin=[object Object]&name=image.png&originHeight=520&originWidth=918&originalType=binary&ratio=1&rotation=0&showTitle=false&size=58327&status=done&style=none&taskId=ufb1e2848-affd-443c-9467-8dab4662488&title=&width=734.4)
![image.png](https://img-blog.csdnimg.cn/img_convert/2fc35d37e63a1280f8c09febc4d63b88.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=444&id=uc76e7931&margin=[object Object]&name=image.png&originHeight=874&originWidth=1394&originalType=binary&ratio=1&rotation=0&showTitle=false&size=195253&status=done&style=none&taskId=u1521593f-fa99-4e42-b988-5c12788b7e3&title=&width=708.2000732421875)
语法分析分为两种
第七章——自上而下(自顶而下)
第八章——自下而上(自底而上)
![image.png](https://img-blog.csdnimg.cn/img_convert/323e076582d628b80ae4930d8a48caf8.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=447&id=u749fac64&margin=[object Object]&name=image.png&originHeight=559&originWidth=844&originalType=binary&ratio=1&rotation=0&showTitle=false&size=80443&status=done&style=none&taskId=u1ca8cc0c-4667-4a07-9e4a-daea6b4eabb&title=&width=675.2)
![image.png](https://img-blog.csdnimg.cn/img_convert/d51d761ec076975913349e782091b6b6.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=374&id=u9c7ab631&margin=[object Object]&name=image.png&originHeight=538&originWidth=931&originalType=binary&ratio=1&rotation=0&showTitle=false&size=84847&status=done&style=none&taskId=u54b26544-2ea7-4a51-bb36-7f664de5412&title=&width=647.7999877929688)
![image.png](https://img-blog.csdnimg.cn/img_convert/e17307a94513a9aac68fcdab563c3d0c.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=386&id=u95cd013f&margin=[object Object]&name=image.png&originHeight=482&originWidth=701&originalType=binary&ratio=1&rotation=0&showTitle=false&size=35735&status=done&style=none&taskId=u6188a0ea-626d-42e8-9562-ce86e9e05d1&title=&width=560.8)
这个例子是啥意思?
![image.png](https://img-blog.csdnimg.cn/img_convert/617e818c03f734f4db30cfe30e44c0eb.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=287&id=ub29867d2&margin=[object Object]&name=image.png&originHeight=527&originWidth=833&originalType=binary&ratio=1&rotation=0&showTitle=false&size=35019&status=done&style=none&taskId=ucb752984-3135-4ac4-a71c-ddb1aee89d6&title=&width=454.4000244140625)
提取公共左因子
![image.png](https://img-blog.csdnimg.cn/img_convert/706b2fe84fce4212f258d397b1c83cdf.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=394&id=u6553a707&margin=[object Object]&name=image.png&originHeight=492&originWidth=926&originalType=binary&ratio=1&rotation=0&showTitle=false&size=63860&status=done&style=none&taskId=u198a6511-61d7-4331-ab39-1dc1bc0c4d8&title=&width=740.8)
先提取左公因子 再消除左递归也ok
![image.png](https://img-blog.csdnimg.cn/img_convert/f9a46082a3cb64aa13facc1cc3cc9c85.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=297&id=u4866a11c&margin=[object Object]&name=image.png&originHeight=1262&originWidth=1146&originalType=url&ratio=1&rotation=0&showTitle=false&size=1157311&status=done&style=none&taskId=ue83a0873-b2d2-474a-9d15-c4adfcf9c87&title=&width=270)
![image.png](https://img-blog.csdnimg.cn/img_convert/906ba4ed80939febb49439e5d3f2acca.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=464&id=ue443c4ae&margin=[object Object]&name=image.png&originHeight=580&originWidth=792&originalType=binary&ratio=1&rotation=0&showTitle=false&size=37622&status=done&style=none&taskId=u916eabcf-726b-4d0c-80d9-54abec2ba15&title=&width=633.6)
![image.png](https://img-blog.csdnimg.cn/img_convert/6ec507fef7b50afc01d6d1e594e8a5ab.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=321&id=u1ef7020d&margin=[object Object]&name=image.png&originHeight=401&originWidth=812&originalType=binary&ratio=1&rotation=0&showTitle=false&size=27327&status=done&style=none&taskId=u9efcdcea-3986-4168-ad8a-8c31aece357&title=&width=649.6)
![image.png](https://img-blog.csdnimg.cn/img_convert/89287b11b17eefeba032025f14133f96.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=363&id=ua6850bdc&margin=[object Object]&name=image.png&originHeight=454&originWidth=768&originalType=binary&ratio=1&rotation=0&showTitle=false&size=42394&status=done&style=none&taskId=ub1dccc77-f8eb-4c1e-b4dd-15ac076a8db&title=&width=614.4)
![image.png](https://img-blog.csdnimg.cn/img_convert/13923dec79add1b79a62d0b3ec837c92.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=380&id=u559474b9&margin=[object Object]&name=image.png&originHeight=475&originWidth=700&originalType=binary&ratio=1&rotation=0&showTitle=false&size=40145&status=done&style=none&taskId=u87ba403e-037a-43e9-8119-b954821ed03&title=&width=560)
![image.png](https://img-blog.csdnimg.cn/img_convert/390db38d6cbf9092d2528d83aba6a7bb.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=295&id=uda03023b&margin=[object Object]&name=image.png&originHeight=369&originWidth=584&originalType=binary&ratio=1&rotation=0&showTitle=false&size=21181&status=done&style=none&taskId=u0469aede-cdb5-4d27-9938-ae6a7324305&title=&width=467.2)
![image.png](https://img-blog.csdnimg.cn/img_convert/2869063ef93d4f19fdae9ef3fdcbf79f.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=350&id=uadb08ef7&margin=[object Object]&name=image.png&originHeight=590&originWidth=821&originalType=binary&ratio=1&rotation=0&showTitle=false&size=61456&status=done&style=none&taskId=u546ae122-6933-4851-836f-3d16ee9161e&title=&width=486.79998779296875)
![image.png](https://img-blog.csdnimg.cn/img_convert/b6febead91aa99550ffb50b2cca7d637.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=313&id=u0d5bd3a1&margin=[object Object]&name=image.png&originHeight=574&originWidth=911&originalType=binary&ratio=1&rotation=0&showTitle=false&size=63685&status=done&style=none&taskId=u3407ed12-b156-43de-ab5d-2dde2098e21&title=&width=496.8000183105469)
![image.png](https://img-blog.csdnimg.cn/img_convert/0b3079c9f9e27cdbee3183ab97b1290f.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=368&id=uff79b4e4&margin=[object Object]&name=image.png&originHeight=460&originWidth=922&originalType=binary&ratio=1&rotation=0&showTitle=false&size=36846&status=done&style=none&taskId=u02f22093-c4f8-4d63-a5ee-f5be0335ddc&title=&width=737.6)
对于文法G=({a,b,c,d,},{S,A},S,P);
其中P为:
S → Aa|Ac|bc
A → Ad|Sbc|d
请先提取文法G的工共左因子,再消除左递归
![image.png](https://img-blog.csdnimg.cn/img_convert/b24e51e60868cb8fd1a717f8c728c3e6.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=424&id=u7bf77f9b&margin=[object Object]&name=image.png&originHeight=530&originWidth=865&originalType=binary&ratio=1&rotation=0&showTitle=false&size=137884&status=done&style=none&taskId=uda9d219c-9ebe-48e9-ac85-31b40ffa8dd&title=&width=692)
这个不在老师画的重点中 要考察麽?
![image.png](https://img-blog.csdnimg.cn/img_convert/a0682ad950b774fbabd77082951ed13b.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=462&id=ub4bad021&margin=[object Object]&name=image.png&originHeight=577&originWidth=954&originalType=binary&ratio=1&rotation=0&showTitle=false&size=74564&status=done&style=none&taskId=uedbb1815-5ebd-4691-a585-f85fe200a3f&title=&width=763.2)
![image.png](https://img-blog.csdnimg.cn/img_convert/ca96072e03c24424009691d79c250112.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=442&id=ueded4e09&margin=[object Object]&name=image.png&originHeight=593&originWidth=941&originalType=binary&ratio=1&rotation=0&showTitle=false&size=90876&status=done&style=none&taskId=u9d61bc94-96fc-494a-878d-2db732d3254&title=&width=701.7999877929688)
预测分析表
对于LL(1)文法来说,在使用最左推导时,非终结符号的每一步推导使用的产生式是确定的,不用进行试探和回溯。
求预测分析表 要先求出来FIRST表
FIRST(α)中的每一个终结符号a,表格项M(A,a)=A→α
如果是非空串产生式A→α,求FIRST(α),对于FIRST(α)中的每一个终结符号a,M(A,a)=A→α
如果是空串产生式A→α,求FOLLOW(A),对于FOLLOW(A)中的每一个终结符号b,M(A,b)=A→ε
![image.png](https://img-blog.csdnimg.cn/img_convert/4c8ebab926f99dd6082533ec5d3bea2d.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=328&id=uD7uJ&margin=[object Object]&name=image.png&originHeight=410&originWidth=830&originalType=binary&ratio=1&rotation=0&showTitle=false&size=21790&status=done&style=none&taskId=u71f0d725-4f1a-4e88-b0d0-0abd94921d0&title=&width=664)
![image.png](https://img-blog.csdnimg.cn/img_convert/9789ab79289a15b4e8c03822a7b5b031.png#clientId=u041e7754-53fd-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=306&id=u1f0d26df&margin=[object Object]&name=image.png&originHeight=382&originWidth=877&originalType=binary&ratio=1&rotation=0&showTitle=false&size=12986&status=done&style=none&taskId=ube65de2c-4d93-4311-a474-5dd034d14e8&title=&width=701.6)
![image.png](https://img-blog.csdnimg.cn/img_convert/fc750980d96ef90b7f783d51511ef2f3.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=330&id=ub7c44402&margin=[object Object]&name=image.png&originHeight=487&originWidth=923&originalType=binary&ratio=1&rotation=0&showTitle=false&size=49598&status=done&style=none&taskId=u571dc0e5-b5b1-434c-8264-1de90885470&title=&width=625.4000244140625)
![image.png](https://img-blog.csdnimg.cn/img_convert/1806828b3073c0866da7648b9ea12474.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=328&id=u9726d230&margin=[object Object]&name=image.png&originHeight=410&originWidth=830&originalType=binary&ratio=1&rotation=0&showTitle=false&size=21790&status=done&style=none&taskId=u71f0d725-4f1a-4e88-b0d0-0abd94921d0&title=&width=664)
![image.png](https://img-blog.csdnimg.cn/img_convert/c593bf3bedca317cd8062247e63d2024.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=492&id=u480f2442&margin=[object Object]&name=image.png&originHeight=615&originWidth=704&originalType=binary&ratio=1&rotation=0&showTitle=false&size=45196&status=done&style=none&taskId=u333850e0-acd3-4951-aef4-33289163ba5&title=&width=563.2)
![image.png](https://img-blog.csdnimg.cn/img_convert/283b670c3761613e76347d1096dc11ff.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=489&id=u815b052b&margin=[object Object]&name=image.png&originHeight=611&originWidth=703&originalType=binary&ratio=1&rotation=0&showTitle=false&size=29563&status=done&style=none&taskId=u8ee1b364-854b-43f2-9879-bcc0f573645&title=&width=562.4)
![image.png](https://img-blog.csdnimg.cn/img_convert/35374bca1238bc72a91ce5aaa7fdd1ee.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=104&id=As0LL&margin=[object Object]&name=image.png&originHeight=196&originWidth=718&originalType=binary&ratio=1&rotation=0&showTitle=false&size=17814&status=done&style=none&taskId=uadc420bd-0f94-4ff7-8bb7-bf7b88fd783&title=&width=379.4000244140625)
大白话:
https://www.jianshu.com/p/210fda081c76
follow集的意义是寻找所要求字符的下一个字符可能产生的集合,所以寻找follow集应从产生式的右边进行寻找。
找L的Follow集,先从式子右边找到L——
![image.png](https://img-blog.csdnimg.cn/img_convert/f4274df24b97cea09df9b253cf89bdc7.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=163&id=u31646599&margin=[object Object]&name=image.png&originHeight=204&originWidth=499&originalType=binary&ratio=1&rotation=0&showTitle=false&size=93048&status=done&style=none&taskId=u310356e5-6c5d-4dde-a8d4-341310106ea&title=&width=399.2)
![image.png](https://img-blog.csdnimg.cn/img_convert/24bc76dcd024eee5bdc16c7dd4e8f928.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=288&id=u5a190891&margin=[object Object]&name=image.png&originHeight=360&originWidth=1178&originalType=binary&ratio=1&rotation=0&showTitle=false&size=519384&status=done&style=none&taskId=u0f6f2972-7717-4ef3-839d-61717372ebf&title=&width=942.4)
每一个推导式经过推导其对应的SELECT集的交集为空,其为LL(1)文法。
p55之后
![image.png](https://img-blog.csdnimg.cn/img_convert/d72c2112811f1f0b2b8d2327d2a4213a.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=214&id=u7e724d8a&margin=[object Object]&name=image.png&originHeight=268&originWidth=919&originalType=binary&ratio=1&rotation=0&showTitle=false&size=34303&status=done&style=none&taskId=ue6a22409-de56-4383-9300-12848086cb5&title=&width=735.2)
![image.png](https://img-blog.csdnimg.cn/img_convert/f4cc4d4f891d96ac33e94985942dddd1.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=276&id=ufc0b73ed&margin=[object Object]&name=image.png&originHeight=637&originWidth=1347&originalType=binary&ratio=1&rotation=0&showTitle=false&size=59428&status=done&style=none&taskId=uf6b896ee-be19-4e74-8d67-6f2dd4f59ef&title=&width=584.6000366210938)
![image.png](https://img-blog.csdnimg.cn/img_convert/bea8165e7bac466a6eae040e6c4a8a10.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=264&id=u4327d2e5&margin=[object Object]&name=image.png&originHeight=472&originWidth=964&originalType=binary&ratio=1&rotation=0&showTitle=false&size=25994&status=done&style=none&taskId=u970b0018-9e27-435d-9944-c8646ab3ecd&title=&width=539.2000122070312)
上下文无关文法G,没有形如P→ε或P→. . .QR. . .的产生式,则称G为算符文法。
若算符文法G的任何终结符a,b之间的优先关系至多有=、>、<中的一个, 则G为算符优先文法
![image.png](https://img-blog.csdnimg.cn/img_convert/c9f1e83d6a3a3e3206858988338a547f.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=334&id=ue30211a8&margin=[object Object]&name=image.png&originHeight=417&originWidth=600&originalType=binary&ratio=1&rotation=0&showTitle=false&size=36855&status=done&style=none&taskId=udd018193-16e3-4821-a232-9dc7b1d23e0&title=&width=480)
![image.png](https://img-blog.csdnimg.cn/img_convert/dadfdd6b6e91c05cee05d43341080c80.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=514&id=u5fa34c97&margin=[object Object]&name=image.png&originHeight=643&originWidth=1404&originalType=binary&ratio=1&rotation=0&showTitle=false&size=149264&status=done&style=none&taskId=u1ce59a54-886f-4931-a7a2-4836ce09c17&title=&width=1123.2)
-P21才到优先分析表 中间是一些规约的方法
![image.png](https://img-blog.csdnimg.cn/img_convert/33ec6dc1b315c6d8633c6685040f9237.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=290&id=u0e4d4d25&margin=[object Object]&name=image.png&originHeight=629&originWidth=1010&originalType=binary&ratio=1&rotation=0&showTitle=false&size=72652&status=done&style=none&taskId=u3211cf93-26dc-4224-b899-a281f851eae&title=&width=466)
![image.png](https://img-blog.csdnimg.cn/img_convert/2fc61ae5056d233f6ef9f724c11f9a67.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=289&id=ue8fa77f9&margin=[object Object]&name=image.png&originHeight=361&originWidth=850&originalType=binary&ratio=1&rotation=0&showTitle=false&size=34647&status=done&style=none&taskId=ua29d4e53-a0e3-4ae3-be28-19b06cd62c3&title=&width=680)
![image.png](https://img-blog.csdnimg.cn/img_convert/916f05afa281e31826da1ec52a416c53.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=426&id=u79bbee6c&margin=[object Object]&name=image.png&originHeight=532&originWidth=880&originalType=binary&ratio=1&rotation=0&showTitle=false&size=39966&status=done&style=none&taskId=u4e143048-38a3-404c-9572-e86e9403b2b&title=&width=704)
![image.png](https://img-blog.csdnimg.cn/img_convert/ed2753c4ce508d58a5a62b1aa65988b6.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=293&id=ucd0c47cd&margin=[object Object]&name=image.png&originHeight=421&originWidth=835&originalType=binary&ratio=1&rotation=0&showTitle=false&size=37367&status=done&style=none&taskId=ucf52bffd-214f-4a8a-a169-1ff45a8c46e&title=&width=581)
![image.png](https://img-blog.csdnimg.cn/img_convert/dbd6ca166522c0792fee78b0c5030dd9.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=391&id=uc95f8d56&margin=[object Object]&name=image.png&originHeight=787&originWidth=1454&originalType=binary&ratio=1&rotation=0&showTitle=false&size=171812&status=done&style=none&taskId=ua40d5337-9bb8-4124-8a86-76bbfa184ca&title=&width=722.2000122070312)
最右推导就是规范推导,因此最右推导过程中产生的句型都是规范句型
活前缀:规范句型的不含句柄之后任何符号的一个前缀。
如:aAcde => aAbcde,句柄为A→Ab, 活前缀为:ε,a, aA, aAb
![image.png](https://img-blog.csdnimg.cn/img_convert/9bb9dd65b162e0190316476ac2c9adfd.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=383&id=uba5388c0&margin=[object Object]&name=image.png&originHeight=383&originWidth=563&originalType=binary&ratio=1&rotation=0&showTitle=false&size=86891&status=done&style=none&taskId=u4b6840a8-5642-4e90-ab32-d880d3da504&title=&width=563)
关键:构建LR(0)分析表
![image.png](https://img-blog.csdnimg.cn/img_convert/be4ffea12f1a32f620c1da293458781d.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=353&id=ua8fb22cf&margin=[object Object]&name=image.png&originHeight=498&originWidth=866&originalType=binary&ratio=1&rotation=0&showTitle=false&size=87962&status=done&style=none&taskId=u2a015848-8369-4615-bfbf-8b84b326065&title=&width=613.7999877929688)
![image.png](https://img-blog.csdnimg.cn/img_convert/254f304ca0f292b08674403e6ccd24c9.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=350&id=ub2b011ff&margin=[object Object]&name=image.png&originHeight=591&originWidth=840&originalType=binary&ratio=1&rotation=0&showTitle=false&size=43993&status=done&style=none&taskId=u1a79a095-f44a-4626-8321-21352ff9719&title=&width=498)
https://www.cnblogs.com/xpwi/p/11070888.html
![image.png](https://img-blog.csdnimg.cn/img_convert/841a02a2797fa38f5aaef2f32c96ef73.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=442&id=ud4417740&margin=[object Object]&name=image.png&originHeight=684&originWidth=1173&originalType=binary&ratio=1&rotation=0&showTitle=false&size=234530&status=done&style=none&taskId=ub88980d7-58cd-4c67-b917-8443f993d80&title=&width=757.4000244140625)![image.png](https://img-blog.csdnimg.cn/img_convert/756ae02700e18a9d818e424a8611094f.png#clientId=u041e7754-53fd-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=378&id=u97afd2a7&margin=[object Object]&name=image.png&originHeight=607&originWidth=513&originalType=binary&ratio=1&rotation=0&showTitle=false&size=23979&status=done&style=none&taskId=u03fda2f4-664e-4531-a45f-720c73f1d51&title=&width=319.3999938964844)
![image.png](https://img-blog.csdnimg.cn/img_convert/e3d86ce9366eb76acf1d39b746bc01d8.png#clientId=u041e7754-53fd-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=488&id=u0dae83e9&margin=[object Object]&name=image.png&originHeight=610&originWidth=858&originalType=binary&ratio=1&rotation=0&showTitle=false&size=53950&status=done&style=none&taskId=u17d8ac72-ccd6-4622-a886-6dc2fc2f376&title=&width=686.4)
规约时退出的状态个数,规约后用goto判断下一状态
通过考察有关非终结符的FOLLOW集来解决移进-归约和归约-归约冲突——DFA中存在冲突项目(一个状态li中同时有移进、规约项目/有两个规约项目),以此构造出来的LR分析表,叫 做SLR(1)分析表
I={X→a•bb, A→a•, B→a•}
当状态I面临任何输入符号xi时,可采用如下策略:
![image.png](https://img-blog.csdnimg.cn/img_convert/e2d78930f622bbb2d922e1bd2d5bbbbb.png#clientId=u7c804c2a-f82f-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=517&id=u438edcc6&margin=[object Object]&name=image.png&originHeight=1034&originWidth=1888&originalType=binary&ratio=1&rotation=0&showTitle=false&size=1522905&status=done&style=none&taskId=ubfe12e66-4a59-4ed0-ba5f-15b6f51dc5a&title=&width=944)
![image.png](https://img-blog.csdnimg.cn/img_convert/8649d1ac29cac1640a677569ec4faad1.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=401&id=ua3e1a7d3&margin=[object Object]&name=image.png&originHeight=501&originWidth=841&originalType=binary&ratio=1&rotation=0&showTitle=false&size=78804&status=done&style=none&taskId=u6d8f9516-6e18-46c3-897c-184e59336db&title=&width=672.8)
每使用一次产生式则调用相应的语义子程序,则推导完成时,语义值E.VAL也计算出来。
![image.png](https://img-blog.csdnimg.cn/img_convert/ad8031099bef401e300eba9b5e6b383e.png#clientId=ub82bd813-5d31-4&crop=0&crop=0&crop=1&crop=1&from=paste&height=111&id=u15fb3e50&margin=[object Object]&name=image.png&originHeight=111&originWidth=469&originalType=binary&ratio=1&rotation=0&showTitle=false&size=35572&status=done&style=none&taskId=uafe497b2-8ed0-44e4-940a-8c13c154829&title=&width=469)
循环优化
每次操作只能是寄存器-寄存器或寄存器-变量;不能是变量-变量
引用调用(传地址)、值调用、名调用三种方式的输出结果