From eb6b83da80eb1f0114f65dd93184f0b8a3f0af11 Mon Sep 17 00:00:00 2001 From: Chiichen <39649411+Chiichen@users.noreply.github.com> Date: Wed, 11 Oct 2023 05:02:21 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20Chiichen?= =?UTF-8?q?/Chiichen.github.io@46b3bfb79f86e06f49e16ef178980cba86d63772=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.html | 4 ++-- article/index.html | 4 ++-- .../{1.html-cc1bc8b7.js => 1.html-41c2f4ce.js} | 2 +- .../{1.html-cd53a16c.js => 1.html-7f42b9fe.js} | 2 +- .../{1.html-2416d2fe.js => 1.html-8d92ef9a.js} | 2 +- .../{2.html-488d8f8b.js => 2.html-24f2a0a4.js} | 2 +- .../{2.html-19370382.js => 2.html-666fc187.js} | 2 +- .../{2.html-915d33a0.js => 2.html-afc6b7a8.js} | 2 +- .../{3.html-f650b539.js => 3.html-479a173d.js} | 2 +- .../{3.html-c006d8db.js => 3.html-727ef523.js} | 2 +- .../{3.html-39cf9146.js => 3.html-79c2e26f.js} | 2 +- .../{4.html-b6ef9822.js => 4.html-538c2896.js} | 2 +- .../{4.html-37c75e02.js => 4.html-68f7b9c6.js} | 2 +- .../{4.html-09e424e6.js => 4.html-a3ba8fe8.js} | 2 +- ...404.html-211a4153.js => 404.html-c419a746.js} | 2 +- ...r0 \345\211\215\350\250\200.html-abfc2045.js" | 2 +- ...250\347\273\204\346\210\220.html-abab28d5.js" | 2 +- ...225\345\210\206\346\236\220.html-cb683558.js" | 2 +- ...225\345\210\206\346\236\220.html-67b15795.js" | 2 +- ...211\345\210\206\346\236\220.html-b0e59602.js" | 2 +- ...201\347\224\237\346\210\220.html-bfb40f25.js" | 2 +- ...und-8bef47e3.js => VuePlayground-735d6a75.js} | 2 +- assets/{app-a9076d6c.js => app-c6e156cf.js} | 16 ++++++++-------- assets/{arc-de401818.js => arc-0619f874.js} | 2 +- ...3469030.js => c4Diagram-44c43e89-a90a041b.js} | 2 +- ....html-794e0f7c.js => cherry.html-be8b7b64.js} | 2 +- ....html-78f50802.js => cherry.html-bf097d24.js} | 2 +- ...81b0.js => classDiagram-634fc78b-fff87f8d.js} | 2 +- ...8.js => classDiagram-v2-72bddc41-5afaa5a3.js} | 2 +- ...08a878.js => createText-1f5f8f92-73e41c81.js} | 2 +- ...html-19ab8a43.js => disable.html-3978f9df.js} | 2 +- ...html-661c735e.js => disable.html-bdfcf139.js} | 2 +- ...-a23a5beb.js => dragonfruit.html-04fdaf61.js} | 2 +- ...-076a45a1.js => dragonfruit.html-9762d1d3.js} | 2 +- ...5f-15ee381c.js => edges-2e77835f-a4accc94.js} | 2 +- ...html-eb051be1.js => encrypt.html-20ef40df.js} | 2 +- ...html-e26e2721.js => encrypt.html-525f9ee8.js} | 2 +- ...6795ab0.js => erDiagram-20cc9db4-6482ff3f.js} | 2 +- ...7-ae486821.js => flowDb-52e24d17-e1601b65.js} | 2 +- ...94d94.js => flowDiagram-46a15f6f-c31a5042.js} | 2 +- assets/flowDiagram-v2-8e52592d-cf5b198a.js | 1 + assets/flowDiagram-v2-8e52592d-d7ccc47a.js | 1 - ...lowchart-elk-definition-a44a74cb-97241f08.js} | 2 +- ...c92a.js => ganttDiagram-04e74c0a-3eac92a4.js} | 2 +- ...c.js => gitGraphDiagram-0a645df6-d10ef56a.js} | 2 +- ...11-bb677f0e.js => index-5219d011-5161df09.js} | 2 +- ...x.html-1259154b.js => index.html-0e6c1225.js} | 2 +- ...x.html-00fea1d7.js => index.html-12796d28.js} | 2 +- ...x.html-0a4cfe81.js => index.html-18ce8b37.js} | 2 +- assets/index.html-1bfa6dc5.js | 1 - ...x.html-38740475.js => index.html-1d40c993.js} | 2 +- ...x.html-0c165a43.js => index.html-1f89dd5a.js} | 2 +- assets/index.html-1facc632.js | 1 - assets/index.html-2b532de7.js | 1 + assets/index.html-2c783916.js | 1 + assets/index.html-2cfbf123.js | 1 - assets/index.html-2d66db9c.js | 1 - assets/index.html-3057d440.js | 1 - assets/index.html-31dbf075.js | 1 + assets/index.html-3280d51d.js | 1 - assets/index.html-33bdd7e9.js | 1 + assets/index.html-34ed445a.js | 1 + assets/index.html-36290088.js | 1 - assets/index.html-36f1b3dc.js | 1 - assets/index.html-38735731.js | 1 - assets/index.html-391d2634.js | 1 + assets/index.html-392bfcae.js | 1 - assets/index.html-393dc655.js | 1 + assets/index.html-39e4f317.js | 1 + assets/index.html-3a7a5bdc.js | 1 - assets/index.html-3b04a4ea.js | 1 - assets/index.html-3c1222f5.js | 1 + assets/index.html-3cbc45c5.js | 1 + assets/index.html-3ed30783.js | 1 + assets/index.html-4016dc2e.js | 1 + assets/index.html-402a6ca7.js | 1 - assets/index.html-45a302c2.js | 1 - assets/index.html-45d2ef36.js | 1 + assets/index.html-46c2a70a.js | 1 + assets/index.html-486451fa.js | 1 - assets/index.html-48eda3ef.js | 1 + assets/index.html-491d8d5b.js | 1 - assets/index.html-49921b80.js | 1 - assets/index.html-49b23f93.js | 1 + assets/index.html-4c3dff1d.js | 1 + ...x.html-448b6cc5.js => index.html-4d924b6e.js} | 2 +- assets/index.html-4ddb8c14.js | 1 + assets/index.html-4de84a8e.js | 1 - assets/index.html-4e97c620.js | 1 - assets/index.html-50d2eaf2.js | 1 - assets/index.html-513a427e.js | 1 + assets/index.html-531addc8.js | 1 - assets/index.html-54827d45.js | 1 + assets/index.html-54ea7f4b.js | 1 + assets/index.html-59e057ed.js | 1 - assets/index.html-5ac3d727.js | 1 + assets/index.html-5b82b17d.js | 1 - assets/index.html-5da60136.js | 1 - ...x.html-5999b28d.js => index.html-5e9504e6.js} | 2 +- assets/index.html-5eb97ce5.js | 1 + assets/index.html-60c261b9.js | 1 + assets/index.html-63e349f4.js | 1 - assets/index.html-64ab3d12.js | 1 + assets/index.html-6ec861d6.js | 1 - assets/index.html-7011c689.js | 1 - assets/index.html-75d51ec5.js | 1 + assets/index.html-78375217.js | 1 + assets/index.html-82b65023.js | 1 + assets/index.html-89f26342.js | 1 - assets/index.html-8a5e7484.js | 1 - ...x.html-6e45764e.js => index.html-8a8343f2.js} | 2 +- assets/index.html-8a9c30a2.js | 1 - assets/index.html-8b544649.js | 1 + assets/index.html-8c368962.js | 1 + assets/index.html-8dc4c41e.js | 1 + assets/index.html-8e93d3bf.js | 1 - assets/index.html-922faedb.js | 1 + assets/index.html-93c86664.js | 1 - assets/index.html-96cb70e1.js | 1 - assets/index.html-96e759c9.js | 1 + assets/index.html-97eea022.js | 1 + assets/index.html-989c6411.js | 1 - assets/index.html-98f8ba39.js | 1 + assets/index.html-992d9a55.js | 1 - assets/index.html-9a0570a3.js | 1 - ...x.html-b97c4495.js => index.html-9c77daa3.js} | 2 +- assets/index.html-a93d0bc4.js | 1 - assets/index.html-ac5c9c42.js | 1 + assets/index.html-ae8e8f7d.js | 1 + assets/index.html-ae98d047.js | 1 - assets/index.html-b41d0fec.js | 1 + assets/index.html-b4a02a6b.js | 1 - assets/index.html-b70c62aa.js | 1 + assets/index.html-c318e04f.js | 1 + assets/index.html-c3afb00a.js | 1 + assets/index.html-c423e253.js | 1 + assets/index.html-c7b9e3b3.js | 1 - assets/index.html-c896b8cd.js | 1 + assets/index.html-ca87f242.js | 1 - ...x.html-60a51174.js => index.html-ccb72aa6.js} | 2 +- assets/index.html-ce0bfe56.js | 1 - assets/index.html-ce915ead.js | 1 + assets/index.html-cf49465e.js | 1 + assets/index.html-cfcb925d.js | 1 + assets/index.html-d0607214.js | 1 - ...x.html-5a182a7c.js => index.html-d3a3c3f2.js} | 2 +- assets/index.html-d42c8536.js | 1 - assets/index.html-d4f519a1.js | 1 - assets/index.html-d5413c1c.js | 1 - assets/index.html-d769cc4d.js | 1 - assets/index.html-e1e2c09f.js | 1 - assets/index.html-e1f94921.js | 1 - assets/index.html-e34cebc6.js | 1 - ...x.html-f5a29007.js => index.html-e6001c0e.js} | 2 +- assets/index.html-e66c357a.js | 1 - assets/index.html-ea083a25.js | 1 + assets/index.html-ec4561e5.js | 1 + assets/index.html-ed51bb7c.js | 1 + assets/index.html-eee136c7.js | 1 - assets/index.html-f11f3ef8.js | 1 + assets/index.html-f202bb4a.js | 1 + assets/index.html-f23999a9.js | 1 - assets/index.html-f28901ab.js | 1 + assets/index.html-fd1e230c.js | 1 + assets/index.html-fed48ed8.js | 1 + assets/index.html-ffaa699d.js | 1 - ...89c7f.js => infoDiagram-69ec1a58-e47572b4.js} | 2 +- ...o.html-e9e78a5a.js => intro.html-c710abf3.js} | 2 +- ...o.html-4eab08d6.js => intro.html-dda4a75a.js} | 2 +- .../{is_dark-e48acf3a.js => is_dark-f89b38ab.js} | 2 +- ...24.js => journeyDiagram-d38aa57d-a6d083db.js} | 2 +- .../{layout-bf7246bc.js => layout-a069d6be.js} | 2 +- assets/{line-baa0bcd0.js => line-48b6eed6.js} | 2 +- ...tml-128438fb.js => markdown.html-2e42d0db.js} | 2 +- ...tml-1fd14400.js => markdown.html-7c13ae33.js} | 2 +- ...core-4ed10f14.js => mermaid.core-60744b48.js} | 6 +++--- ...s => mindmap-definition-65b51176-466c8a6e.js} | 2 +- ...ge.html-c5fd6dac.js => page.html-64d77899.js} | 2 +- ...ge.html-22d81100.js => page.html-7e919006.js} | 2 +- ...a7128f.js => pieDiagram-db1a8a21-b86c4224.js} | 2 +- ...s => requirementDiagram-b9649942-23ea5934.js} | 2 +- ...lectAll-42b997c3.js => selectAll-f34204b6.js} | 2 +- ...9.js => sequenceDiagram-446df3e4-d41a3ac1.js} | 2 +- ....html-205cc332.js => slides.html-83f8859c.js} | 2 +- ....html-d6a8c7df.js => slides.html-cc79890d.js} | 2 +- ...5c95.js => stateDiagram-d53d2428-5cf7d303.js} | 2 +- ...3.js => stateDiagram-v2-9765461d-0d4ac6b3.js} | 2 +- ...l-21764891.js => strawberry.html-cd88738f.js} | 2 +- ...l-f4cafeb3.js => strawberry.html-d8034118.js} | 2 +- ...b-7907c3c7.js => styles-16907e1b-f28cd53a.js} | 2 +- ...2-62db5e31.js => styles-26373982-85886a9a.js} | 2 +- ...5-f383f08b.js => styles-47a825a5-f977ba0d.js} | 2 +- ...-20ca25a8.js => svgDraw-2526cba0-285177df.js} | 2 +- ... => timeline-definition-de69aca6-ce58a928.js} | 2 +- ....html-8c45820b.js => tomato.html-35306829.js} | 2 +- ....html-71b975a5.js => tomato.html-b2f4cbf2.js} | 2 +- ...vue-repl-2394d437.js => vue-repl-dfd900ee.js} | 2 +- ...1_0\357\274\201\357\274\237.html-650ab2f3.js" | 2 +- category/apple/index.html | 4 ++-- category/banana/index.html | 4 ++-- category/cherry/index.html | 4 ++-- category/dragon-fruit/index.html | 4 ++-- category/fruit/index.html | 4 ++-- category/guide/index.html | 4 ++-- category/index.html | 4 ++-- category/strawberry/index.html | 4 ++-- category/vegetable/index.html | 4 ++-- demo/disable.html | 4 ++-- demo/encrypt.html | 4 ++-- demo/index.html | 4 ++-- demo/markdown.html | 4 ++-- demo/page.html | 4 ++-- index.html | 4 ++-- intro.html | 4 ++-- posts/apple/1.html | 4 ++-- posts/apple/2.html | 4 ++-- posts/apple/3.html | 4 ++-- posts/apple/4.html | 4 ++-- posts/apple/index.html | 4 ++-- posts/banana/1.html | 4 ++-- posts/banana/2.html | 4 ++-- posts/banana/3.html | 4 ++-- posts/banana/4.html | 4 ++-- posts/banana/index.html | 4 ++-- posts/cherry.html | 4 ++-- posts/dragonfruit.html | 4 ++-- posts/index.html | 4 ++-- posts/strawberry.html | 4 ++-- posts/tomato.html | 4 ++-- slides.html | 4 ++-- star/index.html | 4 ++-- tag/big/index.html | 4 ++-- tag/curly/index.html | 4 ++-- tag/disable/index.html | 4 ++-- tag/encryption/index.html | 4 ++-- tag/guide/index.html | 4 ++-- tag/index.html | 4 ++-- tag/long/index.html | 4 ++-- tag/markdown/index.html | 4 ++-- tag/page-config/index.html | 4 ++-- tag/red/index.html | 4 ++-- tag/round/index.html | 4 ++-- tag/small/index.html | 4 ++-- tag/yellow/index.html | 4 ++-- .../index.html" | 4 ++-- timeline/index.html | 4 ++-- zh/article/index.html | 4 ++-- zh/category/index.html | 4 ++-- .../index.html" | 4 ++-- .../\346\235\202\350\260\210/index.html" | 4 ++-- .../\346\250\261\346\241\203/index.html" | 4 ++-- .../\346\260\264\346\236\234/index.html" | 4 ++-- .../index.html" | 4 ++-- .../\347\254\224\350\256\260/index.html" | 4 ++-- .../\350\215\211\350\216\223/index.html" | 4 ++-- .../\350\224\254\350\217\234/index.html" | 4 ++-- .../\351\246\231\350\225\211/index.html" | 4 ++-- zh/demo/disable.html | 4 ++-- zh/demo/encrypt.html | 4 ++-- zh/demo/index.html | 4 ++-- zh/demo/markdown.html | 4 ++-- zh/demo/page.html | 4 ++-- zh/index.html | 4 ++-- zh/intro.html | 4 ++-- zh/posts/banana/1.html | 4 ++-- zh/posts/banana/2.html | 4 ++-- zh/posts/banana/3.html | 4 ++-- zh/posts/banana/4.html | 4 ++-- zh/posts/banana/index.html | 4 ++-- zh/posts/cherry.html | 4 ++-- zh/posts/dragonfruit.html | 4 ++-- zh/posts/index.html | 4 ++-- zh/posts/strawberry.html | 4 ++-- zh/posts/tomato.html | 4 ++-- "zh/posts/\346\235\202\350\260\210/index.html" | 4 ++-- .../index.html" | 4 ++-- ...\357\274\2141_0\357\274\201\357\274\237.html" | 4 ++-- .../Chapter0 \345\211\215\350\250\200.html" | 4 ++-- ...221\345\231\250\347\273\204\346\210\220.html" | 4 ++-- ...215\346\263\225\345\210\206\346\236\220.html" | 4 ++-- ...255\346\263\225\345\210\206\346\236\220.html" | 4 ++-- ...255\344\271\211\345\210\206\346\236\220.html" | 4 ++-- ...243\347\240\201\347\224\237\346\210\220.html" | 4 ++-- .../index.html" | 4 ++-- zh/slides.html | 4 ++-- zh/star/index.html | 4 ++-- zh/tag/index.html | 4 ++-- zh/tag/markdown/index.html | 4 ++-- .../index.html" | 4 ++-- "zh/tag/\345\234\206/index.html" | 4 ++-- "zh/tag/\345\244\247/index.html" | 4 ++-- "zh/tag/\345\260\217/index.html" | 4 ++-- .../index.html" | 4 ++-- .../index.html" | 4 ++-- .../index.html" | 4 ++-- "zh/tag/\347\246\201\347\224\250/index.html" | 4 ++-- .../index.html" | 4 ++-- "zh/tag/\347\272\242/index.html" | 4 ++-- "zh/tag/\351\225\277/index.html" | 4 ++-- .../index.html" | 4 ++-- "zh/tag/\351\273\204/index.html" | 4 ++-- zh/timeline/index.html | 4 ++-- 302 files changed, 362 insertions(+), 362 deletions(-) rename assets/{1.html-cc1bc8b7.js => 1.html-41c2f4ce.js} (99%) rename assets/{1.html-cd53a16c.js => 1.html-7f42b9fe.js} (90%) rename assets/{1.html-2416d2fe.js => 1.html-8d92ef9a.js} (90%) rename assets/{2.html-488d8f8b.js => 2.html-24f2a0a4.js} (92%) rename assets/{2.html-19370382.js => 2.html-666fc187.js} (92%) rename assets/{2.html-915d33a0.js => 2.html-afc6b7a8.js} (92%) rename assets/{3.html-f650b539.js => 3.html-479a173d.js} (90%) rename assets/{3.html-c006d8db.js => 3.html-727ef523.js} (90%) rename assets/{3.html-39cf9146.js => 3.html-79c2e26f.js} (90%) rename assets/{4.html-b6ef9822.js => 4.html-538c2896.js} (90%) rename assets/{4.html-37c75e02.js => 4.html-68f7b9c6.js} (90%) rename assets/{4.html-09e424e6.js => 4.html-a3ba8fe8.js} (90%) rename assets/{404.html-211a4153.js => 404.html-c419a746.js} (71%) rename "assets/Chapter0 \345\211\215\350\250\200.html-9276126a.js" => "assets/Chapter0 \345\211\215\350\250\200.html-abfc2045.js" (96%) rename "assets/Chapter1 \347\274\226\350\257\221\345\231\250\347\273\204\346\210\220.html-6396b848.js" => "assets/Chapter1 \347\274\226\350\257\221\345\231\250\347\273\204\346\210\220.html-abab28d5.js" (98%) rename "assets/Chapter2 \350\257\215\346\263\225\345\210\206\346\236\220.html-132355fc.js" => "assets/Chapter2 \350\257\215\346\263\225\345\210\206\346\236\220.html-cb683558.js" (99%) rename "assets/Chapter3 \350\257\255\346\263\225\345\210\206\346\236\220.html-95301033.js" => "assets/Chapter3 \350\257\255\346\263\225\345\210\206\346\236\220.html-67b15795.js" (99%) rename "assets/Chapter4 \350\257\255\344\271\211\345\210\206\346\236\220.html-ca76b0c6.js" => "assets/Chapter4 \350\257\255\344\271\211\345\210\206\346\236\220.html-b0e59602.js" (99%) rename "assets/Chapter5 \344\273\243\347\240\201\347\224\237\346\210\220.html-3b3704dc.js" => "assets/Chapter5 \344\273\243\347\240\201\347\224\237\346\210\220.html-bfb40f25.js" (99%) rename assets/{VuePlayground-8bef47e3.js => VuePlayground-735d6a75.js} (82%) rename assets/{app-a9076d6c.js => app-c6e156cf.js} (89%) rename assets/{arc-de401818.js => arc-0619f874.js} (98%) rename assets/{c4Diagram-44c43e89-23469030.js => c4Diagram-44c43e89-a90a041b.js} (99%) rename assets/{cherry.html-794e0f7c.js => cherry.html-be8b7b64.js} (90%) rename assets/{cherry.html-78f50802.js => cherry.html-bf097d24.js} (90%) rename assets/{classDiagram-634fc78b-523e81b0.js => classDiagram-634fc78b-fff87f8d.js} (92%) rename assets/{classDiagram-v2-72bddc41-93a5c928.js => classDiagram-v2-72bddc41-5afaa5a3.js} (90%) rename assets/{createText-1f5f8f92-7008a878.js => createText-1f5f8f92-73e41c81.js} (99%) rename assets/{disable.html-19ab8a43.js => disable.html-3978f9df.js} (90%) rename assets/{disable.html-661c735e.js => disable.html-bdfcf139.js} (90%) rename assets/{dragonfruit.html-a23a5beb.js => dragonfruit.html-04fdaf61.js} (90%) rename assets/{dragonfruit.html-076a45a1.js => dragonfruit.html-9762d1d3.js} (90%) rename assets/{edges-2e77835f-15ee381c.js => edges-2e77835f-a4accc94.js} (99%) rename assets/{encrypt.html-eb051be1.js => encrypt.html-20ef40df.js} (92%) rename assets/{encrypt.html-e26e2721.js => encrypt.html-525f9ee8.js} (93%) rename assets/{erDiagram-20cc9db4-d6795ab0.js => erDiagram-20cc9db4-6482ff3f.js} (99%) rename assets/{flowDb-52e24d17-ae486821.js => flowDb-52e24d17-e1601b65.js} (99%) rename assets/{flowDiagram-46a15f6f-ff094d94.js => flowDiagram-46a15f6f-c31a5042.js} (97%) create mode 100644 assets/flowDiagram-v2-8e52592d-cf5b198a.js delete mode 100644 assets/flowDiagram-v2-8e52592d-d7ccc47a.js rename assets/{flowchart-elk-definition-a44a74cb-d25a78a1.js => flowchart-elk-definition-a44a74cb-97241f08.js} (99%) rename assets/{ganttDiagram-04e74c0a-1e4dc92a.js => ganttDiagram-04e74c0a-3eac92a4.js} (99%) rename assets/{gitGraphDiagram-0a645df6-58af34fc.js => gitGraphDiagram-0a645df6-d10ef56a.js} (99%) rename assets/{index-5219d011-bb677f0e.js => index-5219d011-5161df09.js} (97%) rename assets/{index.html-1259154b.js => index.html-0e6c1225.js} (71%) rename assets/{index.html-00fea1d7.js => index.html-12796d28.js} (71%) rename assets/{index.html-0a4cfe81.js => index.html-18ce8b37.js} (71%) delete mode 100644 assets/index.html-1bfa6dc5.js rename assets/{index.html-38740475.js => index.html-1d40c993.js} (76%) rename assets/{index.html-0c165a43.js => index.html-1f89dd5a.js} (71%) delete mode 100644 assets/index.html-1facc632.js create mode 100644 assets/index.html-2b532de7.js create mode 100644 assets/index.html-2c783916.js delete mode 100644 assets/index.html-2cfbf123.js delete mode 100644 assets/index.html-2d66db9c.js delete mode 100644 assets/index.html-3057d440.js create mode 100644 assets/index.html-31dbf075.js delete mode 100644 assets/index.html-3280d51d.js create mode 100644 assets/index.html-33bdd7e9.js create mode 100644 assets/index.html-34ed445a.js delete mode 100644 assets/index.html-36290088.js delete mode 100644 assets/index.html-36f1b3dc.js delete mode 100644 assets/index.html-38735731.js create mode 100644 assets/index.html-391d2634.js delete mode 100644 assets/index.html-392bfcae.js create mode 100644 assets/index.html-393dc655.js create mode 100644 assets/index.html-39e4f317.js delete mode 100644 assets/index.html-3a7a5bdc.js delete mode 100644 assets/index.html-3b04a4ea.js create mode 100644 assets/index.html-3c1222f5.js create mode 100644 assets/index.html-3cbc45c5.js create mode 100644 assets/index.html-3ed30783.js create mode 100644 assets/index.html-4016dc2e.js delete mode 100644 assets/index.html-402a6ca7.js delete mode 100644 assets/index.html-45a302c2.js create mode 100644 assets/index.html-45d2ef36.js create mode 100644 assets/index.html-46c2a70a.js delete mode 100644 assets/index.html-486451fa.js create mode 100644 assets/index.html-48eda3ef.js delete mode 100644 assets/index.html-491d8d5b.js delete mode 100644 assets/index.html-49921b80.js create mode 100644 assets/index.html-49b23f93.js create mode 100644 assets/index.html-4c3dff1d.js rename assets/{index.html-448b6cc5.js => index.html-4d924b6e.js} (76%) create mode 100644 assets/index.html-4ddb8c14.js delete mode 100644 assets/index.html-4de84a8e.js delete mode 100644 assets/index.html-4e97c620.js delete mode 100644 assets/index.html-50d2eaf2.js create mode 100644 assets/index.html-513a427e.js delete mode 100644 assets/index.html-531addc8.js create mode 100644 assets/index.html-54827d45.js create mode 100644 assets/index.html-54ea7f4b.js delete mode 100644 assets/index.html-59e057ed.js create mode 100644 assets/index.html-5ac3d727.js delete mode 100644 assets/index.html-5b82b17d.js delete mode 100644 assets/index.html-5da60136.js rename assets/{index.html-5999b28d.js => index.html-5e9504e6.js} (76%) create mode 100644 assets/index.html-5eb97ce5.js create mode 100644 assets/index.html-60c261b9.js delete mode 100644 assets/index.html-63e349f4.js create mode 100644 assets/index.html-64ab3d12.js delete mode 100644 assets/index.html-6ec861d6.js delete mode 100644 assets/index.html-7011c689.js create mode 100644 assets/index.html-75d51ec5.js create mode 100644 assets/index.html-78375217.js create mode 100644 assets/index.html-82b65023.js delete mode 100644 assets/index.html-89f26342.js delete mode 100644 assets/index.html-8a5e7484.js rename assets/{index.html-6e45764e.js => index.html-8a8343f2.js} (76%) delete mode 100644 assets/index.html-8a9c30a2.js create mode 100644 assets/index.html-8b544649.js create mode 100644 assets/index.html-8c368962.js create mode 100644 assets/index.html-8dc4c41e.js delete mode 100644 assets/index.html-8e93d3bf.js create mode 100644 assets/index.html-922faedb.js delete mode 100644 assets/index.html-93c86664.js delete mode 100644 assets/index.html-96cb70e1.js create mode 100644 assets/index.html-96e759c9.js create mode 100644 assets/index.html-97eea022.js delete mode 100644 assets/index.html-989c6411.js create mode 100644 assets/index.html-98f8ba39.js delete mode 100644 assets/index.html-992d9a55.js delete mode 100644 assets/index.html-9a0570a3.js rename assets/{index.html-b97c4495.js => index.html-9c77daa3.js} (92%) delete mode 100644 assets/index.html-a93d0bc4.js create mode 100644 assets/index.html-ac5c9c42.js create mode 100644 assets/index.html-ae8e8f7d.js delete mode 100644 assets/index.html-ae98d047.js create mode 100644 assets/index.html-b41d0fec.js delete mode 100644 assets/index.html-b4a02a6b.js create mode 100644 assets/index.html-b70c62aa.js create mode 100644 assets/index.html-c318e04f.js create mode 100644 assets/index.html-c3afb00a.js create mode 100644 assets/index.html-c423e253.js delete mode 100644 assets/index.html-c7b9e3b3.js create mode 100644 assets/index.html-c896b8cd.js delete mode 100644 assets/index.html-ca87f242.js rename assets/{index.html-60a51174.js => index.html-ccb72aa6.js} (91%) delete mode 100644 assets/index.html-ce0bfe56.js create mode 100644 assets/index.html-ce915ead.js create mode 100644 assets/index.html-cf49465e.js create mode 100644 assets/index.html-cfcb925d.js delete mode 100644 assets/index.html-d0607214.js rename assets/{index.html-5a182a7c.js => index.html-d3a3c3f2.js} (84%) delete mode 100644 assets/index.html-d42c8536.js delete mode 100644 assets/index.html-d4f519a1.js delete mode 100644 assets/index.html-d5413c1c.js delete mode 100644 assets/index.html-d769cc4d.js delete mode 100644 assets/index.html-e1e2c09f.js delete mode 100644 assets/index.html-e1f94921.js delete mode 100644 assets/index.html-e34cebc6.js rename assets/{index.html-f5a29007.js => index.html-e6001c0e.js} (90%) delete mode 100644 assets/index.html-e66c357a.js create mode 100644 assets/index.html-ea083a25.js create mode 100644 assets/index.html-ec4561e5.js create mode 100644 assets/index.html-ed51bb7c.js delete mode 100644 assets/index.html-eee136c7.js create mode 100644 assets/index.html-f11f3ef8.js create mode 100644 assets/index.html-f202bb4a.js delete mode 100644 assets/index.html-f23999a9.js create mode 100644 assets/index.html-f28901ab.js create mode 100644 assets/index.html-fd1e230c.js create mode 100644 assets/index.html-fed48ed8.js delete mode 100644 assets/index.html-ffaa699d.js rename assets/{infoDiagram-69ec1a58-28089c7f.js => infoDiagram-69ec1a58-e47572b4.js} (98%) rename assets/{intro.html-e9e78a5a.js => intro.html-c710abf3.js} (85%) rename assets/{intro.html-4eab08d6.js => intro.html-dda4a75a.js} (85%) rename assets/{is_dark-e48acf3a.js => is_dark-f89b38ab.js} (75%) rename assets/{journeyDiagram-d38aa57d-1dadf824.js => journeyDiagram-d38aa57d-a6d083db.js} (99%) rename assets/{layout-bf7246bc.js => layout-a069d6be.js} (99%) rename assets/{line-baa0bcd0.js => line-48b6eed6.js} (93%) rename assets/{markdown.html-128438fb.js => markdown.html-2e42d0db.js} (99%) rename assets/{markdown.html-1fd14400.js => markdown.html-7c13ae33.js} (99%) rename assets/{mermaid.core-4ed10f14.js => mermaid.core-60744b48.js} (97%) rename assets/{mindmap-definition-65b51176-7035c3af.js => mindmap-definition-65b51176-466c8a6e.js} (99%) rename assets/{page.html-c5fd6dac.js => page.html-64d77899.js} (98%) rename assets/{page.html-22d81100.js => page.html-7e919006.js} (98%) rename assets/{pieDiagram-db1a8a21-f4a7128f.js => pieDiagram-db1a8a21-b86c4224.js} (98%) rename assets/{requirementDiagram-b9649942-b4c235d0.js => requirementDiagram-b9649942-23ea5934.js} (99%) rename assets/{selectAll-42b997c3.js => selectAll-f34204b6.js} (68%) rename assets/{sequenceDiagram-446df3e4-511a3b79.js => sequenceDiagram-446df3e4-d41a3ac1.js} (99%) rename assets/{slides.html-205cc332.js => slides.html-83f8859c.js} (97%) rename assets/{slides.html-d6a8c7df.js => slides.html-cc79890d.js} (97%) rename assets/{stateDiagram-d53d2428-ebe25c95.js => stateDiagram-d53d2428-5cf7d303.js} (97%) rename assets/{stateDiagram-v2-9765461d-bca3eea3.js => stateDiagram-v2-9765461d-0d4ac6b3.js} (91%) rename assets/{strawberry.html-21764891.js => strawberry.html-cd88738f.js} (90%) rename assets/{strawberry.html-f4cafeb3.js => strawberry.html-d8034118.js} (90%) rename assets/{styles-16907e1b-7907c3c7.js => styles-16907e1b-f28cd53a.js} (99%) rename assets/{styles-26373982-62db5e31.js => styles-26373982-85886a9a.js} (97%) rename assets/{styles-47a825a5-f383f08b.js => styles-47a825a5-f977ba0d.js} (99%) rename assets/{svgDraw-2526cba0-20ca25a8.js => svgDraw-2526cba0-285177df.js} (98%) rename assets/{timeline-definition-de69aca6-4f58ac86.js => timeline-definition-de69aca6-ce58a928.js} (99%) rename assets/{tomato.html-8c45820b.js => tomato.html-35306829.js} (90%) rename assets/{tomato.html-71b975a5.js => tomato.html-b2f4cbf2.js} (90%) rename assets/{vue-repl-2394d437.js => vue-repl-dfd900ee.js} (99%) rename "assets/\351\234\207\346\203\212\357\274\2141_0\357\274\201\357\274\237.html-55dfcb3a.js" => "assets/\351\234\207\346\203\212\357\274\2141_0\357\274\201\357\274\237.html-650ab2f3.js" (98%) diff --git a/404.html b/404.html index 9fb3173b0..160f23466 100644 --- a/404.html +++ b/404.html @@ -31,10 +31,10 @@ } - +

404

Page not found

Looks like we've got some broken links.

- + diff --git a/article/index.html b/article/index.html index 8c996a320..c4f58a14b 100644 --- a/article/index.html +++ b/article/index.html @@ -31,7 +31,7 @@ } - +
Tomato

Tomato

@@ -71,6 +71,6 @@

Heading 2

Heading 3

Here is the content.


ChiLess than 1 minuteDragon FruitFruitredbig
2
- + diff --git a/assets/1.html-cc1bc8b7.js b/assets/1.html-41c2f4ce.js similarity index 99% rename from assets/1.html-cc1bc8b7.js rename to assets/1.html-41c2f4ce.js index 4a8eb5fbd..e225e7bea 100644 --- a/assets/1.html-cc1bc8b7.js +++ b/assets/1.html-41c2f4ce.js @@ -1,4 +1,4 @@ -import{_ as t}from"./plugin-vue_export-helper-c27b6911.js";import{o as n,c as m,a as s,b as a,f as l}from"./app-a9076d6c.js";const e={},i=s("h1",{id:"语法分析",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#语法分析","aria-hidden":"true"},"#"),a(" 语法分析")],-1),r=s("ul",null,[s("li",null,[a("正则表达式的能力有限,无法分析具体的语法细节(例如嵌套、"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msup",null,[s("mi",null,"a"),s("mi",null,"n")]),s("msup",null,[s("mi",null,"b"),s("mi",null,"n")])]),s("annotation",{encoding:"application/x-tex"},"a^nb^n")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6644em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"b"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6644em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])])])])])])])])]),a("的n值),与其等价的有穷自动机同理,因此引入了下推自动机和上下文有关、无关文法")])],-1),p=l('

大纲

上下文无关文法(CFG)

Chomsky语言层级

',5),c=s("table",null,[s("thead",null,[s("tr",null,[s("th",null,"Chomsky hierarchy"),s("th",null,"Production(产生式)"),s("th",null,"Explanation")])]),s("tbody",null,[s("tr",null,[s("td",null,"unrestricted(type 0)(自然语言)"),s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"α"),s("mo",null,"→"),s("mi",null,"β"),s("mspace",{width:"1em"}),s("msup",null,[s("mi",null,"V"),s("mo",null,"+")]),s("mo",null,"="),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",null,"∪"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")])]),s("annotation",{encoding:"application/x-tex"},"\\alpha \\rightarrow \\beta \\quad V^+=V_N\\cup V_T")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9658em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"1em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7713em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"+")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∪"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mtext",null,"其中"),s("mi",null,"α"),s("mo",null,"∈"),s("msup",null,[s("mi",null,"V"),s("mo",null,"+")]),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"β"),s("mo",null,"∈"),s("msup",null,[s("mi",null,"V"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"其中\\alpha\\in V^+,\\; \\beta\\in V^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7224em","vertical-align":"-0.0391em"}}),s("span",{class:"mord cjk_fallback"},"其中"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9658em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7713em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"+")])])])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])])]),s("td",null,"无严格约束")]),s("tr",null,[s("td",null,"context sensitive(type 1)(上下文有关文法)"),s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"α"),s("mi",null,"A"),s("mi",null,"γ"),s("mo",null,"→"),s("mi",null,"α"),s("mi",null,"β"),s("mi",null,"γ"),s("mo",{separator:"true"},",")]),s("annotation",{encoding:"application/x-tex"},"\\alpha A \\gamma \\rightarrow \\alpha \\beta \\gamma,")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05556em"}},"γ"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05556em"}},"γ"),s("span",{class:"mpunct"},",")])])]),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mtext",null,"其中"),s("mi",null,"α"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"γ"),s("mo",null,"∈"),s("msup",null,[s("mi",null,"V"),s("mo",null,"∗")]),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"A"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"β"),s("mo",null,"∈"),s("msup",null,[s("mi",null,"V"),s("mo",null,"+")])]),s("annotation",{encoding:"application/x-tex"},"其中\\alpha,\\;\\gamma\\in V^*,\\;A \\in V_N, \\; \\beta \\in V^+")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord cjk_fallback"},"其中"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05556em"}},"γ"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8831em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7713em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7713em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"+")])])])])])])])])])])]),s("td",null,[a("在不同的上下文中,"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A")]),s("annotation",{encoding:"application/x-tex"},"A")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A")])])]),a("可能被不同的"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"γ")]),s("annotation",{encoding:"application/x-tex"},"\\gamma")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.625em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05556em"}},"γ")])])]),a("替换")])]),s("tr",null,[s("td",null,"context free(type 2)(上下文无关文法)"),s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"β"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"A"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",{separator:"true"},",")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\beta ,\\;A\\in V_N,")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},",")])])]),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mtext",null,"其中"),s("mi",null,"β"),s("mo",null,"∈"),s("msup",null,[s("mi",null,"V"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"其中\\beta \\in V^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord cjk_fallback"},"其中"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])])]),s("td",null,[a("在任何"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A")]),s("annotation",{encoding:"application/x-tex"},"A")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A")])])]),a("出现的地方都会被"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"γ")]),s("annotation",{encoding:"application/x-tex"},"\\gamma")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.625em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05556em"}},"γ")])])]),a("替换")])]),s("tr",null,[s("td",null,"regular(type 3)(正则表达式)"),s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"a"),s("mi",null,"B"),s("mtext",null,"  "),s("mi",null,"o"),s("mi",null,"r"),s("mtext",null,"  "),s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"a")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow aB\\;or\\;A\\rightarrow a")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05017em"}},"B"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"or"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"a")])])]),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",{stretchy:"false"},"("),s("mtext",null,"其中"),s("mi",null,"A"),s("mo",{separator:"true"},","),s("mi",null,"B"),s("mtext",null,"  "),s("mi",null,"A"),s("mo",{separator:"true"},","),s("mi",null,"b"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mtext",null,"  "),s("mo",{separator:"true"},","),s("mi",null,"a"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"(其中A,B\\;A,b\\in V_N\\;,a\\in V_T)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord cjk_fallback"},"其中"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05017em"}},"B"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mclose"},")")])])])]),s("td",null,"等价于正则表达式")])])],-1),h=s("ul",null,[s("li",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mtext",null,"和"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")])]),s("annotation",{encoding:"application/x-tex"},"V_N和V_T")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord cjk_fallback"},"和"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a("分别是非终止符号集(nonterminal)和终止符号(terminal)集,是由语言设计者设计的集合,终止符就是常说的token")]),s("li",null,[a("如果一个符号由它自身定义("),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"a"),s("mo",null,"→"),s("mi",null,"a")]),s("annotation",{encoding:"application/x-tex"},"a\\rightarrow a")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"a")])])]),a("或"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"i"),s("mi",null,"n"),s("mi",null,"t"),s("mo",null,"→"),s("mi",null,"i"),s("mi",null,"n"),s("mi",null,"t")]),s("annotation",{encoding:"application/x-tex"},"int \\rightarrow int")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6595em"}}),s("span",{class:"mord mathnormal"},"in"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6595em"}}),s("span",{class:"mord mathnormal"},"in"),s("span",{class:"mord mathnormal"},"t")])])]),a(")那么就是一个终止符号,通常是标点符号,如分号,括号等")]),s("li",null,[a("如果一个符号有其定义的可再分的结构就是一个非终止符号("),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"l"),s("mi",null,"e"),s("mi",null,"t"),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mo",null,"→"),s("mo",{stretchy:"false"},"["),s("mi",null,"A"),s("mo",null,"−"),s("mi",null,"Z"),s("mi",null,"a"),s("mo",null,"−"),s("mi",null,"z"),s("mo",{stretchy:"false"},"]")]),s("annotation",{encoding:"application/x-tex"},"letter\\rightarrow [A-Za-z]")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"tt"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"["),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"−"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7667em","vertical-align":"-0.0833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07153em"}},"Z"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"−"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.04398em"}},"z"),s("span",{class:"mclose"},"]")])])]),a("),通常是句子,短语,表达式等")]),s("li",null,[a("要注意,"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msup",null,[s("mi",null,"A"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"A^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])]),a('(Kleene闭包)是正则表达式特有的规则,CFG中没有,"|"在CFG中表示的是或,用来简化表示多个产生式,而不是正则表达式中的Union。')]),s("li",null,"CFG文法规定的第一个文法的左部是开始符号,规定了该语言都满足的一个规则"),s("li",null,"一个处于较低层级的文法是上级文法的特例,例如RE就是一种特殊的CFG")],-1),o=s("h2",{id:"形式化定义",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#形式化定义","aria-hidden":"true"},"#"),a(" 形式化定义")],-1),g=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"C"),s("mi",null,"F"),s("mi",null,"G"),s("mo",null,":"),s("mi",null,"G"),s("mo",null,"="),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",{separator:"true"},","),s("mi",null,"P"),s("mo",{separator:"true"},","),s("mi",null,"S"),s("mo",{stretchy:"false"},")")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mtext",null,"是终止符集合")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mtext",null,"是非终止符集合,"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",null,"∩"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mo",null,"="),s("mi",{mathvariant:"normal"},"∅")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"P"),s("mtext",null,"是产生式集合,或称语法规则集,满足"),s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"β"),s("mtext",null,"  "),s("mi",null,"A"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mtext",null,"和"),s("mi",null,"β"),s("mo",null,"∈"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",null,"∪"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("msup",null,[s("mo",{stretchy:"false"},")"),s("mo",null,"∗")])])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"S"),s("mtext",null,"是初始符号,"),s("mi",null,"S"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")])])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} CFG:G=(V_T,V_N,P,S)\\\\ V_T\\text{是终止符集合}\\\\ V_N\\text{是非终止符集合,}V_N\\cap V_T=\\varnothing\\\\ P\\text{是产生式集合,或称语法规则集,满足}A\\rightarrow \\beta \\;A\\in V_N和\\beta \\in (V_N\\cup V_T)^*\\\\ S\\text{是初始符号,}S\\in V_N \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"6em","vertical-align":"-2.75em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"3.25em"}},[s("span",{style:{top:"-5.41em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"CFG"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},":"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"G"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"P"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mclose"},")")])]),s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是终止符集合")])])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是非终止符集合,")]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∩"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord amsrm"},"∅")])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"P"),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是产生式集合,或称语法规则集,满足")]),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord cjk_fallback"},"和"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∪"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mclose"},[s("span",{class:"mclose"},")"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])]),s("span",{style:{top:"-0.61em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是初始符号,")]),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.75em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),u=s("h3",{id:"ebnf-extended-backus-naur-form",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#ebnf-extended-backus-naur-form","aria-hidden":"true"},"#"),a(" EBNF(Extended Backus-Naur form)")],-1),d=s("ul",null,[s("li",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",null,"→")]),s("annotation",{encoding:"application/x-tex"},"\\rightarrow")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.3669em"}}),s("span",{class:"mrel"},"→")])])]),a(":"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"X"),s("mo",null,"→"),s("msub",null,[s("mi",null,"Y"),s("mn",null,"1")]),s("msub",null,[s("mi",null,"Y"),s("mn",null,"2")]),s("msub",null,[s("mi",null,"Y"),s("mn",null,"3")]),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"Y"),s("mi",null,"N")])]),s("annotation",{encoding:"application/x-tex"},"X\\rightarrow Y_1Y_2Y_3...Y_N")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"3")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"..."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a("表示"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"X"),s("mtext",null,"可以用"),s("msub",null,[s("mi",null,"Y"),s("mn",null,"1")]),s("msub",null,[s("mi",null,"Y"),s("mn",null,"2")]),s("msub",null,[s("mi",null,"Y"),s("mn",null,"3")]),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"Y"),s("mi",null,"N")])]),s("annotation",{encoding:"application/x-tex"},"X\\text{可以用}Y_1Y_2Y_3...Y_N")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"可以用")]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"3")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"..."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a("来代替,"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"X"),s("mo",null,"→"),s("mi",null,"ε")]),s("annotation",{encoding:"application/x-tex"},"X\\rightarrow \\varepsilon")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"ε")])])]),a("表示"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"X")]),s("annotation",{encoding:"application/x-tex"},"X")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X")])])]),a("可以用空串代替,这种"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"α")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\alpha")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α")])])]),a("被称为BNF表示法")]),s("li",null,[a("简化表示: "),s("ol",null,[s("li",null,"除非特殊说明,否则第一个产生式的左部就是初始符号"),s("li",null,"用小写字母表示终止符号"),s("li",null,[a("用大写字符或者"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",null,"<"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",null,">")]),s("annotation",{encoding:"application/x-tex"},"<...>")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.5782em","vertical-align":"-0.0391em"}}),s("span",{class:"mrel"},"<"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.5782em","vertical-align":"-0.0391em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},">")])])]),a("表示非终止符号")]),s("li",null,[a("如果左部都为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A")]),s("annotation",{encoding:"application/x-tex"},"A")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A")])])]),a("的一系列产生式"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"α"),s("mn",null,"2")]),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"α"),s("mi",null,"n")]),s("mo",{separator:"true"},","),s("mtext",null,"  ")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\alpha_2,\\;...,\\;A\\rightarrow \\alpha_n,\\;")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.625em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})])])]),a("可以简写为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"α"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"α"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"α"),s("mi",null,"n")])]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\alpha_1 | \\alpha _2|...|\\alpha_n")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])])])])]),s("li",null,"特别注意:")],-1),y=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"S"),s("mo",null,"→"),s("msup",null,[s("mi",null,"a"),s("mo",null,"∗")]),s("mi",null,"b"),s("mtext",null,"(错误写法,没有Kleene闭包)")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"S"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"b")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"a"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"ε")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} S\\rightarrow a^*b \\text{(错误写法,没有Kleene闭包)}\\\\ S\\rightarrow Ab\\\\ A\\rightarrow Aa|\\varepsilon \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"3.6em","vertical-align":"-1.55em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.05em"}},[s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mord text"},[s("span",{class:"mord"},"("),s("span",{class:"mord cjk_fallback"},"错误写法,没有"),s("span",{class:"mord"},"Kleene"),s("span",{class:"mord cjk_fallback"},"闭包"),s("span",{class:"mord"},")")])])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"b")])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"ε")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.55em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),v=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"S"),s("mo",null,"→"),s("mi",null,"a"),s("mo",{stretchy:"false"},"("),s("mi",null,"b"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"c"),s("mo",{stretchy:"false"},")"),s("mo",{stretchy:"false"},"("),s("mtext",null,"错误,没有括号"),s("mo",{stretchy:"false"},")")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"S"),s("mo",null,"→"),s("mi",null,"a"),s("mi",null,"X")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"X"),s("mo",null,"→"),s("mi",null,"b"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"c")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} S\\rightarrow a(b|c)(错误,没有括号)\\\\ S\\rightarrow aX\\\\ X\\rightarrow b|c \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"3.6em","vertical-align":"-1.55em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.05em"}},[s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mclose"},")"),s("span",{class:"mopen"},"("),s("span",{class:"mord cjk_fallback"},"错误,没有括号"),s("span",{class:"mclose"},")")])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X")])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"c")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.55em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),x=s("ul",null,[s("li",null,[a("左递归:"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"α"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"β"),s("mtext",null,"  "),s("mo",{stretchy:"false"},"("),s("mi",null,"l"),s("mi",null,"e"),s("mi",null,"f"),s("mi",null,"t"),s("mtext",null,"  "),s("mi",null,"r"),s("mi",null,"e"),s("mi",null,"c"),s("mi",null,"u"),s("mi",null,"r"),s("mi",null,"s"),s("mi",null,"i"),s("mi",null,"v"),s("mi",null,"e"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"A \\rightarrow A\\alpha|\\beta\\;(left\\;recursive)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"rec"),s("span",{class:"mord mathnormal"},"u"),s("span",{class:"mord mathnormal"},"rs"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.03588em"}},"v"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mclose"},")")])])]),a("可表示"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"β"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"β"),s("mi",null,"α"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"β"),s("mi",null,"α"),s("mi",null,"α"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},".")]),s("annotation",{encoding:"application/x-tex"},"\\beta ,\\;\\beta \\alpha,\\; \\beta \\alpha \\alpha...")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"αα"),s("span",{class:"mord"},"...")])])]),a("即有推导"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"β"),s("msup",null,[s("mi",null,"α"),s("mi",null,"n")]),s("mo",{stretchy:"false"},"("),s("mi",null,"n"),s("mo",null,"="),s("mn",null,"0"),s("mo",{separator:"true"},","),s("mn",null,"1"),s("mo",{separator:"true"},","),s("mn",null,"2"),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"A\\Rightarrow^*\\beta \\alpha^n(n=0,1,2,...)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6644em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])])])])])]),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},"0"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"1"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"2"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mclose"},")")])])]),a("在EBNF中可表示为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"β"),s("mo",{stretchy:"false"},"{"),s("mi",null,"α"),s("mo",{stretchy:"false"},"}")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow\\beta \\{\\alpha \\}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mclose"},"}")])])])]),s("li",null,[a("右递归:"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"α"),s("mi",null,"A"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"β"),s("mtext",null,"  "),s("mo",{stretchy:"false"},"("),s("mi",null,"r"),s("mi",null,"i"),s("mi",null,"g"),s("mi",null,"h"),s("mi",null,"t"),s("mtext",null,"  "),s("mi",null,"r"),s("mi",null,"e"),s("mi",null,"c"),s("mi",null,"u"),s("mi",null,"r"),s("mi",null,"s"),s("mi",null,"i"),s("mi",null,"v"),s("mi",null,"e"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"A \\rightarrow \\alpha A|\\beta\\;(right\\;recursive)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"r"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.03588em"}},"g"),s("span",{class:"mord mathnormal"},"h"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"rec"),s("span",{class:"mord mathnormal"},"u"),s("span",{class:"mord mathnormal"},"rs"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.03588em"}},"v"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mclose"},")")])])]),a("可表示"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"β"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"α"),s("mi",null,"β"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"α"),s("mi",null,"β"),s("mi",null,"β"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},".")]),s("annotation",{encoding:"application/x-tex"},"\\beta,\\; \\alpha \\beta,\\; \\alpha \\beta \\beta...")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"ββ"),s("span",{class:"mord"},"...")])])]),a("即有推导"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("msup",null,[s("mi",null,"α"),s("mi",null,"n")]),s("mi",null,"β"),s("mo",{stretchy:"false"},"("),s("mi",null,"n"),s("mo",null,"="),s("mn",null,"0"),s("mo",{separator:"true"},","),s("mn",null,"1"),s("mo",{separator:"true"},","),s("mn",null,"2"),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"A\\Rightarrow^* \\alpha^n \\beta(n=0,1,2,...)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6644em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])])])])])]),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},"0"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"1"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"2"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mclose"},")")])])]),a("在EBNF中可表示为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mo",{stretchy:"false"},"{"),s("mi",null,"α"),s("mo",{stretchy:"false"},"}"),s("mi",null,"β")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\{\\alpha \\}\\beta")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mclose"},"}"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β")])])])]),s("li",null,"结合性")],-1),w=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"p"),s("mo",null,"→"),s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"p"),s("mtext",null,"  "),s("mi",null,"a"),s("mi",null,"d"),s("mi",null,"d"),s("mi",null,"o"),s("mi",null,"p"),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"p"),s("mo",null,"→"),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m"),s("mo",{stretchy:"false"},"{"),s("mi",null,"a"),s("mi",null,"d"),s("mi",null,"d"),s("mi",null,"o"),s("mi",null,"p"),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m"),s("mo",{stretchy:"false"},"}"),s("mtext",null,"(左结合性)")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"p"),s("mo",null,"→"),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m"),s("mo",{stretchy:"false"},"["),s("mi",null,"a"),s("mi",null,"d"),s("mi",null,"d"),s("mi",null,"o"),s("mi",null,"p"),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m"),s("mo",{stretchy:"false"},"]"),s("mtext",null,"(右结合性)")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} exp\\rightarrow exp\\; addop\\; term|term\\\\ exp\\rightarrow term\\{addop\\;term\\}\\text{(左结合性)}\\\\ exp\\rightarrow term[addop \\; term]\\text{(右结合性)} \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"3.6em","vertical-align":"-1.55em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.05em"}},[s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"dd"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m")])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"dd"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mclose"},"}"),s("span",{class:"mord text"},[s("span",{class:"mord"},"("),s("span",{class:"mord cjk_fallback"},"左结合性"),s("span",{class:"mord"},")")])])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mopen"},"["),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"dd"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mclose"},"]"),s("span",{class:"mord text"},[s("span",{class:"mord"},"("),s("span",{class:"mord cjk_fallback"},"右结合性"),s("span",{class:"mord"},")")])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.55em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),b=s("ul",null,[s("li",null,"中括号表示其中的符号出现0次或1次,大括号表示0次或")],-1),k=s("h2",{id:"推导-derivation-与规约-reduction",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#推导-derivation-与规约-reduction","aria-hidden":"true"},"#"),a(" 推导(Derivation)与规约(Reduction)")],-1),f=s("ul",null,[s("li",null,"如果能用一步步推导从初始符号得到需要验证的式子,那么式子就是符合规则的"),s("li",null,"推导就是不断用产生式的右部来替换一个非终止符"),s("li",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"\\Rightarrow^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])]),a("表示多步推导")]),s("li",null,"由终止符号构成的串称为句子(sentence),由非终止符号构成的串是句型(sentential form)"),s("li",null,[a("以S为开始符号的CFG构成的语言:"),s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mrow",null,[s("mi",null,"L"),s("mo",{stretchy:"false"},"("),s("mi",null,"G"),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mo",{stretchy:"false"},"{"),s("mi",null,"s"),s("mo",null,"∈"),s("msubsup",null,[s("mi",null,"V"),s("mi",null,"T"),s("mo",null,"∗")]),s("mi",{mathvariant:"normal"},"∣"),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"h"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"e"),s("mtext",null,"  "),s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"i"),s("mi",null,"s"),s("mi",null,"t"),s("mi",null,"s"),s("mtext",null,"  "),s("mi",null,"S"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"s"),s("mtext",null,"  "),s("mi",null,"o"),s("mi",null,"f"),s("mtext",null,"  "),s("mi",null,"G"),s("mo",{stretchy:"false"},"}")]),s("annotation",{encoding:"application/x-tex"}," L(G)=\\{s\\in V_T^*|\\;there\\;exists\\;S\\Rightarrow^*s\\;of\\; G\\} ")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"L"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"G"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7387em"}},[s("span",{style:{top:"-2.453em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])]),s("span",{style:{top:"-3.113em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.247em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"h"),s("span",{class:"mord mathnormal"},"ere"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7387em"}},[s("span",{style:{top:"-3.113em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"G"),s("span",{class:"mclose"},"}")])])])])])])],-1),z=s("h3",{id:"语法树",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#语法树","aria-hidden":"true"},"#"),a(" 语法树")],-1),M=s("ul",null,[s("li",null,"根节点是开始符号"),s("li",null,"内部节点是非终止符号"),s("li",null,[a("叶子节点是终止符号或者"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"ε")]),s("annotation",{encoding:"application/x-tex"},"\\varepsilon")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"ε")])])])]),s("li",null,[a("如果节点A有子节点"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mn",null,"1")]),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mn",null,"2")]),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mi",null,"N")])]),s("annotation",{encoding:"application/x-tex"},"X_1,X_2,...,X_N")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a("则意为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"X"),s("mn",null,"1")]),s("msub",null,[s("mi",null,"X"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"X"),s("mi",null,"N")])]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow X_1X_2...X_N")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"..."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])])]),s("li",null,"最终的叶子节点连起来就是一个句子"),s("li",null,"不同的推导会得到不同的树,但是可能会有相同的结果。")],-1),_=s("h3",{id:"最左推导-leftmost-derivation前缀推导",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#最左推导-leftmost-derivation前缀推导","aria-hidden":"true"},"#"),a(" 最左推导(LeftMost Derivation前缀推导)")],-1),A=s("ul",null,[s("li",null,"总是对句型中最左侧的非终止符号进行一次推导"),s("li",null,"从开始符号推导到结果,被称为Top-down")],-1),L=s("h3",{id:"最右推导-rightmost-derivation",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#最右推导-rightmost-derivation","aria-hidden":"true"},"#"),a(" 最右推导(RightMost Derivation)")],-1),S=s("ul",null,[s("li",null,[a("从结果反向推回开始符号,这个过程被称为规约"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"s"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"S")]),s("annotation",{encoding:"application/x-tex"},"s\\Rightarrow^*S")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S")])])])]),s("li",null,"等价于对语法树进行后序遍历的逆过程"),s("li",null,"最右推导的能力比最左推导要强")],-1),V=l('

抽象语法树

![[语法树与抽象语法树.png]]

歧义(Ambiguity)

解决方法

',7),F=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mrow",null,[s("mi",null,"E"),s("mo",null,"→"),s("mi",null,"E"),s("mo",null,"−"),s("mi",null,"E"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"E"),s("mo",null,"×"),s("mi",null,"E"),s("mi",{mathvariant:"normal"},"∣"),s("mo",{stretchy:"false"},"("),s("mi",null,"E"),s("mo",{stretchy:"false"},")"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"i"),s("mtext",null,"  "),s("mo",null,"⇒"),s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"E"),s("mo",null,"→"),s("mi",null,"E"),s("mo",null,"−"),s("mi",null,"E"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"T")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"T"),s("mo",null,"→"),s("mi",null,"T"),s("mo",null,"×"),s("mi",null,"T"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"F")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"F"),s("mo",null,"→"),s("mo",{stretchy:"false"},"("),s("mi",null,"E"),s("mo",{stretchy:"false"},")"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"i")])])])])])]),s("annotation",{encoding:"application/x-tex"}," E\\rightarrow E-E|E \\times E|(E)|i\\;\\Rightarrow \\begin{array}{c} E\\rightarrow E-E|T\\\\ T\\rightarrow T\\times T|F\\\\ F\\rightarrow(E)|i \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7667em","vertical-align":"-0.0833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"−"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"×"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mord"},"∣"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mclose"},")"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"⇒"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"3.6em","vertical-align":"-1.55em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.05em"}},[s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"−"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T")])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"×"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F")])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mclose"},")"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"i")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.55em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),T=l('

![[消除歧义1.png]] ![[消除歧义2.png]] ![[消除歧义3.png]]

语法分析算法(parsing)

Top-Down(Leftmost) parsing

回溯算法(Backtracking)

',5),R=s("ul",null,[s("li",null,"用BFS:进行图遍历搜索,复杂,时间复杂度过高,产生大量无用分支,时间和空间的最差情况都是指数级别。现代编译器中不被使用"),s("li",null,[a("剪枝:由终止符号做前缀时,如果无法与输入的前缀匹配则剪枝。("),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mi",null,"a"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"A"),s("mi",null,"b"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"c"),s("mo",null,"→"),s("mi",null,"c"),s("mi",null,"a"),s("mi",null,"a"),s("mi",null,"a"),s("mi",null,"a"),s("mi",null,"a")]),s("annotation",{encoding:"application/x-tex"},"Aa|Ab|c\\rightarrow caaaaa")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mord mathnormal"},"aaaaa")])])]),a("时,无法剪枝,因为前缀一直是非终止符号)")]),s("li",null,[a("用DFS:有比BFS更好的空间复杂度和时间复杂度,但是无法匹配("),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mi",null,"a"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"c"),s("mo",null,"→"),s("mi",null,"c")]),s("annotation",{encoding:"application/x-tex"},"Aa|c\\rightarrow c")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"c")])])]),a(",因为会一直循环)")])],-1),N=s("h3",{id:"预测推导-predictive-parsing",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#预测推导-predictive-parsing","aria-hidden":"true"},"#"),a(" 预测推导(predictive parsing)")],-1),X=s("ul",null,[s("li",null,"Idea:利用先行词(lokkahead tokens),也就是上面提到过的终止符前缀"),s("li",null,"两种分析方法:")],-1),O=s("ol",null,[s("li",null,"递归下降分析(Recursive-descent parsing)"),s("li",null,"LL(1)分析")],-1),j=s("h4",{id:"预测分析的概念",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#预测分析的概念","aria-hidden":"true"},"#"),a(" 预测分析的概念")],-1),E=s("ul",null,[s("li",null,"从输入串和文法的开始符号开始分析"),s("li",null,"可以从当前输入的token(s)唯一确定下一个要使用的产生式"),s("li",null,[a("预测分析文法包括LL(k)文法,其中L表示从左向右扫描,L表示最左推导,k表示“需要"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",null,"≤"),s("mi",null,"k")]),s("annotation",{encoding:"application/x-tex"},"\\le k")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7719em","vertical-align":"-0.136em"}}),s("span",{class:"mrel"},"≤"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.03148em"}},"k")])])]),a("个先行词用于预测 ”")]),s("li",null,"LL(1)文法是常用的,也不完全常用")],-1),B=s("h5",{id:"lookahead-sets",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#lookahead-sets","aria-hidden":"true"},"#"),a(" Lookahead Sets")],-1),G=s("h6",{id:"first-sets-具体计算看讲义和书",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#first-sets-具体计算看讲义和书","aria-hidden":"true"},"#"),a(" First Sets(具体计算看讲义和书)")],-1),I=s("ul",null,[s("li",null,"定义")],-1),Y=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"G"),s("mo",null,"="),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mo",{separator:"true"},","),s("mi",null,"P"),s("mo",{separator:"true"},","),s("mi",null,"S"),s("mo",{stretchy:"false"},")"),s("mtext",null,"是一个文法")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"β"),s("mo",null,"∈"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",null,"∪"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("msup",null,[s("mo",{stretchy:"false"},")"),s("mo",null,"∗")])])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"F"),s("mi",null,"I"),s("mi",null,"R"),s("mi",null,"S"),s("mi",null,"T"),s("mo",{stretchy:"false"},"("),s("mi",null,"β"),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mo",{stretchy:"false"},"{"),s("mi",null,"α"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"β"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"a"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{stretchy:"false"},"}")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"i"),s("mi",null,"f"),s("mtext",null,"  "),s("mi",null,"β"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"ε"),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"h"),s("mi",null,"e"),s("mi",null,"n"),s("mtext",null,"  "),s("mi",null,"ε"),s("mo",null,"∈"),s("mi",null,"F"),s("mi",null,"I"),s("mi",null,"R"),s("mi",null,"S"),s("mi",null,"T"),s("mo",{stretchy:"false"},"("),s("mi",null,"β"),s("mo",{stretchy:"false"},")")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} G=(V_N,V_T,P,S)\\text{是一个文法}\\\\ \\beta\\in(V_N\\cup V_T)^*\\\\ FIRST(\\beta)=\\{\\alpha\\in V_T|\\beta\\Rightarrow^*a...\\}\\\\ if\\;\\beta\\Rightarrow^*\\varepsilon\\;then\\;\\varepsilon\\in FIRST(\\beta) \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"4.8em","vertical-align":"-2.15em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.65em"}},[s("span",{style:{top:"-4.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"G"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"P"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mclose"},")"),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是一个文法")])])]),s("span",{style:{top:"-3.61em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∪"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mclose"},[s("span",{class:"mclose"},")"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])]),s("span",{style:{top:"-2.41em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"I"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"RST"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord"},"..."),s("span",{class:"mclose"},"}")])]),s("span",{style:{top:"-1.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"ε"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"h"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"ε"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"I"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"RST"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mclose"},")")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.15em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),P=s("ul",null,[s("li",null,"计算")],-1),U=s("p",null,"![[First()计算 1.png]] ![[First()计算 2.png]] ![[First()计算 3.png]] ![[First()计算 4.png]] ![[First()计算 5.png]] //Todo 提取简练笔记",-1),C=s("h6",{id:"follow-sets",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#follow-sets","aria-hidden":"true"},"#"),a(" Follow Sets")],-1),K=s("ul",null,[s("li",null,"定义:")],-1),W=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"G"),s("mo",null,"="),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mo",{separator:"true"},","),s("mi",null,"P"),s("mo",{separator:"true"},","),s("mi",null,"S"),s("mo",{stretchy:"false"},")"),s("mtext",null,"是一个文法")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")])])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"F"),s("mi",null,"O"),s("mi",null,"L"),s("mi",null,"L"),s("mi",null,"O"),s("mi",null,"W"),s("mo",{stretchy:"false"},"("),s("mi",null,"A"),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mo",{stretchy:"false"},"{"),s("mi",null,"a"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"S"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",null,"A"),s("mi",null,"a"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{stretchy:"false"},"}"),s("mo",{separator:"true"},",")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"i"),s("mi",null,"f"),s("mtext",null,"  "),s("mi",null,"S"),s("mo",null,"⇒"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",null,"A"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"h"),s("mi",null,"e"),s("mi",null,"n"),s("mtext",null,"  "),s("mi",{mathvariant:"normal"},"$"),s("mo",null,"∈"),s("mi",null,"F"),s("mi",null,"O"),s("mi",null,"L"),s("mi",null,"L"),s("mi",null,"O"),s("mi",null,"W"),s("mo",{stretchy:"false"},"("),s("mi",null,"A"),s("mo",{stretchy:"false"},")")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",{mathvariant:"normal"},"$"),s("mtext",null,"是用来标记输入的终止的符号")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} G=(V_N,V_T,P,S)\\text{是一个文法}\\\\A\\in V_N\\\\ FOLLOW(A)=\\{a\\in V_T|S\\Rightarrow^*...Aa...\\},\\\\ if\\;S\\Rightarrow...A,\\;then\\;\\$\\in FOLLOW(A)\\\\ \\$是用来标记输入的终止的符号 \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"6em","vertical-align":"-2.75em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"3.25em"}},[s("span",{style:{top:"-5.41em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"G"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"P"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mclose"},")"),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是一个文法")])])]),s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"FO"),s("span",{class:"mord mathnormal"},"LL"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"O"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"W"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord"},"..."),s("span",{class:"mclose"},"}"),s("span",{class:"mpunct"},",")])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"⇒"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"h"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},"$"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"FO"),s("span",{class:"mord mathnormal"},"LL"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"O"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"W"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mclose"},")")])]),s("span",{style:{top:"-0.61em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"},"$"),s("span",{class:"mord cjk_fallback"},"是用来标记输入的终止的符号")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.75em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),Z=s("ul",null,[s("li",null,"计算: ![[Follow()计算 1.png]] ![[Follow()计算 2.png]]")],-1),D=s("h5",{id:"可空的非终止符-nullable-nonterminal",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#可空的非终止符-nullable-nonterminal","aria-hidden":"true"},"#"),a(" 可空的非终止符(nullable nonterminal)")],-1),$=s("ul",null,[s("li",null,[a("定义:"),s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mrow",null,[s("mi",null,"S"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"ε")]),s("annotation",{encoding:"application/x-tex"}," S\\Rightarrow^*\\varepsilon ")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7387em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7387em"}},[s("span",{style:{top:"-3.113em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"ε")])])])])])])],-1),q=s("p",null,"则称S是一个可空的非终止符",-1),H=s("ul",null,[s("li",null,"计算: ![[nullble set计算 1.png]] ![[nullble set计算 2.png]]")],-1),J=s("h5",{id:"判定ll-1-文法",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#判定ll-1-文法","aria-hidden":"true"},"#"),a(" 判定LL(1)文法")],-1),Q=s("ul",null,[s("li",null,"计算每个可空的非终止符"),s("li",null,[a("计算产生式右侧所有的"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"F"),s("mi",null,"I"),s("mi",null,"R"),s("mi",null,"S"),s("mi",null,"T"),s("mo",{stretchy:"false"},"("),s("mi",null,"α"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"FIRST(\\alpha)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"I"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"RST"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mclose"},")")])])]),a("并验证其两两交集是否为空")]),s("li",null,[a("计算(1)中算出的非终止符的"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"F"),s("mi",null,"O"),s("mi",null,"L"),s("mi",null,"L"),s("mi",null,"O"),s("mi",null,"W"),s("mo",{stretchy:"false"},"("),s("mi",null,"A"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"FOLLOW(A)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"FO"),s("span",{class:"mord mathnormal"},"LL"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"O"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"W"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mclose"},")")])])]),a("并验证"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"F"),s("mi",null,"I"),s("mi",null,"R"),s("mi",null,"S"),s("mi",null,"T"),s("mo",{stretchy:"false"},"("),s("mi",null,"A"),s("mo",{stretchy:"false"},")"),s("mo",null,"∩"),s("mi",null,"F"),s("mi",null,"O"),s("mi",null,"L"),s("mi",null,"L"),s("mi",null,"O"),s("mi",null,"W"),s("mo",{stretchy:"false"},"("),s("mi",null,"A"),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mi",{mathvariant:"normal"},"∅")]),s("annotation",{encoding:"application/x-tex"},"FIRST(A)\\cap FOLLOW(A)=\\varnothing")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"I"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"RST"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∩"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"FO"),s("span",{class:"mord mathnormal"},"LL"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"O"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"W"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6633em","vertical-align":"-0.0817em"}}),s("span",{class:"mord amsrm"},"∅")])])]),a(" ![[判断LL(1)示例.png]]")])],-1),ss=s("h5",{id:"非ll-1-到ll-1",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#非ll-1-到ll-1","aria-hidden":"true"},"#"),a(" 非LL(1)到LL(1)")],-1),as=s("ul",null,[s("li",null,"两种简单的非LL(1)情形:")],-1),ls=s("ol",null,[s("li",null,[a("左因子,例如"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"α"),s("mi",null,"β"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"α"),s("mi",null,"r")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\alpha \\beta|\\alpha r")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"r")])])]),a(",这是两个产生式的简写,其产生式交集为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"α")]),s("annotation",{encoding:"application/x-tex"},"\\alpha")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α")])])]),a(",改写方法为")])],-1),ts=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"α"),s("msub",null,[s("mi",null,"β"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"α"),s("msub",null,[s("mi",null,"β"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"α"),s("msub",null,[s("mi",null,"β"),s("mi",null,"n")]),s("mtext",null,"  "),s("mtext",null,"重写为"),s("mo",null,":")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"α"),s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")]),s("mspace",{width:"1em"}),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mo",null,"→"),s("msub",null,[s("mi",null,"β"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mi",null,"n")])])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} A\\rightarrow\\alpha\\beta_1|\\alpha\\beta_2|...|\\alpha\\beta_n\\;重写为:\\\\ A\\rightarrow\\alpha A{'}\\quad A^{'}\\rightarrow\\beta_1|\\beta_2|...|\\beta_n \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"2.5025em","vertical-align":"-1.0012em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.5012em"}},[s("span",{style:{top:"-3.6612em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord cjk_fallback"},"重写为"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},":")])]),s("span",{style:{top:"-2.3588em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},[s("span",{class:"mord"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7519em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"1em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.0012em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),ns=s("ol",{start:"2"},[s("li",null,[a("左递归,包括直接左递归和间接左递归,例如"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"β")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow A \\beta")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β")])])]),a("和"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"B"),s("mi",null,"β"),s("mspace",{width:"1em"}),s("mi",null,"B"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"α")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow B \\beta\\quad B\\rightarrow A\\alpha")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"Bβ"),s("span",{class:"mspace",style:{"margin-right":"1em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05017em"}},"B"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α")])])]),a(" 改写方法为")])],-1),ms=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"α"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"β"),s("mtext",null,"  "),s("mtext",null,"重写为:")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"β"),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mtext",null,"  "),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mo",null,"→"),s("mi",null,"α"),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"ε")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mtext",null,"一般情况为:")])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"A"),s("msub",null,[s("mi",null,"α"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"A"),s("msub",null,[s("mi",null,"α"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"A"),s("msub",null,[s("mi",null,"α"),s("mi",null,"m")]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mi",null,"n")]),s("mtext",null,"  "),s("mtext",null,"重写为:")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"β"),s("mn",null,"1")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mn",null,"2")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mi",null,"n")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])])])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mo",null,"→"),s("msub",null,[s("mi",null,"α"),s("mn",null,"1")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"α"),s("mn",null,"1")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"α"),s("mi",null,"m")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"ε")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} A\\rightarrow A \\alpha|\\beta\\;\\text{重写为:}\\\\ A\\rightarrow\\beta A^{'}\\; ,\\;A^{'}\\rightarrow\\alpha A^{'}|\\varepsilon\\\\ \\text{一般情况为:}\\\\ A\\rightarrow A \\alpha_1|A \\alpha_2|...|A \\alpha_m|\\beta_1|\\beta_2|...|\\beta_n\\; \\text{重写为:}\\\\ A\\rightarrow \\beta_1 A^{'}|\\beta_2 A^{'}|...|\\beta_n A^{'}\\\\ A^{'}\\rightarrow\\alpha_1 A^{'}|\\alpha_1 A^{'}|...|\\alpha_m A^{'}|\\varepsilon \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"7.5074em","vertical-align":"-3.5037em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"4.0037em"}},[s("span",{style:{top:"-6.1637em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"重写为:")])])]),s("span",{style:{top:"-4.8612em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"ε")])]),s("span",{style:{top:"-3.6612em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"一般情况为:")])])]),s("span",{style:{top:"-2.4612em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"m")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"重写为:")])])]),s("span",{style:{top:"-1.1588em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])])])]),s("span",{style:{top:"0.1437em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"m")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"ε")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"3.5037em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),es=l(`

递归下降

输入
int main(){
+import{_ as t}from"./plugin-vue_export-helper-c27b6911.js";import{o as n,c as m,a as s,b as a,f as l}from"./app-c6e156cf.js";const e={},i=s("h1",{id:"语法分析",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#语法分析","aria-hidden":"true"},"#"),a(" 语法分析")],-1),r=s("ul",null,[s("li",null,[a("正则表达式的能力有限,无法分析具体的语法细节(例如嵌套、"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msup",null,[s("mi",null,"a"),s("mi",null,"n")]),s("msup",null,[s("mi",null,"b"),s("mi",null,"n")])]),s("annotation",{encoding:"application/x-tex"},"a^nb^n")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6644em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"b"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6644em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])])])])])])])])]),a("的n值),与其等价的有穷自动机同理,因此引入了下推自动机和上下文有关、无关文法")])],-1),p=l('

大纲

  • 语法分析的形式化——上下文无关文法
  • 语法分析算法

上下文无关文法(CFG)

  • 是用来描述一个编程语言的语法结构的文法
  • 和正则表达式一样,可以表示递归的规则,而且更强大
  • 是正则表达式的严格超集

Chomsky语言层级

',5),c=s("table",null,[s("thead",null,[s("tr",null,[s("th",null,"Chomsky hierarchy"),s("th",null,"Production(产生式)"),s("th",null,"Explanation")])]),s("tbody",null,[s("tr",null,[s("td",null,"unrestricted(type 0)(自然语言)"),s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"α"),s("mo",null,"→"),s("mi",null,"β"),s("mspace",{width:"1em"}),s("msup",null,[s("mi",null,"V"),s("mo",null,"+")]),s("mo",null,"="),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",null,"∪"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")])]),s("annotation",{encoding:"application/x-tex"},"\\alpha \\rightarrow \\beta \\quad V^+=V_N\\cup V_T")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9658em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"1em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7713em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"+")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∪"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mtext",null,"其中"),s("mi",null,"α"),s("mo",null,"∈"),s("msup",null,[s("mi",null,"V"),s("mo",null,"+")]),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"β"),s("mo",null,"∈"),s("msup",null,[s("mi",null,"V"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"其中\\alpha\\in V^+,\\; \\beta\\in V^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7224em","vertical-align":"-0.0391em"}}),s("span",{class:"mord cjk_fallback"},"其中"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9658em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7713em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"+")])])])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])])]),s("td",null,"无严格约束")]),s("tr",null,[s("td",null,"context sensitive(type 1)(上下文有关文法)"),s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"α"),s("mi",null,"A"),s("mi",null,"γ"),s("mo",null,"→"),s("mi",null,"α"),s("mi",null,"β"),s("mi",null,"γ"),s("mo",{separator:"true"},",")]),s("annotation",{encoding:"application/x-tex"},"\\alpha A \\gamma \\rightarrow \\alpha \\beta \\gamma,")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05556em"}},"γ"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05556em"}},"γ"),s("span",{class:"mpunct"},",")])])]),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mtext",null,"其中"),s("mi",null,"α"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"γ"),s("mo",null,"∈"),s("msup",null,[s("mi",null,"V"),s("mo",null,"∗")]),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"A"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"β"),s("mo",null,"∈"),s("msup",null,[s("mi",null,"V"),s("mo",null,"+")])]),s("annotation",{encoding:"application/x-tex"},"其中\\alpha,\\;\\gamma\\in V^*,\\;A \\in V_N, \\; \\beta \\in V^+")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord cjk_fallback"},"其中"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05556em"}},"γ"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8831em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7713em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7713em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"+")])])])])])])])])])])]),s("td",null,[a("在不同的上下文中,"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A")]),s("annotation",{encoding:"application/x-tex"},"A")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A")])])]),a("可能被不同的"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"γ")]),s("annotation",{encoding:"application/x-tex"},"\\gamma")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.625em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05556em"}},"γ")])])]),a("替换")])]),s("tr",null,[s("td",null,"context free(type 2)(上下文无关文法)"),s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"β"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"A"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",{separator:"true"},",")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\beta ,\\;A\\in V_N,")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},",")])])]),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mtext",null,"其中"),s("mi",null,"β"),s("mo",null,"∈"),s("msup",null,[s("mi",null,"V"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"其中\\beta \\in V^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord cjk_fallback"},"其中"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])])]),s("td",null,[a("在任何"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A")]),s("annotation",{encoding:"application/x-tex"},"A")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A")])])]),a("出现的地方都会被"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"γ")]),s("annotation",{encoding:"application/x-tex"},"\\gamma")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.625em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05556em"}},"γ")])])]),a("替换")])]),s("tr",null,[s("td",null,"regular(type 3)(正则表达式)"),s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"a"),s("mi",null,"B"),s("mtext",null,"  "),s("mi",null,"o"),s("mi",null,"r"),s("mtext",null,"  "),s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"a")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow aB\\;or\\;A\\rightarrow a")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05017em"}},"B"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"or"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"a")])])]),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",{stretchy:"false"},"("),s("mtext",null,"其中"),s("mi",null,"A"),s("mo",{separator:"true"},","),s("mi",null,"B"),s("mtext",null,"  "),s("mi",null,"A"),s("mo",{separator:"true"},","),s("mi",null,"b"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mtext",null,"  "),s("mo",{separator:"true"},","),s("mi",null,"a"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"(其中A,B\\;A,b\\in V_N\\;,a\\in V_T)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord cjk_fallback"},"其中"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05017em"}},"B"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mclose"},")")])])])]),s("td",null,"等价于正则表达式")])])],-1),h=s("ul",null,[s("li",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mtext",null,"和"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")])]),s("annotation",{encoding:"application/x-tex"},"V_N和V_T")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord cjk_fallback"},"和"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a("分别是非终止符号集(nonterminal)和终止符号(terminal)集,是由语言设计者设计的集合,终止符就是常说的token")]),s("li",null,[a("如果一个符号由它自身定义("),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"a"),s("mo",null,"→"),s("mi",null,"a")]),s("annotation",{encoding:"application/x-tex"},"a\\rightarrow a")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"a")])])]),a("或"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"i"),s("mi",null,"n"),s("mi",null,"t"),s("mo",null,"→"),s("mi",null,"i"),s("mi",null,"n"),s("mi",null,"t")]),s("annotation",{encoding:"application/x-tex"},"int \\rightarrow int")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6595em"}}),s("span",{class:"mord mathnormal"},"in"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6595em"}}),s("span",{class:"mord mathnormal"},"in"),s("span",{class:"mord mathnormal"},"t")])])]),a(")那么就是一个终止符号,通常是标点符号,如分号,括号等")]),s("li",null,[a("如果一个符号有其定义的可再分的结构就是一个非终止符号("),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"l"),s("mi",null,"e"),s("mi",null,"t"),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mo",null,"→"),s("mo",{stretchy:"false"},"["),s("mi",null,"A"),s("mo",null,"−"),s("mi",null,"Z"),s("mi",null,"a"),s("mo",null,"−"),s("mi",null,"z"),s("mo",{stretchy:"false"},"]")]),s("annotation",{encoding:"application/x-tex"},"letter\\rightarrow [A-Za-z]")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"tt"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"["),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"−"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7667em","vertical-align":"-0.0833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07153em"}},"Z"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"−"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.04398em"}},"z"),s("span",{class:"mclose"},"]")])])]),a("),通常是句子,短语,表达式等")]),s("li",null,[a("要注意,"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msup",null,[s("mi",null,"A"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"A^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])]),a('(Kleene闭包)是正则表达式特有的规则,CFG中没有,"|"在CFG中表示的是或,用来简化表示多个产生式,而不是正则表达式中的Union。')]),s("li",null,"CFG文法规定的第一个文法的左部是开始符号,规定了该语言都满足的一个规则"),s("li",null,"一个处于较低层级的文法是上级文法的特例,例如RE就是一种特殊的CFG")],-1),o=s("h2",{id:"形式化定义",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#形式化定义","aria-hidden":"true"},"#"),a(" 形式化定义")],-1),g=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"C"),s("mi",null,"F"),s("mi",null,"G"),s("mo",null,":"),s("mi",null,"G"),s("mo",null,"="),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",{separator:"true"},","),s("mi",null,"P"),s("mo",{separator:"true"},","),s("mi",null,"S"),s("mo",{stretchy:"false"},")")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mtext",null,"是终止符集合")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mtext",null,"是非终止符集合,"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",null,"∩"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mo",null,"="),s("mi",{mathvariant:"normal"},"∅")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"P"),s("mtext",null,"是产生式集合,或称语法规则集,满足"),s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"β"),s("mtext",null,"  "),s("mi",null,"A"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mtext",null,"和"),s("mi",null,"β"),s("mo",null,"∈"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",null,"∪"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("msup",null,[s("mo",{stretchy:"false"},")"),s("mo",null,"∗")])])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"S"),s("mtext",null,"是初始符号,"),s("mi",null,"S"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")])])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} CFG:G=(V_T,V_N,P,S)\\\\ V_T\\text{是终止符集合}\\\\ V_N\\text{是非终止符集合,}V_N\\cap V_T=\\varnothing\\\\ P\\text{是产生式集合,或称语法规则集,满足}A\\rightarrow \\beta \\;A\\in V_N和\\beta \\in (V_N\\cup V_T)^*\\\\ S\\text{是初始符号,}S\\in V_N \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"6em","vertical-align":"-2.75em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"3.25em"}},[s("span",{style:{top:"-5.41em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"CFG"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},":"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"G"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"P"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mclose"},")")])]),s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是终止符集合")])])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是非终止符集合,")]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∩"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord amsrm"},"∅")])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"P"),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是产生式集合,或称语法规则集,满足")]),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord cjk_fallback"},"和"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∪"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mclose"},[s("span",{class:"mclose"},")"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])]),s("span",{style:{top:"-0.61em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是初始符号,")]),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.75em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),u=s("h3",{id:"ebnf-extended-backus-naur-form",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#ebnf-extended-backus-naur-form","aria-hidden":"true"},"#"),a(" EBNF(Extended Backus-Naur form)")],-1),d=s("ul",null,[s("li",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",null,"→")]),s("annotation",{encoding:"application/x-tex"},"\\rightarrow")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.3669em"}}),s("span",{class:"mrel"},"→")])])]),a(":"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"X"),s("mo",null,"→"),s("msub",null,[s("mi",null,"Y"),s("mn",null,"1")]),s("msub",null,[s("mi",null,"Y"),s("mn",null,"2")]),s("msub",null,[s("mi",null,"Y"),s("mn",null,"3")]),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"Y"),s("mi",null,"N")])]),s("annotation",{encoding:"application/x-tex"},"X\\rightarrow Y_1Y_2Y_3...Y_N")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"3")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"..."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a("表示"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"X"),s("mtext",null,"可以用"),s("msub",null,[s("mi",null,"Y"),s("mn",null,"1")]),s("msub",null,[s("mi",null,"Y"),s("mn",null,"2")]),s("msub",null,[s("mi",null,"Y"),s("mn",null,"3")]),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"Y"),s("mi",null,"N")])]),s("annotation",{encoding:"application/x-tex"},"X\\text{可以用}Y_1Y_2Y_3...Y_N")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"可以用")]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"3")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"..."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a("来代替,"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"X"),s("mo",null,"→"),s("mi",null,"ε")]),s("annotation",{encoding:"application/x-tex"},"X\\rightarrow \\varepsilon")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"ε")])])]),a("表示"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"X")]),s("annotation",{encoding:"application/x-tex"},"X")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X")])])]),a("可以用空串代替,这种"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"α")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\alpha")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α")])])]),a("被称为BNF表示法")]),s("li",null,[a("简化表示: "),s("ol",null,[s("li",null,"除非特殊说明,否则第一个产生式的左部就是初始符号"),s("li",null,"用小写字母表示终止符号"),s("li",null,[a("用大写字符或者"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",null,"<"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",null,">")]),s("annotation",{encoding:"application/x-tex"},"<...>")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.5782em","vertical-align":"-0.0391em"}}),s("span",{class:"mrel"},"<"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.5782em","vertical-align":"-0.0391em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},">")])])]),a("表示非终止符号")]),s("li",null,[a("如果左部都为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A")]),s("annotation",{encoding:"application/x-tex"},"A")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A")])])]),a("的一系列产生式"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"α"),s("mn",null,"2")]),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"α"),s("mi",null,"n")]),s("mo",{separator:"true"},","),s("mtext",null,"  ")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\alpha_2,\\;...,\\;A\\rightarrow \\alpha_n,\\;")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.625em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})])])]),a("可以简写为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"α"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"α"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"α"),s("mi",null,"n")])]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\alpha_1 | \\alpha _2|...|\\alpha_n")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])])])])]),s("li",null,"特别注意:")],-1),y=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"S"),s("mo",null,"→"),s("msup",null,[s("mi",null,"a"),s("mo",null,"∗")]),s("mi",null,"b"),s("mtext",null,"(错误写法,没有Kleene闭包)")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"S"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"b")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"a"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"ε")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} S\\rightarrow a^*b \\text{(错误写法,没有Kleene闭包)}\\\\ S\\rightarrow Ab\\\\ A\\rightarrow Aa|\\varepsilon \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"3.6em","vertical-align":"-1.55em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.05em"}},[s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mord text"},[s("span",{class:"mord"},"("),s("span",{class:"mord cjk_fallback"},"错误写法,没有"),s("span",{class:"mord"},"Kleene"),s("span",{class:"mord cjk_fallback"},"闭包"),s("span",{class:"mord"},")")])])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"b")])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"ε")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.55em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),v=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"S"),s("mo",null,"→"),s("mi",null,"a"),s("mo",{stretchy:"false"},"("),s("mi",null,"b"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"c"),s("mo",{stretchy:"false"},")"),s("mo",{stretchy:"false"},"("),s("mtext",null,"错误,没有括号"),s("mo",{stretchy:"false"},")")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"S"),s("mo",null,"→"),s("mi",null,"a"),s("mi",null,"X")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"X"),s("mo",null,"→"),s("mi",null,"b"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"c")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} S\\rightarrow a(b|c)(错误,没有括号)\\\\ S\\rightarrow aX\\\\ X\\rightarrow b|c \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"3.6em","vertical-align":"-1.55em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.05em"}},[s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mclose"},")"),s("span",{class:"mopen"},"("),s("span",{class:"mord cjk_fallback"},"错误,没有括号"),s("span",{class:"mclose"},")")])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X")])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"c")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.55em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),x=s("ul",null,[s("li",null,[a("左递归:"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"α"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"β"),s("mtext",null,"  "),s("mo",{stretchy:"false"},"("),s("mi",null,"l"),s("mi",null,"e"),s("mi",null,"f"),s("mi",null,"t"),s("mtext",null,"  "),s("mi",null,"r"),s("mi",null,"e"),s("mi",null,"c"),s("mi",null,"u"),s("mi",null,"r"),s("mi",null,"s"),s("mi",null,"i"),s("mi",null,"v"),s("mi",null,"e"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"A \\rightarrow A\\alpha|\\beta\\;(left\\;recursive)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"rec"),s("span",{class:"mord mathnormal"},"u"),s("span",{class:"mord mathnormal"},"rs"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.03588em"}},"v"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mclose"},")")])])]),a("可表示"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"β"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"β"),s("mi",null,"α"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"β"),s("mi",null,"α"),s("mi",null,"α"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},".")]),s("annotation",{encoding:"application/x-tex"},"\\beta ,\\;\\beta \\alpha,\\; \\beta \\alpha \\alpha...")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"αα"),s("span",{class:"mord"},"...")])])]),a("即有推导"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"β"),s("msup",null,[s("mi",null,"α"),s("mi",null,"n")]),s("mo",{stretchy:"false"},"("),s("mi",null,"n"),s("mo",null,"="),s("mn",null,"0"),s("mo",{separator:"true"},","),s("mn",null,"1"),s("mo",{separator:"true"},","),s("mn",null,"2"),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"A\\Rightarrow^*\\beta \\alpha^n(n=0,1,2,...)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6644em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])])])])])]),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},"0"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"1"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"2"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mclose"},")")])])]),a("在EBNF中可表示为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"β"),s("mo",{stretchy:"false"},"{"),s("mi",null,"α"),s("mo",{stretchy:"false"},"}")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow\\beta \\{\\alpha \\}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mclose"},"}")])])])]),s("li",null,[a("右递归:"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"α"),s("mi",null,"A"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"β"),s("mtext",null,"  "),s("mo",{stretchy:"false"},"("),s("mi",null,"r"),s("mi",null,"i"),s("mi",null,"g"),s("mi",null,"h"),s("mi",null,"t"),s("mtext",null,"  "),s("mi",null,"r"),s("mi",null,"e"),s("mi",null,"c"),s("mi",null,"u"),s("mi",null,"r"),s("mi",null,"s"),s("mi",null,"i"),s("mi",null,"v"),s("mi",null,"e"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"A \\rightarrow \\alpha A|\\beta\\;(right\\;recursive)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"r"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.03588em"}},"g"),s("span",{class:"mord mathnormal"},"h"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"rec"),s("span",{class:"mord mathnormal"},"u"),s("span",{class:"mord mathnormal"},"rs"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.03588em"}},"v"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mclose"},")")])])]),a("可表示"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"β"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"α"),s("mi",null,"β"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"α"),s("mi",null,"β"),s("mi",null,"β"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},".")]),s("annotation",{encoding:"application/x-tex"},"\\beta,\\; \\alpha \\beta,\\; \\alpha \\beta \\beta...")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"ββ"),s("span",{class:"mord"},"...")])])]),a("即有推导"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("msup",null,[s("mi",null,"α"),s("mi",null,"n")]),s("mi",null,"β"),s("mo",{stretchy:"false"},"("),s("mi",null,"n"),s("mo",null,"="),s("mn",null,"0"),s("mo",{separator:"true"},","),s("mn",null,"1"),s("mo",{separator:"true"},","),s("mn",null,"2"),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"A\\Rightarrow^* \\alpha^n \\beta(n=0,1,2,...)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6644em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])])])])])]),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},"0"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"1"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"2"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mclose"},")")])])]),a("在EBNF中可表示为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mo",{stretchy:"false"},"{"),s("mi",null,"α"),s("mo",{stretchy:"false"},"}"),s("mi",null,"β")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\{\\alpha \\}\\beta")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mclose"},"}"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β")])])])]),s("li",null,"结合性")],-1),w=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"p"),s("mo",null,"→"),s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"p"),s("mtext",null,"  "),s("mi",null,"a"),s("mi",null,"d"),s("mi",null,"d"),s("mi",null,"o"),s("mi",null,"p"),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"p"),s("mo",null,"→"),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m"),s("mo",{stretchy:"false"},"{"),s("mi",null,"a"),s("mi",null,"d"),s("mi",null,"d"),s("mi",null,"o"),s("mi",null,"p"),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m"),s("mo",{stretchy:"false"},"}"),s("mtext",null,"(左结合性)")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"p"),s("mo",null,"→"),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m"),s("mo",{stretchy:"false"},"["),s("mi",null,"a"),s("mi",null,"d"),s("mi",null,"d"),s("mi",null,"o"),s("mi",null,"p"),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m"),s("mo",{stretchy:"false"},"]"),s("mtext",null,"(右结合性)")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} exp\\rightarrow exp\\; addop\\; term|term\\\\ exp\\rightarrow term\\{addop\\;term\\}\\text{(左结合性)}\\\\ exp\\rightarrow term[addop \\; term]\\text{(右结合性)} \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"3.6em","vertical-align":"-1.55em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.05em"}},[s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"dd"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m")])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"dd"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mclose"},"}"),s("span",{class:"mord text"},[s("span",{class:"mord"},"("),s("span",{class:"mord cjk_fallback"},"左结合性"),s("span",{class:"mord"},")")])])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mopen"},"["),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"dd"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mclose"},"]"),s("span",{class:"mord text"},[s("span",{class:"mord"},"("),s("span",{class:"mord cjk_fallback"},"右结合性"),s("span",{class:"mord"},")")])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.55em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),b=s("ul",null,[s("li",null,"中括号表示其中的符号出现0次或1次,大括号表示0次或")],-1),k=s("h2",{id:"推导-derivation-与规约-reduction",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#推导-derivation-与规约-reduction","aria-hidden":"true"},"#"),a(" 推导(Derivation)与规约(Reduction)")],-1),f=s("ul",null,[s("li",null,"如果能用一步步推导从初始符号得到需要验证的式子,那么式子就是符合规则的"),s("li",null,"推导就是不断用产生式的右部来替换一个非终止符"),s("li",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"\\Rightarrow^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])]),a("表示多步推导")]),s("li",null,"由终止符号构成的串称为句子(sentence),由非终止符号构成的串是句型(sentential form)"),s("li",null,[a("以S为开始符号的CFG构成的语言:"),s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mrow",null,[s("mi",null,"L"),s("mo",{stretchy:"false"},"("),s("mi",null,"G"),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mo",{stretchy:"false"},"{"),s("mi",null,"s"),s("mo",null,"∈"),s("msubsup",null,[s("mi",null,"V"),s("mi",null,"T"),s("mo",null,"∗")]),s("mi",{mathvariant:"normal"},"∣"),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"h"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"e"),s("mtext",null,"  "),s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"i"),s("mi",null,"s"),s("mi",null,"t"),s("mi",null,"s"),s("mtext",null,"  "),s("mi",null,"S"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"s"),s("mtext",null,"  "),s("mi",null,"o"),s("mi",null,"f"),s("mtext",null,"  "),s("mi",null,"G"),s("mo",{stretchy:"false"},"}")]),s("annotation",{encoding:"application/x-tex"}," L(G)=\\{s\\in V_T^*|\\;there\\;exists\\;S\\Rightarrow^*s\\;of\\; G\\} ")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"L"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"G"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7387em"}},[s("span",{style:{top:"-2.453em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])]),s("span",{style:{top:"-3.113em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.247em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"h"),s("span",{class:"mord mathnormal"},"ere"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7387em"}},[s("span",{style:{top:"-3.113em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"G"),s("span",{class:"mclose"},"}")])])])])])])],-1),z=s("h3",{id:"语法树",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#语法树","aria-hidden":"true"},"#"),a(" 语法树")],-1),M=s("ul",null,[s("li",null,"根节点是开始符号"),s("li",null,"内部节点是非终止符号"),s("li",null,[a("叶子节点是终止符号或者"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"ε")]),s("annotation",{encoding:"application/x-tex"},"\\varepsilon")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"ε")])])])]),s("li",null,[a("如果节点A有子节点"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mn",null,"1")]),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mn",null,"2")]),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mi",null,"N")])]),s("annotation",{encoding:"application/x-tex"},"X_1,X_2,...,X_N")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a("则意为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"X"),s("mn",null,"1")]),s("msub",null,[s("mi",null,"X"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"X"),s("mi",null,"N")])]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow X_1X_2...X_N")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"..."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])])]),s("li",null,"最终的叶子节点连起来就是一个句子"),s("li",null,"不同的推导会得到不同的树,但是可能会有相同的结果。")],-1),_=s("h3",{id:"最左推导-leftmost-derivation前缀推导",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#最左推导-leftmost-derivation前缀推导","aria-hidden":"true"},"#"),a(" 最左推导(LeftMost Derivation前缀推导)")],-1),A=s("ul",null,[s("li",null,"总是对句型中最左侧的非终止符号进行一次推导"),s("li",null,"从开始符号推导到结果,被称为Top-down")],-1),L=s("h3",{id:"最右推导-rightmost-derivation",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#最右推导-rightmost-derivation","aria-hidden":"true"},"#"),a(" 最右推导(RightMost Derivation)")],-1),S=s("ul",null,[s("li",null,[a("从结果反向推回开始符号,这个过程被称为规约"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"s"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"S")]),s("annotation",{encoding:"application/x-tex"},"s\\Rightarrow^*S")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S")])])])]),s("li",null,"等价于对语法树进行后序遍历的逆过程"),s("li",null,"最右推导的能力比最左推导要强")],-1),V=l('

抽象语法树

![[语法树与抽象语法树.png]]

  • 比起语法树,省略了部分细节,带来了更好的语法抽象,对于后续编译阶段是一个更好的数据结构
  • 它反映了源码token序列的一个抽象,比语法树更高效

歧义(Ambiguity)

  • 对于一个CFG,同样的输入可能有不同的解析 ![[语法树歧义.png]]

解决方法

  • 消除歧义(Disambiguity rule):不改变文法,列举所有可能造成歧义的情况并进行消除,不现实的
  • 文法重写:改变文法,进行同义转换:(添加优先级,添加关联性)
',7),F=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mrow",null,[s("mi",null,"E"),s("mo",null,"→"),s("mi",null,"E"),s("mo",null,"−"),s("mi",null,"E"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"E"),s("mo",null,"×"),s("mi",null,"E"),s("mi",{mathvariant:"normal"},"∣"),s("mo",{stretchy:"false"},"("),s("mi",null,"E"),s("mo",{stretchy:"false"},")"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"i"),s("mtext",null,"  "),s("mo",null,"⇒"),s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"E"),s("mo",null,"→"),s("mi",null,"E"),s("mo",null,"−"),s("mi",null,"E"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"T")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"T"),s("mo",null,"→"),s("mi",null,"T"),s("mo",null,"×"),s("mi",null,"T"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"F")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"F"),s("mo",null,"→"),s("mo",{stretchy:"false"},"("),s("mi",null,"E"),s("mo",{stretchy:"false"},")"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"i")])])])])])]),s("annotation",{encoding:"application/x-tex"}," E\\rightarrow E-E|E \\times E|(E)|i\\;\\Rightarrow \\begin{array}{c} E\\rightarrow E-E|T\\\\ T\\rightarrow T\\times T|F\\\\ F\\rightarrow(E)|i \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7667em","vertical-align":"-0.0833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"−"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"×"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mord"},"∣"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mclose"},")"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"⇒"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"3.6em","vertical-align":"-1.55em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.05em"}},[s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"−"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T")])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"×"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F")])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mclose"},")"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"i")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.55em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),T=l('

![[消除歧义1.png]] ![[消除歧义2.png]] ![[消除歧义3.png]]

语法分析算法(parsing)

Top-Down(Leftmost) parsing

  • 本质上是一个图搜索问题,在树上搜索,查找能否获得一个与输入sentence匹配的路径

回溯算法(Backtracking)

',5),R=s("ul",null,[s("li",null,"用BFS:进行图遍历搜索,复杂,时间复杂度过高,产生大量无用分支,时间和空间的最差情况都是指数级别。现代编译器中不被使用"),s("li",null,[a("剪枝:由终止符号做前缀时,如果无法与输入的前缀匹配则剪枝。("),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mi",null,"a"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"A"),s("mi",null,"b"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"c"),s("mo",null,"→"),s("mi",null,"c"),s("mi",null,"a"),s("mi",null,"a"),s("mi",null,"a"),s("mi",null,"a"),s("mi",null,"a")]),s("annotation",{encoding:"application/x-tex"},"Aa|Ab|c\\rightarrow caaaaa")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mord mathnormal"},"aaaaa")])])]),a("时,无法剪枝,因为前缀一直是非终止符号)")]),s("li",null,[a("用DFS:有比BFS更好的空间复杂度和时间复杂度,但是无法匹配("),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mi",null,"a"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"c"),s("mo",null,"→"),s("mi",null,"c")]),s("annotation",{encoding:"application/x-tex"},"Aa|c\\rightarrow c")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"c")])])]),a(",因为会一直循环)")])],-1),N=s("h3",{id:"预测推导-predictive-parsing",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#预测推导-predictive-parsing","aria-hidden":"true"},"#"),a(" 预测推导(predictive parsing)")],-1),X=s("ul",null,[s("li",null,"Idea:利用先行词(lokkahead tokens),也就是上面提到过的终止符前缀"),s("li",null,"两种分析方法:")],-1),O=s("ol",null,[s("li",null,"递归下降分析(Recursive-descent parsing)"),s("li",null,"LL(1)分析")],-1),j=s("h4",{id:"预测分析的概念",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#预测分析的概念","aria-hidden":"true"},"#"),a(" 预测分析的概念")],-1),E=s("ul",null,[s("li",null,"从输入串和文法的开始符号开始分析"),s("li",null,"可以从当前输入的token(s)唯一确定下一个要使用的产生式"),s("li",null,[a("预测分析文法包括LL(k)文法,其中L表示从左向右扫描,L表示最左推导,k表示“需要"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",null,"≤"),s("mi",null,"k")]),s("annotation",{encoding:"application/x-tex"},"\\le k")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7719em","vertical-align":"-0.136em"}}),s("span",{class:"mrel"},"≤"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.03148em"}},"k")])])]),a("个先行词用于预测 ”")]),s("li",null,"LL(1)文法是常用的,也不完全常用")],-1),B=s("h5",{id:"lookahead-sets",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#lookahead-sets","aria-hidden":"true"},"#"),a(" Lookahead Sets")],-1),G=s("h6",{id:"first-sets-具体计算看讲义和书",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#first-sets-具体计算看讲义和书","aria-hidden":"true"},"#"),a(" First Sets(具体计算看讲义和书)")],-1),I=s("ul",null,[s("li",null,"定义")],-1),Y=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"G"),s("mo",null,"="),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mo",{separator:"true"},","),s("mi",null,"P"),s("mo",{separator:"true"},","),s("mi",null,"S"),s("mo",{stretchy:"false"},")"),s("mtext",null,"是一个文法")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"β"),s("mo",null,"∈"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",null,"∪"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("msup",null,[s("mo",{stretchy:"false"},")"),s("mo",null,"∗")])])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"F"),s("mi",null,"I"),s("mi",null,"R"),s("mi",null,"S"),s("mi",null,"T"),s("mo",{stretchy:"false"},"("),s("mi",null,"β"),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mo",{stretchy:"false"},"{"),s("mi",null,"α"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"β"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"a"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{stretchy:"false"},"}")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"i"),s("mi",null,"f"),s("mtext",null,"  "),s("mi",null,"β"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"ε"),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"h"),s("mi",null,"e"),s("mi",null,"n"),s("mtext",null,"  "),s("mi",null,"ε"),s("mo",null,"∈"),s("mi",null,"F"),s("mi",null,"I"),s("mi",null,"R"),s("mi",null,"S"),s("mi",null,"T"),s("mo",{stretchy:"false"},"("),s("mi",null,"β"),s("mo",{stretchy:"false"},")")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} G=(V_N,V_T,P,S)\\text{是一个文法}\\\\ \\beta\\in(V_N\\cup V_T)^*\\\\ FIRST(\\beta)=\\{\\alpha\\in V_T|\\beta\\Rightarrow^*a...\\}\\\\ if\\;\\beta\\Rightarrow^*\\varepsilon\\;then\\;\\varepsilon\\in FIRST(\\beta) \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"4.8em","vertical-align":"-2.15em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.65em"}},[s("span",{style:{top:"-4.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"G"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"P"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mclose"},")"),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是一个文法")])])]),s("span",{style:{top:"-3.61em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∪"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mclose"},[s("span",{class:"mclose"},")"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])]),s("span",{style:{top:"-2.41em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"I"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"RST"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord"},"..."),s("span",{class:"mclose"},"}")])]),s("span",{style:{top:"-1.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"ε"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"h"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"ε"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"I"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"RST"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mclose"},")")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.15em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),P=s("ul",null,[s("li",null,"计算")],-1),U=s("p",null,"![[First()计算 1.png]] ![[First()计算 2.png]] ![[First()计算 3.png]] ![[First()计算 4.png]] ![[First()计算 5.png]] //Todo 提取简练笔记",-1),C=s("h6",{id:"follow-sets",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#follow-sets","aria-hidden":"true"},"#"),a(" Follow Sets")],-1),K=s("ul",null,[s("li",null,"定义:")],-1),W=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"G"),s("mo",null,"="),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mo",{separator:"true"},","),s("mi",null,"P"),s("mo",{separator:"true"},","),s("mi",null,"S"),s("mo",{stretchy:"false"},")"),s("mtext",null,"是一个文法")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")])])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"F"),s("mi",null,"O"),s("mi",null,"L"),s("mi",null,"L"),s("mi",null,"O"),s("mi",null,"W"),s("mo",{stretchy:"false"},"("),s("mi",null,"A"),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mo",{stretchy:"false"},"{"),s("mi",null,"a"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"S"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",null,"A"),s("mi",null,"a"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{stretchy:"false"},"}"),s("mo",{separator:"true"},",")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"i"),s("mi",null,"f"),s("mtext",null,"  "),s("mi",null,"S"),s("mo",null,"⇒"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",null,"A"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"h"),s("mi",null,"e"),s("mi",null,"n"),s("mtext",null,"  "),s("mi",{mathvariant:"normal"},"$"),s("mo",null,"∈"),s("mi",null,"F"),s("mi",null,"O"),s("mi",null,"L"),s("mi",null,"L"),s("mi",null,"O"),s("mi",null,"W"),s("mo",{stretchy:"false"},"("),s("mi",null,"A"),s("mo",{stretchy:"false"},")")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",{mathvariant:"normal"},"$"),s("mtext",null,"是用来标记输入的终止的符号")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} G=(V_N,V_T,P,S)\\text{是一个文法}\\\\A\\in V_N\\\\ FOLLOW(A)=\\{a\\in V_T|S\\Rightarrow^*...Aa...\\},\\\\ if\\;S\\Rightarrow...A,\\;then\\;\\$\\in FOLLOW(A)\\\\ \\$是用来标记输入的终止的符号 \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"6em","vertical-align":"-2.75em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"3.25em"}},[s("span",{style:{top:"-5.41em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"G"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"P"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mclose"},")"),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是一个文法")])])]),s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"FO"),s("span",{class:"mord mathnormal"},"LL"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"O"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"W"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord"},"..."),s("span",{class:"mclose"},"}"),s("span",{class:"mpunct"},",")])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"⇒"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"h"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},"$"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"FO"),s("span",{class:"mord mathnormal"},"LL"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"O"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"W"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mclose"},")")])]),s("span",{style:{top:"-0.61em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"},"$"),s("span",{class:"mord cjk_fallback"},"是用来标记输入的终止的符号")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.75em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),Z=s("ul",null,[s("li",null,"计算: ![[Follow()计算 1.png]] ![[Follow()计算 2.png]]")],-1),D=s("h5",{id:"可空的非终止符-nullable-nonterminal",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#可空的非终止符-nullable-nonterminal","aria-hidden":"true"},"#"),a(" 可空的非终止符(nullable nonterminal)")],-1),$=s("ul",null,[s("li",null,[a("定义:"),s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mrow",null,[s("mi",null,"S"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"ε")]),s("annotation",{encoding:"application/x-tex"}," S\\Rightarrow^*\\varepsilon ")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7387em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7387em"}},[s("span",{style:{top:"-3.113em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"ε")])])])])])])],-1),q=s("p",null,"则称S是一个可空的非终止符",-1),H=s("ul",null,[s("li",null,"计算: ![[nullble set计算 1.png]] ![[nullble set计算 2.png]]")],-1),J=s("h5",{id:"判定ll-1-文法",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#判定ll-1-文法","aria-hidden":"true"},"#"),a(" 判定LL(1)文法")],-1),Q=s("ul",null,[s("li",null,"计算每个可空的非终止符"),s("li",null,[a("计算产生式右侧所有的"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"F"),s("mi",null,"I"),s("mi",null,"R"),s("mi",null,"S"),s("mi",null,"T"),s("mo",{stretchy:"false"},"("),s("mi",null,"α"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"FIRST(\\alpha)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"I"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"RST"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mclose"},")")])])]),a("并验证其两两交集是否为空")]),s("li",null,[a("计算(1)中算出的非终止符的"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"F"),s("mi",null,"O"),s("mi",null,"L"),s("mi",null,"L"),s("mi",null,"O"),s("mi",null,"W"),s("mo",{stretchy:"false"},"("),s("mi",null,"A"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"FOLLOW(A)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"FO"),s("span",{class:"mord mathnormal"},"LL"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"O"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"W"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mclose"},")")])])]),a("并验证"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"F"),s("mi",null,"I"),s("mi",null,"R"),s("mi",null,"S"),s("mi",null,"T"),s("mo",{stretchy:"false"},"("),s("mi",null,"A"),s("mo",{stretchy:"false"},")"),s("mo",null,"∩"),s("mi",null,"F"),s("mi",null,"O"),s("mi",null,"L"),s("mi",null,"L"),s("mi",null,"O"),s("mi",null,"W"),s("mo",{stretchy:"false"},"("),s("mi",null,"A"),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mi",{mathvariant:"normal"},"∅")]),s("annotation",{encoding:"application/x-tex"},"FIRST(A)\\cap FOLLOW(A)=\\varnothing")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"I"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"RST"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∩"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"FO"),s("span",{class:"mord mathnormal"},"LL"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"O"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"W"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6633em","vertical-align":"-0.0817em"}}),s("span",{class:"mord amsrm"},"∅")])])]),a(" ![[判断LL(1)示例.png]]")])],-1),ss=s("h5",{id:"非ll-1-到ll-1",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#非ll-1-到ll-1","aria-hidden":"true"},"#"),a(" 非LL(1)到LL(1)")],-1),as=s("ul",null,[s("li",null,"两种简单的非LL(1)情形:")],-1),ls=s("ol",null,[s("li",null,[a("左因子,例如"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"α"),s("mi",null,"β"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"α"),s("mi",null,"r")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\alpha \\beta|\\alpha r")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"r")])])]),a(",这是两个产生式的简写,其产生式交集为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"α")]),s("annotation",{encoding:"application/x-tex"},"\\alpha")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α")])])]),a(",改写方法为")])],-1),ts=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"α"),s("msub",null,[s("mi",null,"β"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"α"),s("msub",null,[s("mi",null,"β"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"α"),s("msub",null,[s("mi",null,"β"),s("mi",null,"n")]),s("mtext",null,"  "),s("mtext",null,"重写为"),s("mo",null,":")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"α"),s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")]),s("mspace",{width:"1em"}),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mo",null,"→"),s("msub",null,[s("mi",null,"β"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mi",null,"n")])])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} A\\rightarrow\\alpha\\beta_1|\\alpha\\beta_2|...|\\alpha\\beta_n\\;重写为:\\\\ A\\rightarrow\\alpha A{'}\\quad A^{'}\\rightarrow\\beta_1|\\beta_2|...|\\beta_n \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"2.5025em","vertical-align":"-1.0012em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.5012em"}},[s("span",{style:{top:"-3.6612em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord cjk_fallback"},"重写为"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},":")])]),s("span",{style:{top:"-2.3588em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},[s("span",{class:"mord"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7519em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"1em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.0012em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),ns=s("ol",{start:"2"},[s("li",null,[a("左递归,包括直接左递归和间接左递归,例如"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"β")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow A \\beta")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β")])])]),a("和"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"B"),s("mi",null,"β"),s("mspace",{width:"1em"}),s("mi",null,"B"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"α")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow B \\beta\\quad B\\rightarrow A\\alpha")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"Bβ"),s("span",{class:"mspace",style:{"margin-right":"1em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05017em"}},"B"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α")])])]),a(" 改写方法为")])],-1),ms=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"α"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"β"),s("mtext",null,"  "),s("mtext",null,"重写为:")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"β"),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mtext",null,"  "),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mo",null,"→"),s("mi",null,"α"),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"ε")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mtext",null,"一般情况为:")])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"A"),s("msub",null,[s("mi",null,"α"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"A"),s("msub",null,[s("mi",null,"α"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"A"),s("msub",null,[s("mi",null,"α"),s("mi",null,"m")]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mi",null,"n")]),s("mtext",null,"  "),s("mtext",null,"重写为:")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"β"),s("mn",null,"1")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mn",null,"2")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mi",null,"n")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])])])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mo",null,"→"),s("msub",null,[s("mi",null,"α"),s("mn",null,"1")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"α"),s("mn",null,"1")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"α"),s("mi",null,"m")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"ε")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} A\\rightarrow A \\alpha|\\beta\\;\\text{重写为:}\\\\ A\\rightarrow\\beta A^{'}\\; ,\\;A^{'}\\rightarrow\\alpha A^{'}|\\varepsilon\\\\ \\text{一般情况为:}\\\\ A\\rightarrow A \\alpha_1|A \\alpha_2|...|A \\alpha_m|\\beta_1|\\beta_2|...|\\beta_n\\; \\text{重写为:}\\\\ A\\rightarrow \\beta_1 A^{'}|\\beta_2 A^{'}|...|\\beta_n A^{'}\\\\ A^{'}\\rightarrow\\alpha_1 A^{'}|\\alpha_1 A^{'}|...|\\alpha_m A^{'}|\\varepsilon \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"7.5074em","vertical-align":"-3.5037em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"4.0037em"}},[s("span",{style:{top:"-6.1637em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"重写为:")])])]),s("span",{style:{top:"-4.8612em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"ε")])]),s("span",{style:{top:"-3.6612em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"一般情况为:")])])]),s("span",{style:{top:"-2.4612em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"m")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"重写为:")])])]),s("span",{style:{top:"-1.1588em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])])])]),s("span",{style:{top:"0.1437em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"m")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"ε")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"3.5037em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),es=l(`
  • 要注意:将这两者进行改写后并不能保证改写后的文法是LL(1),仍需要再进行验证

递归下降

输入
  • 非终止符号递归调用,终止符号匹配
int main(){
  Token token = getNextToken();
  S();/*S is the start symbol*/
  if(token!='$') throw error;
diff --git a/assets/1.html-cd53a16c.js b/assets/1.html-7f42b9fe.js
similarity index 90%
rename from assets/1.html-cd53a16c.js
rename to assets/1.html-7f42b9fe.js
index fa226b9d9..4b0bc60d4 100644
--- a/assets/1.html-cd53a16c.js
+++ b/assets/1.html-7f42b9fe.js
@@ -1 +1 @@
-import{_ as e}from"./plugin-vue_export-helper-c27b6911.js";import{o as a,c as r,f as t}from"./app-a9076d6c.js";const c={},h=t('

香蕉 1

标题 2

这里是内容。

标题 3

这里是内容。

',5),d=[h];function n(i,o){return a(),r("div",null,d)}const f=e(c,[["render",n],["__file","1.html.vue"]]);export{f as default}; +import{_ as e}from"./plugin-vue_export-helper-c27b6911.js";import{o as a,c as r,f as t}from"./app-c6e156cf.js";const c={},h=t('

香蕉 1

标题 2

这里是内容。

标题 3

这里是内容。

',5),d=[h];function n(i,o){return a(),r("div",null,d)}const f=e(c,[["render",n],["__file","1.html.vue"]]);export{f as default}; diff --git a/assets/1.html-2416d2fe.js b/assets/1.html-8d92ef9a.js similarity index 90% rename from assets/1.html-2416d2fe.js rename to assets/1.html-8d92ef9a.js index 3c0238b3f..60ea35a2b 100644 --- a/assets/1.html-2416d2fe.js +++ b/assets/1.html-8d92ef9a.js @@ -1 +1 @@ -import{_ as e}from"./plugin-vue_export-helper-c27b6911.js";import{o as a,c as n,f as t}from"./app-a9076d6c.js";const r={},h=t('

Banana 1

Heading 2

Here is the content.

Heading 3

Here is the content.

',5),i=[h];function d(c,o){return a(),n("div",null,i)}const f=e(r,[["render",d],["__file","1.html.vue"]]);export{f as default}; +import{_ as e}from"./plugin-vue_export-helper-c27b6911.js";import{o as a,c as n,f as t}from"./app-c6e156cf.js";const r={},h=t('

Banana 1

Heading 2

Here is the content.

Heading 3

Here is the content.

',5),i=[h];function d(c,o){return a(),n("div",null,i)}const f=e(r,[["render",d],["__file","1.html.vue"]]);export{f as default}; diff --git a/assets/2.html-488d8f8b.js b/assets/2.html-24f2a0a4.js similarity index 92% rename from assets/2.html-488d8f8b.js rename to assets/2.html-24f2a0a4.js index e19053616..04f626cbd 100644 --- a/assets/2.html-488d8f8b.js +++ b/assets/2.html-24f2a0a4.js @@ -1 +1 @@ -import{_ as t}from"./plugin-vue_export-helper-c27b6911.js";import{o as n,c as r,e as d,a as e,b as a}from"./app-a9076d6c.js";const o={},i=e("h1",{id:"apple-2",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#apple-2","aria-hidden":"true"},"#"),a(" Apple 2")],-1),s=e("p",null,"A apple article being stared.",-1),c=e("h2",{id:"heading-2",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#heading-2","aria-hidden":"true"},"#"),a(" Heading 2")],-1),h=e("p",null,"Here is the content.",-1),_=e("h3",{id:"heading-3",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#heading-3","aria-hidden":"true"},"#"),a(" Heading 3")],-1),l=e("p",null,"Here is the content.",-1);function p(f,m){return n(),r("div",null,[i,s,d(" more "),c,h,_,l])}const x=t(o,[["render",p],["__file","2.html.vue"]]);export{x as default}; +import{_ as t}from"./plugin-vue_export-helper-c27b6911.js";import{o as n,c as r,e as d,a as e,b as a}from"./app-c6e156cf.js";const o={},i=e("h1",{id:"apple-2",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#apple-2","aria-hidden":"true"},"#"),a(" Apple 2")],-1),s=e("p",null,"A apple article being stared.",-1),c=e("h2",{id:"heading-2",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#heading-2","aria-hidden":"true"},"#"),a(" Heading 2")],-1),h=e("p",null,"Here is the content.",-1),_=e("h3",{id:"heading-3",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#heading-3","aria-hidden":"true"},"#"),a(" Heading 3")],-1),l=e("p",null,"Here is the content.",-1);function p(f,m){return n(),r("div",null,[i,s,d(" more "),c,h,_,l])}const x=t(o,[["render",p],["__file","2.html.vue"]]);export{x as default}; diff --git a/assets/2.html-19370382.js b/assets/2.html-666fc187.js similarity index 92% rename from assets/2.html-19370382.js rename to assets/2.html-666fc187.js index 89c418bdf..daa3746c2 100644 --- a/assets/2.html-19370382.js +++ b/assets/2.html-666fc187.js @@ -1 +1 @@ -import{_ as n}from"./plugin-vue_export-helper-c27b6911.js";import{o as t,c as r,e as d,a as e,b as a}from"./app-a9076d6c.js";const o={},i=e("h1",{id:"banana-2",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#banana-2","aria-hidden":"true"},"#"),a(" Banana 2")],-1),s=e("p",null,[a("A banana article being stared with number "),e("code",null,"10"),a(".")],-1),c=e("h2",{id:"heading-2",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#heading-2","aria-hidden":"true"},"#"),a(" Heading 2")],-1),h=e("p",null,"Here is the content.",-1),_=e("h3",{id:"heading-3",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#heading-3","aria-hidden":"true"},"#"),a(" Heading 3")],-1),l=e("p",null,"Here is the content.",-1);function u(m,f){return t(),r("div",null,[i,s,d(" more "),c,h,_,l])}const g=n(o,[["render",u],["__file","2.html.vue"]]);export{g as default}; +import{_ as n}from"./plugin-vue_export-helper-c27b6911.js";import{o as t,c as r,e as d,a as e,b as a}from"./app-c6e156cf.js";const o={},i=e("h1",{id:"banana-2",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#banana-2","aria-hidden":"true"},"#"),a(" Banana 2")],-1),s=e("p",null,[a("A banana article being stared with number "),e("code",null,"10"),a(".")],-1),c=e("h2",{id:"heading-2",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#heading-2","aria-hidden":"true"},"#"),a(" Heading 2")],-1),h=e("p",null,"Here is the content.",-1),_=e("h3",{id:"heading-3",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#heading-3","aria-hidden":"true"},"#"),a(" Heading 3")],-1),l=e("p",null,"Here is the content.",-1);function u(m,f){return t(),r("div",null,[i,s,d(" more "),c,h,_,l])}const g=n(o,[["render",u],["__file","2.html.vue"]]);export{g as default}; diff --git a/assets/2.html-915d33a0.js b/assets/2.html-afc6b7a8.js similarity index 92% rename from assets/2.html-915d33a0.js rename to assets/2.html-afc6b7a8.js index 170dc8a79..d3ae1238a 100644 --- a/assets/2.html-915d33a0.js +++ b/assets/2.html-afc6b7a8.js @@ -1 +1 @@ -import{_ as t}from"./plugin-vue_export-helper-c27b6911.js";import{o,c as r,e as n,a as e,b as a}from"./app-a9076d6c.js";const s={},c=e("h1",{id:"香蕉-2",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#香蕉-2","aria-hidden":"true"},"#"),a(" 香蕉 2")],-1),d=e("p",null,[a("一个被数字 "),e("code",null,"10"),a(" 星标了的香蕉文章。")],-1),_=e("h2",{id:"标题-2",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#标题-2","aria-hidden":"true"},"#"),a(" 标题 2")],-1),h=e("p",null,"这里是内容。",-1),i=e("h3",{id:"标题-3",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#标题-3","aria-hidden":"true"},"#"),a(" 标题 3")],-1),l=e("p",null,"这里是内容。",-1);function u(f,m){return o(),r("div",null,[c,d,n(" more "),_,h,i,l])}const b=t(s,[["render",u],["__file","2.html.vue"]]);export{b as default}; +import{_ as t}from"./plugin-vue_export-helper-c27b6911.js";import{o,c as r,e as n,a as e,b as a}from"./app-c6e156cf.js";const s={},c=e("h1",{id:"香蕉-2",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#香蕉-2","aria-hidden":"true"},"#"),a(" 香蕉 2")],-1),d=e("p",null,[a("一个被数字 "),e("code",null,"10"),a(" 星标了的香蕉文章。")],-1),_=e("h2",{id:"标题-2",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#标题-2","aria-hidden":"true"},"#"),a(" 标题 2")],-1),h=e("p",null,"这里是内容。",-1),i=e("h3",{id:"标题-3",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#标题-3","aria-hidden":"true"},"#"),a(" 标题 3")],-1),l=e("p",null,"这里是内容。",-1);function u(f,m){return o(),r("div",null,[c,d,n(" more "),_,h,i,l])}const b=t(s,[["render",u],["__file","2.html.vue"]]);export{b as default}; diff --git a/assets/3.html-f650b539.js b/assets/3.html-479a173d.js similarity index 90% rename from assets/3.html-f650b539.js rename to assets/3.html-479a173d.js index ee254d095..165195666 100644 --- a/assets/3.html-f650b539.js +++ b/assets/3.html-479a173d.js @@ -1 +1 @@ -import{_ as e}from"./plugin-vue_export-helper-c27b6911.js";import{o as a,c as r,f as t}from"./app-a9076d6c.js";const c={},h=t('

香蕉 3

标题 2

这里是内容。

标题 3

这里是内容。

',5),d=[h];function n(i,o){return a(),r("div",null,d)}const f=e(c,[["render",n],["__file","3.html.vue"]]);export{f as default}; +import{_ as e}from"./plugin-vue_export-helper-c27b6911.js";import{o as a,c as r,f as t}from"./app-c6e156cf.js";const c={},h=t('

香蕉 3

标题 2

这里是内容。

标题 3

这里是内容。

',5),d=[h];function n(i,o){return a(),r("div",null,d)}const f=e(c,[["render",n],["__file","3.html.vue"]]);export{f as default}; diff --git a/assets/3.html-c006d8db.js b/assets/3.html-727ef523.js similarity index 90% rename from assets/3.html-c006d8db.js rename to assets/3.html-727ef523.js index 1cc39c2aa..72e5b41b4 100644 --- a/assets/3.html-c006d8db.js +++ b/assets/3.html-727ef523.js @@ -1 +1 @@ -import{_ as e}from"./plugin-vue_export-helper-c27b6911.js";import{o as a,c as t,f as n}from"./app-a9076d6c.js";const r={},h=n('

Apple 3

Heading 2

Here is the content.

Heading 3

Here is the content.

',5),i=[h];function d(c,o){return a(),t("div",null,i)}const l=e(r,[["render",d],["__file","3.html.vue"]]);export{l as default}; +import{_ as e}from"./plugin-vue_export-helper-c27b6911.js";import{o as a,c as t,f as n}from"./app-c6e156cf.js";const r={},h=n('

Apple 3

Heading 2

Here is the content.

Heading 3

Here is the content.

',5),i=[h];function d(c,o){return a(),t("div",null,i)}const l=e(r,[["render",d],["__file","3.html.vue"]]);export{l as default}; diff --git a/assets/3.html-39cf9146.js b/assets/3.html-79c2e26f.js similarity index 90% rename from assets/3.html-39cf9146.js rename to assets/3.html-79c2e26f.js index 83808e26f..b55ab1f7a 100644 --- a/assets/3.html-39cf9146.js +++ b/assets/3.html-79c2e26f.js @@ -1 +1 @@ -import{_ as e}from"./plugin-vue_export-helper-c27b6911.js";import{o as a,c as n,f as t}from"./app-a9076d6c.js";const r={},h=t('

Banana 3

Heading 2

Here is the content.

Heading 3

Here is the content.

',5),i=[h];function d(c,o){return a(),n("div",null,i)}const f=e(r,[["render",d],["__file","3.html.vue"]]);export{f as default}; +import{_ as e}from"./plugin-vue_export-helper-c27b6911.js";import{o as a,c as n,f as t}from"./app-c6e156cf.js";const r={},h=t('

Banana 3

Heading 2

Here is the content.

Heading 3

Here is the content.

',5),i=[h];function d(c,o){return a(),n("div",null,i)}const f=e(r,[["render",d],["__file","3.html.vue"]]);export{f as default}; diff --git a/assets/4.html-b6ef9822.js b/assets/4.html-538c2896.js similarity index 90% rename from assets/4.html-b6ef9822.js rename to assets/4.html-538c2896.js index 4ccb0552a..0e0c66a37 100644 --- a/assets/4.html-b6ef9822.js +++ b/assets/4.html-538c2896.js @@ -1 +1 @@ -import{_ as e}from"./plugin-vue_export-helper-c27b6911.js";import{o as a,c as r,f as t}from"./app-a9076d6c.js";const c={},h=t('

香蕉 4

标题 2

这里是内容。

标题 3

这里是内容。

',5),d=[h];function n(i,o){return a(),r("div",null,d)}const f=e(c,[["render",n],["__file","4.html.vue"]]);export{f as default}; +import{_ as e}from"./plugin-vue_export-helper-c27b6911.js";import{o as a,c as r,f as t}from"./app-c6e156cf.js";const c={},h=t('

香蕉 4

标题 2

这里是内容。

标题 3

这里是内容。

',5),d=[h];function n(i,o){return a(),r("div",null,d)}const f=e(c,[["render",n],["__file","4.html.vue"]]);export{f as default}; diff --git a/assets/4.html-37c75e02.js b/assets/4.html-68f7b9c6.js similarity index 90% rename from assets/4.html-37c75e02.js rename to assets/4.html-68f7b9c6.js index c656fdb33..40f9e630d 100644 --- a/assets/4.html-37c75e02.js +++ b/assets/4.html-68f7b9c6.js @@ -1 +1 @@ -import{_ as e}from"./plugin-vue_export-helper-c27b6911.js";import{o as a,c as t,f as n}from"./app-a9076d6c.js";const r={},h=n('

Apple 4

Heading 2

Here is the content.

Heading 3

Here is the content.

',5),i=[h];function d(c,o){return a(),t("div",null,i)}const l=e(r,[["render",d],["__file","4.html.vue"]]);export{l as default}; +import{_ as e}from"./plugin-vue_export-helper-c27b6911.js";import{o as a,c as t,f as n}from"./app-c6e156cf.js";const r={},h=n('

Apple 4

Heading 2

Here is the content.

Heading 3

Here is the content.

',5),i=[h];function d(c,o){return a(),t("div",null,i)}const l=e(r,[["render",d],["__file","4.html.vue"]]);export{l as default}; diff --git a/assets/4.html-09e424e6.js b/assets/4.html-a3ba8fe8.js similarity index 90% rename from assets/4.html-09e424e6.js rename to assets/4.html-a3ba8fe8.js index ddefb3bea..263fa8ceb 100644 --- a/assets/4.html-09e424e6.js +++ b/assets/4.html-a3ba8fe8.js @@ -1 +1 @@ -import{_ as e}from"./plugin-vue_export-helper-c27b6911.js";import{o as a,c as n,f as t}from"./app-a9076d6c.js";const r={},h=t('

Banana 4

Heading 2

Here is the content.

Heading 3

Here is the content.

',5),i=[h];function d(c,o){return a(),n("div",null,i)}const f=e(r,[["render",d],["__file","4.html.vue"]]);export{f as default}; +import{_ as e}from"./plugin-vue_export-helper-c27b6911.js";import{o as a,c as n,f as t}from"./app-c6e156cf.js";const r={},h=t('

Banana 4

Heading 2

Here is the content.

Heading 3

Here is the content.

',5),i=[h];function d(c,o){return a(),n("div",null,i)}const f=e(r,[["render",d],["__file","4.html.vue"]]);export{f as default}; diff --git a/assets/404.html-211a4153.js b/assets/404.html-c419a746.js similarity index 71% rename from assets/404.html-211a4153.js rename to assets/404.html-c419a746.js index d7e117853..c1d6d4aa7 100644 --- a/assets/404.html-211a4153.js +++ b/assets/404.html-c419a746.js @@ -1 +1 @@ -import{_ as e}from"./plugin-vue_export-helper-c27b6911.js";import{o as t,c}from"./app-a9076d6c.js";const o={};function r(_,n){return t(),c("div")}const f=e(o,[["render",r],["__file","404.html.vue"]]);export{f as default}; +import{_ as e}from"./plugin-vue_export-helper-c27b6911.js";import{o as t,c}from"./app-c6e156cf.js";const o={};function r(_,n){return t(),c("div")}const f=e(o,[["render",r],["__file","404.html.vue"]]);export{f as default}; diff --git "a/assets/Chapter0 \345\211\215\350\250\200.html-9276126a.js" "b/assets/Chapter0 \345\211\215\350\250\200.html-abfc2045.js" similarity index 96% rename from "assets/Chapter0 \345\211\215\350\250\200.html-9276126a.js" rename to "assets/Chapter0 \345\211\215\350\250\200.html-abfc2045.js" index f5d5968df..00770a337 100644 --- "a/assets/Chapter0 \345\211\215\350\250\200.html-9276126a.js" +++ "b/assets/Chapter0 \345\211\215\350\250\200.html-abfc2045.js" @@ -1 +1 @@ -import{_ as e}from"./plugin-vue_export-helper-c27b6911.js";import{o as a,c as r,f as c}from"./app-a9076d6c.js";const o={},t=c('

前言

写给华工软院学生

  1. 2021级编译原理考试难度较低,复习优先级低,不建议花太多时间准备。虽然根据老师不同(以徐老师为例),可能上课的内容比较深入,让学生产生了这门科目难度很大的错觉。诚然要彻底理解编译原理需要花费大量的时间,但考试内容基本都是简单的算法,只要把几个重要算法理解了,都不需要把每个概念搞的非常清楚,考试都基本不会出问题。
  2. 编译原理博大精深,作为计算机底层设计的一部分,课堂上教授的内容少之又少,甚至可以说和一些工程实践是严重脱钩的,比如上课会花很大的精力教你自动机和自动机的相关算法,但是在实际工程运用中,我们有诸如 lexer 的工具帮我们完成这个工作,而且如果是编写一个简单的词法分析器,甚至只需要简单的 最长字串匹配 就能实现一个词法分析。仅凭课堂上学的内容,大概率连怎么写一个 TinyC(精简版的C语言) 都不知道。感兴趣的同学可以认真钻研一番,这对编程能力会有极大的提高。

写给全体

1.本系列笔记是对自己大学生活的记录,不保证能记录下所有知识点,仅供同学们学习参考。

',5),d=[t];function i(h,n){return a(),r("div",null,d)}const _=e(o,[["render",i],["__file","Chapter0 前言.html.vue"]]);export{_ as default}; +import{_ as e}from"./plugin-vue_export-helper-c27b6911.js";import{o as a,c as r,f as c}from"./app-c6e156cf.js";const o={},t=c('

前言

写给华工软院学生

  1. 2021级编译原理考试难度较低,复习优先级低,不建议花太多时间准备。虽然根据老师不同(以徐老师为例),可能上课的内容比较深入,让学生产生了这门科目难度很大的错觉。诚然要彻底理解编译原理需要花费大量的时间,但考试内容基本都是简单的算法,只要把几个重要算法理解了,都不需要把每个概念搞的非常清楚,考试都基本不会出问题。
  2. 编译原理博大精深,作为计算机底层设计的一部分,课堂上教授的内容少之又少,甚至可以说和一些工程实践是严重脱钩的,比如上课会花很大的精力教你自动机和自动机的相关算法,但是在实际工程运用中,我们有诸如 lexer 的工具帮我们完成这个工作,而且如果是编写一个简单的词法分析器,甚至只需要简单的 最长字串匹配 就能实现一个词法分析。仅凭课堂上学的内容,大概率连怎么写一个 TinyC(精简版的C语言) 都不知道。感兴趣的同学可以认真钻研一番,这对编程能力会有极大的提高。

写给全体

1.本系列笔记是对自己大学生活的记录,不保证能记录下所有知识点,仅供同学们学习参考。

',5),d=[t];function i(h,n){return a(),r("div",null,d)}const _=e(o,[["render",i],["__file","Chapter0 前言.html.vue"]]);export{_ as default}; diff --git "a/assets/Chapter1 \347\274\226\350\257\221\345\231\250\347\273\204\346\210\220.html-6396b848.js" "b/assets/Chapter1 \347\274\226\350\257\221\345\231\250\347\273\204\346\210\220.html-abab28d5.js" similarity index 98% rename from "assets/Chapter1 \347\274\226\350\257\221\345\231\250\347\273\204\346\210\220.html-6396b848.js" rename to "assets/Chapter1 \347\274\226\350\257\221\345\231\250\347\273\204\346\210\220.html-abab28d5.js" index a09afbf78..7b53a96e5 100644 --- "a/assets/Chapter1 \347\274\226\350\257\221\345\231\250\347\273\204\346\210\220.html-6396b848.js" +++ "b/assets/Chapter1 \347\274\226\350\257\221\345\231\250\347\273\204\346\210\220.html-abab28d5.js" @@ -1 +1 @@ -import{_ as s}from"./plugin-vue_export-helper-c27b6911.js";import{o as n,c as e,f as l,a}from"./app-a9076d6c.js";const m={},t=l('

Chapter1 编译器组成

编译器的结构

  • 词法分析Lexical analysis (Scanning)
  • 语法分析Syntax analysis (Parsing)
  • 语义分析 Semantic analysis

相关信息

以上三步的目的是通过分析输入代码,生成能被统一处理的中间层代码,亦即编译器前端(front-end)

  • 中间代码生成 IR Generation
  • 中间代码优化 IR Optimization
  • 最终代码生成 Generation
  • 最终代码优化 Optimization
',5),r=a("p",{class:"katex-block"},[a("span",{class:"katex-display"},[a("span",{class:"katex"},[a("span",{class:"katex-mathml"},[a("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[a("semantics",null,[a("mrow",null,[a("mi",null,"C"),a("mo",{stretchy:"false"},"("),a("mtext",null,"源代码"),a("mo",{stretchy:"false"},")"),a("mo",null,"→"),a("mi",null,"T"),a("mi",null,"A"),a("mi",null,"C"),a("mo",{stretchy:"false"},"("),a("mi",null,"T"),a("mi",null,"h"),a("mi",null,"r"),a("mi",null,"e"),a("mi",null,"e"),a("mi",null,"A"),a("mi",null,"d"),a("mi",null,"d"),a("mi",null,"r"),a("mi",null,"e"),a("mi",null,"s"),a("mi",null,"s"),a("mi",null,"C"),a("mi",null,"o"),a("mi",null,"d"),a("mi",null,"e"),a("mo",{stretchy:"false"},")"),a("mtext",null,"中间("),a("mi",null,"i"),a("mi",null,"n"),a("mi",null,"t"),a("mi",null,"e"),a("mi",null,"r"),a("mi",null,"m"),a("mi",null,"e"),a("mi",null,"d"),a("mi",null,"i"),a("mi",null,"a"),a("mi",null,"t"),a("mi",null,"e"),a("mtext",null,")码"),a("mo",null,"→"),a("mtext",null,"机器码")]),a("annotation",{encoding:"application/x-tex"}," C(源代码)\\rightarrow TAC(Three Address Code)中间(intermediate)码\\rightarrow 机器码 ")])])]),a("span",{class:"katex-html","aria-hidden":"true"},[a("span",{class:"base"},[a("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),a("span",{class:"mord mathnormal",style:{"margin-right":"0.07153em"}},"C"),a("span",{class:"mopen"},"("),a("span",{class:"mord cjk_fallback"},"源代码"),a("span",{class:"mclose"},")"),a("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),a("span",{class:"mrel"},"→"),a("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),a("span",{class:"base"},[a("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),a("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T"),a("span",{class:"mord mathnormal"},"A"),a("span",{class:"mord mathnormal",style:{"margin-right":"0.07153em"}},"C"),a("span",{class:"mopen"},"("),a("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T"),a("span",{class:"mord mathnormal"},"h"),a("span",{class:"mord mathnormal"},"ree"),a("span",{class:"mord mathnormal"},"A"),a("span",{class:"mord mathnormal"},"dd"),a("span",{class:"mord mathnormal"},"ress"),a("span",{class:"mord mathnormal",style:{"margin-right":"0.07153em"}},"C"),a("span",{class:"mord mathnormal"},"o"),a("span",{class:"mord mathnormal"},"d"),a("span",{class:"mord mathnormal"},"e"),a("span",{class:"mclose"},")"),a("span",{class:"mord cjk_fallback"},"中间("),a("span",{class:"mord mathnormal"},"in"),a("span",{class:"mord mathnormal"},"t"),a("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),a("span",{class:"mord mathnormal"},"m"),a("span",{class:"mord mathnormal"},"e"),a("span",{class:"mord mathnormal"},"d"),a("span",{class:"mord mathnormal"},"ia"),a("span",{class:"mord mathnormal"},"t"),a("span",{class:"mord mathnormal"},"e"),a("span",{class:"mord cjk_fallback"},")码"),a("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),a("span",{class:"mrel"},"→"),a("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),a("span",{class:"base"},[a("span",{class:"strut",style:{height:"0.6833em"}}),a("span",{class:"mord cjk_fallback"},"机器码")])])])])],-1),i=l('

词法分析

  • 本质上就是为了输出一个合法的token序列,每个token就是一个关键词或者一个关键词+词素(lexeme)的组合如$$\\begin{array}{c}T_While\\quad 关键词\\ T_Identifier ;;x \\quad 关键词+词素\\end{array}$$

语法分析

  • 就是将一个token序列表示为一棵语法树

语义分析

  • 就是将语法分析得到的语法树转化为一个带注解(annotated)的语法树

中间代码生成

  • 从语法树生成通用的中间代码
',8),c=[t,r,i];function o(h,d){return n(),e("div",null,c)}const g=s(m,[["render",o],["__file","Chapter1 编译器组成.html.vue"]]);export{g as default}; +import{_ as s}from"./plugin-vue_export-helper-c27b6911.js";import{o as n,c as e,f as l,a}from"./app-c6e156cf.js";const m={},t=l('

Chapter1 编译器组成

编译器的结构

  • 词法分析Lexical analysis (Scanning)
  • 语法分析Syntax analysis (Parsing)
  • 语义分析 Semantic analysis

相关信息

以上三步的目的是通过分析输入代码,生成能被统一处理的中间层代码,亦即编译器前端(front-end)

  • 中间代码生成 IR Generation
  • 中间代码优化 IR Optimization
  • 最终代码生成 Generation
  • 最终代码优化 Optimization
',5),r=a("p",{class:"katex-block"},[a("span",{class:"katex-display"},[a("span",{class:"katex"},[a("span",{class:"katex-mathml"},[a("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[a("semantics",null,[a("mrow",null,[a("mi",null,"C"),a("mo",{stretchy:"false"},"("),a("mtext",null,"源代码"),a("mo",{stretchy:"false"},")"),a("mo",null,"→"),a("mi",null,"T"),a("mi",null,"A"),a("mi",null,"C"),a("mo",{stretchy:"false"},"("),a("mi",null,"T"),a("mi",null,"h"),a("mi",null,"r"),a("mi",null,"e"),a("mi",null,"e"),a("mi",null,"A"),a("mi",null,"d"),a("mi",null,"d"),a("mi",null,"r"),a("mi",null,"e"),a("mi",null,"s"),a("mi",null,"s"),a("mi",null,"C"),a("mi",null,"o"),a("mi",null,"d"),a("mi",null,"e"),a("mo",{stretchy:"false"},")"),a("mtext",null,"中间("),a("mi",null,"i"),a("mi",null,"n"),a("mi",null,"t"),a("mi",null,"e"),a("mi",null,"r"),a("mi",null,"m"),a("mi",null,"e"),a("mi",null,"d"),a("mi",null,"i"),a("mi",null,"a"),a("mi",null,"t"),a("mi",null,"e"),a("mtext",null,")码"),a("mo",null,"→"),a("mtext",null,"机器码")]),a("annotation",{encoding:"application/x-tex"}," C(源代码)\\rightarrow TAC(Three Address Code)中间(intermediate)码\\rightarrow 机器码 ")])])]),a("span",{class:"katex-html","aria-hidden":"true"},[a("span",{class:"base"},[a("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),a("span",{class:"mord mathnormal",style:{"margin-right":"0.07153em"}},"C"),a("span",{class:"mopen"},"("),a("span",{class:"mord cjk_fallback"},"源代码"),a("span",{class:"mclose"},")"),a("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),a("span",{class:"mrel"},"→"),a("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),a("span",{class:"base"},[a("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),a("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T"),a("span",{class:"mord mathnormal"},"A"),a("span",{class:"mord mathnormal",style:{"margin-right":"0.07153em"}},"C"),a("span",{class:"mopen"},"("),a("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T"),a("span",{class:"mord mathnormal"},"h"),a("span",{class:"mord mathnormal"},"ree"),a("span",{class:"mord mathnormal"},"A"),a("span",{class:"mord mathnormal"},"dd"),a("span",{class:"mord mathnormal"},"ress"),a("span",{class:"mord mathnormal",style:{"margin-right":"0.07153em"}},"C"),a("span",{class:"mord mathnormal"},"o"),a("span",{class:"mord mathnormal"},"d"),a("span",{class:"mord mathnormal"},"e"),a("span",{class:"mclose"},")"),a("span",{class:"mord cjk_fallback"},"中间("),a("span",{class:"mord mathnormal"},"in"),a("span",{class:"mord mathnormal"},"t"),a("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),a("span",{class:"mord mathnormal"},"m"),a("span",{class:"mord mathnormal"},"e"),a("span",{class:"mord mathnormal"},"d"),a("span",{class:"mord mathnormal"},"ia"),a("span",{class:"mord mathnormal"},"t"),a("span",{class:"mord mathnormal"},"e"),a("span",{class:"mord cjk_fallback"},")码"),a("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),a("span",{class:"mrel"},"→"),a("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),a("span",{class:"base"},[a("span",{class:"strut",style:{height:"0.6833em"}}),a("span",{class:"mord cjk_fallback"},"机器码")])])])])],-1),i=l('

词法分析

  • 本质上就是为了输出一个合法的token序列,每个token就是一个关键词或者一个关键词+词素(lexeme)的组合如$$\\begin{array}{c}T_While\\quad 关键词\\ T_Identifier ;;x \\quad 关键词+词素\\end{array}$$

语法分析

  • 就是将一个token序列表示为一棵语法树

语义分析

  • 就是将语法分析得到的语法树转化为一个带注解(annotated)的语法树

中间代码生成

  • 从语法树生成通用的中间代码
',8),c=[t,r,i];function o(h,d){return n(),e("div",null,c)}const g=s(m,[["render",o],["__file","Chapter1 编译器组成.html.vue"]]);export{g as default}; diff --git "a/assets/Chapter2 \350\257\215\346\263\225\345\210\206\346\236\220.html-132355fc.js" "b/assets/Chapter2 \350\257\215\346\263\225\345\210\206\346\236\220.html-cb683558.js" similarity index 99% rename from "assets/Chapter2 \350\257\215\346\263\225\345\210\206\346\236\220.html-132355fc.js" rename to "assets/Chapter2 \350\257\215\346\263\225\345\210\206\346\236\220.html-cb683558.js" index b04ac1b5e..a81be828f 100644 --- "a/assets/Chapter2 \350\257\215\346\263\225\345\210\206\346\236\220.html-132355fc.js" +++ "b/assets/Chapter2 \350\257\215\346\263\225\345\210\206\346\236\220.html-cb683558.js" @@ -1,4 +1,4 @@ -import{_ as n}from"./plugin-vue_export-helper-c27b6911.js";import{o as t,c as m,f as l,a as s,b as a}from"./app-a9076d6c.js";const e="/assets/images/编译原理/词法分析/扫描过程图示.png",i="/assets/images/编译原理/词法分析/子表达式NFA1.png",r="/assets/images/编译原理/词法分析/子表达式NFA3.png",p="/assets/images/编译原理/词法分析/子表达式NFA4.png",c="/assets/images/编译原理/词法分析/子表达式NFA5.png",h="/assets/images/编译原理/词法分析/NFA2DFA.png",o="/assets/images/编译原理/词法分析/NFA2DFA2.png",u="/assets/images/编译原理/词法分析/最小化DFA.png",g={},d=l(`

Chapter2 词法分析

大纲

  • 扫描过程 Scanning Process
  • 正则表达式 Regular Expressions
  • 有限自动机 Finite Automata(NFA(nondeterministic 非确定性有限自动机) and DFA(deterministic 确定性))
  • RE转换NFA(McNaughton-Yamda-Thompson algorithm)
  • NFA 转换DFA(子集算法 Subset construction Algorithm)
  • 最小化DFA(State-Minimization Algorithm)

扫描过程

 while(137<n) 
+import{_ as n}from"./plugin-vue_export-helper-c27b6911.js";import{o as t,c as m,f as l,a as s,b as a}from"./app-c6e156cf.js";const e="/assets/images/编译原理/词法分析/扫描过程图示.png",i="/assets/images/编译原理/词法分析/子表达式NFA1.png",r="/assets/images/编译原理/词法分析/子表达式NFA3.png",p="/assets/images/编译原理/词法分析/子表达式NFA4.png",c="/assets/images/编译原理/词法分析/子表达式NFA5.png",h="/assets/images/编译原理/词法分析/NFA2DFA.png",o="/assets/images/编译原理/词法分析/NFA2DFA2.png",u="/assets/images/编译原理/词法分析/最小化DFA.png",g={},d=l(`

Chapter2 词法分析

大纲

  • 扫描过程 Scanning Process
  • 正则表达式 Regular Expressions
  • 有限自动机 Finite Automata(NFA(nondeterministic 非确定性有限自动机) and DFA(deterministic 确定性))
  • RE转换NFA(McNaughton-Yamda-Thompson algorithm)
  • NFA 转换DFA(子集算法 Subset construction Algorithm)
  • 最小化DFA(State-Minimization Algorithm)

扫描过程

 while(137<n) 
   ++i;
 
`,5),y=s("p",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",null,"→"),s("mi",null,"T"),s("mi",{mathvariant:"normal"},"_"),s("mi",null,"w"),s("mi",null,"h"),s("mi",null,"i"),s("mi",null,"l"),s("mi",null,"e"),s("mo",null,"→"),s("mo",{stretchy:"false"},"("),s("mo",null,"→"),s("mi",null,"T"),s("mi",{mathvariant:"normal"},"_"),s("mi",null,"I"),s("mi",null,"n"),s("mi",null,"t"),s("mi",null,"C"),s("mi",null,"o"),s("mi",null,"n"),s("mi",null,"s"),s("mi",null,"t"),s("mo",null,"+"),s("mn",null,"137"),s("mo",null,"→"),s("mo",null,"<"),s("mo",{separator:"true"},"⋅"),s("mo",{separator:"true"},"⋅"),s("mo",{separator:"true"},"⋅"),s("mo",{separator:"true"},"⋅"),s("mo",{separator:"true"},"⋅")]),s("annotation",{encoding:"application/x-tex"},"\\rightarrow T\\_while \\rightarrow( \\rightarrow T\\_IntConst+137\\rightarrow<·····")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.3669em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1.0044em","vertical-align":"-0.31em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T"),s("span",{class:"mord",style:{"margin-right":"0.02778em"}},"_"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02691em"}},"w"),s("span",{class:"mord mathnormal"},"hi"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9933em","vertical-align":"-0.31em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T"),s("span",{class:"mord",style:{"margin-right":"0.02778em"}},"_"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"I"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07153em"}},"tC"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"+"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6835em","vertical-align":"-0.0391em"}}),s("span",{class:"mord"},"137"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→<")]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4445em"}}),s("span",{class:"mpunct"},"⋅⋅⋅⋅⋅")])])])],-1),x=s("figure",null,[s("img",{src:e,alt:"扫描过程图示",tabindex:"0",loading:"lazy"}),s("figcaption",null,"扫描过程图示")],-1),v=s("h3",{id:"词元-tokens",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#词元-tokens","aria-hidden":"true"},"#"),a(" 词元(tokens)")],-1),w=s("ul",null,[s("li",null,[a("一个token表示源代码中的一个逻辑语义片段,可以是一个关键字、一个变量名,以"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",null,"<"),s("mi",null,"t"),s("mi",null,"o"),s("mi",null,"k"),s("mi",null,"e"),s("mi",null,"n"),s("mi",{mathvariant:"normal"},"_"),s("mi",null,"t"),s("mi",null,"y"),s("mi",null,"p"),s("mi",null,"e"),s("mo",{separator:"true"},","),s("mi",null,"l"),s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"e"),s("mi",null,"m"),s("mi",null,"e"),s("mo",null,">")]),s("annotation",{encoding:"application/x-tex"},"")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.5782em","vertical-align":"-0.0391em"}}),s("span",{class:"mrel"},"<"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1.0044em","vertical-align":"-0.31em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.03148em"}},"k"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mord",style:{"margin-right":"0.02778em"}},"_"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.03588em"}},"y"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},">")])])]),a("表示")]),s("li",null,"token表示一组符合特定规则的字符,例如标识符必须以字母开头并只包含字母和数字"),s("li",null,[a("每个token关联一个词素(lexeme) "),s("ul",null,[s("li",null,"lexeme即为token的字面值,如“137”,”int“等")])]),s("li",null,[a("每个token可能有属性(attributes) "),s("ul",null,[s("li",null,[a("从字面值中得到的额外信息,一般是一个数值,如"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mn",null,"137"),s("mo",null,"→"),s("mo",null,"<"),s("mi",null,"T"),s("mi",{mathvariant:"normal"},"_"),s("mi",null,"I"),s("mi",null,"n"),s("mi",null,"t"),s("mi",null,"C"),s("mi",null,"o"),s("mi",null,"n"),s("mi",null,"s"),s("mi",null,"t"),s("mo",{separator:"true"},","),s("mn",null,"137"),s("mo",null,">")]),s("annotation",{encoding:"application/x-tex"},"137\\rightarrow ")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6835em","vertical-align":"-0.0391em"}}),s("span",{class:"mord"},"137"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→<"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9933em","vertical-align":"-0.31em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T"),s("span",{class:"mord",style:{"margin-right":"0.02778em"}},"_"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"I"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07153em"}},"tC"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"137"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},">")])])])])])])],-1),b=l('

正则表达式

形式化语言

字符表(alphabet)

  • 是指一个由符号(字符、数字、特殊符号)组成的有限集,例如$$\\sum={0,1},A={a,b,c}$$

字符串(string)

',5),k=s("ul",null,[s("li",null,"一个基于某个字符表的字符串是一个由字符表中给出的符号组成的有穷序列"),s("li",null,[a("特殊的"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"ε")]),s("annotation",{encoding:"application/x-tex"},"\\varepsilon")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"ε")])])]),a(" 表示一个空串,但不等价于空集")]),s("li",null,[a("例如 "),s("ul",null,[s("li",null,[a("0,00,10是"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",null,"∑"),s("mo",null,"="),s("mo",{stretchy:"false"},"{"),s("mn",null,"0"),s("mo",{separator:"true"},","),s("mn",null,"1"),s("mo",{stretchy:"false"},"}")]),s("annotation",{encoding:"application/x-tex"},"\\sum=\\{0,1\\}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mop op-symbol small-op",style:{position:"relative",top:"0em"}},"∑"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"{"),s("span",{class:"mord"},"0"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"1"),s("span",{class:"mclose"},"}")])])]),a("的字符串")]),s("li",null,[a("a,ab,aaca是"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"="),s("mo",{stretchy:"false"},"{"),s("mi",null,"a"),s("mo",{separator:"true"},","),s("mi",null,"b"),s("mo",{separator:"true"},","),s("mi",null,"c"),s("mo",{stretchy:"false"},"}")]),s("annotation",{encoding:"application/x-tex"},"A=\\{a,b,c\\}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mclose"},"}")])])]),a("的字符串")])])])],-1),M=s("h4",{id:"语言-language",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#语言-language","aria-hidden":"true"},"#"),a(" 语言(language)")],-1),_=s("ul",null,[s("li",null,"由基于某一给定的字符表的一系列字符串组成的集合"),s("li",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",{stretchy:"false"},"{"),s("mi",null,"ε"),s("mo",{stretchy:"false"},"}"),s("mtext",null,"和空集"),s("mi",{mathvariant:"normal"},"Φ")]),s("annotation",{encoding:"application/x-tex"},"\\{\\varepsilon\\}和空集\\Phi")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal"},"ε"),s("span",{class:"mclose"},"}"),s("span",{class:"mord cjk_fallback"},"和空集"),s("span",{class:"mord"},"Φ")])])]),a(" 都是语言")])],-1),f=s("h5",{id:"语言的运算",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#语言的运算","aria-hidden":"true"},"#"),a(" 语言的运算")],-1),z=s("table",null,[s("thead",null,[s("tr",null,[s("th",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"O"),s("mi",null,"p"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"a"),s("mi",null,"t"),s("mi",null,"i"),s("mi",null,"o"),s("mi",null,"n")]),s("annotation",{encoding:"application/x-tex"},"Operation")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal"},"Op"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"n")])])])]),s("th",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"D"),s("mi",null,"e"),s("mi",null,"f"),s("mi",null,"i"),s("mi",null,"n"),s("mi",null,"i"),s("mi",null,"t"),s("mi",null,"i"),s("mi",null,"o"),s("mi",null,"n"),s("mtext",null,"  "),s("mtext",null,"  "),s("mi",null,"A"),s("mi",null,"n"),s("mi",null,"d"),s("mtext",null,"  "),s("mtext",null,"  "),s("mi",null,"n"),s("mi",null,"o"),s("mi",null,"t"),s("mi",null,"a"),s("mi",null,"t"),s("mi",null,"i"),s("mi",null,"o"),s("mi",null,"n")]),s("annotation",{encoding:"application/x-tex"},"Definition\\;\\; And \\;\\; notation")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal"},"De"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mord mathnormal"},"ini"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mord mathnormal"},"d"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"n")])])])])])]),s("tbody",null,[s("tr",null,[s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"U"),s("mi",null,"n"),s("mi",null,"i"),s("mi",null,"o"),s("mi",null,"n"),s("mtext",null,"  "),s("mtext",null,"  "),s("mi",null,"o"),s("mi",null,"f"),s("mtext",null,"  "),s("mtext",null,"  "),s("mi",null,"L"),s("mtext",null,"  "),s("mtext",null,"  "),s("mi",null,"a"),s("mi",null,"n"),s("mi",null,"d"),s("mtext",null,"  "),s("mtext",null,"  "),s("mi",null,"M")]),s("annotation",{encoding:"application/x-tex"},"Union\\;\\; of\\;\\; L\\;\\; and\\;\\; M")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10903em"}},"U"),s("span",{class:"mord mathnormal"},"ni"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"L"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"an"),s("span",{class:"mord mathnormal"},"d"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10903em"}},"M")])])])]),s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"L"),s("mo",null,"⋃"),s("mi",null,"M"),s("mo",null,"="),s("mrow",null,[s("mo",{fence:"true"},"{"),s("mi",null,"s"),s("mo",null,"∣"),s("mi",null,"s"),s("mo",null,"∈"),s("mi",null,"L"),s("mo",null,"∨"),s("mi",null,"s"),s("mo",null,"∈"),s("mi",null,"M"),s("mo",{fence:"true"},"}")])]),s("annotation",{encoding:"application/x-tex"},"L\\bigcup M = \\left\\{s\\mid s\\in L \\lor s\\in M\\right\\}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"L"),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mop op-symbol small-op",style:{position:"relative",top:"0em"}},"⋃"),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10903em"}},"M"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"minner"},[s("span",{class:"mopen delimcenter",style:{top:"0em"}},"{"),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∣"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"L"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∨"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10903em"}},"M"),s("span",{class:"mclose delimcenter",style:{top:"0em"}},"}")])])])])])]),s("tr",null,[s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"C"),s("mi",null,"o"),s("mi",null,"n"),s("mi",null,"c"),s("mi",null,"a"),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"n"),s("mi",null,"a"),s("mi",null,"t"),s("mi",null,"i"),s("mi",null,"o"),s("mi",null,"n"),s("mtext",null,"  "),s("mtext",null,"  "),s("mi",null,"o"),s("mi",null,"f"),s("mtext",null,"  "),s("mtext",null,"  "),s("mi",null,"L"),s("mtext",null,"  "),s("mtext",null,"  "),s("mi",null,"a"),s("mi",null,"n"),s("mi",null,"d"),s("mtext",null,"  "),s("mtext",null,"  "),s("mi",null,"M")]),s("annotation",{encoding:"application/x-tex"},"Concatenation\\;\\; of\\;\\; L\\;\\; and\\;\\; M")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07153em"}},"C"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"na"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"L"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"an"),s("span",{class:"mord mathnormal"},"d"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10903em"}},"M")])])])]),s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"L"),s("mi",null,"M"),s("mo",null,"="),s("mo",{stretchy:"false"},"{"),s("mi",null,"s"),s("mi",null,"t"),s("mo",null,"∣"),s("mi",null,"s"),s("mo",null,"∈"),s("mi",null,"L"),s("mo",null,"∧"),s("mi",null,"t"),s("mo",null,"∈"),s("mi",null,"M"),s("mo",{stretchy:"false"},"}")]),s("annotation",{encoding:"application/x-tex"},"LM=\\{st\\mid s\\in L \\land t\\in M\\}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"L"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10903em"}},"M"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∣"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.5782em","vertical-align":"-0.0391em"}}),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"L"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∧"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6542em","vertical-align":"-0.0391em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10903em"}},"M"),s("span",{class:"mclose"},"}")])])])])]),s("tr",null,[s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"K"),s("mi",null,"l"),s("mi",null,"e"),s("mi",null,"e"),s("mi",null,"n"),s("mi",null,"e"),s("mtext",null,"  "),s("mtext",null,"  "),s("mi",null,"c"),s("mi",null,"l"),s("mi",null,"o"),s("mi",null,"s"),s("mi",null,"u"),s("mi",null,"r"),s("mi",null,"e"),s("mtext",null,"  "),s("mtext",null,"  "),s("mi",null,"o"),s("mi",null,"f"),s("mtext",null,"  "),s("mtext",null,"  "),s("mi",null,"L")]),s("annotation",{encoding:"application/x-tex"},"Kleene\\;\\; closure\\;\\; of\\;\\; L")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07153em"}},"K"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mord mathnormal"},"ee"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mord mathnormal"},"os"),s("span",{class:"mord mathnormal"},"u"),s("span",{class:"mord mathnormal"},"re"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"L")])])])]),s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msup",null,[s("mi",null,"L"),s("mo",null,"∗")]),s("mo",null,"="),s("msubsup",null,[s("mo",null,"⋃"),s("mrow",null,[s("mi",null,"i"),s("mo",null,"="),s("mn",null,"0")]),s("mi",{mathvariant:"normal"},"∞")]),s("msup",null,[s("mi",null,"L"),s("mi",null,"i")])]),s("annotation",{encoding:"application/x-tex"},"L^*=\\bigcup^\\infty_{i=0}L^i")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"L"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1.1244em","vertical-align":"-0.2997em"}}),s("span",{class:"mop"},[s("span",{class:"mop op-symbol small-op",style:{position:"relative",top:"0em"}},"⋃"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8043em"}},[s("span",{style:{top:"-2.4003em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mathnormal mtight"},"i"),s("span",{class:"mrel mtight"},"="),s("span",{class:"mord mtight"},"0")])])]),s("span",{style:{top:"-3.2029em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"∞")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.2997em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"L"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8247em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"i")])])])])])])])])])])])]),s("tr",null,[s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"P"),s("mi",null,"o"),s("mi",null,"s"),s("mi",null,"i"),s("mi",null,"t"),s("mi",null,"i"),s("mi",null,"v"),s("mi",null,"e"),s("mtext",null,"  "),s("mtext",null,"  "),s("mi",null,"c"),s("mi",null,"l"),s("mi",null,"o"),s("mi",null,"s"),s("mi",null,"u"),s("mi",null,"r"),s("mi",null,"e"),s("mtext",null,"  "),s("mtext",null,"  "),s("mi",null,"o"),s("mi",null,"f"),s("mtext",null,"  "),s("mtext",null,"  "),s("mi",null,"L")]),s("annotation",{encoding:"application/x-tex"},"Positive\\;\\; closure\\;\\; of\\;\\; L")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"P"),s("span",{class:"mord mathnormal"},"os"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.03588em"}},"v"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mord mathnormal"},"os"),s("span",{class:"mord mathnormal"},"u"),s("span",{class:"mord mathnormal"},"re"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"L")])])])]),s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msup",null,[s("mi",null,"L"),s("mo",{lspace:"0em",rspace:"0em"},"+")]),s("mo",null,"="),s("msubsup",null,[s("mo",null,"⋃"),s("mrow",null,[s("mi",null,"i"),s("mo",null,"="),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∞")]),s("msup",null,[s("mi",null,"L"),s("mi",null,"i")])]),s("annotation",{encoding:"application/x-tex"},"L^{+}=\\bigcup^\\infty_{i=1}L^i")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7713em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"L"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7713em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"+")])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1.1244em","vertical-align":"-0.2997em"}}),s("span",{class:"mop"},[s("span",{class:"mop op-symbol small-op",style:{position:"relative",top:"0em"}},"⋃"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8043em"}},[s("span",{style:{top:"-2.4003em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mathnormal mtight"},"i"),s("span",{class:"mrel mtight"},"="),s("span",{class:"mord mtight"},"1")])])]),s("span",{style:{top:"-3.2029em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"∞")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.2997em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"L"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8247em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"i")])])])])])])])])])])])])])],-1),L=s("h3",{id:"正则表达式-1",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#正则表达式-1","aria-hidden":"true"},"#"),a(" 正则表达式")],-1),A=s("h4",{id:"原子表达式",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#原子表达式","aria-hidden":"true"},"#"),a(" 原子表达式")],-1),F=s("ul",null,[s("li",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"ε")]),s("annotation",{encoding:"application/x-tex"},"\\varepsilon")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"ε")])])]),a("匹配一个空串")]),s("li",null,"字符表中的符号a只匹配a")],-1),R=s("h4",{id:"复合表达式",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#复合表达式","aria-hidden":"true"},"#"),a(" 复合表达式")],-1),S=s("p",null,[a("假设"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"R"),s("mn",null,"1")]),s("mtext",null,"和"),s("msub",null,[s("mi",null,"R"),s("mn",null,"2")])]),s("annotation",{encoding:"application/x-tex"},"R_1和R_2")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.00773em"}},"R"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0077em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord cjk_fallback"},"和"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.00773em"}},"R"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0077em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a("是两个正则表达式,那么:")],-1),N=s("ul",null,[s("li",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"R"),s("mn",null,"1")]),s("msub",null,[s("mi",null,"R"),s("mn",null,"2")])]),s("annotation",{encoding:"application/x-tex"},"R_1R_2")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.00773em"}},"R"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0077em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.00773em"}},"R"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0077em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a("是它们的级联")]),s("li",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"R"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"R"),s("mn",null,"2")])]),s("annotation",{encoding:"application/x-tex"},"R_1|R_2")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.00773em"}},"R"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0077em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.00773em"}},"R"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0077em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a("是它们的并集")]),s("li",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msup",null,[s("mi",null,"R"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"R^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.00773em"}},"R"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])]),a("是它们的Kleene闭包")]),s("li",null,[a("(R)可以提高运算优先级("),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",{stretchy:"false"},"("),s("mi",null,"R"),s("mo",{stretchy:"false"},")"),s("mo",null,">"),s("msup",null,[s("mi",null,"R"),s("mo",null,"∗")]),s("mo",null,">"),s("msub",null,[s("mi",null,"R"),s("mn",null,"1")]),s("msub",null,[s("mi",null,"R"),s("mn",null,"2")]),s("mo",null,">"),s("msub",null,[s("mi",null,"R"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"R"),s("mn",null,"2")])]),s("annotation",{encoding:"application/x-tex"},"(R)>R^*>R_1R_2>R_1|R_2")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.00773em"}},"R"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},">"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7278em","vertical-align":"-0.0391em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.00773em"}},"R"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},">"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.00773em"}},"R"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0077em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.00773em"}},"R"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0077em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},">"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.00773em"}},"R"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0077em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.00773em"}},"R"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0077em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a(")")])],-1),I=s("h4",{id:"例子",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#例子","aria-hidden":"true"},"#"),a(" 例子")],-1),D=s("ul",null,[s("li",null,[a("中间包含00的任意串:"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",{stretchy:"false"},"("),s("mn",null,"0"),s("mi",{mathvariant:"normal"},"∣"),s("mn",null,"1"),s("msup",null,[s("mo",{stretchy:"false"},")"),s("mo",null,"∗")]),s("mn",null,"00"),s("mo",{stretchy:"false"},"("),s("mn",null,"0"),s("mi",{mathvariant:"normal"},"∣"),s("mn",null,"1"),s("msup",null,[s("mo",{stretchy:"false"},")"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"(0|1)^*00(0|1)^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},"0∣1"),s("span",{class:"mclose"},[s("span",{class:"mclose"},")"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mord"},"00"),s("span",{class:"mopen"},"("),s("span",{class:"mord"},"0∣1"),s("span",{class:"mclose"},[s("span",{class:"mclose"},")"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])])]),s("li",null,[a("包含最多一个零:"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msup",null,[s("mn",null,"1"),s("mo",null,"∗")]),s("mo",{stretchy:"false"},"("),s("mn",null,"0"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"ε"),s("mo",{stretchy:"false"},")"),s("msup",null,[s("mn",null,"1"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"1^*(0|\\varepsilon)1^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},[s("span",{class:"mord"},"1"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mopen"},"("),s("span",{class:"mord"},"0∣"),s("span",{class:"mord mathnormal"},"ε"),s("span",{class:"mclose"},")"),s("span",{class:"mord"},[s("span",{class:"mord"},"1"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])]),a("或"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msup",null,[s("mn",null,"1"),s("mo",null,"∗")]),s("mn",null,"0"),s("mo",{stretchy:"false"},"?"),s("msup",null,[s("mn",null,"1"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"1^*0?1^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6944em"}}),s("span",{class:"mord"},[s("span",{class:"mord"},"1"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mord"},"0"),s("span",{class:"mclose"},"?"),s("span",{class:"mord"},[s("span",{class:"mord"},"1"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])])]),s("li",null,[a("标识符:"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"l"),s("mi",null,"e"),s("mi",null,"t"),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mo",{stretchy:"false"},"("),s("mi",null,"l"),s("mi",null,"e"),s("mi",null,"t"),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"d"),s("mi",null,"i"),s("mi",null,"g"),s("mi",null,"i"),s("mi",null,"t"),s("msup",null,[s("mo",{stretchy:"false"},")"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"letter(letter|digit)^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"tt"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"tt"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"d"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.03588em"}},"g"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mclose"},[s("span",{class:"mclose"},")"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])])])],-1),T=s("h2",{id:"有限自动机",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#有限自动机","aria-hidden":"true"},"#"),a(" 有限自动机")],-1),C=s("h3",{id:"概念",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#概念","aria-hidden":"true"},"#"),a(" 概念")],-1),O=s("ul",null,[s("li",null,"正则表达式可以用一个有限自动机来实现"),s("li",null,"有两种类型的有限自动机——NFA与DFA"),s("li",null,[a("核心思想"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"R"),s("mi",null,"E"),s("mo",null,"→"),s("mi",null,"N"),s("mi",null,"F"),s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"D"),s("mi",null,"F"),s("mi",null,"A")]),s("annotation",{encoding:"application/x-tex"},"RE\\rightarrow NFA\\rightarrow DFA")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"RE"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"NF"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"D"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mord mathnormal"},"A")])])])])],-1),$=s("h3",{id:"有限自动机的数学定义",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#有限自动机的数学定义","aria-hidden":"true"},"#"),a(" 有限自动机的数学定义")],-1),E=s("p",null,"是一个五元组(tuple)$$\\begin{array}{c} M=( \\sum,S,F,S_{0},S_{a} )\\ F:S\\times \\sum \\rightarrow S \\ \\sum为符号表 \\ S为状态集 \\ F为状态转移函数 \\ S_0为初始态 \\ S_a为接受态 \\end{array} $$",-1),U=s("h3",{id:"nfa-nondeterministic-finite-automata",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#nfa-nondeterministic-finite-automata","aria-hidden":"true"},"#"),a(" NFA(Nondeterministic Finite Automata)")],-1),j=s("ul",null,[s("li",null,"对于给定的状态,一个输入会有多个转移"),s("li",null,[a("可以有"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"ε")]),s("annotation",{encoding:"application/x-tex"},"\\varepsilon")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"ε")])])]),a("转移")])],-1),P=s("h4",{id:"nfa的执行",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#nfa的执行","aria-hidden":"true"},"#"),a(" NFA的执行")],-1),K=s("ol",null,[s("li",null,"维护一个下一状态的集合,初始为空"),s("li",null,[a("对于每个当前状态,执行 "),s("ol",null,[s("li",null,"对于当前输入执行全部转移"),s("li",null,"将所有转移的结果加入下一状态的集合中")])]),s("li",null,[a("再将所有"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"ε")]),s("annotation",{encoding:"application/x-tex"},"\\varepsilon")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"ε")])])]),a("转移加入下一状态集合中")])],-1),B=s("h4",{id:"时间复杂度",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#时间复杂度","aria-hidden":"true"},"#"),a(" 时间复杂度")],-1),V=s("ul",null,[s("li",null,[a("对一个长为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"m")]),s("annotation",{encoding:"application/x-tex"},"m")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"m")])])]),a("的字符串,并且有"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"n")]),s("annotation",{encoding:"application/x-tex"},"n")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"n")])])]),a("个状态的自动机,时间复杂度为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"O"),s("mo",{stretchy:"false"},"("),s("mi",null,"m"),s("msup",null,[s("mi",null,"n"),s("mn",null,"2")]),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"O(mn^2)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1.0641em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"O"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"n"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8141em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])])])])])]),s("span",{class:"mclose"},")")])])])])],-1),Y=s("h3",{id:"dfa-deterministic-finite-automate",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#dfa-deterministic-finite-automate","aria-hidden":"true"},"#"),a(" DFA(Deterministic Finite Automate)")],-1),q=s("ul",null,[s("li",null,"每个状态每个输入只会有一个转移"),s("li",null,[a("没有"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"ε")]),s("annotation",{encoding:"application/x-tex"},"\\varepsilon")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"ε")])])]),a("转移")])],-1),G=l(`

DFA的执行

int kTransitionTable[kNumStates][kNumSymbols]={
 {2,1,3,0,0,3}
diff --git "a/assets/Chapter3 \350\257\255\346\263\225\345\210\206\346\236\220.html-95301033.js" "b/assets/Chapter3 \350\257\255\346\263\225\345\210\206\346\236\220.html-67b15795.js"
similarity index 99%
rename from "assets/Chapter3 \350\257\255\346\263\225\345\210\206\346\236\220.html-95301033.js"
rename to "assets/Chapter3 \350\257\255\346\263\225\345\210\206\346\236\220.html-67b15795.js"
index f7f764199..09dfad50c 100644
--- "a/assets/Chapter3 \350\257\255\346\263\225\345\210\206\346\236\220.html-95301033.js"	
+++ "b/assets/Chapter3 \350\257\255\346\263\225\345\210\206\346\236\220.html-67b15795.js"	
@@ -1,4 +1,4 @@
-import{_ as t}from"./plugin-vue_export-helper-c27b6911.js";import{o as n,c as m,a as s,b as a,f as l}from"./app-a9076d6c.js";const e={},i=s("h1",{id:"chapter3-语法分析",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#chapter3-语法分析","aria-hidden":"true"},"#"),a(" Chapter3 语法分析")],-1),r=s("ul",null,[s("li",null,[a("正则表达式的能力有限,无法分析具体的语法细节(例如嵌套、"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msup",null,[s("mi",null,"a"),s("mi",null,"n")]),s("msup",null,[s("mi",null,"b"),s("mi",null,"n")])]),s("annotation",{encoding:"application/x-tex"},"a^nb^n")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6644em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"b"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6644em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])])])])])])])])]),a("的n值),与其等价的有穷自动机同理,因此引入了下推自动机和上下文有关、无关文法")])],-1),p=l('

大纲

  • 语法分析的形式化——上下文无关文法
  • 语法分析算法

上下文无关文法(CFG)

  • 是用来描述一个编程语言的语法结构的文法
  • 和正则表达式一样,可以表示递归的规则,而且更强大
  • 是正则表达式的严格超集

Chomsky语言层级

',5),c=s("table",null,[s("thead",null,[s("tr",null,[s("th",null,"Chomsky hierarchy"),s("th",null,"Production(产生式)"),s("th",null,"Explanation")])]),s("tbody",null,[s("tr",null,[s("td",null,"unrestricted(type 0)(自然语言)"),s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"α"),s("mo",null,"→"),s("mi",null,"β"),s("mspace",{width:"1em"}),s("msup",null,[s("mi",null,"V"),s("mo",null,"+")]),s("mo",null,"="),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",null,"∪"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")])]),s("annotation",{encoding:"application/x-tex"},"\\alpha \\rightarrow \\beta \\quad V^+=V_N\\cup V_T")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9658em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"1em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7713em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"+")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∪"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mtext",null,"其中"),s("mi",null,"α"),s("mo",null,"∈"),s("msup",null,[s("mi",null,"V"),s("mo",null,"+")]),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"β"),s("mo",null,"∈"),s("msup",null,[s("mi",null,"V"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"其中\\alpha\\in V^+,\\; \\beta\\in V^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7224em","vertical-align":"-0.0391em"}}),s("span",{class:"mord cjk_fallback"},"其中"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9658em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7713em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"+")])])])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])])]),s("td",null,"无严格约束")]),s("tr",null,[s("td",null,"context sensitive(type 1)(上下文有关文法)"),s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"α"),s("mi",null,"A"),s("mi",null,"γ"),s("mo",null,"→"),s("mi",null,"α"),s("mi",null,"β"),s("mi",null,"γ"),s("mo",{separator:"true"},",")]),s("annotation",{encoding:"application/x-tex"},"\\alpha A \\gamma \\rightarrow \\alpha \\beta \\gamma,")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05556em"}},"γ"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05556em"}},"γ"),s("span",{class:"mpunct"},",")])])]),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mtext",null,"其中"),s("mi",null,"α"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"γ"),s("mo",null,"∈"),s("msup",null,[s("mi",null,"V"),s("mo",null,"∗")]),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"A"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"β"),s("mo",null,"∈"),s("msup",null,[s("mi",null,"V"),s("mo",null,"+")])]),s("annotation",{encoding:"application/x-tex"},"其中\\alpha,\\;\\gamma\\in V^*,\\;A \\in V_N, \\; \\beta \\in V^+")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord cjk_fallback"},"其中"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05556em"}},"γ"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8831em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7713em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7713em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"+")])])])])])])])])])])]),s("td",null,[a("在不同的上下文中,"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A")]),s("annotation",{encoding:"application/x-tex"},"A")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A")])])]),a("可能被不同的"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"γ")]),s("annotation",{encoding:"application/x-tex"},"\\gamma")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.625em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05556em"}},"γ")])])]),a("替换")])]),s("tr",null,[s("td",null,"context free(type 2)(上下文无关文法)"),s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"β"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"A"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",{separator:"true"},",")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\beta ,\\;A\\in V_N,")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},",")])])]),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mtext",null,"其中"),s("mi",null,"β"),s("mo",null,"∈"),s("msup",null,[s("mi",null,"V"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"其中\\beta \\in V^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord cjk_fallback"},"其中"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])])]),s("td",null,[a("在任何"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A")]),s("annotation",{encoding:"application/x-tex"},"A")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A")])])]),a("出现的地方都会被"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"γ")]),s("annotation",{encoding:"application/x-tex"},"\\gamma")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.625em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05556em"}},"γ")])])]),a("替换")])]),s("tr",null,[s("td",null,"regular(type 3)(正则表达式)"),s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"a"),s("mi",null,"B"),s("mtext",null,"  "),s("mi",null,"o"),s("mi",null,"r"),s("mtext",null,"  "),s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"a")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow aB\\;or\\;A\\rightarrow a")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05017em"}},"B"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"or"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"a")])])]),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",{stretchy:"false"},"("),s("mtext",null,"其中"),s("mi",null,"A"),s("mo",{separator:"true"},","),s("mi",null,"B"),s("mtext",null,"  "),s("mi",null,"A"),s("mo",{separator:"true"},","),s("mi",null,"b"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mtext",null,"  "),s("mo",{separator:"true"},","),s("mi",null,"a"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"(其中A,B\\;A,b\\in V_N\\;,a\\in V_T)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord cjk_fallback"},"其中"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05017em"}},"B"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mclose"},")")])])])]),s("td",null,"等价于正则表达式")])])],-1),h=s("ul",null,[s("li",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mtext",null,"和"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")])]),s("annotation",{encoding:"application/x-tex"},"V_N和V_T")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord cjk_fallback"},"和"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a("分别是非终止符号集(nonterminal)和终止符号(terminal)集,是由语言设计者设计的集合,终止符就是常说的token")]),s("li",null,[a("如果一个符号由它自身定义("),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"a"),s("mo",null,"→"),s("mi",null,"a")]),s("annotation",{encoding:"application/x-tex"},"a\\rightarrow a")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"a")])])]),a("或"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"i"),s("mi",null,"n"),s("mi",null,"t"),s("mo",null,"→"),s("mi",null,"i"),s("mi",null,"n"),s("mi",null,"t")]),s("annotation",{encoding:"application/x-tex"},"int \\rightarrow int")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6595em"}}),s("span",{class:"mord mathnormal"},"in"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6595em"}}),s("span",{class:"mord mathnormal"},"in"),s("span",{class:"mord mathnormal"},"t")])])]),a(")那么就是一个终止符号,通常是标点符号,如分号,括号等")]),s("li",null,[a("如果一个符号有其定义的可再分的结构就是一个非终止符号("),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"l"),s("mi",null,"e"),s("mi",null,"t"),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mo",null,"→"),s("mo",{stretchy:"false"},"["),s("mi",null,"A"),s("mo",null,"−"),s("mi",null,"Z"),s("mi",null,"a"),s("mo",null,"−"),s("mi",null,"z"),s("mo",{stretchy:"false"},"]")]),s("annotation",{encoding:"application/x-tex"},"letter\\rightarrow [A-Za-z]")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"tt"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"["),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"−"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7667em","vertical-align":"-0.0833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07153em"}},"Z"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"−"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.04398em"}},"z"),s("span",{class:"mclose"},"]")])])]),a("),通常是句子,短语,表达式等")]),s("li",null,[a("要注意,"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msup",null,[s("mi",null,"A"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"A^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])]),a('(Kleene闭包)是正则表达式特有的规则,CFG中没有,"|"在CFG中表示的是或,用来简化表示多个产生式,而不是正则表达式中的Union。')]),s("li",null,"CFG文法规定的第一个文法的左部是开始符号,规定了该语言都满足的一个规则"),s("li",null,"一个处于较低层级的文法是上级文法的特例,例如RE就是一种特殊的CFG")],-1),o=s("h2",{id:"形式化定义",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#形式化定义","aria-hidden":"true"},"#"),a(" 形式化定义")],-1),g=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"C"),s("mi",null,"F"),s("mi",null,"G"),s("mo",null,":"),s("mi",null,"G"),s("mo",null,"="),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",{separator:"true"},","),s("mi",null,"P"),s("mo",{separator:"true"},","),s("mi",null,"S"),s("mo",{stretchy:"false"},")")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mtext",null,"是终止符集合")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mtext",null,"是非终止符集合,"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",null,"∩"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mo",null,"="),s("mi",{mathvariant:"normal"},"∅")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"P"),s("mtext",null,"是产生式集合,或称语法规则集,满足"),s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"β"),s("mtext",null,"  "),s("mi",null,"A"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mtext",null,"和"),s("mi",null,"β"),s("mo",null,"∈"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",null,"∪"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("msup",null,[s("mo",{stretchy:"false"},")"),s("mo",null,"∗")])])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"S"),s("mtext",null,"是初始符号,"),s("mi",null,"S"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")])])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} CFG:G=(V_T,V_N,P,S)\\\\ V_T\\text{是终止符集合}\\\\ V_N\\text{是非终止符集合,}V_N\\cap V_T=\\varnothing\\\\ P\\text{是产生式集合,或称语法规则集,满足}A\\rightarrow \\beta \\;A\\in V_N和\\beta \\in (V_N\\cup V_T)^*\\\\ S\\text{是初始符号,}S\\in V_N \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"6em","vertical-align":"-2.75em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"3.25em"}},[s("span",{style:{top:"-5.41em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"CFG"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},":"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"G"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"P"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mclose"},")")])]),s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是终止符集合")])])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是非终止符集合,")]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∩"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord amsrm"},"∅")])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"P"),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是产生式集合,或称语法规则集,满足")]),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord cjk_fallback"},"和"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∪"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mclose"},[s("span",{class:"mclose"},")"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])]),s("span",{style:{top:"-0.61em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是初始符号,")]),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.75em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),u=s("h3",{id:"ebnf-extended-backus-naur-form",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#ebnf-extended-backus-naur-form","aria-hidden":"true"},"#"),a(" EBNF(Extended Backus-Naur form)")],-1),d=s("ul",null,[s("li",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",null,"→")]),s("annotation",{encoding:"application/x-tex"},"\\rightarrow")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.3669em"}}),s("span",{class:"mrel"},"→")])])]),a(":"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"X"),s("mo",null,"→"),s("msub",null,[s("mi",null,"Y"),s("mn",null,"1")]),s("msub",null,[s("mi",null,"Y"),s("mn",null,"2")]),s("msub",null,[s("mi",null,"Y"),s("mn",null,"3")]),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"Y"),s("mi",null,"N")])]),s("annotation",{encoding:"application/x-tex"},"X\\rightarrow Y_1Y_2Y_3...Y_N")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"3")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"..."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a("表示"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"X"),s("mtext",null,"可以用"),s("msub",null,[s("mi",null,"Y"),s("mn",null,"1")]),s("msub",null,[s("mi",null,"Y"),s("mn",null,"2")]),s("msub",null,[s("mi",null,"Y"),s("mn",null,"3")]),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"Y"),s("mi",null,"N")])]),s("annotation",{encoding:"application/x-tex"},"X\\text{可以用}Y_1Y_2Y_3...Y_N")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"可以用")]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"3")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"..."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a("来代替,"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"X"),s("mo",null,"→"),s("mi",null,"ε")]),s("annotation",{encoding:"application/x-tex"},"X\\rightarrow \\varepsilon")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"ε")])])]),a("表示"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"X")]),s("annotation",{encoding:"application/x-tex"},"X")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X")])])]),a("可以用空串代替,这种"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"α")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\alpha")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α")])])]),a("被称为BNF表示法")]),s("li",null,[a("简化表示: "),s("ol",null,[s("li",null,"除非特殊说明,否则第一个产生式的左部就是初始符号"),s("li",null,"用小写字母表示终止符号"),s("li",null,[a("用大写字符或者"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",null,"<"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",null,">")]),s("annotation",{encoding:"application/x-tex"},"<...>")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.5782em","vertical-align":"-0.0391em"}}),s("span",{class:"mrel"},"<"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.5782em","vertical-align":"-0.0391em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},">")])])]),a("表示非终止符号")]),s("li",null,[a("如果左部都为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A")]),s("annotation",{encoding:"application/x-tex"},"A")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A")])])]),a("的一系列产生式"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"α"),s("mn",null,"2")]),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"α"),s("mi",null,"n")]),s("mo",{separator:"true"},","),s("mtext",null,"  ")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\alpha_2,\\;...,\\;A\\rightarrow \\alpha_n,\\;")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.625em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})])])]),a("可以简写为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"α"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"α"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"α"),s("mi",null,"n")])]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\alpha_1 | \\alpha _2|...|\\alpha_n")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])])])])]),s("li",null,"特别注意:")],-1),y=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"S"),s("mo",null,"→"),s("msup",null,[s("mi",null,"a"),s("mo",null,"∗")]),s("mi",null,"b"),s("mtext",null,"(错误写法,没有Kleene闭包)")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"S"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"b")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"a"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"ε")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} S\\rightarrow a^*b \\text{(错误写法,没有Kleene闭包)}\\\\ S\\rightarrow Ab\\\\ A\\rightarrow Aa|\\varepsilon \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"3.6em","vertical-align":"-1.55em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.05em"}},[s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mord text"},[s("span",{class:"mord"},"("),s("span",{class:"mord cjk_fallback"},"错误写法,没有"),s("span",{class:"mord"},"Kleene"),s("span",{class:"mord cjk_fallback"},"闭包"),s("span",{class:"mord"},")")])])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"b")])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"ε")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.55em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),v=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"S"),s("mo",null,"→"),s("mi",null,"a"),s("mo",{stretchy:"false"},"("),s("mi",null,"b"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"c"),s("mo",{stretchy:"false"},")"),s("mo",{stretchy:"false"},"("),s("mtext",null,"错误,没有括号"),s("mo",{stretchy:"false"},")")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"S"),s("mo",null,"→"),s("mi",null,"a"),s("mi",null,"X")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"X"),s("mo",null,"→"),s("mi",null,"b"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"c")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} S\\rightarrow a(b|c)(错误,没有括号)\\\\ S\\rightarrow aX\\\\ X\\rightarrow b|c \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"3.6em","vertical-align":"-1.55em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.05em"}},[s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mclose"},")"),s("span",{class:"mopen"},"("),s("span",{class:"mord cjk_fallback"},"错误,没有括号"),s("span",{class:"mclose"},")")])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X")])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"c")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.55em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),x=s("ul",null,[s("li",null,[a("左递归:"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"α"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"β"),s("mtext",null,"  "),s("mo",{stretchy:"false"},"("),s("mi",null,"l"),s("mi",null,"e"),s("mi",null,"f"),s("mi",null,"t"),s("mtext",null,"  "),s("mi",null,"r"),s("mi",null,"e"),s("mi",null,"c"),s("mi",null,"u"),s("mi",null,"r"),s("mi",null,"s"),s("mi",null,"i"),s("mi",null,"v"),s("mi",null,"e"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"A \\rightarrow A\\alpha|\\beta\\;(left\\;recursive)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"rec"),s("span",{class:"mord mathnormal"},"u"),s("span",{class:"mord mathnormal"},"rs"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.03588em"}},"v"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mclose"},")")])])]),a("可表示"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"β"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"β"),s("mi",null,"α"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"β"),s("mi",null,"α"),s("mi",null,"α"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},".")]),s("annotation",{encoding:"application/x-tex"},"\\beta ,\\;\\beta \\alpha,\\; \\beta \\alpha \\alpha...")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"αα"),s("span",{class:"mord"},"...")])])]),a("即有推导"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"β"),s("msup",null,[s("mi",null,"α"),s("mi",null,"n")]),s("mo",{stretchy:"false"},"("),s("mi",null,"n"),s("mo",null,"="),s("mn",null,"0"),s("mo",{separator:"true"},","),s("mn",null,"1"),s("mo",{separator:"true"},","),s("mn",null,"2"),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"A\\Rightarrow^*\\beta \\alpha^n(n=0,1,2,...)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6644em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])])])])])]),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},"0"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"1"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"2"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mclose"},")")])])]),a("在EBNF中可表示为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"β"),s("mo",{stretchy:"false"},"{"),s("mi",null,"α"),s("mo",{stretchy:"false"},"}")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow\\beta \\{\\alpha \\}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mclose"},"}")])])])]),s("li",null,[a("右递归:"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"α"),s("mi",null,"A"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"β"),s("mtext",null,"  "),s("mo",{stretchy:"false"},"("),s("mi",null,"r"),s("mi",null,"i"),s("mi",null,"g"),s("mi",null,"h"),s("mi",null,"t"),s("mtext",null,"  "),s("mi",null,"r"),s("mi",null,"e"),s("mi",null,"c"),s("mi",null,"u"),s("mi",null,"r"),s("mi",null,"s"),s("mi",null,"i"),s("mi",null,"v"),s("mi",null,"e"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"A \\rightarrow \\alpha A|\\beta\\;(right\\;recursive)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"r"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.03588em"}},"g"),s("span",{class:"mord mathnormal"},"h"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"rec"),s("span",{class:"mord mathnormal"},"u"),s("span",{class:"mord mathnormal"},"rs"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.03588em"}},"v"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mclose"},")")])])]),a("可表示"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"β"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"α"),s("mi",null,"β"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"α"),s("mi",null,"β"),s("mi",null,"β"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},".")]),s("annotation",{encoding:"application/x-tex"},"\\beta,\\; \\alpha \\beta,\\; \\alpha \\beta \\beta...")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"ββ"),s("span",{class:"mord"},"...")])])]),a("即有推导"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("msup",null,[s("mi",null,"α"),s("mi",null,"n")]),s("mi",null,"β"),s("mo",{stretchy:"false"},"("),s("mi",null,"n"),s("mo",null,"="),s("mn",null,"0"),s("mo",{separator:"true"},","),s("mn",null,"1"),s("mo",{separator:"true"},","),s("mn",null,"2"),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"A\\Rightarrow^* \\alpha^n \\beta(n=0,1,2,...)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6644em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])])])])])]),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},"0"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"1"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"2"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mclose"},")")])])]),a("在EBNF中可表示为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mo",{stretchy:"false"},"{"),s("mi",null,"α"),s("mo",{stretchy:"false"},"}"),s("mi",null,"β")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\{\\alpha \\}\\beta")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mclose"},"}"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β")])])])]),s("li",null,"结合性")],-1),w=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"p"),s("mo",null,"→"),s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"p"),s("mtext",null,"  "),s("mi",null,"a"),s("mi",null,"d"),s("mi",null,"d"),s("mi",null,"o"),s("mi",null,"p"),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"p"),s("mo",null,"→"),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m"),s("mo",{stretchy:"false"},"{"),s("mi",null,"a"),s("mi",null,"d"),s("mi",null,"d"),s("mi",null,"o"),s("mi",null,"p"),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m"),s("mo",{stretchy:"false"},"}"),s("mtext",null,"(左结合性)")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"p"),s("mo",null,"→"),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m"),s("mo",{stretchy:"false"},"["),s("mi",null,"a"),s("mi",null,"d"),s("mi",null,"d"),s("mi",null,"o"),s("mi",null,"p"),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m"),s("mo",{stretchy:"false"},"]"),s("mtext",null,"(右结合性)")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} exp\\rightarrow exp\\; addop\\; term|term\\\\ exp\\rightarrow term\\{addop\\;term\\}\\text{(左结合性)}\\\\ exp\\rightarrow term[addop \\; term]\\text{(右结合性)} \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"3.6em","vertical-align":"-1.55em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.05em"}},[s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"dd"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m")])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"dd"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mclose"},"}"),s("span",{class:"mord text"},[s("span",{class:"mord"},"("),s("span",{class:"mord cjk_fallback"},"左结合性"),s("span",{class:"mord"},")")])])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mopen"},"["),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"dd"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mclose"},"]"),s("span",{class:"mord text"},[s("span",{class:"mord"},"("),s("span",{class:"mord cjk_fallback"},"右结合性"),s("span",{class:"mord"},")")])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.55em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),b=s("ul",null,[s("li",null,"中括号表示其中的符号出现0次或1次,大括号表示0次或")],-1),k=s("h2",{id:"推导-derivation-与规约-reduction",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#推导-derivation-与规约-reduction","aria-hidden":"true"},"#"),a(" 推导(Derivation)与规约(Reduction)")],-1),f=s("ul",null,[s("li",null,"如果能用一步步推导从初始符号得到需要验证的式子,那么式子就是符合规则的"),s("li",null,"推导就是不断用产生式的右部来替换一个非终止符"),s("li",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"\\Rightarrow^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])]),a("表示多步推导")]),s("li",null,"由终止符号构成的串称为句子(sentence),由非终止符号构成的串是句型(sentential form)"),s("li",null,[a("以S为开始符号的CFG构成的语言:"),s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mrow",null,[s("mi",null,"L"),s("mo",{stretchy:"false"},"("),s("mi",null,"G"),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mo",{stretchy:"false"},"{"),s("mi",null,"s"),s("mo",null,"∈"),s("msubsup",null,[s("mi",null,"V"),s("mi",null,"T"),s("mo",null,"∗")]),s("mi",{mathvariant:"normal"},"∣"),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"h"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"e"),s("mtext",null,"  "),s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"i"),s("mi",null,"s"),s("mi",null,"t"),s("mi",null,"s"),s("mtext",null,"  "),s("mi",null,"S"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"s"),s("mtext",null,"  "),s("mi",null,"o"),s("mi",null,"f"),s("mtext",null,"  "),s("mi",null,"G"),s("mo",{stretchy:"false"},"}")]),s("annotation",{encoding:"application/x-tex"}," L(G)=\\{s\\in V_T^*|\\;there\\;exists\\;S\\Rightarrow^*s\\;of\\; G\\} ")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"L"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"G"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7387em"}},[s("span",{style:{top:"-2.453em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])]),s("span",{style:{top:"-3.113em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.247em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"h"),s("span",{class:"mord mathnormal"},"ere"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7387em"}},[s("span",{style:{top:"-3.113em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"G"),s("span",{class:"mclose"},"}")])])])])])])],-1),z=s("h3",{id:"语法树",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#语法树","aria-hidden":"true"},"#"),a(" 语法树")],-1),M=s("ul",null,[s("li",null,"根节点是开始符号"),s("li",null,"内部节点是非终止符号"),s("li",null,[a("叶子节点是终止符号或者"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"ε")]),s("annotation",{encoding:"application/x-tex"},"\\varepsilon")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"ε")])])])]),s("li",null,[a("如果节点A有子节点"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mn",null,"1")]),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mn",null,"2")]),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mi",null,"N")])]),s("annotation",{encoding:"application/x-tex"},"X_1,X_2,...,X_N")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a("则意为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"X"),s("mn",null,"1")]),s("msub",null,[s("mi",null,"X"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"X"),s("mi",null,"N")])]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow X_1X_2...X_N")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"..."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])])]),s("li",null,"最终的叶子节点连起来就是一个句子"),s("li",null,"不同的推导会得到不同的树,但是可能会有相同的结果。")],-1),_=s("h3",{id:"最左推导-leftmost-derivation前缀推导",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#最左推导-leftmost-derivation前缀推导","aria-hidden":"true"},"#"),a(" 最左推导(LeftMost Derivation前缀推导)")],-1),A=s("ul",null,[s("li",null,"总是对句型中最左侧的非终止符号进行一次推导"),s("li",null,"从开始符号推导到结果,被称为Top-down")],-1),L=s("h3",{id:"最右推导-rightmost-derivation",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#最右推导-rightmost-derivation","aria-hidden":"true"},"#"),a(" 最右推导(RightMost Derivation)")],-1),S=s("ul",null,[s("li",null,[a("从结果反向推回开始符号,这个过程被称为规约"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"s"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"S")]),s("annotation",{encoding:"application/x-tex"},"s\\Rightarrow^*S")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S")])])])]),s("li",null,"等价于对语法树进行后序遍历的逆过程"),s("li",null,"最右推导的能力比最左推导要强")],-1),V=l('

抽象语法树

![[语法树与抽象语法树.png]]

  • 比起语法树,省略了部分细节,带来了更好的语法抽象,对于后续编译阶段是一个更好的数据结构
  • 它反映了源码token序列的一个抽象,比语法树更高效

歧义(Ambiguity)

  • 对于一个CFG,同样的输入可能有不同的解析 ![[语法树歧义.png]]

解决方法

  • 消除歧义(Disambiguity rule):不改变文法,列举所有可能造成歧义的情况并进行消除,不现实的
  • 文法重写:改变文法,进行同义转换:(添加优先级,添加关联性)
',7),F=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mrow",null,[s("mi",null,"E"),s("mo",null,"→"),s("mi",null,"E"),s("mo",null,"−"),s("mi",null,"E"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"E"),s("mo",null,"×"),s("mi",null,"E"),s("mi",{mathvariant:"normal"},"∣"),s("mo",{stretchy:"false"},"("),s("mi",null,"E"),s("mo",{stretchy:"false"},")"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"i"),s("mtext",null,"  "),s("mo",null,"⇒"),s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"E"),s("mo",null,"→"),s("mi",null,"E"),s("mo",null,"−"),s("mi",null,"E"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"T")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"T"),s("mo",null,"→"),s("mi",null,"T"),s("mo",null,"×"),s("mi",null,"T"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"F")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"F"),s("mo",null,"→"),s("mo",{stretchy:"false"},"("),s("mi",null,"E"),s("mo",{stretchy:"false"},")"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"i")])])])])])]),s("annotation",{encoding:"application/x-tex"}," E\\rightarrow E-E|E \\times E|(E)|i\\;\\Rightarrow \\begin{array}{c} E\\rightarrow E-E|T\\\\ T\\rightarrow T\\times T|F\\\\ F\\rightarrow(E)|i \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7667em","vertical-align":"-0.0833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"−"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"×"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mord"},"∣"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mclose"},")"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"⇒"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"3.6em","vertical-align":"-1.55em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.05em"}},[s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"−"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T")])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"×"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F")])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mclose"},")"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"i")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.55em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),T=l('

![[消除歧义1.png]] ![[消除歧义2.png]] ![[消除歧义3.png]]

语法分析算法(parsing)

Top-Down(Leftmost) parsing

  • 本质上是一个图搜索问题,在树上搜索,查找能否获得一个与输入sentence匹配的路径

回溯算法(Backtracking)

',5),R=s("ul",null,[s("li",null,"用BFS:进行图遍历搜索,复杂,时间复杂度过高,产生大量无用分支,时间和空间的最差情况都是指数级别。现代编译器中不被使用"),s("li",null,[a("剪枝:由终止符号做前缀时,如果无法与输入的前缀匹配则剪枝。("),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mi",null,"a"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"A"),s("mi",null,"b"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"c"),s("mo",null,"→"),s("mi",null,"c"),s("mi",null,"a"),s("mi",null,"a"),s("mi",null,"a"),s("mi",null,"a"),s("mi",null,"a")]),s("annotation",{encoding:"application/x-tex"},"Aa|Ab|c\\rightarrow caaaaa")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mord mathnormal"},"aaaaa")])])]),a("时,无法剪枝,因为前缀一直是非终止符号)")]),s("li",null,[a("用DFS:有比BFS更好的空间复杂度和时间复杂度,但是无法匹配("),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mi",null,"a"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"c"),s("mo",null,"→"),s("mi",null,"c")]),s("annotation",{encoding:"application/x-tex"},"Aa|c\\rightarrow c")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"c")])])]),a(",因为会一直循环)")])],-1),N=s("h3",{id:"预测推导-predictive-parsing",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#预测推导-predictive-parsing","aria-hidden":"true"},"#"),a(" 预测推导(predictive parsing)")],-1),X=s("ul",null,[s("li",null,"Idea:利用先行词(lokkahead tokens),也就是上面提到过的终止符前缀"),s("li",null,"两种分析方法:")],-1),O=s("ol",null,[s("li",null,"递归下降分析(Recursive-descent parsing)"),s("li",null,"LL(1)分析")],-1),j=s("h4",{id:"预测分析的概念",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#预测分析的概念","aria-hidden":"true"},"#"),a(" 预测分析的概念")],-1),E=s("ul",null,[s("li",null,"从输入串和文法的开始符号开始分析"),s("li",null,"可以从当前输入的token(s)唯一确定下一个要使用的产生式"),s("li",null,[a("预测分析文法包括LL(k)文法,其中L表示从左向右扫描,L表示最左推导,k表示“需要"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",null,"≤"),s("mi",null,"k")]),s("annotation",{encoding:"application/x-tex"},"\\le k")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7719em","vertical-align":"-0.136em"}}),s("span",{class:"mrel"},"≤"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.03148em"}},"k")])])]),a("个先行词用于预测 ”")]),s("li",null,"LL(1)文法是常用的,也不完全常用")],-1),B=s("h5",{id:"lookahead-sets",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#lookahead-sets","aria-hidden":"true"},"#"),a(" Lookahead Sets")],-1),G=s("h6",{id:"first-sets-具体计算看讲义和书",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#first-sets-具体计算看讲义和书","aria-hidden":"true"},"#"),a(" First Sets(具体计算看讲义和书)")],-1),I=s("ul",null,[s("li",null,"定义")],-1),Y=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"G"),s("mo",null,"="),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mo",{separator:"true"},","),s("mi",null,"P"),s("mo",{separator:"true"},","),s("mi",null,"S"),s("mo",{stretchy:"false"},")"),s("mtext",null,"是一个文法")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"β"),s("mo",null,"∈"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",null,"∪"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("msup",null,[s("mo",{stretchy:"false"},")"),s("mo",null,"∗")])])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"F"),s("mi",null,"I"),s("mi",null,"R"),s("mi",null,"S"),s("mi",null,"T"),s("mo",{stretchy:"false"},"("),s("mi",null,"β"),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mo",{stretchy:"false"},"{"),s("mi",null,"α"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"β"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"a"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{stretchy:"false"},"}")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"i"),s("mi",null,"f"),s("mtext",null,"  "),s("mi",null,"β"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"ε"),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"h"),s("mi",null,"e"),s("mi",null,"n"),s("mtext",null,"  "),s("mi",null,"ε"),s("mo",null,"∈"),s("mi",null,"F"),s("mi",null,"I"),s("mi",null,"R"),s("mi",null,"S"),s("mi",null,"T"),s("mo",{stretchy:"false"},"("),s("mi",null,"β"),s("mo",{stretchy:"false"},")")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} G=(V_N,V_T,P,S)\\text{是一个文法}\\\\ \\beta\\in(V_N\\cup V_T)^*\\\\ FIRST(\\beta)=\\{\\alpha\\in V_T|\\beta\\Rightarrow^*a...\\}\\\\ if\\;\\beta\\Rightarrow^*\\varepsilon\\;then\\;\\varepsilon\\in FIRST(\\beta) \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"4.8em","vertical-align":"-2.15em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.65em"}},[s("span",{style:{top:"-4.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"G"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"P"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mclose"},")"),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是一个文法")])])]),s("span",{style:{top:"-3.61em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∪"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mclose"},[s("span",{class:"mclose"},")"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])]),s("span",{style:{top:"-2.41em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"I"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"RST"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord"},"..."),s("span",{class:"mclose"},"}")])]),s("span",{style:{top:"-1.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"ε"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"h"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"ε"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"I"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"RST"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mclose"},")")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.15em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),P=s("ul",null,[s("li",null,"计算")],-1),C=s("p",null,"![[First()计算 1.png]] ![[First()计算 2.png]] ![[First()计算 3.png]] ![[First()计算 4.png]] ![[First()计算 5.png]] //Todo 提取简练笔记",-1),U=s("h6",{id:"follow-sets",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#follow-sets","aria-hidden":"true"},"#"),a(" Follow Sets")],-1),K=s("ul",null,[s("li",null,"定义:")],-1),W=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"G"),s("mo",null,"="),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mo",{separator:"true"},","),s("mi",null,"P"),s("mo",{separator:"true"},","),s("mi",null,"S"),s("mo",{stretchy:"false"},")"),s("mtext",null,"是一个文法")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")])])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"F"),s("mi",null,"O"),s("mi",null,"L"),s("mi",null,"L"),s("mi",null,"O"),s("mi",null,"W"),s("mo",{stretchy:"false"},"("),s("mi",null,"A"),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mo",{stretchy:"false"},"{"),s("mi",null,"a"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"S"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",null,"A"),s("mi",null,"a"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{stretchy:"false"},"}"),s("mo",{separator:"true"},",")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"i"),s("mi",null,"f"),s("mtext",null,"  "),s("mi",null,"S"),s("mo",null,"⇒"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",null,"A"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"h"),s("mi",null,"e"),s("mi",null,"n"),s("mtext",null,"  "),s("mi",{mathvariant:"normal"},"$"),s("mo",null,"∈"),s("mi",null,"F"),s("mi",null,"O"),s("mi",null,"L"),s("mi",null,"L"),s("mi",null,"O"),s("mi",null,"W"),s("mo",{stretchy:"false"},"("),s("mi",null,"A"),s("mo",{stretchy:"false"},")")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",{mathvariant:"normal"},"$"),s("mtext",null,"是用来标记输入的终止的符号")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} G=(V_N,V_T,P,S)\\text{是一个文法}\\\\A\\in V_N\\\\ FOLLOW(A)=\\{a\\in V_T|S\\Rightarrow^*...Aa...\\},\\\\ if\\;S\\Rightarrow...A,\\;then\\;\\$\\in FOLLOW(A)\\\\ \\$是用来标记输入的终止的符号 \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"6em","vertical-align":"-2.75em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"3.25em"}},[s("span",{style:{top:"-5.41em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"G"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"P"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mclose"},")"),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是一个文法")])])]),s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"FO"),s("span",{class:"mord mathnormal"},"LL"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"O"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"W"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord"},"..."),s("span",{class:"mclose"},"}"),s("span",{class:"mpunct"},",")])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"⇒"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"h"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},"$"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"FO"),s("span",{class:"mord mathnormal"},"LL"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"O"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"W"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mclose"},")")])]),s("span",{style:{top:"-0.61em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"},"$"),s("span",{class:"mord cjk_fallback"},"是用来标记输入的终止的符号")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.75em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),Z=s("ul",null,[s("li",null,"计算: ![[Follow()计算 1.png]] ![[Follow()计算 2.png]]")],-1),D=s("h5",{id:"可空的非终止符-nullable-nonterminal",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#可空的非终止符-nullable-nonterminal","aria-hidden":"true"},"#"),a(" 可空的非终止符(nullable nonterminal)")],-1),$=s("ul",null,[s("li",null,[a("定义:"),s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mrow",null,[s("mi",null,"S"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"ε")]),s("annotation",{encoding:"application/x-tex"}," S\\Rightarrow^*\\varepsilon ")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7387em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7387em"}},[s("span",{style:{top:"-3.113em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"ε")])])])])])])],-1),q=s("p",null,"则称S是一个可空的非终止符",-1),H=s("ul",null,[s("li",null,"计算: ![[nullble set计算 1.png]] ![[nullble set计算 2.png]]")],-1),J=s("h5",{id:"判定ll-1-文法",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#判定ll-1-文法","aria-hidden":"true"},"#"),a(" 判定LL(1)文法")],-1),Q=s("ul",null,[s("li",null,"计算每个可空的非终止符"),s("li",null,[a("计算产生式右侧所有的"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"F"),s("mi",null,"I"),s("mi",null,"R"),s("mi",null,"S"),s("mi",null,"T"),s("mo",{stretchy:"false"},"("),s("mi",null,"α"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"FIRST(\\alpha)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"I"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"RST"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mclose"},")")])])]),a("并验证其两两交集是否为空")]),s("li",null,[a("计算(1)中算出的非终止符的"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"F"),s("mi",null,"O"),s("mi",null,"L"),s("mi",null,"L"),s("mi",null,"O"),s("mi",null,"W"),s("mo",{stretchy:"false"},"("),s("mi",null,"A"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"FOLLOW(A)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"FO"),s("span",{class:"mord mathnormal"},"LL"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"O"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"W"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mclose"},")")])])]),a("并验证"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"F"),s("mi",null,"I"),s("mi",null,"R"),s("mi",null,"S"),s("mi",null,"T"),s("mo",{stretchy:"false"},"("),s("mi",null,"A"),s("mo",{stretchy:"false"},")"),s("mo",null,"∩"),s("mi",null,"F"),s("mi",null,"O"),s("mi",null,"L"),s("mi",null,"L"),s("mi",null,"O"),s("mi",null,"W"),s("mo",{stretchy:"false"},"("),s("mi",null,"A"),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mi",{mathvariant:"normal"},"∅")]),s("annotation",{encoding:"application/x-tex"},"FIRST(A)\\cap FOLLOW(A)=\\varnothing")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"I"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"RST"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∩"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"FO"),s("span",{class:"mord mathnormal"},"LL"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"O"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"W"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6633em","vertical-align":"-0.0817em"}}),s("span",{class:"mord amsrm"},"∅")])])]),a(" ![[判断LL(1)示例.png]]")])],-1),ss=s("h5",{id:"非ll-1-到ll-1",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#非ll-1-到ll-1","aria-hidden":"true"},"#"),a(" 非LL(1)到LL(1)")],-1),as=s("ul",null,[s("li",null,"两种简单的非LL(1)情形:")],-1),ls=s("ol",null,[s("li",null,[a("左因子,例如"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"α"),s("mi",null,"β"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"α"),s("mi",null,"r")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\alpha \\beta|\\alpha r")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"r")])])]),a(",这是两个产生式的简写,其产生式交集为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"α")]),s("annotation",{encoding:"application/x-tex"},"\\alpha")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α")])])]),a(",改写方法为")])],-1),ts=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"α"),s("msub",null,[s("mi",null,"β"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"α"),s("msub",null,[s("mi",null,"β"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"α"),s("msub",null,[s("mi",null,"β"),s("mi",null,"n")]),s("mtext",null,"  "),s("mtext",null,"重写为"),s("mo",null,":")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"α"),s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")]),s("mspace",{width:"1em"}),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mo",null,"→"),s("msub",null,[s("mi",null,"β"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mi",null,"n")])])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} A\\rightarrow\\alpha\\beta_1|\\alpha\\beta_2|...|\\alpha\\beta_n\\;重写为:\\\\ A\\rightarrow\\alpha A{'}\\quad A^{'}\\rightarrow\\beta_1|\\beta_2|...|\\beta_n \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"2.5025em","vertical-align":"-1.0012em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.5012em"}},[s("span",{style:{top:"-3.6612em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord cjk_fallback"},"重写为"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},":")])]),s("span",{style:{top:"-2.3588em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},[s("span",{class:"mord"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7519em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"1em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.0012em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),ns=s("ol",{start:"2"},[s("li",null,[a("左递归,包括直接左递归和间接左递归,例如"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"β")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow A \\beta")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β")])])]),a("和"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"B"),s("mi",null,"β"),s("mspace",{width:"1em"}),s("mi",null,"B"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"α")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow B \\beta\\quad B\\rightarrow A\\alpha")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"Bβ"),s("span",{class:"mspace",style:{"margin-right":"1em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05017em"}},"B"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α")])])]),a(" 改写方法为")])],-1),ms=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"α"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"β"),s("mtext",null,"  "),s("mtext",null,"重写为:")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"β"),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mtext",null,"  "),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mo",null,"→"),s("mi",null,"α"),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"ε")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mtext",null,"一般情况为:")])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"A"),s("msub",null,[s("mi",null,"α"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"A"),s("msub",null,[s("mi",null,"α"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"A"),s("msub",null,[s("mi",null,"α"),s("mi",null,"m")]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mi",null,"n")]),s("mtext",null,"  "),s("mtext",null,"重写为:")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"β"),s("mn",null,"1")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mn",null,"2")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mi",null,"n")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])])])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mo",null,"→"),s("msub",null,[s("mi",null,"α"),s("mn",null,"1")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"α"),s("mn",null,"1")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"α"),s("mi",null,"m")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"ε")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} A\\rightarrow A \\alpha|\\beta\\;\\text{重写为:}\\\\ A\\rightarrow\\beta A^{'}\\; ,\\;A^{'}\\rightarrow\\alpha A^{'}|\\varepsilon\\\\ \\text{一般情况为:}\\\\ A\\rightarrow A \\alpha_1|A \\alpha_2|...|A \\alpha_m|\\beta_1|\\beta_2|...|\\beta_n\\; \\text{重写为:}\\\\ A\\rightarrow \\beta_1 A^{'}|\\beta_2 A^{'}|...|\\beta_n A^{'}\\\\ A^{'}\\rightarrow\\alpha_1 A^{'}|\\alpha_1 A^{'}|...|\\alpha_m A^{'}|\\varepsilon \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"7.5074em","vertical-align":"-3.5037em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"4.0037em"}},[s("span",{style:{top:"-6.1637em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"重写为:")])])]),s("span",{style:{top:"-4.8612em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"ε")])]),s("span",{style:{top:"-3.6612em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"一般情况为:")])])]),s("span",{style:{top:"-2.4612em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"m")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"重写为:")])])]),s("span",{style:{top:"-1.1588em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])])])]),s("span",{style:{top:"0.1437em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"m")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"ε")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"3.5037em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),es=l(`
  • 要注意:将这两者进行改写后并不能保证改写后的文法是LL(1),仍需要再进行验证

递归下降

输入
  • 非终止符号递归调用,终止符号匹配
int main(){
+import{_ as t}from"./plugin-vue_export-helper-c27b6911.js";import{o as n,c as m,a as s,b as a,f as l}from"./app-c6e156cf.js";const e={},i=s("h1",{id:"chapter3-语法分析",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#chapter3-语法分析","aria-hidden":"true"},"#"),a(" Chapter3 语法分析")],-1),r=s("ul",null,[s("li",null,[a("正则表达式的能力有限,无法分析具体的语法细节(例如嵌套、"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msup",null,[s("mi",null,"a"),s("mi",null,"n")]),s("msup",null,[s("mi",null,"b"),s("mi",null,"n")])]),s("annotation",{encoding:"application/x-tex"},"a^nb^n")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6644em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"b"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6644em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])])])])])])])])]),a("的n值),与其等价的有穷自动机同理,因此引入了下推自动机和上下文有关、无关文法")])],-1),p=l('

大纲

  • 语法分析的形式化——上下文无关文法
  • 语法分析算法

上下文无关文法(CFG)

  • 是用来描述一个编程语言的语法结构的文法
  • 和正则表达式一样,可以表示递归的规则,而且更强大
  • 是正则表达式的严格超集

Chomsky语言层级

',5),c=s("table",null,[s("thead",null,[s("tr",null,[s("th",null,"Chomsky hierarchy"),s("th",null,"Production(产生式)"),s("th",null,"Explanation")])]),s("tbody",null,[s("tr",null,[s("td",null,"unrestricted(type 0)(自然语言)"),s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"α"),s("mo",null,"→"),s("mi",null,"β"),s("mspace",{width:"1em"}),s("msup",null,[s("mi",null,"V"),s("mo",null,"+")]),s("mo",null,"="),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",null,"∪"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")])]),s("annotation",{encoding:"application/x-tex"},"\\alpha \\rightarrow \\beta \\quad V^+=V_N\\cup V_T")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9658em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"1em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7713em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"+")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∪"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mtext",null,"其中"),s("mi",null,"α"),s("mo",null,"∈"),s("msup",null,[s("mi",null,"V"),s("mo",null,"+")]),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"β"),s("mo",null,"∈"),s("msup",null,[s("mi",null,"V"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"其中\\alpha\\in V^+,\\; \\beta\\in V^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7224em","vertical-align":"-0.0391em"}}),s("span",{class:"mord cjk_fallback"},"其中"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9658em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7713em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"+")])])])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])])]),s("td",null,"无严格约束")]),s("tr",null,[s("td",null,"context sensitive(type 1)(上下文有关文法)"),s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"α"),s("mi",null,"A"),s("mi",null,"γ"),s("mo",null,"→"),s("mi",null,"α"),s("mi",null,"β"),s("mi",null,"γ"),s("mo",{separator:"true"},",")]),s("annotation",{encoding:"application/x-tex"},"\\alpha A \\gamma \\rightarrow \\alpha \\beta \\gamma,")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05556em"}},"γ"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05556em"}},"γ"),s("span",{class:"mpunct"},",")])])]),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mtext",null,"其中"),s("mi",null,"α"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"γ"),s("mo",null,"∈"),s("msup",null,[s("mi",null,"V"),s("mo",null,"∗")]),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"A"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"β"),s("mo",null,"∈"),s("msup",null,[s("mi",null,"V"),s("mo",null,"+")])]),s("annotation",{encoding:"application/x-tex"},"其中\\alpha,\\;\\gamma\\in V^*,\\;A \\in V_N, \\; \\beta \\in V^+")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord cjk_fallback"},"其中"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05556em"}},"γ"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8831em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7713em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7713em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"+")])])])])])])])])])])]),s("td",null,[a("在不同的上下文中,"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A")]),s("annotation",{encoding:"application/x-tex"},"A")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A")])])]),a("可能被不同的"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"γ")]),s("annotation",{encoding:"application/x-tex"},"\\gamma")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.625em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05556em"}},"γ")])])]),a("替换")])]),s("tr",null,[s("td",null,"context free(type 2)(上下文无关文法)"),s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"β"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"A"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",{separator:"true"},",")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\beta ,\\;A\\in V_N,")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},",")])])]),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mtext",null,"其中"),s("mi",null,"β"),s("mo",null,"∈"),s("msup",null,[s("mi",null,"V"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"其中\\beta \\in V^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord cjk_fallback"},"其中"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])])]),s("td",null,[a("在任何"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A")]),s("annotation",{encoding:"application/x-tex"},"A")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A")])])]),a("出现的地方都会被"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"γ")]),s("annotation",{encoding:"application/x-tex"},"\\gamma")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.625em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05556em"}},"γ")])])]),a("替换")])]),s("tr",null,[s("td",null,"regular(type 3)(正则表达式)"),s("td",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"a"),s("mi",null,"B"),s("mtext",null,"  "),s("mi",null,"o"),s("mi",null,"r"),s("mtext",null,"  "),s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"a")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow aB\\;or\\;A\\rightarrow a")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05017em"}},"B"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"or"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"a")])])]),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",{stretchy:"false"},"("),s("mtext",null,"其中"),s("mi",null,"A"),s("mo",{separator:"true"},","),s("mi",null,"B"),s("mtext",null,"  "),s("mi",null,"A"),s("mo",{separator:"true"},","),s("mi",null,"b"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mtext",null,"  "),s("mo",{separator:"true"},","),s("mi",null,"a"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"(其中A,B\\;A,b\\in V_N\\;,a\\in V_T)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord cjk_fallback"},"其中"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05017em"}},"B"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mclose"},")")])])])]),s("td",null,"等价于正则表达式")])])],-1),h=s("ul",null,[s("li",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mtext",null,"和"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")])]),s("annotation",{encoding:"application/x-tex"},"V_N和V_T")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord cjk_fallback"},"和"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a("分别是非终止符号集(nonterminal)和终止符号(terminal)集,是由语言设计者设计的集合,终止符就是常说的token")]),s("li",null,[a("如果一个符号由它自身定义("),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"a"),s("mo",null,"→"),s("mi",null,"a")]),s("annotation",{encoding:"application/x-tex"},"a\\rightarrow a")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"a")])])]),a("或"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"i"),s("mi",null,"n"),s("mi",null,"t"),s("mo",null,"→"),s("mi",null,"i"),s("mi",null,"n"),s("mi",null,"t")]),s("annotation",{encoding:"application/x-tex"},"int \\rightarrow int")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6595em"}}),s("span",{class:"mord mathnormal"},"in"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6595em"}}),s("span",{class:"mord mathnormal"},"in"),s("span",{class:"mord mathnormal"},"t")])])]),a(")那么就是一个终止符号,通常是标点符号,如分号,括号等")]),s("li",null,[a("如果一个符号有其定义的可再分的结构就是一个非终止符号("),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"l"),s("mi",null,"e"),s("mi",null,"t"),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mo",null,"→"),s("mo",{stretchy:"false"},"["),s("mi",null,"A"),s("mo",null,"−"),s("mi",null,"Z"),s("mi",null,"a"),s("mo",null,"−"),s("mi",null,"z"),s("mo",{stretchy:"false"},"]")]),s("annotation",{encoding:"application/x-tex"},"letter\\rightarrow [A-Za-z]")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"tt"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"["),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"−"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7667em","vertical-align":"-0.0833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07153em"}},"Z"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"−"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.04398em"}},"z"),s("span",{class:"mclose"},"]")])])]),a("),通常是句子,短语,表达式等")]),s("li",null,[a("要注意,"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msup",null,[s("mi",null,"A"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"A^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])]),a('(Kleene闭包)是正则表达式特有的规则,CFG中没有,"|"在CFG中表示的是或,用来简化表示多个产生式,而不是正则表达式中的Union。')]),s("li",null,"CFG文法规定的第一个文法的左部是开始符号,规定了该语言都满足的一个规则"),s("li",null,"一个处于较低层级的文法是上级文法的特例,例如RE就是一种特殊的CFG")],-1),o=s("h2",{id:"形式化定义",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#形式化定义","aria-hidden":"true"},"#"),a(" 形式化定义")],-1),g=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"C"),s("mi",null,"F"),s("mi",null,"G"),s("mo",null,":"),s("mi",null,"G"),s("mo",null,"="),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",{separator:"true"},","),s("mi",null,"P"),s("mo",{separator:"true"},","),s("mi",null,"S"),s("mo",{stretchy:"false"},")")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mtext",null,"是终止符集合")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mtext",null,"是非终止符集合,"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",null,"∩"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mo",null,"="),s("mi",{mathvariant:"normal"},"∅")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"P"),s("mtext",null,"是产生式集合,或称语法规则集,满足"),s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"β"),s("mtext",null,"  "),s("mi",null,"A"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mtext",null,"和"),s("mi",null,"β"),s("mo",null,"∈"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",null,"∪"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("msup",null,[s("mo",{stretchy:"false"},")"),s("mo",null,"∗")])])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"S"),s("mtext",null,"是初始符号,"),s("mi",null,"S"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")])])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} CFG:G=(V_T,V_N,P,S)\\\\ V_T\\text{是终止符集合}\\\\ V_N\\text{是非终止符集合,}V_N\\cap V_T=\\varnothing\\\\ P\\text{是产生式集合,或称语法规则集,满足}A\\rightarrow \\beta \\;A\\in V_N和\\beta \\in (V_N\\cup V_T)^*\\\\ S\\text{是初始符号,}S\\in V_N \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"6em","vertical-align":"-2.75em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"3.25em"}},[s("span",{style:{top:"-5.41em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"CFG"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},":"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"G"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"P"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mclose"},")")])]),s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是终止符集合")])])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是非终止符集合,")]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∩"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord amsrm"},"∅")])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"P"),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是产生式集合,或称语法规则集,满足")]),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord cjk_fallback"},"和"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∪"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mclose"},[s("span",{class:"mclose"},")"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])]),s("span",{style:{top:"-0.61em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是初始符号,")]),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.75em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),u=s("h3",{id:"ebnf-extended-backus-naur-form",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#ebnf-extended-backus-naur-form","aria-hidden":"true"},"#"),a(" EBNF(Extended Backus-Naur form)")],-1),d=s("ul",null,[s("li",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",null,"→")]),s("annotation",{encoding:"application/x-tex"},"\\rightarrow")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.3669em"}}),s("span",{class:"mrel"},"→")])])]),a(":"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"X"),s("mo",null,"→"),s("msub",null,[s("mi",null,"Y"),s("mn",null,"1")]),s("msub",null,[s("mi",null,"Y"),s("mn",null,"2")]),s("msub",null,[s("mi",null,"Y"),s("mn",null,"3")]),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"Y"),s("mi",null,"N")])]),s("annotation",{encoding:"application/x-tex"},"X\\rightarrow Y_1Y_2Y_3...Y_N")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"3")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"..."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a("表示"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"X"),s("mtext",null,"可以用"),s("msub",null,[s("mi",null,"Y"),s("mn",null,"1")]),s("msub",null,[s("mi",null,"Y"),s("mn",null,"2")]),s("msub",null,[s("mi",null,"Y"),s("mn",null,"3")]),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"Y"),s("mi",null,"N")])]),s("annotation",{encoding:"application/x-tex"},"X\\text{可以用}Y_1Y_2Y_3...Y_N")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"可以用")]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"3")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"..."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"Y"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a("来代替,"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"X"),s("mo",null,"→"),s("mi",null,"ε")]),s("annotation",{encoding:"application/x-tex"},"X\\rightarrow \\varepsilon")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"ε")])])]),a("表示"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"X")]),s("annotation",{encoding:"application/x-tex"},"X")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X")])])]),a("可以用空串代替,这种"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"α")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\alpha")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α")])])]),a("被称为BNF表示法")]),s("li",null,[a("简化表示: "),s("ol",null,[s("li",null,"除非特殊说明,否则第一个产生式的左部就是初始符号"),s("li",null,"用小写字母表示终止符号"),s("li",null,[a("用大写字符或者"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",null,"<"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",null,">")]),s("annotation",{encoding:"application/x-tex"},"<...>")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.5782em","vertical-align":"-0.0391em"}}),s("span",{class:"mrel"},"<"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.5782em","vertical-align":"-0.0391em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},">")])])]),a("表示非终止符号")]),s("li",null,[a("如果左部都为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A")]),s("annotation",{encoding:"application/x-tex"},"A")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A")])])]),a("的一系列产生式"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"α"),s("mn",null,"2")]),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"α"),s("mi",null,"n")]),s("mo",{separator:"true"},","),s("mtext",null,"  ")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\alpha_2,\\;...,\\;A\\rightarrow \\alpha_n,\\;")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.625em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})])])]),a("可以简写为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"α"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"α"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"α"),s("mi",null,"n")])]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\alpha_1 | \\alpha _2|...|\\alpha_n")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])])])])]),s("li",null,"特别注意:")],-1),y=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"S"),s("mo",null,"→"),s("msup",null,[s("mi",null,"a"),s("mo",null,"∗")]),s("mi",null,"b"),s("mtext",null,"(错误写法,没有Kleene闭包)")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"S"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"b")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"a"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"ε")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} S\\rightarrow a^*b \\text{(错误写法,没有Kleene闭包)}\\\\ S\\rightarrow Ab\\\\ A\\rightarrow Aa|\\varepsilon \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"3.6em","vertical-align":"-1.55em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.05em"}},[s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mord text"},[s("span",{class:"mord"},"("),s("span",{class:"mord cjk_fallback"},"错误写法,没有"),s("span",{class:"mord"},"Kleene"),s("span",{class:"mord cjk_fallback"},"闭包"),s("span",{class:"mord"},")")])])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"b")])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"ε")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.55em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),v=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"S"),s("mo",null,"→"),s("mi",null,"a"),s("mo",{stretchy:"false"},"("),s("mi",null,"b"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"c"),s("mo",{stretchy:"false"},")"),s("mo",{stretchy:"false"},"("),s("mtext",null,"错误,没有括号"),s("mo",{stretchy:"false"},")")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"S"),s("mo",null,"→"),s("mi",null,"a"),s("mi",null,"X")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"X"),s("mo",null,"→"),s("mi",null,"b"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"c")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} S\\rightarrow a(b|c)(错误,没有括号)\\\\ S\\rightarrow aX\\\\ X\\rightarrow b|c \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"3.6em","vertical-align":"-1.55em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.05em"}},[s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mclose"},")"),s("span",{class:"mopen"},"("),s("span",{class:"mord cjk_fallback"},"错误,没有括号"),s("span",{class:"mclose"},")")])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X")])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"c")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.55em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),x=s("ul",null,[s("li",null,[a("左递归:"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"α"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"β"),s("mtext",null,"  "),s("mo",{stretchy:"false"},"("),s("mi",null,"l"),s("mi",null,"e"),s("mi",null,"f"),s("mi",null,"t"),s("mtext",null,"  "),s("mi",null,"r"),s("mi",null,"e"),s("mi",null,"c"),s("mi",null,"u"),s("mi",null,"r"),s("mi",null,"s"),s("mi",null,"i"),s("mi",null,"v"),s("mi",null,"e"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"A \\rightarrow A\\alpha|\\beta\\;(left\\;recursive)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"rec"),s("span",{class:"mord mathnormal"},"u"),s("span",{class:"mord mathnormal"},"rs"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.03588em"}},"v"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mclose"},")")])])]),a("可表示"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"β"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"β"),s("mi",null,"α"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"β"),s("mi",null,"α"),s("mi",null,"α"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},".")]),s("annotation",{encoding:"application/x-tex"},"\\beta ,\\;\\beta \\alpha,\\; \\beta \\alpha \\alpha...")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"αα"),s("span",{class:"mord"},"...")])])]),a("即有推导"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"β"),s("msup",null,[s("mi",null,"α"),s("mi",null,"n")]),s("mo",{stretchy:"false"},"("),s("mi",null,"n"),s("mo",null,"="),s("mn",null,"0"),s("mo",{separator:"true"},","),s("mn",null,"1"),s("mo",{separator:"true"},","),s("mn",null,"2"),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"A\\Rightarrow^*\\beta \\alpha^n(n=0,1,2,...)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6644em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])])])])])]),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},"0"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"1"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"2"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mclose"},")")])])]),a("在EBNF中可表示为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"β"),s("mo",{stretchy:"false"},"{"),s("mi",null,"α"),s("mo",{stretchy:"false"},"}")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow\\beta \\{\\alpha \\}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mclose"},"}")])])])]),s("li",null,[a("右递归:"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"α"),s("mi",null,"A"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"β"),s("mtext",null,"  "),s("mo",{stretchy:"false"},"("),s("mi",null,"r"),s("mi",null,"i"),s("mi",null,"g"),s("mi",null,"h"),s("mi",null,"t"),s("mtext",null,"  "),s("mi",null,"r"),s("mi",null,"e"),s("mi",null,"c"),s("mi",null,"u"),s("mi",null,"r"),s("mi",null,"s"),s("mi",null,"i"),s("mi",null,"v"),s("mi",null,"e"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"A \\rightarrow \\alpha A|\\beta\\;(right\\;recursive)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"r"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.03588em"}},"g"),s("span",{class:"mord mathnormal"},"h"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"rec"),s("span",{class:"mord mathnormal"},"u"),s("span",{class:"mord mathnormal"},"rs"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.03588em"}},"v"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mclose"},")")])])]),a("可表示"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"β"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"α"),s("mi",null,"β"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"α"),s("mi",null,"β"),s("mi",null,"β"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},".")]),s("annotation",{encoding:"application/x-tex"},"\\beta,\\; \\alpha \\beta,\\; \\alpha \\beta \\beta...")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"ββ"),s("span",{class:"mord"},"...")])])]),a("即有推导"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("msup",null,[s("mi",null,"α"),s("mi",null,"n")]),s("mi",null,"β"),s("mo",{stretchy:"false"},"("),s("mi",null,"n"),s("mo",null,"="),s("mn",null,"0"),s("mo",{separator:"true"},","),s("mn",null,"1"),s("mo",{separator:"true"},","),s("mn",null,"2"),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"A\\Rightarrow^* \\alpha^n \\beta(n=0,1,2,...)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6644em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])])])])])]),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},"0"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"1"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"2"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mclose"},")")])])]),a("在EBNF中可表示为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mo",{stretchy:"false"},"{"),s("mi",null,"α"),s("mo",{stretchy:"false"},"}"),s("mi",null,"β")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\{\\alpha \\}\\beta")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mclose"},"}"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β")])])])]),s("li",null,"结合性")],-1),w=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"p"),s("mo",null,"→"),s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"p"),s("mtext",null,"  "),s("mi",null,"a"),s("mi",null,"d"),s("mi",null,"d"),s("mi",null,"o"),s("mi",null,"p"),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"p"),s("mo",null,"→"),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m"),s("mo",{stretchy:"false"},"{"),s("mi",null,"a"),s("mi",null,"d"),s("mi",null,"d"),s("mi",null,"o"),s("mi",null,"p"),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m"),s("mo",{stretchy:"false"},"}"),s("mtext",null,"(左结合性)")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"p"),s("mo",null,"→"),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m"),s("mo",{stretchy:"false"},"["),s("mi",null,"a"),s("mi",null,"d"),s("mi",null,"d"),s("mi",null,"o"),s("mi",null,"p"),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"m"),s("mo",{stretchy:"false"},"]"),s("mtext",null,"(右结合性)")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} exp\\rightarrow exp\\; addop\\; term|term\\\\ exp\\rightarrow term\\{addop\\;term\\}\\text{(左结合性)}\\\\ exp\\rightarrow term[addop \\; term]\\text{(右结合性)} \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"3.6em","vertical-align":"-1.55em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.05em"}},[s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"dd"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m")])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"dd"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mclose"},"}"),s("span",{class:"mord text"},[s("span",{class:"mord"},"("),s("span",{class:"mord cjk_fallback"},"左结合性"),s("span",{class:"mord"},")")])])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mopen"},"["),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"dd"),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mclose"},"]"),s("span",{class:"mord text"},[s("span",{class:"mord"},"("),s("span",{class:"mord cjk_fallback"},"右结合性"),s("span",{class:"mord"},")")])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.55em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),b=s("ul",null,[s("li",null,"中括号表示其中的符号出现0次或1次,大括号表示0次或")],-1),k=s("h2",{id:"推导-derivation-与规约-reduction",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#推导-derivation-与规约-reduction","aria-hidden":"true"},"#"),a(" 推导(Derivation)与规约(Reduction)")],-1),f=s("ul",null,[s("li",null,"如果能用一步步推导从初始符号得到需要验证的式子,那么式子就是符合规则的"),s("li",null,"推导就是不断用产生式的右部来替换一个非终止符"),s("li",null,[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")])]),s("annotation",{encoding:"application/x-tex"},"\\Rightarrow^*")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])])]),a("表示多步推导")]),s("li",null,"由终止符号构成的串称为句子(sentence),由非终止符号构成的串是句型(sentential form)"),s("li",null,[a("以S为开始符号的CFG构成的语言:"),s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mrow",null,[s("mi",null,"L"),s("mo",{stretchy:"false"},"("),s("mi",null,"G"),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mo",{stretchy:"false"},"{"),s("mi",null,"s"),s("mo",null,"∈"),s("msubsup",null,[s("mi",null,"V"),s("mi",null,"T"),s("mo",null,"∗")]),s("mi",{mathvariant:"normal"},"∣"),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"h"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"e"),s("mtext",null,"  "),s("mi",null,"e"),s("mi",null,"x"),s("mi",null,"i"),s("mi",null,"s"),s("mi",null,"t"),s("mi",null,"s"),s("mtext",null,"  "),s("mi",null,"S"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"s"),s("mtext",null,"  "),s("mi",null,"o"),s("mi",null,"f"),s("mtext",null,"  "),s("mi",null,"G"),s("mo",{stretchy:"false"},"}")]),s("annotation",{encoding:"application/x-tex"}," L(G)=\\{s\\in V_T^*|\\;there\\;exists\\;S\\Rightarrow^*s\\;of\\; G\\} ")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"L"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"G"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7387em"}},[s("span",{style:{top:"-2.453em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])]),s("span",{style:{top:"-3.113em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.247em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"h"),s("span",{class:"mord mathnormal"},"ere"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7387em"}},[s("span",{style:{top:"-3.113em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"G"),s("span",{class:"mclose"},"}")])])])])])])],-1),z=s("h3",{id:"语法树",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#语法树","aria-hidden":"true"},"#"),a(" 语法树")],-1),M=s("ul",null,[s("li",null,"根节点是开始符号"),s("li",null,"内部节点是非终止符号"),s("li",null,[a("叶子节点是终止符号或者"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"ε")]),s("annotation",{encoding:"application/x-tex"},"\\varepsilon")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"ε")])])])]),s("li",null,[a("如果节点A有子节点"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mn",null,"1")]),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mn",null,"2")]),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mi",null,"N")])]),s("annotation",{encoding:"application/x-tex"},"X_1,X_2,...,X_N")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a("则意为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"X"),s("mn",null,"1")]),s("msub",null,[s("mi",null,"X"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"X"),s("mi",null,"N")])]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow X_1X_2...X_N")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"..."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])])]),s("li",null,"最终的叶子节点连起来就是一个句子"),s("li",null,"不同的推导会得到不同的树,但是可能会有相同的结果。")],-1),_=s("h3",{id:"最左推导-leftmost-derivation前缀推导",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#最左推导-leftmost-derivation前缀推导","aria-hidden":"true"},"#"),a(" 最左推导(LeftMost Derivation前缀推导)")],-1),A=s("ul",null,[s("li",null,"总是对句型中最左侧的非终止符号进行一次推导"),s("li",null,"从开始符号推导到结果,被称为Top-down")],-1),L=s("h3",{id:"最右推导-rightmost-derivation",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#最右推导-rightmost-derivation","aria-hidden":"true"},"#"),a(" 最右推导(RightMost Derivation)")],-1),S=s("ul",null,[s("li",null,[a("从结果反向推回开始符号,这个过程被称为规约"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"s"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"S")]),s("annotation",{encoding:"application/x-tex"},"s\\Rightarrow^*S")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6887em"}}),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S")])])])]),s("li",null,"等价于对语法树进行后序遍历的逆过程"),s("li",null,"最右推导的能力比最左推导要强")],-1),V=l('

抽象语法树

![[语法树与抽象语法树.png]]

  • 比起语法树,省略了部分细节,带来了更好的语法抽象,对于后续编译阶段是一个更好的数据结构
  • 它反映了源码token序列的一个抽象,比语法树更高效

歧义(Ambiguity)

  • 对于一个CFG,同样的输入可能有不同的解析 ![[语法树歧义.png]]

解决方法

  • 消除歧义(Disambiguity rule):不改变文法,列举所有可能造成歧义的情况并进行消除,不现实的
  • 文法重写:改变文法,进行同义转换:(添加优先级,添加关联性)
',7),F=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mrow",null,[s("mi",null,"E"),s("mo",null,"→"),s("mi",null,"E"),s("mo",null,"−"),s("mi",null,"E"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"E"),s("mo",null,"×"),s("mi",null,"E"),s("mi",{mathvariant:"normal"},"∣"),s("mo",{stretchy:"false"},"("),s("mi",null,"E"),s("mo",{stretchy:"false"},")"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"i"),s("mtext",null,"  "),s("mo",null,"⇒"),s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"E"),s("mo",null,"→"),s("mi",null,"E"),s("mo",null,"−"),s("mi",null,"E"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"T")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"T"),s("mo",null,"→"),s("mi",null,"T"),s("mo",null,"×"),s("mi",null,"T"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"F")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"F"),s("mo",null,"→"),s("mo",{stretchy:"false"},"("),s("mi",null,"E"),s("mo",{stretchy:"false"},")"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"i")])])])])])]),s("annotation",{encoding:"application/x-tex"}," E\\rightarrow E-E|E \\times E|(E)|i\\;\\Rightarrow \\begin{array}{c} E\\rightarrow E-E|T\\\\ T\\rightarrow T\\times T|F\\\\ F\\rightarrow(E)|i \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7667em","vertical-align":"-0.0833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"−"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"×"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mord"},"∣"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mclose"},")"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"⇒"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"3.6em","vertical-align":"-1.55em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.05em"}},[s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"−"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T")])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"×"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"T"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F")])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"E"),s("span",{class:"mclose"},")"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"i")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.55em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),T=l('

![[消除歧义1.png]] ![[消除歧义2.png]] ![[消除歧义3.png]]

语法分析算法(parsing)

Top-Down(Leftmost) parsing

  • 本质上是一个图搜索问题,在树上搜索,查找能否获得一个与输入sentence匹配的路径

回溯算法(Backtracking)

',5),R=s("ul",null,[s("li",null,"用BFS:进行图遍历搜索,复杂,时间复杂度过高,产生大量无用分支,时间和空间的最差情况都是指数级别。现代编译器中不被使用"),s("li",null,[a("剪枝:由终止符号做前缀时,如果无法与输入的前缀匹配则剪枝。("),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mi",null,"a"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"A"),s("mi",null,"b"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"c"),s("mo",null,"→"),s("mi",null,"c"),s("mi",null,"a"),s("mi",null,"a"),s("mi",null,"a"),s("mi",null,"a"),s("mi",null,"a")]),s("annotation",{encoding:"application/x-tex"},"Aa|Ab|c\\rightarrow caaaaa")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"b"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mord mathnormal"},"aaaaa")])])]),a("时,无法剪枝,因为前缀一直是非终止符号)")]),s("li",null,[a("用DFS:有比BFS更好的空间复杂度和时间复杂度,但是无法匹配("),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mi",null,"a"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"c"),s("mo",null,"→"),s("mi",null,"c")]),s("annotation",{encoding:"application/x-tex"},"Aa|c\\rightarrow c")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"c")])])]),a(",因为会一直循环)")])],-1),N=s("h3",{id:"预测推导-predictive-parsing",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#预测推导-predictive-parsing","aria-hidden":"true"},"#"),a(" 预测推导(predictive parsing)")],-1),X=s("ul",null,[s("li",null,"Idea:利用先行词(lokkahead tokens),也就是上面提到过的终止符前缀"),s("li",null,"两种分析方法:")],-1),O=s("ol",null,[s("li",null,"递归下降分析(Recursive-descent parsing)"),s("li",null,"LL(1)分析")],-1),j=s("h4",{id:"预测分析的概念",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#预测分析的概念","aria-hidden":"true"},"#"),a(" 预测分析的概念")],-1),E=s("ul",null,[s("li",null,"从输入串和文法的开始符号开始分析"),s("li",null,"可以从当前输入的token(s)唯一确定下一个要使用的产生式"),s("li",null,[a("预测分析文法包括LL(k)文法,其中L表示从左向右扫描,L表示最左推导,k表示“需要"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",null,"≤"),s("mi",null,"k")]),s("annotation",{encoding:"application/x-tex"},"\\le k")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7719em","vertical-align":"-0.136em"}}),s("span",{class:"mrel"},"≤"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.03148em"}},"k")])])]),a("个先行词用于预测 ”")]),s("li",null,"LL(1)文法是常用的,也不完全常用")],-1),B=s("h5",{id:"lookahead-sets",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#lookahead-sets","aria-hidden":"true"},"#"),a(" Lookahead Sets")],-1),G=s("h6",{id:"first-sets-具体计算看讲义和书",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#first-sets-具体计算看讲义和书","aria-hidden":"true"},"#"),a(" First Sets(具体计算看讲义和书)")],-1),I=s("ul",null,[s("li",null,"定义")],-1),Y=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"G"),s("mo",null,"="),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mo",{separator:"true"},","),s("mi",null,"P"),s("mo",{separator:"true"},","),s("mi",null,"S"),s("mo",{stretchy:"false"},")"),s("mtext",null,"是一个文法")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"β"),s("mo",null,"∈"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",null,"∪"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("msup",null,[s("mo",{stretchy:"false"},")"),s("mo",null,"∗")])])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"F"),s("mi",null,"I"),s("mi",null,"R"),s("mi",null,"S"),s("mi",null,"T"),s("mo",{stretchy:"false"},"("),s("mi",null,"β"),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mo",{stretchy:"false"},"{"),s("mi",null,"α"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"β"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"a"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{stretchy:"false"},"}")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"i"),s("mi",null,"f"),s("mtext",null,"  "),s("mi",null,"β"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"ε"),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"h"),s("mi",null,"e"),s("mi",null,"n"),s("mtext",null,"  "),s("mi",null,"ε"),s("mo",null,"∈"),s("mi",null,"F"),s("mi",null,"I"),s("mi",null,"R"),s("mi",null,"S"),s("mi",null,"T"),s("mo",{stretchy:"false"},"("),s("mi",null,"β"),s("mo",{stretchy:"false"},")")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} G=(V_N,V_T,P,S)\\text{是一个文法}\\\\ \\beta\\in(V_N\\cup V_T)^*\\\\ FIRST(\\beta)=\\{\\alpha\\in V_T|\\beta\\Rightarrow^*a...\\}\\\\ if\\;\\beta\\Rightarrow^*\\varepsilon\\;then\\;\\varepsilon\\in FIRST(\\beta) \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"4.8em","vertical-align":"-2.15em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.65em"}},[s("span",{style:{top:"-4.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"G"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"P"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mclose"},")"),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是一个文法")])])]),s("span",{style:{top:"-3.61em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∪"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mclose"},[s("span",{class:"mclose"},")"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])])])]),s("span",{style:{top:"-2.41em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"I"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"RST"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord"},"..."),s("span",{class:"mclose"},"}")])]),s("span",{style:{top:"-1.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"ε"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"h"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"ε"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"I"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"RST"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mclose"},")")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.15em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),P=s("ul",null,[s("li",null,"计算")],-1),C=s("p",null,"![[First()计算 1.png]] ![[First()计算 2.png]] ![[First()计算 3.png]] ![[First()计算 4.png]] ![[First()计算 5.png]] //Todo 提取简练笔记",-1),U=s("h6",{id:"follow-sets",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#follow-sets","aria-hidden":"true"},"#"),a(" Follow Sets")],-1),K=s("ul",null,[s("li",null,"定义:")],-1),W=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"G"),s("mo",null,"="),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")]),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mo",{separator:"true"},","),s("mi",null,"P"),s("mo",{separator:"true"},","),s("mi",null,"S"),s("mo",{stretchy:"false"},")"),s("mtext",null,"是一个文法")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"N")])])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"F"),s("mi",null,"O"),s("mi",null,"L"),s("mi",null,"L"),s("mi",null,"O"),s("mi",null,"W"),s("mo",{stretchy:"false"},"("),s("mi",null,"A"),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mo",{stretchy:"false"},"{"),s("mi",null,"a"),s("mo",null,"∈"),s("msub",null,[s("mi",null,"V"),s("mi",null,"T")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"S"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",null,"A"),s("mi",null,"a"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{stretchy:"false"},"}"),s("mo",{separator:"true"},",")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"i"),s("mi",null,"f"),s("mtext",null,"  "),s("mi",null,"S"),s("mo",null,"⇒"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",null,"A"),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("mi",null,"t"),s("mi",null,"h"),s("mi",null,"e"),s("mi",null,"n"),s("mtext",null,"  "),s("mi",{mathvariant:"normal"},"$"),s("mo",null,"∈"),s("mi",null,"F"),s("mi",null,"O"),s("mi",null,"L"),s("mi",null,"L"),s("mi",null,"O"),s("mi",null,"W"),s("mo",{stretchy:"false"},"("),s("mi",null,"A"),s("mo",{stretchy:"false"},")")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",{mathvariant:"normal"},"$"),s("mtext",null,"是用来标记输入的终止的符号")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} G=(V_N,V_T,P,S)\\text{是一个文法}\\\\A\\in V_N\\\\ FOLLOW(A)=\\{a\\in V_T|S\\Rightarrow^*...Aa...\\},\\\\ if\\;S\\Rightarrow...A,\\;then\\;\\$\\in FOLLOW(A)\\\\ \\$是用来标记输入的终止的符号 \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"6em","vertical-align":"-2.75em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"3.25em"}},[s("span",{style:{top:"-5.41em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"G"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"P"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mclose"},")"),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"是一个文法")])])]),s("span",{style:{top:"-4.21em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.10903em"}},"N")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])]),s("span",{style:{top:"-3.01em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"FO"),s("span",{class:"mord mathnormal"},"LL"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"O"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"W"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mopen"},"{"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.22222em"}},"V"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3283em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.2222em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.13889em"}},"T")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.6887em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord"},"..."),s("span",{class:"mclose"},"}"),s("span",{class:"mpunct"},",")])]),s("span",{style:{top:"-1.81em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"i"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"⇒"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord mathnormal"},"h"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},"$"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∈"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"FO"),s("span",{class:"mord mathnormal"},"LL"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"O"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"W"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mclose"},")")])]),s("span",{style:{top:"-0.61em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"},"$"),s("span",{class:"mord cjk_fallback"},"是用来标记输入的终止的符号")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.75em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),Z=s("ul",null,[s("li",null,"计算: ![[Follow()计算 1.png]] ![[Follow()计算 2.png]]")],-1),D=s("h5",{id:"可空的非终止符-nullable-nonterminal",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#可空的非终止符-nullable-nonterminal","aria-hidden":"true"},"#"),a(" 可空的非终止符(nullable nonterminal)")],-1),$=s("ul",null,[s("li",null,[a("定义:"),s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mrow",null,[s("mi",null,"S"),s("msup",null,[s("mo",null,"⇒"),s("mo",null,"∗")]),s("mi",null,"ε")]),s("annotation",{encoding:"application/x-tex"}," S\\Rightarrow^*\\varepsilon ")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7387em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},[s("span",{class:"mrel"},"⇒"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7387em"}},[s("span",{style:{top:"-3.113em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mbin mtight"},"∗")])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"ε")])])])])])])],-1),q=s("p",null,"则称S是一个可空的非终止符",-1),H=s("ul",null,[s("li",null,"计算: ![[nullble set计算 1.png]] ![[nullble set计算 2.png]]")],-1),J=s("h5",{id:"判定ll-1-文法",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#判定ll-1-文法","aria-hidden":"true"},"#"),a(" 判定LL(1)文法")],-1),Q=s("ul",null,[s("li",null,"计算每个可空的非终止符"),s("li",null,[a("计算产生式右侧所有的"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"F"),s("mi",null,"I"),s("mi",null,"R"),s("mi",null,"S"),s("mi",null,"T"),s("mo",{stretchy:"false"},"("),s("mi",null,"α"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"FIRST(\\alpha)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"I"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"RST"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mclose"},")")])])]),a("并验证其两两交集是否为空")]),s("li",null,[a("计算(1)中算出的非终止符的"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"F"),s("mi",null,"O"),s("mi",null,"L"),s("mi",null,"L"),s("mi",null,"O"),s("mi",null,"W"),s("mo",{stretchy:"false"},"("),s("mi",null,"A"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"FOLLOW(A)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"FO"),s("span",{class:"mord mathnormal"},"LL"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"O"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"W"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mclose"},")")])])]),a("并验证"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"F"),s("mi",null,"I"),s("mi",null,"R"),s("mi",null,"S"),s("mi",null,"T"),s("mo",{stretchy:"false"},"("),s("mi",null,"A"),s("mo",{stretchy:"false"},")"),s("mo",null,"∩"),s("mi",null,"F"),s("mi",null,"O"),s("mi",null,"L"),s("mi",null,"L"),s("mi",null,"O"),s("mi",null,"W"),s("mo",{stretchy:"false"},"("),s("mi",null,"A"),s("mo",{stretchy:"false"},")"),s("mo",null,"="),s("mi",{mathvariant:"normal"},"∅")]),s("annotation",{encoding:"application/x-tex"},"FIRST(A)\\cap FOLLOW(A)=\\varnothing")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"F"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"I"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"RST"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∩"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"FO"),s("span",{class:"mord mathnormal"},"LL"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"O"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.13889em"}},"W"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6633em","vertical-align":"-0.0817em"}}),s("span",{class:"mord amsrm"},"∅")])])]),a(" ![[判断LL(1)示例.png]]")])],-1),ss=s("h5",{id:"非ll-1-到ll-1",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#非ll-1-到ll-1","aria-hidden":"true"},"#"),a(" 非LL(1)到LL(1)")],-1),as=s("ul",null,[s("li",null,"两种简单的非LL(1)情形:")],-1),ls=s("ol",null,[s("li",null,[a("左因子,例如"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"α"),s("mi",null,"β"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"α"),s("mi",null,"r")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow \\alpha \\beta|\\alpha r")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"r")])])]),a(",这是两个产生式的简写,其产生式交集为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"α")]),s("annotation",{encoding:"application/x-tex"},"\\alpha")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α")])])]),a(",改写方法为")])],-1),ts=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"α"),s("msub",null,[s("mi",null,"β"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"α"),s("msub",null,[s("mi",null,"β"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"α"),s("msub",null,[s("mi",null,"β"),s("mi",null,"n")]),s("mtext",null,"  "),s("mtext",null,"重写为"),s("mo",null,":")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"α"),s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")]),s("mspace",{width:"1em"}),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mo",null,"→"),s("msub",null,[s("mi",null,"β"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mi",null,"n")])])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} A\\rightarrow\\alpha\\beta_1|\\alpha\\beta_2|...|\\alpha\\beta_n\\;重写为:\\\\ A\\rightarrow\\alpha A{'}\\quad A^{'}\\rightarrow\\beta_1|\\beta_2|...|\\beta_n \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"2.5025em","vertical-align":"-1.0012em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.5012em"}},[s("span",{style:{top:"-3.6612em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord cjk_fallback"},"重写为"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},":")])]),s("span",{style:{top:"-2.3588em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},[s("span",{class:"mord"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7519em"}},[s("span",{style:{top:"-3.063em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"1em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.0012em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),ns=s("ol",{start:"2"},[s("li",null,[a("左递归,包括直接左递归和间接左递归,例如"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"β")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow A \\beta")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β")])])]),a("和"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"B"),s("mi",null,"β"),s("mspace",{width:"1em"}),s("mi",null,"B"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"α")]),s("annotation",{encoding:"application/x-tex"},"A\\rightarrow B \\beta\\quad B\\rightarrow A\\alpha")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"Bβ"),s("span",{class:"mspace",style:{"margin-right":"1em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05017em"}},"B"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α")])])]),a(" 改写方法为")])],-1),ms=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.16em",columnalign:"center",columnspacing:"1em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"A"),s("mi",null,"α"),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"β"),s("mtext",null,"  "),s("mtext",null,"重写为:")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"β"),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mtext",null,"  "),s("mo",{separator:"true"},","),s("mtext",null,"  "),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mo",null,"→"),s("mi",null,"α"),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"ε")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mtext",null,"一般情况为:")])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("mi",null,"A"),s("msub",null,[s("mi",null,"α"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"A"),s("msub",null,[s("mi",null,"α"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"A"),s("msub",null,[s("mi",null,"α"),s("mi",null,"m")]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mi",null,"n")]),s("mtext",null,"  "),s("mtext",null,"重写为:")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"β"),s("mn",null,"1")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mn",null,"2")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"β"),s("mi",null,"n")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])])])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"false"},[s("mrow",null,[s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mo",null,"→"),s("msub",null,[s("mi",null,"α"),s("mn",null,"1")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"α"),s("mn",null,"1")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"∣"),s("msub",null,[s("mi",null,"α"),s("mi",null,"m")]),s("msup",null,[s("mi",null,"A"),s("msup",null,[s("mrow"),s("mo",{mathvariant:"normal",lspace:"0em",rspace:"0em"},"′")])]),s("mi",{mathvariant:"normal"},"∣"),s("mi",null,"ε")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{array}{c} A\\rightarrow A \\alpha|\\beta\\;\\text{重写为:}\\\\ A\\rightarrow\\beta A^{'}\\; ,\\;A^{'}\\rightarrow\\alpha A^{'}|\\varepsilon\\\\ \\text{一般情况为:}\\\\ A\\rightarrow A \\alpha_1|A \\alpha_2|...|A \\alpha_m|\\beta_1|\\beta_2|...|\\beta_n\\; \\text{重写为:}\\\\ A\\rightarrow \\beta_1 A^{'}|\\beta_2 A^{'}|...|\\beta_n A^{'}\\\\ A^{'}\\rightarrow\\alpha_1 A^{'}|\\alpha_1 A^{'}|...|\\alpha_m A^{'}|\\varepsilon \\end{array}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"7.5074em","vertical-align":"-3.5037em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"arraycolsep",style:{width:"0.5em"}}),s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"4.0037em"}},[s("span",{style:{top:"-6.1637em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"重写为:")])])]),s("span",{style:{top:"-4.8612em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"ε")])]),s("span",{style:{top:"-3.6612em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"一般情况为:")])])]),s("span",{style:{top:"-2.4612em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"m")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord cjk_fallback"},"重写为:")])])]),s("span",{style:{top:"-1.1588em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.05278em"}},"β"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0528em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])])])]),s("span",{style:{top:"0.1437em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣...∣"),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.0037em"}},"α"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0037em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"m")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"A"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.9425em"}},[s("span",{style:{top:"-2.9425em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.5795em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},[s("span"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8278em"}},[s("span",{style:{top:"-2.931em","margin-right":"0.0714em"}},[s("span",{class:"pstrut",style:{height:"2.5em"}}),s("span",{class:"sizing reset-size3 size1 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mtight"},"′")])])])])])])])])])])])])])])])]),s("span",{class:"mord"},"∣"),s("span",{class:"mord mathnormal"},"ε")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"3.5037em"}},[s("span")])])])]),s("span",{class:"arraycolsep",style:{width:"0.5em"}})])])])])])])],-1),es=l(`
  • 要注意:将这两者进行改写后并不能保证改写后的文法是LL(1),仍需要再进行验证

递归下降

输入
  • 非终止符号递归调用,终止符号匹配
int main(){
  Token token = getNextToken();
  S();/*S is the start symbol*/
  if(token!='$') throw error;
diff --git "a/assets/Chapter4 \350\257\255\344\271\211\345\210\206\346\236\220.html-ca76b0c6.js" "b/assets/Chapter4 \350\257\255\344\271\211\345\210\206\346\236\220.html-b0e59602.js"
similarity index 99%
rename from "assets/Chapter4 \350\257\255\344\271\211\345\210\206\346\236\220.html-ca76b0c6.js"
rename to "assets/Chapter4 \350\257\255\344\271\211\345\210\206\346\236\220.html-b0e59602.js"
index 1d9380e53..e6ebc800e 100644
--- "a/assets/Chapter4 \350\257\255\344\271\211\345\210\206\346\236\220.html-ca76b0c6.js"	
+++ "b/assets/Chapter4 \350\257\255\344\271\211\345\210\206\346\236\220.html-b0e59602.js"	
@@ -1,4 +1,4 @@
-import{_ as t}from"./plugin-vue_export-helper-c27b6911.js";import{o as n,c as i,f as l,a as s,b as a}from"./app-a9076d6c.js";const e={},m=l('

Chapter4 语义分析

目录

介绍

  • 语义分析核心是类型检查(Type check)和作用域检查(Scope check)
  • 语义通过属性的值来刻画
  • 通过一系列属性等式来进行计算,按照一定的顺序进行计算

Recursive AST Walk

  • 一种语义分析的实现方法,本书暂时不表

Attribute Grammars

语法制导的语法分析(Syntax-Directed Semantics Analysis )

  • 又称SDS、SDT、SDD
  • 属性是附着在文法符号上的

属性(Attribute)

',10),p=s("ul",null,[s("li",null,[a("CFG中的所有文法符号"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"X")]),s("annotation",{encoding:"application/x-tex"},"X")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X")])])]),a("都用属性以描述,把某个属性"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"a")]),s("annotation",{encoding:"application/x-tex"},"a")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"a")])])]),a(" 表示为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"X"),s("mi",{mathvariant:"normal"},"."),s("mi",null,"a")]),s("annotation",{encoding:"application/x-tex"},"X.a")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"mord"},"."),s("span",{class:"mord mathnormal"},"a")])])])])],-1),r=s("h5",{id:"属性等式-attribute-equation",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#属性等式-attribute-equation","aria-hidden":"true"},"#"),a(" 属性等式(Attribute Equation)")],-1),c=s("ul",null,[s("li",null,"又叫语义规则(Semantic Rule)"),s("li",null,[a("给定属性 集合"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"a"),s("mn",null,"1")]),s("mtext",null,","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"a"),s("mi",null,"k")])]),s("annotation",{encoding:"application/x-tex"},"a_1 ,... ,a_k")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord cjk_fallback"},","),s("span",{class:"mord"},"..."),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3361em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.03148em"}},"k")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])])]),s("li",null,[a("对于每个语法规则"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mn",null,"0")]),s("mo",null,"→"),s("msub",null,[s("mi",null,"X"),s("mn",null,"1")]),s("msub",null,[s("mi",null,"X"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"X"),s("mi",null,"n")])]),s("annotation",{encoding:"application/x-tex"},"X_0→X_1X_2...X_n")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"0")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"..."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a(",每个语法符号"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mi",null,"i")])]),s("annotation",{encoding:"application/x-tex"},"X_i")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"i")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a(" 的属性 "),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mi",null,"i")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"j")])]),s("annotation",{encoding:"application/x-tex"},"X_i.a_j")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9694em","vertical-align":"-0.2861em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"i")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.05724em"}},"j")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.2861em"}},[s("span")])])])])])])])]),a(" 的值与规则中其他符号的属性值相关")]),s("li",null,"属性等式就是如下格式")],-1),h=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mi",null,"i")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"j")]),s("mo",null,"="),s("msub",null,[s("mi",null,"f"),s("mrow",null,[s("mi",null,"i"),s("mi",null,"j")])]),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"X"),s("mn",null,"0")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mn",null,"1")]),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mn",null,"0")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"k")]),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mn",null,"1")]),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"k")]),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mi",null,"n")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mn",null,"1")]),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mi",null,"n")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"k")]),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"}," X_i.a_j = f_{ij} (X_0 .a_1,...,X_0.a_k,X_1 .a_1,... ,X_1.a_k,...,X_n.a_1,...,X_n.a_k) ")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9694em","vertical-align":"-0.2861em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"i")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.05724em"}},"j")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.2861em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1.0361em","vertical-align":"-0.2861em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.1076em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.05724em"}},"ij")])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.2861em"}},[s("span")])])])])]),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"0")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"0")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3361em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.03148em"}},"k")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3361em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.03148em"}},"k")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3361em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.03148em"}},"k")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mclose"},")")])])])])],-1),g=l('
属性文法
  • 通常是以下格式:
Grammar RuleSemantic Rules
Rule1Associated attribute equations
...
Rule nAssociated attribute equations
无符号数和数字属性

![[属性示意图.png]] ![[无符号数和数字属性.png]]

变量声明和数据类型属性

![[变量声明和数据类型属性1.png]] ![[变量声明和数据类型属性2.png]]

类型检查与表达式的类型属性

![[类型检查与表达式的类型属性.png]]

属性计算

  • 属性计算可以在分析树构建完成后进行,也可以在分析的过程中同时进行。
属性计算的算法
  1. 依赖图的生成和计算顺序的确定
  • 每一个属性等式对应一个依赖图(有向图,边代表属性值计算的计算依赖顺序)
  • 多个属性等式构成一个组合依赖图,通过这个附着在抽象语法树或者分析树的依赖图可以对计算次序进行计算
  1. 综合(Synthesized)属性和继承(Inherited)属性
  • 综合属性:属性由子节点属性决定(如果所有属性都是综合属性,那这个文法是一个综合属性文法S-attributed grammar),在bottom-up的过程中,可以边分析边计算属性(从叶子节点生成父节点)
  • 继承属性:属性由兄弟节点或兄弟和子节点属性决定(不是综合就是继承)
  1. 在分析的过程中计算属性
  • 属性计算的困难:
    • 属性语法是一种抽象规范,属性方程可以按任意顺序编写而不影响其有效性,它们不指定属性计算的顺序
    • 问题主要在于找到属性计算和分配的顺序,以确保每次计算中使用的所有属性值在执行每次计算时都可用
    • 属性方程本身表明属性计算的顺序约束。 我们将使用依赖图来明确顺序约束
依赖图和计算顺序
',19),o=s("ul",null,[s("li",null,[a("依赖图: "),s("ul",null,[s("li",null,[a("每个符号的每个属性 "),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mi",null,"i")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"j")])]),s("annotation",{encoding:"application/x-tex"},"X_i.a_j")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9694em","vertical-align":"-0.2861em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"i")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.05724em"}},"j")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.2861em"}},[s("span")])])])])])])])]),a(" 对应一个节点")]),s("li",null,[a("对于每个属性方程 "),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mi",null,"i")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"j")]),s("mo",null,"="),s("msub",null,[s("mi",null,"f"),s("mrow",null,[s("mi",null,"i"),s("mi",null,"j")])]),s("mo",{stretchy:"false"},"("),s("mo",null,"…"),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mi",null,"m")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"k")]),s("mo",{separator:"true"},","),s("mo",null,"…"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"X_i.a_j=f_{ij}(…,X_m.a_k,…)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9694em","vertical-align":"-0.2861em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"i")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.05724em"}},"j")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.2861em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1.0361em","vertical-align":"-0.2861em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.1076em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.05724em"}},"ij")])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.2861em"}},[s("span")])])])])]),s("span",{class:"mopen"},"("),s("span",{class:"minner"},"…"),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"m")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3361em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.03148em"}},"k")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"minner"},"…"),s("span",{class:"mclose"},")")])])]),a(" 都有一条从右侧的每个节点 "),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mi",null,"m")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"k")])]),s("annotation",{encoding:"application/x-tex"},"X_m.a_k")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"m")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3361em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.03148em"}},"k")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a(" 到节点 "),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mi",null,"i")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"j")])]),s("annotation",{encoding:"application/x-tex"},"X_i.a_j")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9694em","vertical-align":"-0.2861em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"i")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.05724em"}},"j")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.2861em"}},[s("span")])])])])])])])]),a(" 的边(表示 "),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mi",null,"i")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"j")])]),s("annotation",{encoding:"application/x-tex"},"X_i.a_j")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9694em","vertical-align":"-0.2861em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"i")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.05724em"}},"j")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.2861em"}},[s("span")])])])])])])])]),a(" 对 "),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mi",null,"m")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"k")])]),s("annotation",{encoding:"application/x-tex"},"X_m.a_k")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"m")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3361em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.03148em"}},"k")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a(" 的依赖关系)")])])])],-1),u=s("p",null,"![[依赖图和计算顺序1.png]] ![[依赖图和计算顺序2.png]]",-1),d=s("ul",null,[s("li",null,"我们通常把依赖图直接叠加绘制在分析树上")],-1),v=s("p",null,"![[依赖图和计算顺序3.png]]",-1),y=s("h6",{id:"综合属性",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#综合属性","aria-hidden":"true"},"#"),a(" 综合属性")],-1),b=s("ul",null,[s("li",null,"如果解析树中的所有依赖项都从子级指向父级,那么就是综合属性。"),s("li",null,[a("等价地,如果给定语法规则 "),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"X"),s("mn",null,"1")]),s("msub",null,[s("mi",null,"X"),s("mn",null,"2")]),s("mo",null,"…"),s("msub",null,[s("mi",null,"X"),s("mi",null,"n")])]),s("annotation",{encoding:"application/x-tex"},"A → X_1X_2…X_n")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"minner"},"…"),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a(",左侧带有 "),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"a")]),s("annotation",{encoding:"application/x-tex"},"a")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"a")])])]),a(" 的"),s("em",null,"唯一"),a("(不能存在另一个可能为从非子节点获取属性的属性方程)关联属性方程的形式为以下所示,那么"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"a")]),s("annotation",{encoding:"application/x-tex"},"a")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"a")])])]),a("就是综合属性")])],-1),z=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mi",{mathvariant:"normal"},"."),s("mi",null,"a"),s("mo",null,"="),s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mn",null,"1")]),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"X"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"k")]),s("mo",{separator:"true"},","),s("mo",null,"…"),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mi",null,"n")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mn",null,"1")]),s("mo",{separator:"true"},","),s("mo",null,"…"),s("msub",null,[s("mi",null,"X"),s("mi",null,"n")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"k")]),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"}," A.a=f(x_1.a_1,..X_1.a_k,…,X_n.a_1,…X_n.a_k) ")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},"."),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"x"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},".."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3361em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.03148em"}},"k")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"minner"},"…"),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"minner"},"…"),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3361em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.03148em"}},"k")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mclose"},")")])])])])],-1),x=l(`

![[综合属性定义.png]]

综合属性文法(S-attributed grammar)
  • 如果文法中所有属性都是综合属性,那么这就是一个综合属性文法。
  • 对综合属性的计算可以在分析树的基础上,通过一次自顶向下或者后续遍历完成计算
procedure PostEval(T:treenode)
+import{_ as t}from"./plugin-vue_export-helper-c27b6911.js";import{o as n,c as i,f as l,a as s,b as a}from"./app-c6e156cf.js";const e={},m=l('

Chapter4 语义分析

目录

介绍

  • 语义分析核心是类型检查(Type check)和作用域检查(Scope check)
  • 语义通过属性的值来刻画
  • 通过一系列属性等式来进行计算,按照一定的顺序进行计算

Recursive AST Walk

  • 一种语义分析的实现方法,本书暂时不表

Attribute Grammars

语法制导的语法分析(Syntax-Directed Semantics Analysis )

  • 又称SDS、SDT、SDD
  • 属性是附着在文法符号上的

属性(Attribute)

',10),p=s("ul",null,[s("li",null,[a("CFG中的所有文法符号"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"X")]),s("annotation",{encoding:"application/x-tex"},"X")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X")])])]),a("都用属性以描述,把某个属性"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"a")]),s("annotation",{encoding:"application/x-tex"},"a")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"a")])])]),a(" 表示为"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"X"),s("mi",{mathvariant:"normal"},"."),s("mi",null,"a")]),s("annotation",{encoding:"application/x-tex"},"X.a")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"mord"},"."),s("span",{class:"mord mathnormal"},"a")])])])])],-1),r=s("h5",{id:"属性等式-attribute-equation",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#属性等式-attribute-equation","aria-hidden":"true"},"#"),a(" 属性等式(Attribute Equation)")],-1),c=s("ul",null,[s("li",null,"又叫语义规则(Semantic Rule)"),s("li",null,[a("给定属性 集合"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"a"),s("mn",null,"1")]),s("mtext",null,","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"a"),s("mi",null,"k")])]),s("annotation",{encoding:"application/x-tex"},"a_1 ,... ,a_k")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8778em","vertical-align":"-0.1944em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord cjk_fallback"},","),s("span",{class:"mord"},"..."),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3361em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.03148em"}},"k")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])])]),s("li",null,[a("对于每个语法规则"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mn",null,"0")]),s("mo",null,"→"),s("msub",null,[s("mi",null,"X"),s("mn",null,"1")]),s("msub",null,[s("mi",null,"X"),s("mn",null,"2")]),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"X"),s("mi",null,"n")])]),s("annotation",{encoding:"application/x-tex"},"X_0→X_1X_2...X_n")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"0")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"..."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a(",每个语法符号"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mi",null,"i")])]),s("annotation",{encoding:"application/x-tex"},"X_i")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"i")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a(" 的属性 "),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mi",null,"i")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"j")])]),s("annotation",{encoding:"application/x-tex"},"X_i.a_j")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9694em","vertical-align":"-0.2861em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"i")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.05724em"}},"j")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.2861em"}},[s("span")])])])])])])])]),a(" 的值与规则中其他符号的属性值相关")]),s("li",null,"属性等式就是如下格式")],-1),h=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mi",null,"i")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"j")]),s("mo",null,"="),s("msub",null,[s("mi",null,"f"),s("mrow",null,[s("mi",null,"i"),s("mi",null,"j")])]),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"X"),s("mn",null,"0")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mn",null,"1")]),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mn",null,"0")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"k")]),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mn",null,"1")]),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"k")]),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mi",null,"n")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mn",null,"1")]),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mi",null,"n")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"k")]),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"}," X_i.a_j = f_{ij} (X_0 .a_1,...,X_0.a_k,X_1 .a_1,... ,X_1.a_k,...,X_n.a_1,...,X_n.a_k) ")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9694em","vertical-align":"-0.2861em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"i")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.05724em"}},"j")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.2861em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1.0361em","vertical-align":"-0.2861em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.1076em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.05724em"}},"ij")])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.2861em"}},[s("span")])])])])]),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"0")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"0")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3361em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.03148em"}},"k")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3361em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.03148em"}},"k")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},"..."),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3361em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.03148em"}},"k")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mclose"},")")])])])])],-1),g=l('
属性文法
  • 通常是以下格式:
Grammar RuleSemantic Rules
Rule1Associated attribute equations
...
Rule nAssociated attribute equations
无符号数和数字属性

![[属性示意图.png]] ![[无符号数和数字属性.png]]

变量声明和数据类型属性

![[变量声明和数据类型属性1.png]] ![[变量声明和数据类型属性2.png]]

类型检查与表达式的类型属性

![[类型检查与表达式的类型属性.png]]

属性计算

  • 属性计算可以在分析树构建完成后进行,也可以在分析的过程中同时进行。
属性计算的算法
  1. 依赖图的生成和计算顺序的确定
  • 每一个属性等式对应一个依赖图(有向图,边代表属性值计算的计算依赖顺序)
  • 多个属性等式构成一个组合依赖图,通过这个附着在抽象语法树或者分析树的依赖图可以对计算次序进行计算
  1. 综合(Synthesized)属性和继承(Inherited)属性
  • 综合属性:属性由子节点属性决定(如果所有属性都是综合属性,那这个文法是一个综合属性文法S-attributed grammar),在bottom-up的过程中,可以边分析边计算属性(从叶子节点生成父节点)
  • 继承属性:属性由兄弟节点或兄弟和子节点属性决定(不是综合就是继承)
  1. 在分析的过程中计算属性
  • 属性计算的困难:
    • 属性语法是一种抽象规范,属性方程可以按任意顺序编写而不影响其有效性,它们不指定属性计算的顺序
    • 问题主要在于找到属性计算和分配的顺序,以确保每次计算中使用的所有属性值在执行每次计算时都可用
    • 属性方程本身表明属性计算的顺序约束。 我们将使用依赖图来明确顺序约束
依赖图和计算顺序
',19),o=s("ul",null,[s("li",null,[a("依赖图: "),s("ul",null,[s("li",null,[a("每个符号的每个属性 "),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mi",null,"i")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"j")])]),s("annotation",{encoding:"application/x-tex"},"X_i.a_j")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9694em","vertical-align":"-0.2861em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"i")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.05724em"}},"j")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.2861em"}},[s("span")])])])])])])])]),a(" 对应一个节点")]),s("li",null,[a("对于每个属性方程 "),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mi",null,"i")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"j")]),s("mo",null,"="),s("msub",null,[s("mi",null,"f"),s("mrow",null,[s("mi",null,"i"),s("mi",null,"j")])]),s("mo",{stretchy:"false"},"("),s("mo",null,"…"),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mi",null,"m")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"k")]),s("mo",{separator:"true"},","),s("mo",null,"…"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"X_i.a_j=f_{ij}(…,X_m.a_k,…)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9694em","vertical-align":"-0.2861em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"i")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.05724em"}},"j")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.2861em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1.0361em","vertical-align":"-0.2861em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.1076em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.05724em"}},"ij")])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.2861em"}},[s("span")])])])])]),s("span",{class:"mopen"},"("),s("span",{class:"minner"},"…"),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"m")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3361em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.03148em"}},"k")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"minner"},"…"),s("span",{class:"mclose"},")")])])]),a(" 都有一条从右侧的每个节点 "),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mi",null,"m")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"k")])]),s("annotation",{encoding:"application/x-tex"},"X_m.a_k")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"m")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3361em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.03148em"}},"k")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a(" 到节点 "),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mi",null,"i")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"j")])]),s("annotation",{encoding:"application/x-tex"},"X_i.a_j")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9694em","vertical-align":"-0.2861em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"i")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.05724em"}},"j")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.2861em"}},[s("span")])])])])])])])]),a(" 的边(表示 "),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mi",null,"i")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"j")])]),s("annotation",{encoding:"application/x-tex"},"X_i.a_j")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.9694em","vertical-align":"-0.2861em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"i")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3117em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.05724em"}},"j")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.2861em"}},[s("span")])])])])])])])]),a(" 对 "),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("msub",null,[s("mi",null,"X"),s("mi",null,"m")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"k")])]),s("annotation",{encoding:"application/x-tex"},"X_m.a_k")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"m")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3361em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.03148em"}},"k")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a(" 的依赖关系)")])])])],-1),u=s("p",null,"![[依赖图和计算顺序1.png]] ![[依赖图和计算顺序2.png]]",-1),d=s("ul",null,[s("li",null,"我们通常把依赖图直接叠加绘制在分析树上")],-1),v=s("p",null,"![[依赖图和计算顺序3.png]]",-1),y=s("h6",{id:"综合属性",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#综合属性","aria-hidden":"true"},"#"),a(" 综合属性")],-1),b=s("ul",null,[s("li",null,"如果解析树中的所有依赖项都从子级指向父级,那么就是综合属性。"),s("li",null,[a("等价地,如果给定语法规则 "),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mo",null,"→"),s("msub",null,[s("mi",null,"X"),s("mn",null,"1")]),s("msub",null,[s("mi",null,"X"),s("mn",null,"2")]),s("mo",null,"…"),s("msub",null,[s("mi",null,"X"),s("mi",null,"n")])]),s("annotation",{encoding:"application/x-tex"},"A → X_1X_2…X_n")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8333em","vertical-align":"-0.15em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"2")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"minner"},"…"),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])])])])]),a(",左侧带有 "),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"a")]),s("annotation",{encoding:"application/x-tex"},"a")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"a")])])]),a(" 的"),s("em",null,"唯一"),a("(不能存在另一个可能为从非子节点获取属性的属性方程)关联属性方程的形式为以下所示,那么"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"a")]),s("annotation",{encoding:"application/x-tex"},"a")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"a")])])]),a("就是综合属性")])],-1),z=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mrow",null,[s("mi",null,"A"),s("mi",{mathvariant:"normal"},"."),s("mi",null,"a"),s("mo",null,"="),s("mi",null,"f"),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mn",null,"1")]),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"."),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"X"),s("mn",null,"1")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"k")]),s("mo",{separator:"true"},","),s("mo",null,"…"),s("mo",{separator:"true"},","),s("msub",null,[s("mi",null,"X"),s("mi",null,"n")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mn",null,"1")]),s("mo",{separator:"true"},","),s("mo",null,"…"),s("msub",null,[s("mi",null,"X"),s("mi",null,"n")]),s("mi",{mathvariant:"normal"},"."),s("msub",null,[s("mi",null,"a"),s("mi",null,"k")]),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"}," A.a=f(x_1.a_1,..X_1.a_k,…,X_n.a_1,…X_n.a_k) ")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal"},"A"),s("span",{class:"mord"},"."),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mopen"},"("),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"x"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},".."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3361em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.03148em"}},"k")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"minner"},"…"),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3011em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},"1")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"minner"},"…"),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal",style:{"margin-right":"0.07847em"}},"X"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.1514em"}},[s("span",{style:{top:"-2.55em","margin-left":"-0.0785em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight"},"n")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mord"},"."),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"a"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.3361em"}},[s("span",{style:{top:"-2.55em","margin-left":"0em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mathnormal mtight",style:{"margin-right":"0.03148em"}},"k")])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.15em"}},[s("span")])])])])]),s("span",{class:"mclose"},")")])])])])],-1),x=l(`

![[综合属性定义.png]]

综合属性文法(S-attributed grammar)
  • 如果文法中所有属性都是综合属性,那么这就是一个综合属性文法。
  • 对综合属性的计算可以在分析树的基础上,通过一次自顶向下或者后续遍历完成计算
procedure PostEval(T:treenode)
 begin 
  for each child C of T do 
  PostEval(C); 
diff --git "a/assets/Chapter5 \344\273\243\347\240\201\347\224\237\346\210\220.html-3b3704dc.js" "b/assets/Chapter5 \344\273\243\347\240\201\347\224\237\346\210\220.html-bfb40f25.js"
similarity index 99%
rename from "assets/Chapter5 \344\273\243\347\240\201\347\224\237\346\210\220.html-3b3704dc.js"
rename to "assets/Chapter5 \344\273\243\347\240\201\347\224\237\346\210\220.html-bfb40f25.js"
index 478f4c45a..4b5fe14bc 100644
--- "a/assets/Chapter5 \344\273\243\347\240\201\347\224\237\346\210\220.html-3b3704dc.js"	
+++ "b/assets/Chapter5 \344\273\243\347\240\201\347\224\237\346\210\220.html-bfb40f25.js"	
@@ -1,4 +1,4 @@
-import{_ as t}from"./plugin-vue_export-helper-c27b6911.js";import{o as e,c as n,f as l,a as s,b as a}from"./app-a9076d6c.js";const m={},p=l('

Chapter5 代码生成

介绍

  • 代码生成取决于:源代码、目标系统体系结构、运行时环境
  • 代码生成可以被划分为三步:
  1. 生成中间代码(IR Iermediate code码)
  2. 生成某种汇编形式的代码,而不是真正的可执行代码
  3. 优化目标代码

中间代码

  • 以三地址码(TAC Three Address code)为例

生成三地址码

运算

![[TAC Code1.png]]

变量赋值

![[TAC Instruction.png]]

布尔值

![[TAC Code2.png]]

流程控制语句

![[TAC Code3.png]] ![[TAC Code4.png]]

三地址码的实现

  • 有四元组和三元组实现,一般都用四元组实现,因为利于后面进行进一步的优化

四元组实现

',18),r=s("ul",null,[s("li",null,[a("用"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",{stretchy:"false"},"("),s("mi",null,"o"),s("mi",null,"p"),s("mo",{separator:"true"},","),s("mi",null,"o"),s("mi",null,"p"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"a"),s("mi",null,"n"),s("mi",null,"d"),s("mn",null,"1"),s("mo",{separator:"true"},","),s("mi",null,"o"),s("mi",null,"p"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"a"),s("mi",null,"n"),s("mi",null,"d"),s("mn",null,"2"),s("mo",{separator:"true"},","),s("mi",null,"o"),s("mi",null,"p"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"a"),s("mi",null,"n"),s("mi",null,"d"),s("mn",null,"3"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"(op,operand1,operand2,operand3)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"an"),s("span",{class:"mord mathnormal"},"d"),s("span",{class:"mord"},"1"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"an"),s("span",{class:"mord mathnormal"},"d"),s("span",{class:"mord"},"2"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"an"),s("span",{class:"mord mathnormal"},"d"),s("span",{class:"mord"},"3"),s("span",{class:"mclose"},")")])])]),a("来表示一个三地址指令,用"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",{mathvariant:"normal"},"_")]),s("annotation",{encoding:"application/x-tex"},"\\_")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em","vertical-align":"-0.31em"}}),s("span",{class:"mord",style:{"margin-right":"0.02778em"}},"_")])])]),a("来表示缺省的操作数")]),s("li",null,[a("例如"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"t"),s("mn",null,"2"),s("mo",null,"="),s("mi",null,"f"),s("mi",null,"a"),s("mi",null,"c"),s("mi",null,"t"),s("mo",null,"∗"),s("mi",null,"x"),s("mo",null,"→"),s("mo",{stretchy:"false"},"("),s("mi",null,"m"),s("mi",null,"u"),s("mi",null,"l"),s("mo",{separator:"true"},","),s("mi",null,"f"),s("mi",null,"a"),s("mi",null,"c"),s("mi",null,"t"),s("mo",{separator:"true"},","),s("mi",null,"x"),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"_"),s("mi",null,"t"),s("mn",null,"2"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"t2=fact*x\\rightarrow (mul,fact,x,\\_ t2)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6444em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord"},"2"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∗"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1.06em","vertical-align":"-0.31em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mord mathnormal"},"u"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord",style:{"margin-right":"0.02778em"}},"_"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord"},"2"),s("span",{class:"mclose"},")")])])]),a(" ,"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"l"),s("mi",null,"a"),s("mi",null,"b"),s("mi",null,"e"),s("mi",null,"l"),s("mtext",null,"  "),s("mi",null,"L"),s("mn",null,"2"),s("mo",null,"→"),s("mo",{stretchy:"false"},"("),s("mi",null,"l"),s("mi",null,"a"),s("mi",null,"b"),s("mo",{separator:"true"},","),s("mi",null,"L"),s("mn",null,"2"),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"_"),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"_"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"label\\;L2\\rightarrow (lab,L2,\\_,\\_)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mord mathnormal"},"ab"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"L"),s("span",{class:"mord"},"2"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1.06em","vertical-align":"-0.31em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mord mathnormal"},"ab"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"L"),s("span",{class:"mord"},"2"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord",style:{"margin-right":"0.02778em"}},"_"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord",style:{"margin-right":"0.02778em"}},"_"),s("span",{class:"mclose"},")")])])])])],-1),c=s("h4",{id:"三元组实现",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#三元组实现","aria-hidden":"true"},"#"),a(" 三元组实现")],-1),i=s("ul",null,[s("li",null,"用指令的地址来替换掉一个返回值变量来压缩掉一个变量"),s("li",null,[a("例如"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"t"),s("mn",null,"2"),s("mo",null,"="),s("mi",null,"f"),s("mi",null,"a"),s("mi",null,"c"),s("mi",null,"t"),s("mo",null,"∗"),s("mi",null,"x"),s("mo",null,"→"),s("mo",{stretchy:"false"},"("),s("mn",null,"4"),s("mo",{stretchy:"false"},")"),s("mo",{stretchy:"false"},"("),s("mi",null,"m"),s("mi",null,"u"),s("mi",null,"l"),s("mo",{separator:"true"},","),s("mi",null,"f"),s("mi",null,"a"),s("mi",null,"c"),s("mi",null,"t"),s("mo",{separator:"true"},","),s("mi",null,"x"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"t2=fact*x \\rightarrow (4)(mul,fact,x)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6444em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord"},"2"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∗"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},"4"),s("span",{class:"mclose"},")"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mord mathnormal"},"u"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mclose"},")")])])]),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"f"),s("mi",null,"a"),s("mi",null,"c"),s("mi",null,"t"),s("mo",null,"="),s("mi",null,"t"),s("mn",null,"2"),s("mo",null,"→"),s("mo",{stretchy:"false"},"("),s("mn",null,"5"),s("mo",{stretchy:"false"},")"),s("mo",{stretchy:"false"},"("),s("mi",null,"a"),s("mi",null,"s"),s("mi",null,"n"),s("mo",{separator:"true"},","),s("mo",{stretchy:"false"},"("),s("mn",null,"4"),s("mo",{stretchy:"false"},")"),s("mo",{separator:"true"},","),s("mi",null,"f"),s("mi",null,"a"),s("mi",null,"c"),s("mi",null,"t"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"fact=t2\\rightarrow (5)(asn,(4),fact)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6444em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord"},"2"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},"5"),s("span",{class:"mclose"},")"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},"4"),s("span",{class:"mclose"},")"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mclose"},")")])])])])],-1),o=l('

区别

  • 三元组比较高效,因为空间占用减少了,并且编译器不需要为临时变量生成名称
  • 三元组使用指令索引来表示临时值,那么它们的位置的任何移动都变得困难。 四元组更适合优化

生成三地址码的细节

综合属性

',4),h=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.25em",columnalign:"right left",columnspacing:"0em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"exp"),s("mo",null,"→"),s("mtext",null,"id"),s("mo",null,"="),s("mtext",null,"exp"),s("mo",{fence:"false",stretchy:"true",minsize:"1.2em",maxsize:"1.2em"},"∣"),s("mtext",null,"aexp")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"aexp"),s("mo",null,"→"),s("mtext",null,"aexp+factor"),s("mo",null,"∣"),s("mtext",null,"factor")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"factor"),s("mo",null,"→"),s("mtext",null,"(exp)"),s("mo",null,"∣"),s("mtext",null,"num"),s("mo",null,"∣"),s("mtext",null,"id")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{aligned} &\\text{exp}\\to\\text{id}=\\text{exp}\\big|\\text{aexp} \\\\ &\\text{aexp}\\to\\text{aexp+factor}\\mid\\text{factor} \\\\ &\\text{factor}\\to\\text{(exp)}\\mid\\text{num}\\mid\\text{id} \\end{aligned}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"4.51em","vertical-align":"-2.005em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"col-align-r"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.505em"}},[s("span",{style:{top:"-4.505em"}},[s("span",{class:"pstrut",style:{height:"2.85em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"-3.005em"}},[s("span",{class:"pstrut",style:{height:"2.85em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"-1.505em"}},[s("span",{class:"pstrut",style:{height:"2.85em"}}),s("span",{class:"mord"})])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.005em"}},[s("span")])])])]),s("span",{class:"col-align-l"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.505em"}},[s("span",{style:{top:"-4.655em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"exp")]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"id")]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"exp")]),s("span",{class:"mord"},[s("span",{class:"delimsizing mult"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.85em"}},[s("span",{style:{top:"-2.85em"}},[s("span",{class:"pstrut",style:{height:"3.2em"}}),s("span",{style:{width:"0.333em",height:"1.200em"}},[s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"0.333em",height:"1.200em",viewBox:"0 0 333 1200"},[s("path",{d:`M145 15 v585 v0 v585 c2.667,10,9.667,15,21,15 +import{_ as t}from"./plugin-vue_export-helper-c27b6911.js";import{o as e,c as n,f as l,a as s,b as a}from"./app-c6e156cf.js";const m={},p=l('

Chapter5 代码生成

介绍

  • 代码生成取决于:源代码、目标系统体系结构、运行时环境
  • 代码生成可以被划分为三步:
  1. 生成中间代码(IR Iermediate code码)
  2. 生成某种汇编形式的代码,而不是真正的可执行代码
  3. 优化目标代码

中间代码

  • 以三地址码(TAC Three Address code)为例

生成三地址码

运算

![[TAC Code1.png]]

变量赋值

![[TAC Instruction.png]]

布尔值

![[TAC Code2.png]]

流程控制语句

![[TAC Code3.png]] ![[TAC Code4.png]]

三地址码的实现

  • 有四元组和三元组实现,一般都用四元组实现,因为利于后面进行进一步的优化

四元组实现

',18),r=s("ul",null,[s("li",null,[a("用"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mo",{stretchy:"false"},"("),s("mi",null,"o"),s("mi",null,"p"),s("mo",{separator:"true"},","),s("mi",null,"o"),s("mi",null,"p"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"a"),s("mi",null,"n"),s("mi",null,"d"),s("mn",null,"1"),s("mo",{separator:"true"},","),s("mi",null,"o"),s("mi",null,"p"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"a"),s("mi",null,"n"),s("mi",null,"d"),s("mn",null,"2"),s("mo",{separator:"true"},","),s("mi",null,"o"),s("mi",null,"p"),s("mi",null,"e"),s("mi",null,"r"),s("mi",null,"a"),s("mi",null,"n"),s("mi",null,"d"),s("mn",null,"3"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"(op,operand1,operand2,operand3)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"an"),s("span",{class:"mord mathnormal"},"d"),s("span",{class:"mord"},"1"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"an"),s("span",{class:"mord mathnormal"},"d"),s("span",{class:"mord"},"2"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"o"),s("span",{class:"mord mathnormal"},"p"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.02778em"}},"er"),s("span",{class:"mord mathnormal"},"an"),s("span",{class:"mord mathnormal"},"d"),s("span",{class:"mord"},"3"),s("span",{class:"mclose"},")")])])]),a("来表示一个三地址指令,用"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",{mathvariant:"normal"},"_")]),s("annotation",{encoding:"application/x-tex"},"\\_")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em","vertical-align":"-0.31em"}}),s("span",{class:"mord",style:{"margin-right":"0.02778em"}},"_")])])]),a("来表示缺省的操作数")]),s("li",null,[a("例如"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"t"),s("mn",null,"2"),s("mo",null,"="),s("mi",null,"f"),s("mi",null,"a"),s("mi",null,"c"),s("mi",null,"t"),s("mo",null,"∗"),s("mi",null,"x"),s("mo",null,"→"),s("mo",{stretchy:"false"},"("),s("mi",null,"m"),s("mi",null,"u"),s("mi",null,"l"),s("mo",{separator:"true"},","),s("mi",null,"f"),s("mi",null,"a"),s("mi",null,"c"),s("mi",null,"t"),s("mo",{separator:"true"},","),s("mi",null,"x"),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"_"),s("mi",null,"t"),s("mn",null,"2"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"t2=fact*x\\rightarrow (mul,fact,x,\\_ t2)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6444em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord"},"2"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∗"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1.06em","vertical-align":"-0.31em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mord mathnormal"},"u"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord",style:{"margin-right":"0.02778em"}},"_"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord"},"2"),s("span",{class:"mclose"},")")])])]),a(" ,"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"l"),s("mi",null,"a"),s("mi",null,"b"),s("mi",null,"e"),s("mi",null,"l"),s("mtext",null,"  "),s("mi",null,"L"),s("mn",null,"2"),s("mo",null,"→"),s("mo",{stretchy:"false"},"("),s("mi",null,"l"),s("mi",null,"a"),s("mi",null,"b"),s("mo",{separator:"true"},","),s("mi",null,"L"),s("mn",null,"2"),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"_"),s("mo",{separator:"true"},","),s("mi",{mathvariant:"normal"},"_"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"label\\;L2\\rightarrow (lab,L2,\\_,\\_)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mord mathnormal"},"ab"),s("span",{class:"mord mathnormal"},"e"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord mathnormal"},"L"),s("span",{class:"mord"},"2"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1.06em","vertical-align":"-0.31em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mord mathnormal"},"ab"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"L"),s("span",{class:"mord"},"2"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord",style:{"margin-right":"0.02778em"}},"_"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord",style:{"margin-right":"0.02778em"}},"_"),s("span",{class:"mclose"},")")])])])])],-1),c=s("h4",{id:"三元组实现",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#三元组实现","aria-hidden":"true"},"#"),a(" 三元组实现")],-1),i=s("ul",null,[s("li",null,"用指令的地址来替换掉一个返回值变量来压缩掉一个变量"),s("li",null,[a("例如"),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"t"),s("mn",null,"2"),s("mo",null,"="),s("mi",null,"f"),s("mi",null,"a"),s("mi",null,"c"),s("mi",null,"t"),s("mo",null,"∗"),s("mi",null,"x"),s("mo",null,"→"),s("mo",{stretchy:"false"},"("),s("mn",null,"4"),s("mo",{stretchy:"false"},")"),s("mo",{stretchy:"false"},"("),s("mi",null,"m"),s("mi",null,"u"),s("mi",null,"l"),s("mo",{separator:"true"},","),s("mi",null,"f"),s("mi",null,"a"),s("mi",null,"c"),s("mi",null,"t"),s("mo",{separator:"true"},","),s("mi",null,"x"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"t2=fact*x \\rightarrow (4)(mul,fact,x)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6444em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord"},"2"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"∗"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},"4"),s("span",{class:"mclose"},")"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mord mathnormal"},"u"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.01968em"}},"l"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"x"),s("span",{class:"mclose"},")")])])]),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"f"),s("mi",null,"a"),s("mi",null,"c"),s("mi",null,"t"),s("mo",null,"="),s("mi",null,"t"),s("mn",null,"2"),s("mo",null,"→"),s("mo",{stretchy:"false"},"("),s("mn",null,"5"),s("mo",{stretchy:"false"},")"),s("mo",{stretchy:"false"},"("),s("mi",null,"a"),s("mi",null,"s"),s("mi",null,"n"),s("mo",{separator:"true"},","),s("mo",{stretchy:"false"},"("),s("mn",null,"4"),s("mo",{stretchy:"false"},")"),s("mo",{separator:"true"},","),s("mi",null,"f"),s("mi",null,"a"),s("mi",null,"c"),s("mi",null,"t"),s("mo",{stretchy:"false"},")")]),s("annotation",{encoding:"application/x-tex"},"fact=t2\\rightarrow (5)(asn,(4),fact)")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8889em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6444em"}}),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mord"},"2"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},"5"),s("span",{class:"mclose"},")"),s("span",{class:"mopen"},"("),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"s"),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mopen"},"("),s("span",{class:"mord"},"4"),s("span",{class:"mclose"},")"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.10764em"}},"f"),s("span",{class:"mord mathnormal"},"a"),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mord mathnormal"},"t"),s("span",{class:"mclose"},")")])])])])],-1),o=l('

区别

  • 三元组比较高效,因为空间占用减少了,并且编译器不需要为临时变量生成名称
  • 三元组使用指令索引来表示临时值,那么它们的位置的任何移动都变得困难。 四元组更适合优化

生成三地址码的细节

综合属性

',4),h=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.25em",columnalign:"right left",columnspacing:"0em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"exp"),s("mo",null,"→"),s("mtext",null,"id"),s("mo",null,"="),s("mtext",null,"exp"),s("mo",{fence:"false",stretchy:"true",minsize:"1.2em",maxsize:"1.2em"},"∣"),s("mtext",null,"aexp")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"aexp"),s("mo",null,"→"),s("mtext",null,"aexp+factor"),s("mo",null,"∣"),s("mtext",null,"factor")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"factor"),s("mo",null,"→"),s("mtext",null,"(exp)"),s("mo",null,"∣"),s("mtext",null,"num"),s("mo",null,"∣"),s("mtext",null,"id")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{aligned} &\\text{exp}\\to\\text{id}=\\text{exp}\\big|\\text{aexp} \\\\ &\\text{aexp}\\to\\text{aexp+factor}\\mid\\text{factor} \\\\ &\\text{factor}\\to\\text{(exp)}\\mid\\text{num}\\mid\\text{id} \\end{aligned}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"4.51em","vertical-align":"-2.005em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"col-align-r"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.505em"}},[s("span",{style:{top:"-4.505em"}},[s("span",{class:"pstrut",style:{height:"2.85em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"-3.005em"}},[s("span",{class:"pstrut",style:{height:"2.85em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"-1.505em"}},[s("span",{class:"pstrut",style:{height:"2.85em"}}),s("span",{class:"mord"})])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.005em"}},[s("span")])])])]),s("span",{class:"col-align-l"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.505em"}},[s("span",{style:{top:"-4.655em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"exp")]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"id")]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"exp")]),s("span",{class:"mord"},[s("span",{class:"delimsizing mult"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.85em"}},[s("span",{style:{top:"-2.85em"}},[s("span",{class:"pstrut",style:{height:"3.2em"}}),s("span",{style:{width:"0.333em",height:"1.200em"}},[s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"0.333em",height:"1.200em",viewBox:"0 0 333 1200"},[s("path",{d:`M145 15 v585 v0 v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v0 v-585 c-2.667,-10,-9.667,-15,-21,-15 c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v0 v585 h43z`})])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.35em"}},[s("span")])])])])]),s("span",{class:"mord text"},[s("span",{class:"mord"},"aexp")])])]),s("span",{style:{top:"-3.155em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"aexp")]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"aexp+factor")]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∣"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"factor")])])]),s("span",{style:{top:"-1.655em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"factor")]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"(exp)")]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∣"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"num")]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∣"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"id")])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.005em"}},[s("span")])])])])])])])])])])],-1),d=s("p",null,"![[综合属性语义规则1.png]] ![[综合属性语义规则2.png]] ![[综合属性语义分析.png]]",-1),u=s("h4",{id:"语言结构",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#语言结构","aria-hidden":"true"},"#"),a(" 语言结构")],-1),g=s("h5",{id:"if",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#if","aria-hidden":"true"},"#"),a(" If")],-1),y=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.25em",columnalign:"right left",columnspacing:"0em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mtext",null,"if-stmt")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mo",null,"→"),s("mtext",null,"if(exp)"),s("mtext",null,"  "),s("mtext",null,"stmt")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mi",{mathvariant:"normal"},"∣"),s("mtext",null,"if"),s("mo",{stretchy:"false"},"("),s("mtext",null,"exp"),s("mo",{stretchy:"false"},")"),s("mtext",null,"  "),s("mtext",null,"stmt else stmt")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{aligned} \\text{if-stmt}& \\to\\text{if}\\text{(exp)}\\;\\text{stmt} \\\\ &|\\text{if}(\\text{exp})\\;\\text{stmt else stmt} \\end{aligned}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"3em","vertical-align":"-1.25em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"col-align-r"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.75em"}},[s("span",{style:{top:"-3.91em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord text"},[s("span",{class:"mord"},"if-stmt")])])]),s("span",{style:{top:"-2.41em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"})])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.25em"}},[s("span")])])])]),s("span",{class:"col-align-l"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.75em"}},[s("span",{style:{top:"-3.91em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"if")]),s("span",{class:"mord text"},[s("span",{class:"mord"},"(exp)")]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"stmt")])])]),s("span",{style:{top:"-2.41em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord"},"∣"),s("span",{class:"mord text"},[s("span",{class:"mord"},"if")]),s("span",{class:"mopen"},"("),s("span",{class:"mord text"},[s("span",{class:"mord"},"exp")]),s("span",{class:"mclose"},")"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"stmt else stmt")])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.25em"}},[s("span")])])])])])])])])])])],-1),x=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.25em",columnalign:"right left",columnspacing:"0em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"if"),s("mi",{mathvariant:"normal"},"_"),s("mtext",null,"false t1 goto L1")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"goto L2")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"label L1")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"label L2")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{aligned} &\\text{} \\\\ &\\text{if}\\_\\text{false t1 goto L1} \\\\ &\\text{} \\\\ &\\text{goto L2} \\\\ &\\text{label L1} \\\\ &\\text{} \\\\ &\\text{label L2} \\end{aligned}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"10.5em","vertical-align":"-5em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"col-align-r"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"5.5em"}},[s("span",{style:{top:"-7.5em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"-6em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"-4.5em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"-3em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"-1.5em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"0em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"1.5em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"5em"}},[s("span")])])])]),s("span",{class:"col-align-l"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"5.5em"}},[s("span",{style:{top:"-7.66em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"")])])]),s("span",{style:{top:"-6.16em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"if")]),s("span",{class:"mord",style:{"margin-right":"0.02778em"}},"_"),s("span",{class:"mord text"},[s("span",{class:"mord"},"false t1 goto L1")])])]),s("span",{style:{top:"-4.66em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"")])])]),s("span",{style:{top:"-3.16em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"goto L2")])])]),s("span",{style:{top:"-1.66em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"label L1")])])]),s("span",{style:{top:"-0.16em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"")])])]),s("span",{style:{top:"1.34em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"label L2")])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"5em"}},[s("span")])])])])])])])])])])],-1),v=s("h6",{id:"",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#","aria-hidden":"true"},"#"),a(),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"S"),s("mo",null,"→"),s("mtext",null,"if E then S1")]),s("annotation",{encoding:"application/x-tex"},"S\\to\\text{if E then S1}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6944em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"if E then S1")])])])])],-1),w=s("p",null,"![[if结构.png]]",-1),b=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.25em",columnalign:"right left",columnspacing:"0em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"E.true"),s("mo",null,"="),s("mtext",null,"newlabel ();")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"E.false"),s("mo",null,"="),s("mtext",null,"S.next;")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"S.code"),s("mo",null,"="),s("mtext",null,"E.code"),s("mo",null,"+"),s("mo",null,"+"),s("mtext",null,"Label E.true"),s("mo",null,"+"),s("mo",null,"+"),s("mtext",null,"S1.code")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{aligned} &\\text{E.true}=\\text{newlabel ();} \\\\ &\\text{E.false}=\\text{S.next;} \\\\ &\\text{S.code}=\\text{E.code}++\\text{Label E.true}++\\text{S1.code} \\end{aligned}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"4.5em","vertical-align":"-2em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"col-align-r"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.5em"}},[s("span",{style:{top:"-4.5em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"-3em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"-1.5em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2em"}},[s("span")])])])]),s("span",{class:"col-align-l"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.5em"}},[s("span",{style:{top:"-4.66em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"E.true")]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"newlabel ();")])])]),s("span",{style:{top:"-3.16em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"E.false")]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"S.next;")])])]),s("span",{style:{top:"-1.66em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"S.code")]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"E.code")]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"+"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},"+"),s("span",{class:"mord text"},[s("span",{class:"mord"},"Label E.true")]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"+"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},"+"),s("span",{class:"mord text"},[s("span",{class:"mord"},"S1.code")])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2em"}},[s("span")])])])])])])])])])])],-1),f=s("h6",{id:"-1",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#-1","aria-hidden":"true"},"#"),a(),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mi",null,"S"),s("mo",null,"→"),s("mtext",null,"if E then S1 else S2")]),s("annotation",{encoding:"application/x-tex"},"S\\to\\text{if E then S1 else S2}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6944em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"if E then S1 else S2")])])])])],-1),k=s("p",null,"![[if-else结构.png]]",-1),E=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.25em",columnalign:"right left",columnspacing:"0em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"E.true=newlabel"),s("mo",{separator:"true"},";"),s("mtext",null,"E.false=newlabel"),s("mo",{separator:"true"},";")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"S1.next=S.next"),s("mo",{separator:"true"},";"),s("mtext",null,"S2.next=S.next;")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"S.code=E.code"),s("mo",null,"+"),s("mo",null,"+"),s("mtext",null,"LabelE.true"),s("mo",null,"+"),s("mo",null,"+"),s("mi",null,"S"),s("mn",null,"1."),s("mtext",null,"code"),s("mo",null,"+"),s("mo",null,"+"),s("mtext",null,"goto S.next"),s("mo",null,"+"),s("mo",null,"+")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"Label E.false++S2.code")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{aligned} &\\text{E.true=newlabel};\\text{E.false=newlabel}; \\\\ &\\text{S1.next=S.next};\\text{S2.next=S.next;} \\\\ &\\text{S.code=E.code}++\\text{LabelE.true}++S1.\\text{code}++\\text{goto S.next}++ \\\\ &\\text{Label E.false++S2.code} \\end{aligned}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"6em","vertical-align":"-2.75em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"col-align-r"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"3.25em"}},[s("span",{style:{top:"-5.25em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"-3.75em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"-2.25em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"-0.75em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.75em"}},[s("span")])])])]),s("span",{class:"col-align-l"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"3.25em"}},[s("span",{style:{top:"-5.41em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"E.true=newlabel")]),s("span",{class:"mpunct"},";"),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"E.false=newlabel")]),s("span",{class:"mpunct"},";")])]),s("span",{style:{top:"-3.91em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"S1.next=S.next")]),s("span",{class:"mpunct"},";"),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"S2.next=S.next;")])])]),s("span",{style:{top:"-2.41em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"S.code=E.code")]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"+"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},"+"),s("span",{class:"mord text"},[s("span",{class:"mord"},"LabelE.true")]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"+"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},"+"),s("span",{class:"mord mathnormal",style:{"margin-right":"0.05764em"}},"S"),s("span",{class:"mord"},"1."),s("span",{class:"mord text"},[s("span",{class:"mord"},"code")]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"+"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},"+"),s("span",{class:"mord text"},[s("span",{class:"mord"},"goto S.next")]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"+"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},"+")])]),s("span",{style:{top:"-0.91em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"Label E.false++S2.code")])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.75em"}},[s("span")])])])])])])])])])])],-1),_=s("h5",{id:"while",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#while","aria-hidden":"true"},"#"),a(" While")],-1),M=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mrow",null,[s("mtext",null,"while-stmt"),s("mo",null,"→"),s("mtext",null,"while"),s("mo",{stretchy:"false"},"("),s("mi",null,"exp"),s("mo",null,"⁡"),s("mo",{stretchy:"false"},")"),s("mtext",null,"stmt")]),s("annotation",{encoding:"application/x-tex"}," \\text{while-stmt}\\to\\text{while}(\\exp)\\text{stmt} ")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6944em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"while-stmt")]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"1em","vertical-align":"-0.25em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"while")]),s("span",{class:"mopen"},"("),s("span",{class:"mop"},"exp"),s("span",{class:"mclose"},")"),s("span",{class:"mord text"},[s("span",{class:"mord"},"stmt")])])])])])],-1),z=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.25em",columnalign:"right left",columnspacing:"0em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"label L1")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"if"),s("mi",{mathvariant:"normal"},"_"),s("mtext",null,"false t1 goto L2")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"goto L1")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"label L2")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{aligned} &\\text{label L1} \\\\ &\\text{} \\\\ &\\text{if}\\_\\text{false t1 goto L2} \\\\ &\\text{} \\\\ &\\text{goto L1} \\\\ &\\text{label L2} \\end{aligned}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"9em","vertical-align":"-4.25em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"col-align-r"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"4.75em"}},[s("span",{style:{top:"-6.75em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"-5.25em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"-3.75em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"-2.25em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"-0.75em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"0.75em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"4.25em"}},[s("span")])])])]),s("span",{class:"col-align-l"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"4.75em"}},[s("span",{style:{top:"-6.91em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"label L1")])])]),s("span",{style:{top:"-5.41em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"")])])]),s("span",{style:{top:"-3.91em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"if")]),s("span",{class:"mord",style:{"margin-right":"0.02778em"}},"_"),s("span",{class:"mord text"},[s("span",{class:"mord"},"false t1 goto L2")])])]),s("span",{style:{top:"-2.41em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"")])])]),s("span",{style:{top:"-0.91em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"goto L1")])])]),s("span",{style:{top:"0.59em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"label L2")])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"4.25em"}},[s("span")])])])])])])])])])])],-1),S=s("h6",{id:"-2",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#-2","aria-hidden":"true"},"#"),a(),s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("semantics",null,[s("mrow",null,[s("mtext",null,"S"),s("mo",null,"→"),s("mtext",null,"while E do S1")]),s("annotation",{encoding:"application/x-tex"},"\\text{S}\\to\\text{while E do S1}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6833em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"S")]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.6944em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"while E do S1")])])])])],-1),L=s("p",null,"![[while结构.png]]",-1),T=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.25em",columnalign:"right left",columnspacing:"0em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"S.begin=newlabel"),s("mo",{separator:"true"},";"),s("mtext",null,"E.true=newlabel"),s("mo",{separator:"true"},";"),s("mtext",null,"E.false=S.next;")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"S1.next=S.begin;")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"S.code=Label S.beginin"),s("mo",null,"+"),s("mo",null,"+"),s("mtext",null,"E.code"),s("mo",null,"+"),s("mo",null,"+"),s("mtext",null,"Label E.true"),s("mo",null,"+"),s("mo",null,"+"),s("mtext",null,"S1.code")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mtext",null,"++goto S.begin")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{aligned} &\\text{S.begin=newlabel};\\text{E.true=newlabel};\\text{E.false=S.next;} \\\\ &\\text{S1.next=S.begin;} \\\\ &\\text{S.code=Label S.beginin}++\\text{E.code}++\\text{Label E.true}++\\text{S1.code} \\\\ &\\text{++goto S.begin} \\end{aligned}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"6em","vertical-align":"-2.75em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"col-align-r"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"3.25em"}},[s("span",{style:{top:"-5.25em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"-3.75em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"-2.25em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})]),s("span",{style:{top:"-0.75em"}},[s("span",{class:"pstrut",style:{height:"2.84em"}}),s("span",{class:"mord"})])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.75em"}},[s("span")])])])]),s("span",{class:"col-align-l"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"3.25em"}},[s("span",{style:{top:"-5.41em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"S.begin=newlabel")]),s("span",{class:"mpunct"},";"),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"E.true=newlabel")]),s("span",{class:"mpunct"},";"),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"E.false=S.next;")])])]),s("span",{style:{top:"-3.91em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"S1.next=S.begin;")])])]),s("span",{style:{top:"-2.41em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"S.code=Label S.beginin")]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"+"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},"+"),s("span",{class:"mord text"},[s("span",{class:"mord"},"E.code")]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"+"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},"+"),s("span",{class:"mord text"},[s("span",{class:"mord"},"Label E.true")]),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},"+"),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord"},"+"),s("span",{class:"mord text"},[s("span",{class:"mord"},"S1.code")])])]),s("span",{style:{top:"-0.91em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mord text"},[s("span",{class:"mord"},"++goto S.begin")])])])]),s("span",{class:"vlist-s"},"​")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.75em"}},[s("span")])])])])])])])])])])],-1),I=s("h5",{id:"布尔表达式",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#布尔表达式","aria-hidden":"true"},"#"),a(" 布尔表达式")],-1),A=s("ul",null,[s("li",null,"布尔表达式有两个主要作用,一个是用来计算逻辑值,另一个是用在 if 或 while 等语句中作为条件控制。")],-1),C=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.25em",columnalign:"center",columnspacing:"0em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mtext",null,"E"),s("mo",null,"→"),s("mtext",null,"E or E"),s("mo",null,"∣"),s("mtext",null,"E and E"),s("mo",null,"∣"),s("mtext",null,"not E"),s("mo",null,"∣"),s("mtext",null,"(E)")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mo",{fence:"false",stretchy:"true",minsize:"1.2em",maxsize:"1.2em"},"∣"),s("mtext",null,"id relop id"),s("mo",{fence:"false",stretchy:"true",minsize:"1.2em",maxsize:"1.2em"},"∣"),s("mtext",null,"true"),s("mo",{fence:"false",stretchy:"true",minsize:"1.2em",maxsize:"1.2em"},"∣"),s("mtext",null,"false")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mi",null,"r"),s("mi",null,"e"),s("mi",null,"l"),s("mi",null,"o"),s("mi",null,"p"),s("mo",null,":"),s("mtext",null,"关系运算符"),s("mo",{stretchy:"false"},"("),s("mo",null,"≥"),s("mo",{separator:"true"},","),s("mo",null,"≤"),s("mo",{separator:"true"},","),s("mo",null,"<"),s("mo",{separator:"true"},","),s("mo",null,">"),s("mo",{separator:"true"},","),s("mo",null,"="),s("mo",{separator:"true"},","),s("mo",{mathvariant:"normal"},"≠"),s("mo",{stretchy:"false"},")")])])])])]),s("annotation",{encoding:"application/x-tex"}," \\begin{gathered} \\text{E}\\to\\text{E or E}\\mid\\text{E and E}\\mid\\text{not E}\\mid\\text{(E)} \\\\ \\big|\\text{id relop id}\\big|\\text{true}\\big|\\text{false} \\\\ relop:关系运算符(\\ge,\\le,\\lt,\\gt,=,\\neq) \\end{gathered}")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"4.51em","vertical-align":"-2.005em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"col-align-c"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"2.505em"}},[s("span",{style:{top:"-4.665em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord text"},[s("span",{class:"mord"},"E")]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"→"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"E or E")]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∣"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"E and E")]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∣"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"not E")]),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"∣"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord text"},[s("span",{class:"mord"},"(E)")])])]),s("span",{style:{top:"-3.155em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"},[s("span",{class:"delimsizing mult"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.85em"}},[s("span",{style:{top:"-2.85em"}},[s("span",{class:"pstrut",style:{height:"3.2em"}}),s("span",{style:{width:"0.333em",height:"1.200em"}},[s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"0.333em",height:"1.200em",viewBox:"0 0 333 1200"},[s("path",{d:`M145 15 v585 v0 v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v0 v-585 c-2.667,-10,-9.667,-15,-21,-15 diff --git a/assets/VuePlayground-8bef47e3.js b/assets/VuePlayground-735d6a75.js similarity index 82% rename from assets/VuePlayground-8bef47e3.js rename to assets/VuePlayground-735d6a75.js index 6aae7f07c..3d762d641 100644 --- a/assets/VuePlayground-8bef47e3.js +++ b/assets/VuePlayground-735d6a75.js @@ -1 +1 @@ -import{g as p,i as v,h as c,s as n,j as g,k as f,l as m,m as a,n as y,_ as w}from"./app-a9076d6c.js";const R=e=>JSON.parse(decodeURIComponent(e));var h=p({name:"VuePlayground",props:{title:{type:String,default:""},files:{type:String,required:!0},settings:{type:String,default:"{}"}},setup(e){const i=v(),o=c(!0),t=n(),l=n(),s=g(()=>f({},i,R(e.settings))),u=async()=>{const{ReplStore:r,Repl:d}=await w(()=>import("./vue-repl-2394d437.js"),["assets/vue-repl-2394d437.js","assets/app-a9076d6c.js","assets/commonjs-dynamic-modules-302442b1.js","assets/commonjsHelpers-042e6b4d.js"]);t.value=d,l.value=new r({serializedState:decodeURIComponent(e.files)}),s.value.vueVersion&&await l.value.setVueVersion(s.value.vueVersion)};return m(async()=>{await u(),o.value=!1}),()=>[a("div",{class:"vue-playground-wrapper"},[e.title?a("div",{class:"header"},decodeURIComponent(e.title)):null,a("div",{class:"repl-container"},[o.value?a(y,{class:"preview-loading",height:192}):null,t.value?a(t.value,{store:l.value,autoResize:!0,...s.value,layout:"horizontal"}):null])])]}});export{h as default}; +import{g as p,i as v,h as c,s as n,j as g,k as f,l as m,m as a,n as y,_ as w}from"./app-c6e156cf.js";const R=e=>JSON.parse(decodeURIComponent(e));var h=p({name:"VuePlayground",props:{title:{type:String,default:""},files:{type:String,required:!0},settings:{type:String,default:"{}"}},setup(e){const i=v(),o=c(!0),t=n(),l=n(),s=g(()=>f({},i,R(e.settings))),u=async()=>{const{ReplStore:r,Repl:d}=await w(()=>import("./vue-repl-dfd900ee.js"),["assets/vue-repl-dfd900ee.js","assets/app-c6e156cf.js","assets/commonjs-dynamic-modules-302442b1.js","assets/commonjsHelpers-042e6b4d.js"]);t.value=d,l.value=new r({serializedState:decodeURIComponent(e.files)}),s.value.vueVersion&&await l.value.setVueVersion(s.value.vueVersion)};return m(async()=>{await u(),o.value=!1}),()=>[a("div",{class:"vue-playground-wrapper"},[e.title?a("div",{class:"header"},decodeURIComponent(e.title)):null,a("div",{class:"repl-container"},[o.value?a(y,{class:"preview-loading",height:192}):null,t.value?a(t.value,{store:l.value,autoResize:!0,...s.value,layout:"horizontal"}):null])])]}});export{h as default}; diff --git a/assets/app-a9076d6c.js b/assets/app-c6e156cf.js similarity index 89% rename from assets/app-a9076d6c.js rename to assets/app-c6e156cf.js index b6b213e5f..fceb247fc 100644 --- a/assets/app-a9076d6c.js +++ b/assets/app-c6e156cf.js @@ -1,27 +1,27 @@ -const jc="modulepreload",qc=function(e){return"/"+e},$l={},m=function(t,n,r){if(!n||n.length===0)return t();const a=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=qc(o),o in $l)return;$l[o]=!0;const l=o.endsWith(".css"),s=l?'[rel="stylesheet"]':"";if(!!r)for(let d=a.length-1;d>=0;d--){const p=a[d];if(p.href===o&&(!l||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${s}`))return;const u=document.createElement("link");if(u.rel=l?"stylesheet":jc,l||(u.as="script",u.crossOrigin=""),u.href=o,document.head.appendChild(u),l)return new Promise((d,p)=>{u.addEventListener("load",d),u.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t())};function Ro(e,t){const n=Object.create(null),r=e.split(",");for(let a=0;a!!n[a.toLowerCase()]:a=>!!n[a]}const Ce={},Ln=[],vt=()=>{},Uc=()=>!1,Gc=/^on[^a-z]/,Ar=e=>Gc.test(e),Do=e=>e.startsWith("onUpdate:"),Le=Object.assign,$o=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Wc=Object.prototype.hasOwnProperty,fe=(e,t)=>Wc.call(e,t),Q=Array.isArray,Pn=e=>ga(e)==="[object Map]",gi=e=>ga(e)==="[object Set]",te=e=>typeof e=="function",he=e=>typeof e=="string",Mo=e=>typeof e=="symbol",xe=e=>e!==null&&typeof e=="object",yi=e=>xe(e)&&te(e.then)&&te(e.catch),_i=Object.prototype.toString,ga=e=>_i.call(e),Kc=e=>ga(e).slice(8,-1),bi=e=>ga(e)==="[object Object]",Bo=e=>he(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,or=Ro(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ya=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Jc=/-(\w)/g,st=ya(e=>e.replace(Jc,(t,n)=>n?n.toUpperCase():"")),Yc=/\B([A-Z])/g,hn=ya(e=>e.replace(Yc,"-$1").toLowerCase()),xr=ya(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ra=ya(e=>e?`on${xr(e)}`:""),fr=(e,t)=>!Object.is(e,t),na=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},ro=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Zc=e=>{const t=he(e)?Number(e):NaN;return isNaN(t)?e:t};let Ml;const ao=()=>Ml||(Ml=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Vo(e){if(Q(e)){const t={};for(let n=0;n{if(n){const r=n.split(Xc);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function Fo(e){let t="";if(he(e))t=e;else if(Q(e))for(let n=0;nhe(e)?e:e==null?"":Q(e)||xe(e)&&(e.toString===_i||!te(e.toString))?JSON.stringify(e,wi,2):String(e),wi=(e,t)=>t&&t.__v_isRef?wi(e,t.value):Pn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,a])=>(n[`${r} =>`]=a,n),{})}:gi(t)?{[`Set(${t.size})`]:[...t.values()]}:xe(t)&&!Q(t)&&!bi(t)?String(t):t;let Xe;class a0{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Xe,!t&&Xe&&(this.index=(Xe.scopes||(Xe.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=Xe;try{return Xe=this,t()}finally{Xe=n}}}on(){Xe=this}off(){Xe=this.parent}stop(t){if(this._active){let n,r;for(n=0,r=this.effects.length;n{const t=new Set(e);return t.w=0,t.n=0,t},xi=e=>(e.w&Wt)>0,Ci=e=>(e.n&Wt)>0,s0=({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let r=0;r{(d==="length"||d>=c)&&s.push(u)})}else switch(n!==void 0&&s.push(l.get(n)),t){case"add":Q(e)?Bo(n)&&s.push(l.get("length")):(s.push(l.get(sn)),Pn(e)&&s.push(l.get(lo)));break;case"delete":Q(e)||(s.push(l.get(sn)),Pn(e)&&s.push(l.get(lo)));break;case"set":Pn(e)&&s.push(l.get(sn));break}if(s.length===1)s[0]&&so(s[0]);else{const c=[];for(const u of s)u&&c.push(...u);so(Ho(c))}}function so(e,t){const n=Q(e)?e:[...e];for(const r of n)r.computed&&Vl(r);for(const r of n)r.computed||Vl(r)}function Vl(e,t){(e!==ft||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}function c0(e,t){var n;return(n=oa.get(e))==null?void 0:n.get(t)}const u0=Ro("__proto__,__v_isRef,__isVue"),Li=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Mo)),d0=jo(),p0=jo(!1,!0),f0=jo(!0),Fl=h0();function h0(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const r=ce(this);for(let o=0,l=this.length;o{e[t]=function(...n){Un();const r=ce(this)[t].apply(this,n);return Gn(),r}}),e}function v0(e){const t=ce(this);return We(t,"has",e),t.hasOwnProperty(e)}function jo(e=!1,t=!1){return function(r,a,o){if(a==="__v_isReactive")return!e;if(a==="__v_isReadonly")return e;if(a==="__v_isShallow")return t;if(a==="__v_raw"&&o===(e?t?O0:Si:t?Ii:Oi).get(r))return r;const l=Q(r);if(!e){if(l&&fe(Fl,a))return Reflect.get(Fl,a,o);if(a==="hasOwnProperty")return v0}const s=Reflect.get(r,a,o);return(Mo(a)?Li.has(a):u0(a))||(e||We(r,"get",a),t)?s:$e(s)?l&&Bo(a)?s:s.value:xe(s)?e?vn(s):Wn(s):s}}const m0=Pi(),g0=Pi(!0);function Pi(e=!1){return function(n,r,a,o){let l=n[r];if(Mn(l)&&$e(l)&&!$e(a))return!1;if(!e&&(!la(a)&&!Mn(a)&&(l=ce(l),a=ce(a)),!Q(n)&&$e(l)&&!$e(a)))return l.value=a,!0;const s=Q(n)&&Bo(r)?Number(r)e,_a=e=>Reflect.getPrototypeOf(e);function Hr(e,t,n=!1,r=!1){e=e.__v_raw;const a=ce(e),o=ce(t);n||(t!==o&&We(a,"get",t),We(a,"get",o));const{has:l}=_a(a),s=r?qo:n?Wo:hr;if(l.call(a,t))return s(e.get(t));if(l.call(a,o))return s(e.get(o));e!==a&&e.get(t)}function Nr(e,t=!1){const n=this.__v_raw,r=ce(n),a=ce(e);return t||(e!==a&&We(r,"has",e),We(r,"has",a)),e===a?n.has(e):n.has(e)||n.has(a)}function jr(e,t=!1){return e=e.__v_raw,!t&&We(ce(e),"iterate",sn),Reflect.get(e,"size",e)}function Hl(e){e=ce(e);const t=ce(this);return _a(t).has.call(t,e)||(t.add(e),St(t,"add",e,e)),this}function Nl(e,t){t=ce(t);const n=ce(this),{has:r,get:a}=_a(n);let o=r.call(n,e);o||(e=ce(e),o=r.call(n,e));const l=a.call(n,e);return n.set(e,t),o?fr(t,l)&&St(n,"set",e,t):St(n,"add",e,t),this}function jl(e){const t=ce(this),{has:n,get:r}=_a(t);let a=n.call(t,e);a||(e=ce(e),a=n.call(t,e)),r&&r.call(t,e);const o=t.delete(e);return a&&St(t,"delete",e,void 0),o}function ql(){const e=ce(this),t=e.size!==0,n=e.clear();return t&&St(e,"clear",void 0,void 0),n}function qr(e,t){return function(r,a){const o=this,l=o.__v_raw,s=ce(l),c=t?qo:e?Wo:hr;return!e&&We(s,"iterate",sn),l.forEach((u,d)=>r.call(a,c(u),c(d),o))}}function Ur(e,t,n){return function(...r){const a=this.__v_raw,o=ce(a),l=Pn(o),s=e==="entries"||e===Symbol.iterator&&l,c=e==="keys"&&l,u=a[e](...r),d=n?qo:t?Wo:hr;return!t&&We(o,"iterate",c?lo:sn),{next(){const{value:p,done:f}=u.next();return f?{value:p,done:f}:{value:s?[d(p[0]),d(p[1])]:d(p),done:f}},[Symbol.iterator](){return this}}}}function $t(e){return function(...t){return e==="delete"?!1:this}}function A0(){const e={get(o){return Hr(this,o)},get size(){return jr(this)},has:Nr,add:Hl,set:Nl,delete:jl,clear:ql,forEach:qr(!1,!1)},t={get(o){return Hr(this,o,!1,!0)},get size(){return jr(this)},has:Nr,add:Hl,set:Nl,delete:jl,clear:ql,forEach:qr(!1,!0)},n={get(o){return Hr(this,o,!0)},get size(){return jr(this,!0)},has(o){return Nr.call(this,o,!0)},add:$t("add"),set:$t("set"),delete:$t("delete"),clear:$t("clear"),forEach:qr(!0,!1)},r={get(o){return Hr(this,o,!0,!0)},get size(){return jr(this,!0)},has(o){return Nr.call(this,o,!0)},add:$t("add"),set:$t("set"),delete:$t("delete"),clear:$t("clear"),forEach:qr(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{e[o]=Ur(o,!1,!1),n[o]=Ur(o,!0,!1),t[o]=Ur(o,!1,!0),r[o]=Ur(o,!0,!0)}),[e,n,t,r]}const[x0,C0,T0,k0]=A0();function Uo(e,t){const n=t?e?k0:T0:e?C0:x0;return(r,a,o)=>a==="__v_isReactive"?!e:a==="__v_isReadonly"?e:a==="__v_raw"?r:Reflect.get(fe(n,a)&&a in r?n:r,a,o)}const L0={get:Uo(!1,!1)},P0={get:Uo(!1,!0)},z0={get:Uo(!0,!1)},Oi=new WeakMap,Ii=new WeakMap,Si=new WeakMap,O0=new WeakMap;function I0(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function S0(e){return e.__v_skip||!Object.isExtensible(e)?0:I0(Kc(e))}function Wn(e){return Mn(e)?e:Go(e,!1,zi,L0,Oi)}function R0(e){return Go(e,!1,w0,P0,Ii)}function vn(e){return Go(e,!0,E0,z0,Si)}function Go(e,t,n,r,a){if(!xe(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=a.get(e);if(o)return o;const l=S0(e);if(l===0)return e;const s=new Proxy(e,l===2?r:n);return a.set(e,s),s}function zn(e){return Mn(e)?zn(e.__v_raw):!!(e&&e.__v_isReactive)}function Mn(e){return!!(e&&e.__v_isReadonly)}function la(e){return!!(e&&e.__v_isShallow)}function Ri(e){return zn(e)||Mn(e)}function ce(e){const t=e&&e.__v_raw;return t?ce(t):e}function Di(e){return aa(e,"__v_skip",!0),e}const hr=e=>xe(e)?Wn(e):e,Wo=e=>xe(e)?vn(e):e;function Ko(e){Ut&&ft&&(e=ce(e),ki(e.dep||(e.dep=Ho())))}function Jo(e,t){e=ce(e);const n=e.dep;n&&so(n)}function $e(e){return!!(e&&e.__v_isRef===!0)}function H(e){return $i(e,!1)}function Pe(e){return $i(e,!0)}function $i(e,t){return $e(e)?e:new D0(e,t)}class D0{constructor(t,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?t:ce(t),this._value=n?t:hr(t)}get value(){return Ko(this),this._value}set value(t){const n=this.__v_isShallow||la(t)||Mn(t);t=n?t:ce(t),fr(t,this._rawValue)&&(this._rawValue=t,this._value=n?t:hr(t),Jo(this))}}function cn(e){return $e(e)?e.value:e}const $0={get:(e,t,n)=>cn(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const a=e[t];return $e(a)&&!$e(n)?(a.value=n,!0):Reflect.set(e,t,n,r)}};function Mi(e){return zn(e)?e:new Proxy(e,$0)}class M0{constructor(t){this.dep=void 0,this.__v_isRef=!0;const{get:n,set:r}=t(()=>Ko(this),()=>Jo(this));this._get=n,this._set=r}get value(){return this._get()}set value(t){this._set(t)}}function B0(e){return new M0(e)}class V0{constructor(t,n,r){this._object=t,this._key=n,this._defaultValue=r,this.__v_isRef=!0}get value(){const t=this._object[this._key];return t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return c0(ce(this._object),this._key)}}class F0{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Kn(e,t,n){return $e(e)?e:te(e)?new F0(e):xe(e)&&arguments.length>1?H0(e,t,n):H(e)}function H0(e,t,n){const r=e[t];return $e(r)?r:new V0(e,t,n)}class N0{constructor(t,n,r,a){this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new No(t,()=>{this._dirty||(this._dirty=!0,Jo(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!a,this.__v_isReadonly=r}get value(){const t=ce(this);return Ko(t),(t._dirty||!t._cacheable)&&(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}function j0(e,t,n=!1){let r,a;const o=te(e);return o?(r=e,a=vt):(r=e.get,a=e.set),new N0(r,a,o||!a,n)}function Gt(e,t,n,r){let a;try{a=r?e(...r):e()}catch(o){Cr(o,t,n)}return a}function lt(e,t,n,r){if(te(e)){const o=Gt(e,t,n,r);return o&&yi(o)&&o.catch(l=>{Cr(l,t,n)}),o}const a=[];for(let o=0;o>>1;mr(Ve[r])Tt&&Ve.splice(t,1)}function W0(e){Q(e)?On.push(...e):(!It||!It.includes(e,e.allowRecurse?nn+1:nn))&&On.push(e),Vi()}function Ul(e,t=vr?Tt+1:0){for(;tmr(n)-mr(r)),nn=0;nne.id==null?1/0:e.id,K0=(e,t)=>{const n=mr(e)-mr(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Fi(e){io=!1,vr=!0,Ve.sort(K0);const t=vt;try{for(Tt=0;Tthe(h)?h.trim():h)),p&&(a=n.map(ro))}let s,c=r[s=Ra(t)]||r[s=Ra(st(t))];!c&&o&&(c=r[s=Ra(hn(t))]),c&<(c,e,6,a);const u=r[s+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,lt(u,e,6,a)}}function Hi(e,t,n=!1){const r=t.emitsCache,a=r.get(e);if(a!==void 0)return a;const o=e.emits;let l={},s=!1;if(!te(e)){const c=u=>{const d=Hi(u,t,!0);d&&(s=!0,Le(l,d))};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!o&&!s?(xe(e)&&r.set(e,null),null):(Q(o)?o.forEach(c=>l[c]=null):Le(l,o),xe(e)&&r.set(e,l),l)}function Ea(e,t){return!e||!Ar(t)?!1:(t=t.slice(2).replace(/Once$/,""),fe(e,t[0].toLowerCase()+t.slice(1))||fe(e,hn(t))||fe(e,t))}let Be=null,wa=null;function ia(e){const t=Be;return Be=e,wa=e&&e.type.__scopeId||null,t}function w9(e){wa=e}function A9(){wa=null}function Y0(e,t=Be,n){if(!t||e._n)return e;const r=(...a)=>{r._d&&rs(-1);const o=ia(t);let l;try{l=e(...a)}finally{ia(o),r._d&&rs(1)}return l};return r._n=!0,r._c=!0,r._d=!0,r}function Da(e){const{type:t,vnode:n,proxy:r,withProxy:a,props:o,propsOptions:[l],slots:s,attrs:c,emit:u,render:d,renderCache:p,data:f,setupState:h,ctx:_,inheritAttrs:A}=e;let x,g;const b=ia(e);try{if(n.shapeFlag&4){const R=a||r;x=pt(d.call(R,R,p,o,h,f,_)),g=c}else{const R=t;x=pt(R.length>1?R(o,{attrs:c,slots:s,emit:u}):R(o,null)),g=t.props?c:Z0(c)}}catch(R){ir.length=0,Cr(R,e,1),x=ke(nt)}let S=x;if(g&&A!==!1){const R=Object.keys(g),{shapeFlag:U}=S;R.length&&U&7&&(l&&R.some(Do)&&(g=Q0(g,l)),S=Kt(S,g))}return n.dirs&&(S=Kt(S),S.dirs=S.dirs?S.dirs.concat(n.dirs):n.dirs),n.transition&&(S.transition=n.transition),x=S,ia(b),x}const Z0=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ar(n))&&((t||(t={}))[n]=e[n]);return t},Q0=(e,t)=>{const n={};for(const r in e)(!Do(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function X0(e,t,n){const{props:r,children:a,component:o}=e,{props:l,children:s,patchFlag:c}=t,u=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Gl(r,l,u):!!l;if(c&8){const d=t.dynamicProps;for(let p=0;pe.__isSuspense;function Ni(e,t){t&&t.pendingBranch?Q(e)?t.effects.push(...e):t.effects.push(e):W0(e)}function n3(e,t){return Zo(e,null,t)}const Gr={};function se(e,t,n){return Zo(e,t,n)}function Zo(e,t,{immediate:n,deep:r,flush:a,onTrack:o,onTrigger:l}=Ce){var s;const c=Ai()===((s=De)==null?void 0:s.scope)?De:null;let u,d=!1,p=!1;if($e(e)?(u=()=>e.value,d=la(e)):zn(e)?(u=()=>e,r=!0):Q(e)?(p=!0,d=e.some(R=>zn(R)||la(R)),u=()=>e.map(R=>{if($e(R))return R.value;if(zn(R))return on(R);if(te(R))return Gt(R,c,2)})):te(e)?t?u=()=>Gt(e,c,2):u=()=>{if(!(c&&c.isUnmounted))return f&&f(),lt(e,c,3,[h])}:u=vt,t&&r){const R=u;u=()=>on(R())}let f,h=R=>{f=b.onStop=()=>{Gt(R,c,4)}},_;if(Fn)if(h=vt,t?n&<(t,c,3,[u(),p?[]:void 0,h]):u(),a==="sync"){const R=J3();_=R.__watcherHandles||(R.__watcherHandles=[])}else return vt;let A=p?new Array(e.length).fill(Gr):Gr;const x=()=>{if(b.active)if(t){const R=b.run();(r||d||(p?R.some((U,O)=>fr(U,A[O])):fr(R,A)))&&(f&&f(),lt(t,c,3,[R,A===Gr?void 0:p&&A[0]===Gr?[]:A,h]),A=R)}else b.run()};x.allowRecurse=!!t;let g;a==="sync"?g=x:a==="post"?g=()=>Ue(x,c&&c.suspense):(x.pre=!0,c&&(x.id=c.uid),g=()=>ba(x));const b=new No(u,g);t?n?x():A=b.run():a==="post"?Ue(b.run.bind(b),c&&c.suspense):b.run();const S=()=>{b.stop(),c&&c.scope&&$o(c.scope.effects,b)};return _&&_.push(S),S}function r3(e,t,n){const r=this.proxy,a=he(e)?e.includes(".")?ji(r,e):()=>r[e]:e.bind(r,r);let o;te(t)?o=t:(o=t.handler,n=t);const l=De;Vn(this);const s=Zo(a,o.bind(r),n);return l?Vn(l):un(),s}function ji(e,t){const n=t.split(".");return()=>{let r=e;for(let a=0;a{on(n,t)});else if(bi(e))for(const n in e)on(e[n],t);return e}function x9(e,t){const n=Be;if(n===null)return e;const r=Ca(n)||n.proxy,a=e.dirs||(e.dirs=[]);for(let o=0;o{e.isMounted=!0}),Xo(()=>{e.isUnmounting=!0}),e}const at=[Function,Array],Ui={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:at,onEnter:at,onAfterEnter:at,onEnterCancelled:at,onBeforeLeave:at,onLeave:at,onAfterLeave:at,onLeaveCancelled:at,onBeforeAppear:at,onAppear:at,onAfterAppear:at,onAppearCancelled:at},a3={name:"BaseTransition",props:Ui,setup(e,{slots:t}){const n=Yn(),r=qi();let a;return()=>{const o=t.default&&Qo(t.default(),!0);if(!o||!o.length)return;let l=o[0];if(o.length>1){for(const A of o)if(A.type!==nt){l=A;break}}const s=ce(e),{mode:c}=s;if(r.isLeaving)return $a(l);const u=Wl(l);if(!u)return $a(l);const d=gr(u,s,r,n);yr(u,d);const p=n.subTree,f=p&&Wl(p);let h=!1;const{getTransitionKey:_}=u.type;if(_){const A=_();a===void 0?a=A:A!==a&&(a=A,h=!0)}if(f&&f.type!==nt&&(!rn(u,f)||h)){const A=gr(f,s,r,n);if(yr(f,A),c==="out-in")return r.isLeaving=!0,A.afterLeave=()=>{r.isLeaving=!1,n.update.active!==!1&&n.update()},$a(l);c==="in-out"&&u.type!==nt&&(A.delayLeave=(x,g,b)=>{const S=Gi(r,f);S[String(f.key)]=f,x._leaveCb=()=>{g(),x._leaveCb=void 0,delete d.delayedLeave},d.delayedLeave=b})}return l}}},o3=a3;function Gi(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function gr(e,t,n,r){const{appear:a,mode:o,persisted:l=!1,onBeforeEnter:s,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:p,onLeave:f,onAfterLeave:h,onLeaveCancelled:_,onBeforeAppear:A,onAppear:x,onAfterAppear:g,onAppearCancelled:b}=t,S=String(e.key),R=Gi(n,e),U=(T,j)=>{T&<(T,r,9,j)},O=(T,j)=>{const J=j[1];U(T,j),Q(T)?T.every(re=>re.length<=1)&&J():T.length<=1&&J()},W={mode:o,persisted:l,beforeEnter(T){let j=s;if(!n.isMounted)if(a)j=A||s;else return;T._leaveCb&&T._leaveCb(!0);const J=R[S];J&&rn(e,J)&&J.el._leaveCb&&J.el._leaveCb(),U(j,[T])},enter(T){let j=c,J=u,re=d;if(!n.isMounted)if(a)j=x||c,J=g||u,re=b||d;else return;let N=!1;const X=T._enterCb=q=>{N||(N=!0,q?U(re,[T]):U(J,[T]),W.delayedLeave&&W.delayedLeave(),T._enterCb=void 0)};j?O(j,[T,X]):X()},leave(T,j){const J=String(e.key);if(T._enterCb&&T._enterCb(!0),n.isUnmounting)return j();U(p,[T]);let re=!1;const N=T._leaveCb=X=>{re||(re=!0,j(),X?U(_,[T]):U(h,[T]),T._leaveCb=void 0,R[J]===e&&delete R[J])};R[J]=e,f?O(f,[T,N]):N()},clone(T){return gr(T,t,n,r)}};return W}function $a(e){if(Tr(e))return e=Kt(e),e.children=null,e}function Wl(e){return Tr(e)?e.children?e.children[0]:void 0:e}function yr(e,t){e.shapeFlag&6&&e.component?yr(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Qo(e,t=!1,n){let r=[],a=0;for(let o=0;o1)for(let o=0;oLe({name:e.name},t,{setup:e}))():e}const In=e=>!!e.type.__asyncLoader;function P(e){te(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:a=200,timeout:o,suspensible:l=!0,onError:s}=e;let c=null,u,d=0;const p=()=>(d++,c=null,f()),f=()=>{let h;return c||(h=c=t().catch(_=>{if(_=_ instanceof Error?_:new Error(String(_)),s)return new Promise((A,x)=>{s(_,()=>A(p()),()=>x(_),d+1)});throw _}).then(_=>h!==c&&c?c:(_&&(_.__esModule||_[Symbol.toStringTag]==="Module")&&(_=_.default),u=_,_)))};return D({name:"AsyncComponentWrapper",__asyncLoader:f,get __asyncResolved(){return u},setup(){const h=De;if(u)return()=>Ma(u,h);const _=b=>{c=null,Cr(b,h,13,!r)};if(l&&h.suspense||Fn)return f().then(b=>()=>Ma(b,h)).catch(b=>(_(b),()=>r?ke(r,{error:b}):null));const A=H(!1),x=H(),g=H(!!a);return a&&setTimeout(()=>{g.value=!1},a),o!=null&&setTimeout(()=>{if(!A.value&&!x.value){const b=new Error(`Async component timed out after ${o}ms.`);_(b),x.value=b}},o),f().then(()=>{A.value=!0,h.parent&&Tr(h.parent.vnode)&&ba(h.parent.update)}).catch(b=>{_(b),x.value=b}),()=>{if(A.value&&u)return Ma(u,h);if(x.value&&r)return ke(r,{error:x.value});if(n&&!g.value)return ke(n)}}})}function Ma(e,t){const{ref:n,props:r,children:a,ce:o}=t.vnode,l=ke(e,r,a);return l.ref=n,l.ce=o,delete t.vnode.ce,l}const Tr=e=>e.type.__isKeepAlive;function l3(e,t){Wi(e,"a",t)}function s3(e,t){Wi(e,"da",t)}function Wi(e,t,n=De){const r=e.__wdc||(e.__wdc=()=>{let a=n;for(;a;){if(a.isDeactivated)return;a=a.parent}return e()});if(Aa(t,r,n),n){let a=n.parent;for(;a&&a.parent;)Tr(a.parent.vnode)&&i3(r,t,n,a),a=a.parent}}function i3(e,t,n,r){const a=Aa(t,e,r,!0);Jn(()=>{$o(r[t],a)},n)}function Aa(e,t,n=De,r=!1){if(n){const a=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...l)=>{if(n.isUnmounted)return;Un(),Vn(n);const s=lt(t,n,e,l);return un(),Gn(),s});return r?a.unshift(o):a.push(o),o}}const Rt=e=>(t,n=De)=>(!Fn||e==="sp")&&Aa(e,(...r)=>t(...r),n),c3=Rt("bm"),de=Rt("m"),u3=Rt("bu"),Ki=Rt("u"),Xo=Rt("bum"),Jn=Rt("um"),d3=Rt("sp"),p3=Rt("rtg"),f3=Rt("rtc");function h3(e,t=De){Aa("ec",e,t)}const Ji="components";function tt(e,t){return m3(Ji,e,!0,t)||e}const v3=Symbol.for("v-ndc");function m3(e,t,n=!0,r=!1){const a=Be||De;if(a){const o=a.type;if(e===Ji){const s=G3(o,!1);if(s&&(s===t||s===st(t)||s===xr(st(t))))return o}const l=Kl(a[e]||o[e],t)||Kl(a.appContext[e],t);return!l&&r?o:l}}function Kl(e,t){return e&&(e[t]||e[st(t)]||e[xr(st(t))])}function C9(e,t,n,r){let a;const o=n&&n[r];if(Q(e)||he(e)){a=new Array(e.length);for(let l=0,s=e.length;lt(l,s,void 0,o&&o[s]));else{const l=Object.keys(e);a=new Array(l.length);for(let s=0,c=l.length;spa(t)?!(t.type===nt||t.type===je&&!Yi(t.children)):!0)?e:null}const co=e=>e?d1(e)?Ca(e)||e.proxy:co(e.parent):null,lr=Le(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>co(e.parent),$root:e=>co(e.root),$emit:e=>e.emit,$options:e=>el(e),$forceUpdate:e=>e.f||(e.f=()=>ba(e.update)),$nextTick:e=>e.n||(e.n=mn.bind(e.proxy)),$watch:e=>r3.bind(e)}),Ba=(e,t)=>e!==Ce&&!e.__isScriptSetup&&fe(e,t),g3={get({_:e},t){const{ctx:n,setupState:r,data:a,props:o,accessCache:l,type:s,appContext:c}=e;let u;if(t[0]!=="$"){const h=l[t];if(h!==void 0)switch(h){case 1:return r[t];case 2:return a[t];case 4:return n[t];case 3:return o[t]}else{if(Ba(r,t))return l[t]=1,r[t];if(a!==Ce&&fe(a,t))return l[t]=2,a[t];if((u=e.propsOptions[0])&&fe(u,t))return l[t]=3,o[t];if(n!==Ce&&fe(n,t))return l[t]=4,n[t];uo&&(l[t]=0)}}const d=lr[t];let p,f;if(d)return t==="$attrs"&&We(e,"get",t),d(e);if((p=s.__cssModules)&&(p=p[t]))return p;if(n!==Ce&&fe(n,t))return l[t]=4,n[t];if(f=c.config.globalProperties,fe(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:a,ctx:o}=e;return Ba(a,t)?(a[t]=n,!0):r!==Ce&&fe(r,t)?(r[t]=n,!0):fe(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:a,propsOptions:o}},l){let s;return!!n[l]||e!==Ce&&fe(e,l)||Ba(t,l)||(s=o[0])&&fe(s,l)||fe(r,l)||fe(lr,l)||fe(a.config.globalProperties,l)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:fe(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Jl(e){return Q(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let uo=!0;function y3(e){const t=el(e),n=e.proxy,r=e.ctx;uo=!1,t.beforeCreate&&Yl(t.beforeCreate,e,"bc");const{data:a,computed:o,methods:l,watch:s,provide:c,inject:u,created:d,beforeMount:p,mounted:f,beforeUpdate:h,updated:_,activated:A,deactivated:x,beforeDestroy:g,beforeUnmount:b,destroyed:S,unmounted:R,render:U,renderTracked:O,renderTriggered:W,errorCaptured:T,serverPrefetch:j,expose:J,inheritAttrs:re,components:N,directives:X,filters:q}=t;if(u&&_3(u,r,null),l)for(const ye in l){const ve=l[ye];te(ve)&&(r[ye]=ve.bind(n))}if(a){const ye=a.call(n,n);xe(ye)&&(e.data=Wn(ye))}if(uo=!0,o)for(const ye in o){const ve=o[ye],Ye=te(ve)?ve.bind(n,n):te(ve.get)?ve.get.bind(n,n):vt,He=!te(ve)&&te(ve.set)?ve.set.bind(n):vt,Ze=w({get:Ye,set:He});Object.defineProperty(r,ye,{enumerable:!0,configurable:!0,get:()=>Ze.value,set:Oe=>Ze.value=Oe})}if(s)for(const ye in s)Zi(s[ye],r,n,ye);if(c){const ye=te(c)?c.call(n):c;Reflect.ownKeys(ye).forEach(ve=>{mt(ve,ye[ve])})}d&&Yl(d,e,"c");function ne(ye,ve){Q(ve)?ve.forEach(Ye=>ye(Ye.bind(n))):ve&&ye(ve.bind(n))}if(ne(c3,p),ne(de,f),ne(u3,h),ne(Ki,_),ne(l3,A),ne(s3,x),ne(h3,T),ne(f3,O),ne(p3,W),ne(Xo,b),ne(Jn,R),ne(d3,j),Q(J))if(J.length){const ye=e.exposed||(e.exposed={});J.forEach(ve=>{Object.defineProperty(ye,ve,{get:()=>n[ve],set:Ye=>n[ve]=Ye})})}else e.exposed||(e.exposed={});U&&e.render===vt&&(e.render=U),re!=null&&(e.inheritAttrs=re),N&&(e.components=N),X&&(e.directives=X)}function _3(e,t,n=vt){Q(e)&&(e=po(e));for(const r in e){const a=e[r];let o;xe(a)?"default"in a?o=ue(a.from||r,a.default,!0):o=ue(a.from||r):o=ue(a),$e(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:l=>o.value=l}):t[r]=o}}function Yl(e,t,n){lt(Q(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Zi(e,t,n,r){const a=r.includes(".")?ji(n,r):()=>n[r];if(he(e)){const o=t[e];te(o)&&se(a,o)}else if(te(e))se(a,e.bind(n));else if(xe(e))if(Q(e))e.forEach(o=>Zi(o,t,n,r));else{const o=te(e.handler)?e.handler.bind(n):t[e.handler];te(o)&&se(a,o,e)}}function el(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:a,optionsCache:o,config:{optionMergeStrategies:l}}=e.appContext,s=o.get(t);let c;return s?c=s:!a.length&&!n&&!r?c=t:(c={},a.length&&a.forEach(u=>ca(c,u,l,!0)),ca(c,t,l)),xe(t)&&o.set(t,c),c}function ca(e,t,n,r=!1){const{mixins:a,extends:o}=t;o&&ca(e,o,n,!0),a&&a.forEach(l=>ca(e,l,n,!0));for(const l in t)if(!(r&&l==="expose")){const s=b3[l]||n&&n[l];e[l]=s?s(e[l],t[l]):t[l]}return e}const b3={data:Zl,props:Ql,emits:Ql,methods:ar,computed:ar,beforeCreate:Ne,created:Ne,beforeMount:Ne,mounted:Ne,beforeUpdate:Ne,updated:Ne,beforeDestroy:Ne,beforeUnmount:Ne,destroyed:Ne,unmounted:Ne,activated:Ne,deactivated:Ne,errorCaptured:Ne,serverPrefetch:Ne,components:ar,directives:ar,watch:w3,provide:Zl,inject:E3};function Zl(e,t){return t?e?function(){return Le(te(e)?e.call(this,this):e,te(t)?t.call(this,this):t)}:t:e}function E3(e,t){return ar(po(e),po(t))}function po(e){if(Q(e)){const t={};for(let n=0;n1)return n&&te(t)?t.call(r&&r.proxy):t}}function C3(e,t,n,r=!1){const a={},o={};aa(o,xa,1),e.propsDefaults=Object.create(null),Xi(e,t,a,o);for(const l in e.propsOptions[0])l in a||(a[l]=void 0);n?e.props=r?a:R0(a):e.type.props?e.props=a:e.props=o,e.attrs=o}function T3(e,t,n,r){const{props:a,attrs:o,vnode:{patchFlag:l}}=e,s=ce(a),[c]=e.propsOptions;let u=!1;if((r||l>0)&&!(l&16)){if(l&8){const d=e.vnode.dynamicProps;for(let p=0;p{c=!0;const[f,h]=e1(p,t,!0);Le(l,f),h&&s.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!o&&!c)return xe(e)&&r.set(e,Ln),Ln;if(Q(o))for(let d=0;d-1,h[1]=A<0||_-1||fe(h,"default"))&&s.push(p)}}}const u=[l,s];return xe(e)&&r.set(e,u),u}function Xl(e){return e[0]!=="$"}function es(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:e===null?"null":""}function ts(e,t){return es(e)===es(t)}function ns(e,t){return Q(t)?t.findIndex(n=>ts(n,e)):te(t)&&ts(t,e)?0:-1}const t1=e=>e[0]==="_"||e==="$stable",tl=e=>Q(e)?e.map(pt):[pt(e)],k3=(e,t,n)=>{if(t._n)return t;const r=Y0((...a)=>tl(t(...a)),n);return r._c=!1,r},n1=(e,t,n)=>{const r=e._ctx;for(const a in e){if(t1(a))continue;const o=e[a];if(te(o))t[a]=k3(a,o,r);else if(o!=null){const l=tl(o);t[a]=()=>l}}},r1=(e,t)=>{const n=tl(t);e.slots.default=()=>n},L3=(e,t)=>{if(e.vnode.shapeFlag&32){const n=t._;n?(e.slots=ce(t),aa(t,"_",n)):n1(t,e.slots={})}else e.slots={},t&&r1(e,t);aa(e.slots,xa,1)},P3=(e,t,n)=>{const{vnode:r,slots:a}=e;let o=!0,l=Ce;if(r.shapeFlag&32){const s=t._;s?n&&s===1?o=!1:(Le(a,t),!n&&s===1&&delete a._):(o=!t.$stable,n1(t,a)),l=t}else t&&(r1(e,t),l={default:1});if(o)for(const s in a)!t1(s)&&!(s in l)&&delete a[s]};function da(e,t,n,r,a=!1){if(Q(e)){e.forEach((f,h)=>da(f,t&&(Q(t)?t[h]:t),n,r,a));return}if(In(r)&&!a)return;const o=r.shapeFlag&4?Ca(r.component)||r.component.proxy:r.el,l=a?null:o,{i:s,r:c}=e,u=t&&t.r,d=s.refs===Ce?s.refs={}:s.refs,p=s.setupState;if(u!=null&&u!==c&&(he(u)?(d[u]=null,fe(p,u)&&(p[u]=null)):$e(u)&&(u.value=null)),te(c))Gt(c,s,12,[l,d]);else{const f=he(c),h=$e(c);if(f||h){const _=()=>{if(e.f){const A=f?fe(p,c)?p[c]:d[c]:c.value;a?Q(A)&&$o(A,o):Q(A)?A.includes(o)||A.push(o):f?(d[c]=[o],fe(p,c)&&(p[c]=d[c])):(c.value=[o],e.k&&(d[e.k]=c.value))}else f?(d[c]=l,fe(p,c)&&(p[c]=l)):h&&(c.value=l,e.k&&(d[e.k]=l))};l?(_.id=-1,Ue(_,n)):_()}}}let Mt=!1;const Wr=e=>/svg/.test(e.namespaceURI)&&e.tagName!=="foreignObject",Kr=e=>e.nodeType===8;function z3(e){const{mt:t,p:n,o:{patchProp:r,createText:a,nextSibling:o,parentNode:l,remove:s,insert:c,createComment:u}}=e,d=(g,b)=>{if(!b.hasChildNodes()){n(null,g,b),sa(),b._vnode=g;return}Mt=!1,p(b.firstChild,g,null,null,null),sa(),b._vnode=g,Mt&&console.error("Hydration completed but contains mismatches.")},p=(g,b,S,R,U,O=!1)=>{const W=Kr(g)&&g.data==="[",T=()=>A(g,b,S,R,U,W),{type:j,ref:J,shapeFlag:re,patchFlag:N}=b;let X=g.nodeType;b.el=g,N===-2&&(O=!1,b.dynamicChildren=null);let q=null;switch(j){case Bn:X!==3?b.children===""?(c(b.el=a(""),l(g),g),q=g):q=T():(g.data!==b.children&&(Mt=!0,g.data=b.children),q=o(g));break;case nt:X!==8||W?q=T():q=o(g);break;case sr:if(W&&(g=o(g),X=g.nodeType),X===1||X===3){q=g;const ze=!b.children.length;for(let ne=0;ne{O=O||!!b.dynamicChildren;const{type:W,props:T,patchFlag:j,shapeFlag:J,dirs:re}=b,N=W==="input"&&re||W==="option";if(N||j!==-1){if(re&&Ct(b,null,S,"created"),T)if(N||!O||j&48)for(const q in T)(N&&q.endsWith("value")||Ar(q)&&!or(q))&&r(g,q,null,T[q],!1,void 0,S);else T.onClick&&r(g,"onClick",null,T.onClick,!1,void 0,S);let X;if((X=T&&T.onVnodeBeforeMount)&&ot(X,S,b),re&&Ct(b,null,S,"beforeMount"),((X=T&&T.onVnodeMounted)||re)&&Ni(()=>{X&&ot(X,S,b),re&&Ct(b,null,S,"mounted")},R),J&16&&!(T&&(T.innerHTML||T.textContent))){let q=h(g.firstChild,b,g,S,R,U,O);for(;q;){Mt=!0;const ze=q;q=q.nextSibling,s(ze)}}else J&8&&g.textContent!==b.children&&(Mt=!0,g.textContent=b.children)}return g.nextSibling},h=(g,b,S,R,U,O,W)=>{W=W||!!b.dynamicChildren;const T=b.children,j=T.length;for(let J=0;J{const{slotScopeIds:W}=b;W&&(U=U?U.concat(W):W);const T=l(g),j=h(o(g),b,T,S,R,U,O);return j&&Kr(j)&&j.data==="]"?o(b.anchor=j):(Mt=!0,c(b.anchor=u("]"),T,j),j)},A=(g,b,S,R,U,O)=>{if(Mt=!0,b.el=null,O){const j=x(g);for(;;){const J=o(g);if(J&&J!==j)s(J);else break}}const W=o(g),T=l(g);return s(g),n(null,b,T,W,S,R,Wr(T),U),W},x=g=>{let b=0;for(;g;)if(g=o(g),g&&Kr(g)&&(g.data==="["&&b++,g.data==="]")){if(b===0)return o(g);b--}return g};return[d,p]}const Ue=Ni;function O3(e){return I3(e,z3)}function I3(e,t){const n=ao();n.__VUE__=!0;const{insert:r,remove:a,patchProp:o,createElement:l,createText:s,createComment:c,setText:u,setElementText:d,parentNode:p,nextSibling:f,setScopeId:h=vt,insertStaticContent:_}=e,A=(v,y,E,C=null,L=null,z=null,V=!1,$=null,M=!!y.dynamicChildren)=>{if(v===y)return;v&&!rn(v,y)&&(C=k(v),Oe(v,L,z,!0),v=null),y.patchFlag===-2&&(M=!1,y.dynamicChildren=null);const{type:I,ref:Y,shapeFlag:G}=y;switch(I){case Bn:x(v,y,E,C);break;case nt:g(v,y,E,C);break;case sr:v==null&&b(y,E,C,V);break;case je:N(v,y,E,C,L,z,V,$,M);break;default:G&1?U(v,y,E,C,L,z,V,$,M):G&6?X(v,y,E,C,L,z,V,$,M):(G&64||G&128)&&I.process(v,y,E,C,L,z,V,$,M,B)}Y!=null&&L&&da(Y,v&&v.ref,z,y||v,!y)},x=(v,y,E,C)=>{if(v==null)r(y.el=s(y.children),E,C);else{const L=y.el=v.el;y.children!==v.children&&u(L,y.children)}},g=(v,y,E,C)=>{v==null?r(y.el=c(y.children||""),E,C):y.el=v.el},b=(v,y,E,C)=>{[v.el,v.anchor]=_(v.children,y,E,C,v.el,v.anchor)},S=({el:v,anchor:y},E,C)=>{let L;for(;v&&v!==y;)L=f(v),r(v,E,C),v=L;r(y,E,C)},R=({el:v,anchor:y})=>{let E;for(;v&&v!==y;)E=f(v),a(v),v=E;a(y)},U=(v,y,E,C,L,z,V,$,M)=>{V=V||y.type==="svg",v==null?O(y,E,C,L,z,V,$,M):j(v,y,L,z,V,$,M)},O=(v,y,E,C,L,z,V,$)=>{let M,I;const{type:Y,props:G,shapeFlag:Z,transition:ee,dirs:le}=v;if(M=v.el=l(v.type,z,G&&G.is,G),Z&8?d(M,v.children):Z&16&&T(v.children,M,null,C,L,z&&Y!=="foreignObject",V,$),le&&Ct(v,null,C,"created"),W(M,v,v.scopeId,V,C),G){for(const Ee in G)Ee!=="value"&&!or(Ee)&&o(M,Ee,null,G[Ee],z,v.children,C,L,Re);"value"in G&&o(M,"value",null,G.value),(I=G.onVnodeBeforeMount)&&ot(I,C,v)}le&&Ct(v,null,C,"beforeMount");const Ae=(!L||L&&!L.pendingBranch)&&ee&&!ee.persisted;Ae&&ee.beforeEnter(M),r(M,y,E),((I=G&&G.onVnodeMounted)||Ae||le)&&Ue(()=>{I&&ot(I,C,v),Ae&&ee.enter(M),le&&Ct(v,null,C,"mounted")},L)},W=(v,y,E,C,L)=>{if(E&&h(v,E),C)for(let z=0;z{for(let I=M;I{const $=y.el=v.el;let{patchFlag:M,dynamicChildren:I,dirs:Y}=y;M|=v.patchFlag&16;const G=v.props||Ce,Z=y.props||Ce;let ee;E&&en(E,!1),(ee=Z.onVnodeBeforeUpdate)&&ot(ee,E,y,v),Y&&Ct(y,v,E,"beforeUpdate"),E&&en(E,!0);const le=L&&y.type!=="foreignObject";if(I?J(v.dynamicChildren,I,$,E,C,le,z):V||ve(v,y,$,null,E,C,le,z,!1),M>0){if(M&16)re($,y,G,Z,E,C,L);else if(M&2&&G.class!==Z.class&&o($,"class",null,Z.class,L),M&4&&o($,"style",G.style,Z.style,L),M&8){const Ae=y.dynamicProps;for(let Ee=0;Ee{ee&&ot(ee,E,y,v),Y&&Ct(y,v,E,"updated")},C)},J=(v,y,E,C,L,z,V)=>{for(let $=0;${if(E!==C){if(E!==Ce)for(const $ in E)!or($)&&!($ in C)&&o(v,$,E[$],null,V,y.children,L,z,Re);for(const $ in C){if(or($))continue;const M=C[$],I=E[$];M!==I&&$!=="value"&&o(v,$,I,M,V,y.children,L,z,Re)}"value"in C&&o(v,"value",E.value,C.value)}},N=(v,y,E,C,L,z,V,$,M)=>{const I=y.el=v?v.el:s(""),Y=y.anchor=v?v.anchor:s("");let{patchFlag:G,dynamicChildren:Z,slotScopeIds:ee}=y;ee&&($=$?$.concat(ee):ee),v==null?(r(I,E,C),r(Y,E,C),T(y.children,E,Y,L,z,V,$,M)):G>0&&G&64&&Z&&v.dynamicChildren?(J(v.dynamicChildren,Z,E,L,z,V,$),(y.key!=null||L&&y===L.subTree)&&a1(v,y,!0)):ve(v,y,E,Y,L,z,V,$,M)},X=(v,y,E,C,L,z,V,$,M)=>{y.slotScopeIds=$,v==null?y.shapeFlag&512?L.ctx.activate(y,E,C,V,M):q(y,E,C,L,z,V,M):ze(v,y,M)},q=(v,y,E,C,L,z,V)=>{const $=v.component=H3(v,C,L);if(Tr(v)&&($.ctx.renderer=B),N3($),$.asyncDep){if(L&&L.registerDep($,ne),!v.el){const M=$.subTree=ke(nt);g(null,M,y,E)}return}ne($,v,y,E,L,z,V)},ze=(v,y,E)=>{const C=y.component=v.component;if(X0(v,y,E))if(C.asyncDep&&!C.asyncResolved){ye(C,y,E);return}else C.next=y,G0(C.update),C.update();else y.el=v.el,C.vnode=y},ne=(v,y,E,C,L,z,V)=>{const $=()=>{if(v.isMounted){let{next:Y,bu:G,u:Z,parent:ee,vnode:le}=v,Ae=Y,Ee;en(v,!1),Y?(Y.el=le.el,ye(v,Y,V)):Y=le,G&&na(G),(Ee=Y.props&&Y.props.onVnodeBeforeUpdate)&&ot(Ee,ee,Y,le),en(v,!0);const Ie=Da(v),ct=v.subTree;v.subTree=Ie,A(ct,Ie,p(ct.el),k(ct),v,L,z),Y.el=Ie.el,Ae===null&&e3(v,Ie.el),Z&&Ue(Z,L),(Ee=Y.props&&Y.props.onVnodeUpdated)&&Ue(()=>ot(Ee,ee,Y,le),L)}else{let Y;const{el:G,props:Z}=y,{bm:ee,m:le,parent:Ae}=v,Ee=In(y);if(en(v,!1),ee&&na(ee),!Ee&&(Y=Z&&Z.onVnodeBeforeMount)&&ot(Y,Ae,y),en(v,!0),G&&ge){const Ie=()=>{v.subTree=Da(v),ge(G,v.subTree,v,L,null)};Ee?y.type.__asyncLoader().then(()=>!v.isUnmounted&&Ie()):Ie()}else{const Ie=v.subTree=Da(v);A(null,Ie,E,C,v,L,z),y.el=Ie.el}if(le&&Ue(le,L),!Ee&&(Y=Z&&Z.onVnodeMounted)){const Ie=y;Ue(()=>ot(Y,Ae,Ie),L)}(y.shapeFlag&256||Ae&&In(Ae.vnode)&&Ae.vnode.shapeFlag&256)&&v.a&&Ue(v.a,L),v.isMounted=!0,y=E=C=null}},M=v.effect=new No($,()=>ba(I),v.scope),I=v.update=()=>M.run();I.id=v.uid,en(v,!0),I()},ye=(v,y,E)=>{y.component=v;const C=v.vnode.props;v.vnode=y,v.next=null,T3(v,y.props,C,E),P3(v,y.children,E),Un(),Ul(),Gn()},ve=(v,y,E,C,L,z,V,$,M=!1)=>{const I=v&&v.children,Y=v?v.shapeFlag:0,G=y.children,{patchFlag:Z,shapeFlag:ee}=y;if(Z>0){if(Z&128){He(I,G,E,C,L,z,V,$,M);return}else if(Z&256){Ye(I,G,E,C,L,z,V,$,M);return}}ee&8?(Y&16&&Re(I,L,z),G!==I&&d(E,G)):Y&16?ee&16?He(I,G,E,C,L,z,V,$,M):Re(I,L,z,!0):(Y&8&&d(E,""),ee&16&&T(G,E,C,L,z,V,$,M))},Ye=(v,y,E,C,L,z,V,$,M)=>{v=v||Ln,y=y||Ln;const I=v.length,Y=y.length,G=Math.min(I,Y);let Z;for(Z=0;ZY?Re(v,L,z,!0,!1,G):T(y,E,C,L,z,V,$,M,G)},He=(v,y,E,C,L,z,V,$,M)=>{let I=0;const Y=y.length;let G=v.length-1,Z=Y-1;for(;I<=G&&I<=Z;){const ee=v[I],le=y[I]=M?Nt(y[I]):pt(y[I]);if(rn(ee,le))A(ee,le,E,null,L,z,V,$,M);else break;I++}for(;I<=G&&I<=Z;){const ee=v[G],le=y[Z]=M?Nt(y[Z]):pt(y[Z]);if(rn(ee,le))A(ee,le,E,null,L,z,V,$,M);else break;G--,Z--}if(I>G){if(I<=Z){const ee=Z+1,le=eeZ)for(;I<=G;)Oe(v[I],L,z,!0),I++;else{const ee=I,le=I,Ae=new Map;for(I=le;I<=Z;I++){const Qe=y[I]=M?Nt(y[I]):pt(y[I]);Qe.key!=null&&Ae.set(Qe.key,I)}let Ee,Ie=0;const ct=Z-le+1;let _n=!1,Sl=0;const Xn=new Array(ct);for(I=0;I=ct){Oe(Qe,L,z,!0);continue}let xt;if(Qe.key!=null)xt=Ae.get(Qe.key);else for(Ee=le;Ee<=Z;Ee++)if(Xn[Ee-le]===0&&rn(Qe,y[Ee])){xt=Ee;break}xt===void 0?Oe(Qe,L,z,!0):(Xn[xt-le]=I+1,xt>=Sl?Sl=xt:_n=!0,A(Qe,y[xt],E,null,L,z,V,$,M),Ie++)}const Rl=_n?S3(Xn):Ln;for(Ee=Rl.length-1,I=ct-1;I>=0;I--){const Qe=le+I,xt=y[Qe],Dl=Qe+1{const{el:z,type:V,transition:$,children:M,shapeFlag:I}=v;if(I&6){Ze(v.component.subTree,y,E,C);return}if(I&128){v.suspense.move(y,E,C);return}if(I&64){V.move(v,y,E,B);return}if(V===je){r(z,y,E);for(let G=0;G$.enter(z),L);else{const{leave:G,delayLeave:Z,afterLeave:ee}=$,le=()=>r(z,y,E),Ae=()=>{G(z,()=>{le(),ee&&ee()})};Z?Z(z,le,Ae):Ae()}else r(z,y,E)},Oe=(v,y,E,C=!1,L=!1)=>{const{type:z,props:V,ref:$,children:M,dynamicChildren:I,shapeFlag:Y,patchFlag:G,dirs:Z}=v;if($!=null&&da($,null,E,v,!0),Y&256){y.ctx.deactivate(v);return}const ee=Y&1&&Z,le=!In(v);let Ae;if(le&&(Ae=V&&V.onVnodeBeforeUnmount)&&ot(Ae,y,v),Y&6)Xt(v.component,E,C);else{if(Y&128){v.suspense.unmount(E,C);return}ee&&Ct(v,null,y,"beforeUnmount"),Y&64?v.type.remove(v,y,E,L,B,C):I&&(z!==je||G>0&&G&64)?Re(I,y,E,!1,!0):(z===je&&G&384||!L&&Y&16)&&Re(M,y,E),C&&wt(v)}(le&&(Ae=V&&V.onVnodeUnmounted)||ee)&&Ue(()=>{Ae&&ot(Ae,y,v),ee&&Ct(v,null,y,"unmounted")},E)},wt=v=>{const{type:y,el:E,anchor:C,transition:L}=v;if(y===je){At(E,C);return}if(y===sr){R(v);return}const z=()=>{a(E),L&&!L.persisted&&L.afterLeave&&L.afterLeave()};if(v.shapeFlag&1&&L&&!L.persisted){const{leave:V,delayLeave:$}=L,M=()=>V(E,z);$?$(v.el,z,M):M()}else z()},At=(v,y)=>{let E;for(;v!==y;)E=f(v),a(v),v=E;a(y)},Xt=(v,y,E)=>{const{bum:C,scope:L,update:z,subTree:V,um:$}=v;C&&na(C),L.stop(),z&&(z.active=!1,Oe(V,v,y,E)),$&&Ue($,y),Ue(()=>{v.isUnmounted=!0},y),y&&y.pendingBranch&&!y.isUnmounted&&v.asyncDep&&!v.asyncResolved&&v.suspenseId===y.pendingId&&(y.deps--,y.deps===0&&y.resolve())},Re=(v,y,E,C=!1,L=!1,z=0)=>{for(let V=z;Vv.shapeFlag&6?k(v.component.subTree):v.shapeFlag&128?v.suspense.next():f(v.anchor||v.el),F=(v,y,E)=>{v==null?y._vnode&&Oe(y._vnode,null,null,!0):A(y._vnode||null,v,y,null,null,null,E),Ul(),sa(),y._vnode=v},B={p:A,um:Oe,m:Ze,r:wt,mt:q,mc:T,pc:ve,pbc:J,n:k,o:e};let K,ge;return t&&([K,ge]=t(B)),{render:F,hydrate:K,createApp:x3(F,K)}}function en({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function a1(e,t,n=!1){const r=e.children,a=t.children;if(Q(r)&&Q(a))for(let o=0;o>1,e[n[s]]0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,l=n[o-1];o-- >0;)n[o]=l,l=t[l];return n}const R3=e=>e.__isTeleport,je=Symbol.for("v-fgt"),Bn=Symbol.for("v-txt"),nt=Symbol.for("v-cmt"),sr=Symbol.for("v-stc"),ir=[];let ht=null;function o1(e=!1){ir.push(ht=e?null:[])}function D3(){ir.pop(),ht=ir[ir.length-1]||null}let _r=1;function rs(e){_r+=e}function l1(e){return e.dynamicChildren=_r>0?ht||Ln:null,D3(),_r>0&&ht&&ht.push(e),e}function k9(e,t,n,r,a,o){return l1(c1(e,t,n,r,a,o,!0))}function s1(e,t,n,r,a){return l1(ke(e,t,n,r,a,!0))}function pa(e){return e?e.__v_isVNode===!0:!1}function rn(e,t){return e.type===t.type&&e.key===t.key}const xa="__vInternal",i1=({key:e})=>e??null,ra=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?he(e)||$e(e)||te(e)?{i:Be,r:e,k:t,f:!!n}:e:null);function c1(e,t=null,n=null,r=0,a=null,o=e===je?0:1,l=!1,s=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&i1(t),ref:t&&ra(t),scopeId:wa,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:a,dynamicChildren:null,appContext:null,ctx:Be};return s?(nl(c,n),o&128&&e.normalize(c)):n&&(c.shapeFlag|=he(n)?8:16),_r>0&&!l&&ht&&(c.patchFlag>0||o&6)&&c.patchFlag!==32&&ht.push(c),c}const ke=$3;function $3(e,t=null,n=null,r=0,a=null,o=!1){if((!e||e===v3)&&(e=nt),pa(e)){const s=Kt(e,t,!0);return n&&nl(s,n),_r>0&&!o&&ht&&(s.shapeFlag&6?ht[ht.indexOf(e)]=s:ht.push(s)),s.patchFlag|=-2,s}if(W3(e)&&(e=e.__vccOpts),t){t=M3(t);let{class:s,style:c}=t;s&&!he(s)&&(t.class=Fo(s)),xe(c)&&(Ri(c)&&!Q(c)&&(c=Le({},c)),t.style=Vo(c))}const l=he(e)?1:t3(e)?128:R3(e)?64:xe(e)?4:te(e)?2:0;return c1(e,t,n,r,a,l,o,!0)}function M3(e){return e?Ri(e)||xa in e?Le({},e):e:null}function Kt(e,t,n=!1){const{props:r,ref:a,patchFlag:o,children:l}=e,s=t?B3(r||{},t):r;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:s,key:s&&i1(s),ref:t&&t.ref?n&&a?Q(a)?a.concat(ra(t)):[a,ra(t)]:ra(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==je?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Kt(e.ssContent),ssFallback:e.ssFallback&&Kt(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function u1(e=" ",t=0){return ke(Bn,null,e,t)}function L9(e,t){const n=ke(sr,null,e);return n.staticCount=t,n}function P9(e="",t=!1){return t?(o1(),s1(nt,null,e)):ke(nt,null,e)}function pt(e){return e==null||typeof e=="boolean"?ke(nt):Q(e)?ke(je,null,e.slice()):typeof e=="object"?Nt(e):ke(Bn,null,String(e))}function Nt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Kt(e)}function nl(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Q(t))n=16;else if(typeof t=="object")if(r&65){const a=t.default;a&&(a._c&&(a._d=!1),nl(e,a()),a._c&&(a._d=!0));return}else{n=32;const a=t._;!a&&!(xa in t)?t._ctx=Be:a===3&&Be&&(Be.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else te(t)?(t={default:t,_ctx:Be},n=32):(t=String(t),r&64?(n=16,t=[u1(t)]):n=8);e.children=t,e.shapeFlag|=n}function B3(...e){const t={};for(let n=0;nDe||Be;let rl,bn,as="__VUE_INSTANCE_SETTERS__";(bn=ao()[as])||(bn=ao()[as]=[]),bn.push(e=>De=e),rl=e=>{bn.length>1?bn.forEach(t=>t(e)):bn[0](e)};const Vn=e=>{rl(e),e.scope.on()},un=()=>{De&&De.scope.off(),rl(null)};function d1(e){return e.vnode.shapeFlag&4}let Fn=!1;function N3(e,t=!1){Fn=t;const{props:n,children:r}=e.vnode,a=d1(e);C3(e,n,a,t),L3(e,r);const o=a?j3(e,t):void 0;return Fn=!1,o}function j3(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=Di(new Proxy(e.ctx,g3));const{setup:r}=n;if(r){const a=e.setupContext=r.length>1?U3(e):null;Vn(e),Un();const o=Gt(r,e,0,[e.props,a]);if(Gn(),un(),yi(o)){if(o.then(un,un),t)return o.then(l=>{os(e,l,t)}).catch(l=>{Cr(l,e,0)});e.asyncDep=o}else os(e,o,t)}else p1(e,t)}function os(e,t,n){te(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:xe(t)&&(e.setupState=Mi(t)),p1(e,n)}let ls;function p1(e,t,n){const r=e.type;if(!e.render){if(!t&&ls&&!r.render){const a=r.template||el(e).template;if(a){const{isCustomElement:o,compilerOptions:l}=e.appContext.config,{delimiters:s,compilerOptions:c}=r,u=Le(Le({isCustomElement:o,delimiters:s},l),c);r.render=ls(a,u)}}e.render=r.render||vt}Vn(e),Un(),y3(e),Gn(),un()}function q3(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get(t,n){return We(e,"get","$attrs"),t[n]}}))}function U3(e){const t=n=>{e.exposed=n||{}};return{get attrs(){return q3(e)},slots:e.slots,emit:e.emit,expose:t}}function Ca(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Mi(Di(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in lr)return lr[n](e)},has(t,n){return n in t||n in lr}}))}function G3(e,t=!0){return te(e)?e.displayName||e.name:e.name||t&&e.__name}function W3(e){return te(e)&&"__vccOpts"in e}const w=(e,t)=>j0(e,t,Fn);function i(e,t,n){const r=arguments.length;return r===2?xe(t)&&!Q(t)?pa(t)?ke(e,null,[t]):ke(e,t):ke(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&pa(n)&&(n=[n]),ke(e,t,n))}const K3=Symbol.for("v-scx"),J3=()=>ue(K3),Y3="3.3.2",Z3="http://www.w3.org/2000/svg",an=typeof document<"u"?document:null,ss=an&&an.createElement("template"),Q3={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const a=t?an.createElementNS(Z3,e):an.createElement(e,n?{is:n}:void 0);return e==="select"&&r&&r.multiple!=null&&a.setAttribute("multiple",r.multiple),a},createText:e=>an.createTextNode(e),createComment:e=>an.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>an.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,a,o){const l=n?n.previousSibling:t.lastChild;if(a&&(a===o||a.nextSibling))for(;t.insertBefore(a.cloneNode(!0),n),!(a===o||!(a=a.nextSibling)););else{ss.innerHTML=r?`${e}`:e;const s=ss.content;if(r){const c=s.firstChild;for(;c.firstChild;)s.appendChild(c.firstChild);s.removeChild(c)}t.insertBefore(s,n)}return[l?l.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};function X3(e,t,n){const r=e._vtc;r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}function e4(e,t,n){const r=e.style,a=he(n);if(n&&!a){if(t&&!he(t))for(const o in t)n[o]==null&&ho(r,o,"");for(const o in n)ho(r,o,n[o])}else{const o=r.display;a?t!==n&&(r.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(r.display=o)}}const is=/\s*!important$/;function ho(e,t,n){if(Q(n))n.forEach(r=>ho(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=t4(e,t);is.test(n)?e.setProperty(hn(r),n.replace(is,""),"important"):e[r]=n}}const cs=["Webkit","Moz","ms"],Va={};function t4(e,t){const n=Va[t];if(n)return n;let r=st(t);if(r!=="filter"&&r in e)return Va[t]=r;r=xr(r);for(let a=0;aFa||(s4.then(()=>Fa=0),Fa=Date.now());function c4(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;lt(u4(r,n.value),t,5,[r])};return n.value=e,n.attached=i4(),n}function u4(e,t){if(Q(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>a=>!a._stopped&&r&&r(a))}else return t}const ps=/^on[a-z]/,d4=(e,t,n,r,a=!1,o,l,s,c)=>{t==="class"?X3(e,r,a):t==="style"?e4(e,n,r):Ar(t)?Do(t)||o4(e,t,n,r,l):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):p4(e,t,r,a))?r4(e,t,r,o,l,s,c):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),n4(e,t,r,a))};function p4(e,t,n,r){return r?!!(t==="innerHTML"||t==="textContent"||t in e&&ps.test(t)&&te(n)):t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA"||ps.test(t)&&he(n)?!1:t in e}const Bt="transition",er="animation",Jt=(e,{slots:t})=>i(o3,h1(e),t);Jt.displayName="Transition";const f1={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},f4=Jt.props=Le({},Ui,f1),tn=(e,t=[])=>{Q(e)?e.forEach(n=>n(...t)):e&&e(...t)},fs=e=>e?Q(e)?e.some(t=>t.length>1):e.length>1:!1;function h1(e){const t={};for(const N in e)N in f1||(t[N]=e[N]);if(e.css===!1)return t;const{name:n="v",type:r,duration:a,enterFromClass:o=`${n}-enter-from`,enterActiveClass:l=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=o,appearActiveClass:u=l,appearToClass:d=s,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,_=h4(a),A=_&&_[0],x=_&&_[1],{onBeforeEnter:g,onEnter:b,onEnterCancelled:S,onLeave:R,onLeaveCancelled:U,onBeforeAppear:O=g,onAppear:W=b,onAppearCancelled:T=S}=t,j=(N,X,q)=>{Ht(N,X?d:s),Ht(N,X?u:l),q&&q()},J=(N,X)=>{N._isLeaving=!1,Ht(N,p),Ht(N,h),Ht(N,f),X&&X()},re=N=>(X,q)=>{const ze=N?W:b,ne=()=>j(X,N,q);tn(ze,[X,ne]),hs(()=>{Ht(X,N?c:o),Pt(X,N?d:s),fs(ze)||vs(X,r,A,ne)})};return Le(t,{onBeforeEnter(N){tn(g,[N]),Pt(N,o),Pt(N,l)},onBeforeAppear(N){tn(O,[N]),Pt(N,c),Pt(N,u)},onEnter:re(!1),onAppear:re(!0),onLeave(N,X){N._isLeaving=!0;const q=()=>J(N,X);Pt(N,p),m1(),Pt(N,f),hs(()=>{N._isLeaving&&(Ht(N,p),Pt(N,h),fs(R)||vs(N,r,x,q))}),tn(R,[N,q])},onEnterCancelled(N){j(N,!1),tn(S,[N])},onAppearCancelled(N){j(N,!0),tn(T,[N])},onLeaveCancelled(N){J(N),tn(U,[N])}})}function h4(e){if(e==null)return null;if(xe(e))return[Ha(e.enter),Ha(e.leave)];{const t=Ha(e);return[t,t]}}function Ha(e){return Zc(e)}function Pt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e._vtc||(e._vtc=new Set)).add(t)}function Ht(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const{_vtc:n}=e;n&&(n.delete(t),n.size||(e._vtc=void 0))}function hs(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let v4=0;function vs(e,t,n,r){const a=e._endId=++v4,o=()=>{a===e._endId&&r()};if(n)return setTimeout(o,n);const{type:l,timeout:s,propCount:c}=v1(e,t);if(!l)return r();const u=l+"end";let d=0;const p=()=>{e.removeEventListener(u,f),o()},f=h=>{h.target===e&&++d>=c&&p()};setTimeout(()=>{d(n[_]||"").split(", "),a=r(`${Bt}Delay`),o=r(`${Bt}Duration`),l=ms(a,o),s=r(`${er}Delay`),c=r(`${er}Duration`),u=ms(s,c);let d=null,p=0,f=0;t===Bt?l>0&&(d=Bt,p=l,f=o.length):t===er?u>0&&(d=er,p=u,f=c.length):(p=Math.max(l,u),d=p>0?l>u?Bt:er:null,f=d?d===Bt?o.length:c.length:0);const h=d===Bt&&/\b(transform|all)(,|$)/.test(r(`${Bt}Property`).toString());return{type:d,timeout:p,propCount:f,hasTransform:h}}function ms(e,t){for(;e.lengthgs(n)+gs(e[r])))}function gs(e){return Number(e.slice(0,-1).replace(",","."))*1e3}function m1(){return document.body.offsetHeight}const g1=new WeakMap,y1=new WeakMap,_1={name:"TransitionGroup",props:Le({},f4,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Yn(),r=qi();let a,o;return Ki(()=>{if(!a.length)return;const l=e.moveClass||`${e.name||"v"}-move`;if(!E4(a[0].el,n.vnode.el,l))return;a.forEach(y4),a.forEach(_4);const s=a.filter(b4);m1(),s.forEach(c=>{const u=c.el,d=u.style;Pt(u,l),d.transform=d.webkitTransform=d.transitionDuration="";const p=u._moveCb=f=>{f&&f.target!==u||(!f||/transform$/.test(f.propertyName))&&(u.removeEventListener("transitionend",p),u._moveCb=null,Ht(u,l))};u.addEventListener("transitionend",p)})}),()=>{const l=ce(e),s=h1(l);let c=l.tag||je;a=o,o=t.default?Qo(t.default()):[];for(let u=0;udelete e.mode;_1.props;const g4=_1;function y4(e){const t=e.el;t._moveCb&&t._moveCb(),t._enterCb&&t._enterCb()}function _4(e){y1.set(e,e.el.getBoundingClientRect())}function b4(e){const t=g1.get(e),n=y1.get(e),r=t.left-n.left,a=t.top-n.top;if(r||a){const o=e.el.style;return o.transform=o.webkitTransform=`translate(${r}px,${a}px)`,o.transitionDuration="0s",e}}function E4(e,t,n){const r=e.cloneNode();e._vtc&&e._vtc.forEach(l=>{l.split(/\s+/).forEach(s=>s&&r.classList.remove(s))}),n.split(/\s+/).forEach(l=>l&&r.classList.add(l)),r.style.display="none";const a=t.nodeType===1?t:t.parentNode;a.appendChild(r);const{hasTransform:o}=v1(r);return a.removeChild(r),o}const ys=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Q(t)?n=>na(t,n):t};function w4(e){e.target.composing=!0}function _s(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const z9={created(e,{modifiers:{lazy:t,trim:n,number:r}},a){e._assign=ys(a);const o=r||a.props&&a.props.type==="number";xn(e,t?"change":"input",l=>{if(l.target.composing)return;let s=e.value;n&&(s=s.trim()),o&&(s=ro(s)),e._assign(s)}),n&&xn(e,"change",()=>{e.value=e.value.trim()}),t||(xn(e,"compositionstart",w4),xn(e,"compositionend",_s),xn(e,"change",_s))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,modifiers:{lazy:n,trim:r,number:a}},o){if(e._assign=ys(o),e.composing||document.activeElement===e&&e.type!=="range"&&(n||r&&e.value.trim()===t||(a||e.type==="number")&&ro(e.value)===t))return;const l=t??"";e.value!==l&&(e.value=l)}},A4=["ctrl","shift","alt","meta"],x4={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>A4.some(n=>e[`${n}Key`]&&!t.includes(n))},O9=(e,t)=>(n,...r)=>{for(let a=0;an=>{if(!("key"in n))return;const r=hn(n.key);if(t.some(a=>a===r||C4[a]===r))return e(n)},S9={beforeMount(e,{value:t},{transition:n}){e._vod=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):tr(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),tr(e,!0),r.enter(e)):r.leave(e,()=>{tr(e,!1)}):tr(e,t))},beforeUnmount(e,{value:t}){tr(e,t)}};function tr(e,t){e.style.display=t?e._vod:"none"}const T4=Le({patchProp:d4},Q3);let Na,bs=!1;function k4(){return Na=bs?Na:O3(T4),bs=!0,Na}const L4=(...e)=>{const t=k4().createApp(...e),{mount:n}=t;return t.mount=r=>{const a=P4(r);if(a)return n(a,!0,a instanceof SVGElement)},t};function P4(e){return he(e)?document.querySelector(e):e}const z4={"v-8daa1a0e":()=>m(()=>import("./index.html-e2d78b40.js"),[]).then(({data:e})=>e),"v-184f4da6":()=>m(()=>import("./intro.html-66251a3e.js"),[]).then(({data:e})=>e),"v-2e3eac9e":()=>m(()=>import("./slides.html-0184e10d.js"),[]).then(({data:e})=>e),"v-1473bf53":()=>m(()=>import("./index.html-8917e60a.js"),[]).then(({data:e})=>e),"v-4e65ec78":()=>m(()=>import("./disable.html-3d980691.js"),[]).then(({data:e})=>e),"v-c151bf32":()=>m(()=>import("./encrypt.html-5eace103.js"),[]).then(({data:e})=>e),"v-438ffe52":()=>m(()=>import("./markdown.html-21e949f0.js"),[]).then(({data:e})=>e),"v-6e19edb7":()=>m(()=>import("./page.html-79c95730.js"),[]).then(({data:e})=>e),"v-2bc6566a":()=>m(()=>import("./cherry.html-9f35de0f.js"),[]).then(({data:e})=>e),"v-24b7c48d":()=>m(()=>import("./dragonfruit.html-d0774ab6.js"),[]).then(({data:e})=>e),"v-f0ec4556":()=>m(()=>import("./strawberry.html-848856a6.js"),[]).then(({data:e})=>e),"v-df8b6e0c":()=>m(()=>import("./tomato.html-73929c01.js"),[]).then(({data:e})=>e),"v-2d0ad528":()=>m(()=>import("./index.html-0e18d554.js"),[]).then(({data:e})=>e),"v-858cfdd6":()=>m(()=>import("./intro.html-ec82353f.js"),[]).then(({data:e})=>e),"v-269ae70f":()=>m(()=>import("./slides.html-5854bb5e.js"),[]).then(({data:e})=>e),"v-67b8c712":()=>m(()=>import("./1.html-0f8639e1.js"),[]).then(({data:e})=>e),"v-696d9fb1":()=>m(()=>import("./2.html-6d5aa095.js"),[]).then(({data:e})=>e),"v-6b227850":()=>m(()=>import("./3.html-63e4f954.js"),[]).then(({data:e})=>e),"v-6cd750ef":()=>m(()=>import("./4.html-c5758e5e.js"),[]).then(({data:e})=>e),"v-7a07405d":()=>m(()=>import("./1.html-ba22902f.js"),[]).then(({data:e})=>e),"v-7bbc18fc":()=>m(()=>import("./2.html-f0772481.js"),[]).then(({data:e})=>e),"v-7d70f19b":()=>m(()=>import("./3.html-9e1cd135.js"),[]).then(({data:e})=>e),"v-7f25ca3a":()=>m(()=>import("./4.html-034a95e0.js"),[]).then(({data:e})=>e),"v-2b64e284":()=>m(()=>import("./index.html-fe1322c2.js"),[]).then(({data:e})=>e),"v-c1942916":()=>m(()=>import("./disable.html-7d39a99e.js"),[]).then(({data:e})=>e),"v-65c00218":()=>m(()=>import("./encrypt.html-bf2de9f2.js"),[]).then(({data:e})=>e),"v-36295574":()=>m(()=>import("./markdown.html-1c617bdb.js"),[]).then(({data:e})=>e),"v-62ced1a6":()=>m(()=>import("./page.html-ae9c7723.js"),[]).then(({data:e})=>e),"v-9ef49308":()=>m(()=>import("./cherry.html-4ae7488a.js"),[]).then(({data:e})=>e),"v-3fbd497c":()=>m(()=>import("./dragonfruit.html-366382a2.js"),[]).then(({data:e})=>e),"v-46587e86":()=>m(()=>import("./strawberry.html-8d908b02.js"),[]).then(({data:e})=>e),"v-56a32aab":()=>m(()=>import("./tomato.html-0713861e.js"),[]).then(({data:e})=>e),"v-49be79ce":()=>m(()=>import("./1.html-0b642b0c.js"),[]).then(({data:e})=>e),"v-4b73526d":()=>m(()=>import("./2.html-d27c997b.js"),[]).then(({data:e})=>e),"v-4d282b0c":()=>m(()=>import("./3.html-68855027.js"),[]).then(({data:e})=>e),"v-4edd03ab":()=>m(()=>import("./4.html-31cefaff.js"),[]).then(({data:e})=>e),"v-6ac108ec":()=>m(()=>import("./Chapter0 前言.html-5e6f7ae2.js"),[]).then(({data:e})=>e),"v-974cb780":()=>m(()=>import("./Chapter1 编译器组成.html-6d0733eb.js"),[]).then(({data:e})=>e),"v-bdae3856":()=>m(()=>import("./Chapter2 词法分析.html-6b849e8e.js"),[]).then(({data:e})=>e),"v-61e78b6d":()=>m(()=>import("./Chapter3 语法分析.html-e922cfec.js"),[]).then(({data:e})=>e),"v-82296c9e":()=>m(()=>import("./Chapter4 语义分析.html-e129e39d.js"),[]).then(({data:e})=>e),"v-2248c4e9":()=>m(()=>import("./Chapter5 代码生成.html-b53a2f8f.js"),[]).then(({data:e})=>e),"v-a12e2b60":()=>m(()=>import("./震惊,1_0!?.html-6985c468.js"),[]).then(({data:e})=>e),"v-3706649a":()=>m(()=>import("./404.html-a141a261.js"),[]).then(({data:e})=>e),"v-e1e3da16":()=>m(()=>import("./index.html-36c3878d.js"),[]).then(({data:e})=>e),"v-08f42f4a":()=>m(()=>import("./index.html-69480aa3.js"),[]).then(({data:e})=>e),"v-30be3cd5":()=>m(()=>import("./index.html-5c057e54.js"),[]).then(({data:e})=>e),"v-564155e4":()=>m(()=>import("./index.html-470441a0.js"),[]).then(({data:e})=>e),"v-fa14c1f4":()=>m(()=>import("./index.html-5db1bcf8.js"),[]).then(({data:e})=>e),"v-0d2efb0a":()=>m(()=>import("./index.html-8d0464aa.js"),[]).then(({data:e})=>e),"v-089df10d":()=>m(()=>import("./index.html-7c9a45ff.js"),[]).then(({data:e})=>e),"v-07744026":()=>m(()=>import("./index.html-3eedd500.js"),[]).then(({data:e})=>e),"v-5bc93818":()=>m(()=>import("./index.html-ee561570.js"),[]).then(({data:e})=>e),"v-744d024e":()=>m(()=>import("./index.html-a3654b4d.js"),[]).then(({data:e})=>e),"v-e52c881c":()=>m(()=>import("./index.html-d0a6bff5.js"),[]).then(({data:e})=>e),"v-154dc4c4":()=>m(()=>import("./index.html-c008990b.js"),[]).then(({data:e})=>e),"v-01560935":()=>m(()=>import("./index.html-31fe1954.js"),[]).then(({data:e})=>e),"v-ac0c2a6a":()=>m(()=>import("./index.html-0d37cd3a.js"),[]).then(({data:e})=>e),"v-c5a9e2d6":()=>m(()=>import("./index.html-fa98b48d.js"),[]).then(({data:e})=>e),"v-54d7ff21":()=>m(()=>import("./index.html-6556585d.js"),[]).then(({data:e})=>e),"v-2c3ee7f5":()=>m(()=>import("./index.html-a7e92c7c.js"),[]).then(({data:e})=>e),"v-27b02be6":()=>m(()=>import("./index.html-e84bae74.js"),[]).then(({data:e})=>e),"v-a96c8ac4":()=>m(()=>import("./index.html-4e9ce9dd.js"),[]).then(({data:e})=>e),"v-cbedfc04":()=>m(()=>import("./index.html-decef7ec.js"),[]).then(({data:e})=>e),"v-84a70306":()=>m(()=>import("./index.html-4fd84dd2.js"),[]).then(({data:e})=>e),"v-484552dc":()=>m(()=>import("./index.html-a180934e.js"),[]).then(({data:e})=>e),"v-afbf569a":()=>m(()=>import("./index.html-8bc3abb0.js"),[]).then(({data:e})=>e),"v-26f8293d":()=>m(()=>import("./index.html-4e7293f4.js"),[]).then(({data:e})=>e),"v-6c3f91a8":()=>m(()=>import("./index.html-6e297a09.js"),[]).then(({data:e})=>e),"v-30e296fe":()=>m(()=>import("./index.html-da9b643c.js"),[]).then(({data:e})=>e),"v-7fd39646":()=>m(()=>import("./index.html-72b354e5.js"),[]).then(({data:e})=>e),"v-b306f5e8":()=>m(()=>import("./index.html-ec9caa22.js"),[]).then(({data:e})=>e),"v-c10ca3a6":()=>m(()=>import("./index.html-2b734471.js"),[]).then(({data:e})=>e),"v-08d6c854":()=>m(()=>import("./index.html-acb512e8.js"),[]).then(({data:e})=>e),"v-6ae89a52":()=>m(()=>import("./index.html-ba666728.js"),[]).then(({data:e})=>e),"v-0bf5dfa2":()=>m(()=>import("./index.html-ab329651.js"),[]).then(({data:e})=>e),"v-fbb94a6e":()=>m(()=>import("./index.html-5ef4f88d.js"),[]).then(({data:e})=>e),"v-b3156306":()=>m(()=>import("./index.html-e23f1f98.js"),[]).then(({data:e})=>e),"v-2a32a3a8":()=>m(()=>import("./index.html-1689d654.js"),[]).then(({data:e})=>e),"v-4446a48e":()=>m(()=>import("./index.html-ca0cf526.js"),[]).then(({data:e})=>e),"v-16890533":()=>m(()=>import("./index.html-45269fc1.js"),[]).then(({data:e})=>e),"v-b14ed7a6":()=>m(()=>import("./index.html-2eaf1428.js"),[]).then(({data:e})=>e),"v-d28a2a8a":()=>m(()=>import("./index.html-22b3a076.js"),[]).then(({data:e})=>e),"v-3e80ec60":()=>m(()=>import("./index.html-12248d5a.js"),[]).then(({data:e})=>e),"v-1397518c":()=>m(()=>import("./index.html-39cd6071.js"),[]).then(({data:e})=>e),"v-28c447a5":()=>m(()=>import("./index.html-f58734b4.js"),[]).then(({data:e})=>e),"v-41412eae":()=>m(()=>import("./index.html-7df53659.js"),[]).then(({data:e})=>e),"v-540234fd":()=>m(()=>import("./index.html-ab36ce7a.js"),[]).then(({data:e})=>e),"v-d908375e":()=>m(()=>import("./index.html-bbc0acc4.js"),[]).then(({data:e})=>e),"v-03ba1c5a":()=>m(()=>import("./index.html-f7e2aac4.js"),[]).then(({data:e})=>e),"v-6905c52d":()=>m(()=>import("./index.html-7bd0f4ec.js"),[]).then(({data:e})=>e),"v-05bf9c12":()=>m(()=>import("./index.html-f6310996.js"),[]).then(({data:e})=>e),"v-660629f4":()=>m(()=>import("./index.html-ba4fc6d2.js"),[]).then(({data:e})=>e),"v-2e14b8c3":()=>m(()=>import("./index.html-1257554b.js"),[]).then(({data:e})=>e),"v-111f01be":()=>m(()=>import("./index.html-84336144.js"),[]).then(({data:e})=>e),"v-d4827004":()=>m(()=>import("./index.html-3689c8ba.js"),[]).then(({data:e})=>e),"v-ac203710":()=>m(()=>import("./index.html-bd993855.js"),[]).then(({data:e})=>e),"v-03d1f283":()=>m(()=>import("./index.html-02a3be5c.js"),[]).then(({data:e})=>e),"v-331fe9d7":()=>m(()=>import("./index.html-519fa8a2.js"),[]).then(({data:e})=>e),"v-24d008e3":()=>m(()=>import("./index.html-9a0eddb3.js"),[]).then(({data:e})=>e),"v-31a38f34":()=>m(()=>import("./index.html-a4e473d7.js"),[]).then(({data:e})=>e),"v-58bb7b92":()=>m(()=>import("./index.html-30860f2b.js"),[]).then(({data:e})=>e),"v-012340a5":()=>m(()=>import("./index.html-f0da7875.js"),[]).then(({data:e})=>e),"v-78e0ca6a":()=>m(()=>import("./index.html-7dc30a0b.js"),[]).then(({data:e})=>e),"v-e5784e02":()=>m(()=>import("./index.html-989a8a1b.js"),[]).then(({data:e})=>e),"v-3a531ab1":()=>m(()=>import("./index.html-90de2315.js"),[]).then(({data:e})=>e)},O4=JSON.parse('{"base":"/","lang":"en-US","title":"","description":"","head":[],"locales":{"/":{"lang":"en-US","title":"Blog Demo","description":"A blog demo for vuepress-theme-hope"},"/zh/":{"lang":"zh-CN","title":"博客演示","description":"vuepress-theme-hope 的博客演示"}}}');var I4=([e,t,n])=>e==="meta"&&t.name?`${e}.${t.name}`:["title","base"].includes(e)?e:e==="template"&&t.id?`${e}.${t.id}`:JSON.stringify([e,t,n]),S4=e=>{const t=new Set,n=[];return e.forEach(r=>{const a=I4(r);t.has(a)||(t.add(a),n.push(r))}),n},R4=e=>e[e.length-1]==="/"||e.endsWith(".html")?e:`${e}/`,D4=e=>e.startsWith("ftp://"),gn=e=>/^(https?:)?\/\//.test(e),$4=/.md((\?|#).*)?$/,fa=(e,t="/")=>!!(gn(e)||D4(e)||e.startsWith("/")&&!e.startsWith(t)&&!$4.test(e)),b1=e=>/^mailto:/.test(e),M4=e=>/^tel:/.test(e),kr=e=>Object.prototype.toString.call(e)==="[object Object]",al=e=>e[e.length-1]==="/"?e.slice(0,-1):e,E1=e=>e[0]==="/"?e.slice(1):e,B4=(e,t)=>{const n=Object.keys(e).sort((r,a)=>{const o=a.split("/").length-r.split("/").length;return o!==0?o:a.length-r.length});for(const r of n)if(t.startsWith(r))return r;return"/"};const w1={"v-8daa1a0e":P(()=>m(()=>import("./index.html-60a51174.js"),["assets/index.html-60a51174.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-184f4da6":P(()=>m(()=>import("./intro.html-4eab08d6.js"),["assets/intro.html-4eab08d6.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-2e3eac9e":P(()=>m(()=>import("./slides.html-d6a8c7df.js"),["assets/slides.html-d6a8c7df.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-1473bf53":P(()=>m(()=>import("./index.html-5a182a7c.js"),["assets/index.html-5a182a7c.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-4e65ec78":P(()=>m(()=>import("./disable.html-661c735e.js"),["assets/disable.html-661c735e.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-c151bf32":P(()=>m(()=>import("./encrypt.html-e26e2721.js"),["assets/encrypt.html-e26e2721.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-438ffe52":P(()=>m(()=>import("./markdown.html-1fd14400.js"),["assets/markdown.html-1fd14400.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-6e19edb7":P(()=>m(()=>import("./page.html-c5fd6dac.js"),["assets/page.html-c5fd6dac.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-2bc6566a":P(()=>m(()=>import("./cherry.html-794e0f7c.js"),["assets/cherry.html-794e0f7c.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-24b7c48d":P(()=>m(()=>import("./dragonfruit.html-076a45a1.js"),["assets/dragonfruit.html-076a45a1.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-f0ec4556":P(()=>m(()=>import("./strawberry.html-f4cafeb3.js"),["assets/strawberry.html-f4cafeb3.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-df8b6e0c":P(()=>m(()=>import("./tomato.html-71b975a5.js"),["assets/tomato.html-71b975a5.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-2d0ad528":P(()=>m(()=>import("./index.html-f5a29007.js"),["assets/index.html-f5a29007.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-858cfdd6":P(()=>m(()=>import("./intro.html-e9e78a5a.js"),["assets/intro.html-e9e78a5a.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-269ae70f":P(()=>m(()=>import("./slides.html-205cc332.js"),["assets/slides.html-205cc332.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-67b8c712":P(()=>m(()=>import("./1.html-cc1bc8b7.js"),["assets/1.html-cc1bc8b7.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-696d9fb1":P(()=>m(()=>import("./2.html-488d8f8b.js"),["assets/2.html-488d8f8b.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-6b227850":P(()=>m(()=>import("./3.html-c006d8db.js"),["assets/3.html-c006d8db.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-6cd750ef":P(()=>m(()=>import("./4.html-37c75e02.js"),["assets/4.html-37c75e02.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-7a07405d":P(()=>m(()=>import("./1.html-2416d2fe.js"),["assets/1.html-2416d2fe.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-7bbc18fc":P(()=>m(()=>import("./2.html-19370382.js"),["assets/2.html-19370382.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-7d70f19b":P(()=>m(()=>import("./3.html-39cf9146.js"),["assets/3.html-39cf9146.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-7f25ca3a":P(()=>m(()=>import("./4.html-09e424e6.js"),["assets/4.html-09e424e6.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-2b64e284":P(()=>m(()=>import("./index.html-b97c4495.js"),["assets/index.html-b97c4495.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-c1942916":P(()=>m(()=>import("./disable.html-19ab8a43.js"),["assets/disable.html-19ab8a43.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-65c00218":P(()=>m(()=>import("./encrypt.html-eb051be1.js"),["assets/encrypt.html-eb051be1.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-36295574":P(()=>m(()=>import("./markdown.html-128438fb.js"),["assets/markdown.html-128438fb.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-62ced1a6":P(()=>m(()=>import("./page.html-22d81100.js"),["assets/page.html-22d81100.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-9ef49308":P(()=>m(()=>import("./cherry.html-78f50802.js"),["assets/cherry.html-78f50802.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-3fbd497c":P(()=>m(()=>import("./dragonfruit.html-a23a5beb.js"),["assets/dragonfruit.html-a23a5beb.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-46587e86":P(()=>m(()=>import("./strawberry.html-21764891.js"),["assets/strawberry.html-21764891.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-56a32aab":P(()=>m(()=>import("./tomato.html-8c45820b.js"),["assets/tomato.html-8c45820b.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-49be79ce":P(()=>m(()=>import("./1.html-cd53a16c.js"),["assets/1.html-cd53a16c.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-4b73526d":P(()=>m(()=>import("./2.html-915d33a0.js"),["assets/2.html-915d33a0.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-4d282b0c":P(()=>m(()=>import("./3.html-f650b539.js"),["assets/3.html-f650b539.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-4edd03ab":P(()=>m(()=>import("./4.html-b6ef9822.js"),["assets/4.html-b6ef9822.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-6ac108ec":P(()=>m(()=>import("./Chapter0 前言.html-9276126a.js"),["assets/Chapter0 前言.html-9276126a.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-974cb780":P(()=>m(()=>import("./Chapter1 编译器组成.html-6396b848.js"),["assets/Chapter1 编译器组成.html-6396b848.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-bdae3856":P(()=>m(()=>import("./Chapter2 词法分析.html-132355fc.js"),["assets/Chapter2 词法分析.html-132355fc.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-61e78b6d":P(()=>m(()=>import("./Chapter3 语法分析.html-95301033.js"),["assets/Chapter3 语法分析.html-95301033.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-82296c9e":P(()=>m(()=>import("./Chapter4 语义分析.html-ca76b0c6.js"),["assets/Chapter4 语义分析.html-ca76b0c6.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-2248c4e9":P(()=>m(()=>import("./Chapter5 代码生成.html-3b3704dc.js"),["assets/Chapter5 代码生成.html-3b3704dc.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-a12e2b60":P(()=>m(()=>import("./震惊,1_0!?.html-55dfcb3a.js"),["assets/震惊,1_0!?.html-55dfcb3a.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-3706649a":P(()=>m(()=>import("./404.html-211a4153.js"),["assets/404.html-211a4153.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-e1e3da16":P(()=>m(()=>import("./index.html-5999b28d.js"),["assets/index.html-5999b28d.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-08f42f4a":P(()=>m(()=>import("./index.html-6e45764e.js"),["assets/index.html-6e45764e.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-30be3cd5":P(()=>m(()=>import("./index.html-89f26342.js"),["assets/index.html-89f26342.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-564155e4":P(()=>m(()=>import("./index.html-448b6cc5.js"),["assets/index.html-448b6cc5.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-fa14c1f4":P(()=>m(()=>import("./index.html-96cb70e1.js"),["assets/index.html-96cb70e1.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-0d2efb0a":P(()=>m(()=>import("./index.html-e66c357a.js"),["assets/index.html-e66c357a.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-089df10d":P(()=>m(()=>import("./index.html-93c86664.js"),["assets/index.html-93c86664.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-07744026":P(()=>m(()=>import("./index.html-38740475.js"),["assets/index.html-38740475.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-5bc93818":P(()=>m(()=>import("./index.html-8a5e7484.js"),["assets/index.html-8a5e7484.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-744d024e":P(()=>m(()=>import("./index.html-d42c8536.js"),["assets/index.html-d42c8536.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-e52c881c":P(()=>m(()=>import("./index.html-491d8d5b.js"),["assets/index.html-491d8d5b.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-154dc4c4":P(()=>m(()=>import("./index.html-0c165a43.js"),["assets/index.html-0c165a43.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-01560935":P(()=>m(()=>import("./index.html-3057d440.js"),["assets/index.html-3057d440.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-ac0c2a6a":P(()=>m(()=>import("./index.html-4de84a8e.js"),["assets/index.html-4de84a8e.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-c5a9e2d6":P(()=>m(()=>import("./index.html-8e93d3bf.js"),["assets/index.html-8e93d3bf.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-54d7ff21":P(()=>m(()=>import("./index.html-6ec861d6.js"),["assets/index.html-6ec861d6.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-2c3ee7f5":P(()=>m(()=>import("./index.html-d5413c1c.js"),["assets/index.html-d5413c1c.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-27b02be6":P(()=>m(()=>import("./index.html-ae98d047.js"),["assets/index.html-ae98d047.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-a96c8ac4":P(()=>m(()=>import("./index.html-1bfa6dc5.js"),["assets/index.html-1bfa6dc5.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-cbedfc04":P(()=>m(()=>import("./index.html-5da60136.js"),["assets/index.html-5da60136.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-84a70306":P(()=>m(()=>import("./index.html-36290088.js"),["assets/index.html-36290088.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-484552dc":P(()=>m(()=>import("./index.html-2cfbf123.js"),["assets/index.html-2cfbf123.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-afbf569a":P(()=>m(()=>import("./index.html-59e057ed.js"),["assets/index.html-59e057ed.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-26f8293d":P(()=>m(()=>import("./index.html-63e349f4.js"),["assets/index.html-63e349f4.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-6c3f91a8":P(()=>m(()=>import("./index.html-d4f519a1.js"),["assets/index.html-d4f519a1.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-30e296fe":P(()=>m(()=>import("./index.html-7011c689.js"),["assets/index.html-7011c689.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-7fd39646":P(()=>m(()=>import("./index.html-e1f94921.js"),["assets/index.html-e1f94921.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-b306f5e8":P(()=>m(()=>import("./index.html-d0607214.js"),["assets/index.html-d0607214.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-c10ca3a6":P(()=>m(()=>import("./index.html-9a0570a3.js"),["assets/index.html-9a0570a3.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-08d6c854":P(()=>m(()=>import("./index.html-00fea1d7.js"),["assets/index.html-00fea1d7.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-6ae89a52":P(()=>m(()=>import("./index.html-3280d51d.js"),["assets/index.html-3280d51d.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-0bf5dfa2":P(()=>m(()=>import("./index.html-a93d0bc4.js"),["assets/index.html-a93d0bc4.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-fbb94a6e":P(()=>m(()=>import("./index.html-1259154b.js"),["assets/index.html-1259154b.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-b3156306":P(()=>m(()=>import("./index.html-5b82b17d.js"),["assets/index.html-5b82b17d.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-2a32a3a8":P(()=>m(()=>import("./index.html-989c6411.js"),["assets/index.html-989c6411.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-4446a48e":P(()=>m(()=>import("./index.html-2d66db9c.js"),["assets/index.html-2d66db9c.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-16890533":P(()=>m(()=>import("./index.html-b4a02a6b.js"),["assets/index.html-b4a02a6b.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-b14ed7a6":P(()=>m(()=>import("./index.html-ce0bfe56.js"),["assets/index.html-ce0bfe56.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-d28a2a8a":P(()=>m(()=>import("./index.html-8a9c30a2.js"),["assets/index.html-8a9c30a2.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-3e80ec60":P(()=>m(()=>import("./index.html-49921b80.js"),["assets/index.html-49921b80.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-1397518c":P(()=>m(()=>import("./index.html-c7b9e3b3.js"),["assets/index.html-c7b9e3b3.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-28c447a5":P(()=>m(()=>import("./index.html-3a7a5bdc.js"),["assets/index.html-3a7a5bdc.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-41412eae":P(()=>m(()=>import("./index.html-992d9a55.js"),["assets/index.html-992d9a55.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-540234fd":P(()=>m(()=>import("./index.html-eee136c7.js"),["assets/index.html-eee136c7.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-d908375e":P(()=>m(()=>import("./index.html-531addc8.js"),["assets/index.html-531addc8.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-03ba1c5a":P(()=>m(()=>import("./index.html-36f1b3dc.js"),["assets/index.html-36f1b3dc.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-6905c52d":P(()=>m(()=>import("./index.html-e34cebc6.js"),["assets/index.html-e34cebc6.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-05bf9c12":P(()=>m(()=>import("./index.html-392bfcae.js"),["assets/index.html-392bfcae.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-660629f4":P(()=>m(()=>import("./index.html-486451fa.js"),["assets/index.html-486451fa.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-2e14b8c3":P(()=>m(()=>import("./index.html-e1e2c09f.js"),["assets/index.html-e1e2c09f.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-111f01be":P(()=>m(()=>import("./index.html-ca87f242.js"),["assets/index.html-ca87f242.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-d4827004":P(()=>m(()=>import("./index.html-38735731.js"),["assets/index.html-38735731.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-ac203710":P(()=>m(()=>import("./index.html-50d2eaf2.js"),["assets/index.html-50d2eaf2.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-03d1f283":P(()=>m(()=>import("./index.html-f23999a9.js"),["assets/index.html-f23999a9.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-331fe9d7":P(()=>m(()=>import("./index.html-ffaa699d.js"),["assets/index.html-ffaa699d.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-24d008e3":P(()=>m(()=>import("./index.html-d769cc4d.js"),["assets/index.html-d769cc4d.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-31a38f34":P(()=>m(()=>import("./index.html-4e97c620.js"),["assets/index.html-4e97c620.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-58bb7b92":P(()=>m(()=>import("./index.html-3b04a4ea.js"),["assets/index.html-3b04a4ea.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-012340a5":P(()=>m(()=>import("./index.html-45a302c2.js"),["assets/index.html-45a302c2.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-78e0ca6a":P(()=>m(()=>import("./index.html-1facc632.js"),["assets/index.html-1facc632.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-e5784e02":P(()=>m(()=>import("./index.html-402a6ca7.js"),["assets/index.html-402a6ca7.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-3a531ab1":P(()=>m(()=>import("./index.html-0a4cfe81.js"),["assets/index.html-0a4cfe81.js","assets/plugin-vue_export-helper-c27b6911.js"]))};var V4=Symbol(""),F4=H(z4),A1=vn({key:"",path:"",title:"",lang:"",frontmatter:{},headers:[]}),jt=H(A1),ie=()=>jt,x1=Symbol(""),be=()=>{const e=ue(x1);if(!e)throw new Error("usePageFrontmatter() is called without provider.");return e},C1=Symbol(""),H4=()=>{const e=ue(C1);if(!e)throw new Error("usePageHead() is called without provider.");return e},T1=Symbol(""),N4=()=>{const e=ue(T1);if(!e)throw new Error("usePageHeadTitle() is called without provider.");return e},k1=Symbol(""),ol=()=>{const e=ue(k1);if(!e)throw new Error("usePageLang() is called without provider.");return e},L1=Symbol(""),j4=()=>{const e=ue(L1);if(!e)throw new Error("usePageLayout() is called without provider.");return e},ll=Symbol(""),kt=()=>{const e=ue(ll);if(!e)throw new Error("useRouteLocale() is called without provider.");return e},kn=H(O4),P1=()=>kn,z1=Symbol(""),Lr=()=>{const e=ue(z1);if(!e)throw new Error("useSiteLocaleData() is called without provider.");return e},q4=Symbol(""),U4="Layout",G4="NotFound",zt=Wn({resolveLayouts:e=>e.reduce((t,n)=>({...t,...n.layouts}),{}),resolvePageData:async e=>{const t=F4.value[e];return await(t==null?void 0:t())??A1},resolvePageFrontmatter:e=>e.frontmatter,resolvePageHead:(e,t,n)=>{const r=he(t.description)?t.description:n.description,a=[...Q(t.head)?t.head:[],...n.head,["title",{},e],["meta",{name:"description",content:r}]];return S4(a)},resolvePageHeadTitle:(e,t)=>[e.title,t.title].filter(n=>!!n).join(" | "),resolvePageLang:e=>e.lang||"en",resolvePageLayout:(e,t)=>{let n;if(e.path){const r=e.frontmatter.layout;he(r)?n=r:n=U4}else n=G4;return t[n]},resolveRouteLocale:(e,t)=>B4(e,t),resolveSiteLocaleData:(e,t)=>({...e,...e.locales[t]})}),Ta=D({name:"ClientOnly",setup(e,t){const n=H(!1);return de(()=>{n.value=!0}),()=>{var r,a;return n.value?(a=(r=t.slots).default)==null?void 0:a.call(r):null}}}),sl=D({name:"Content",props:{pageKey:{type:String,required:!1,default:""}},setup(e){const t=ie(),n=w(()=>w1[e.pageKey||t.value.key]);return()=>n.value?i(n.value):i("div","404 Not Found")}}),bt=(e={})=>e,Fe=e=>gn(e)?e:`/${E1(e)}`;const W4={};var qe=Uint8Array,ln=Uint16Array,O1=Uint32Array,I1=new qe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),S1=new qe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),K4=new qe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),R1=function(e,t){for(var n=new ln(31),r=0;r<31;++r)n[r]=t+=1<>>1|(Te&21845)<<1;Vt=(Vt&52428)>>>2|(Vt&13107)<<2,Vt=(Vt&61680)>>>4|(Vt&3855)<<4,vo[Te]=((Vt&65280)>>>8|(Vt&255)<<8)>>>1}var cr=function(e,t,n){for(var r=e.length,a=0,o=new ln(t);a>>c]=u}else for(s=new ln(r),a=0;a>>15-e[a]);return s},Pr=new qe(288);for(var Te=0;Te<144;++Te)Pr[Te]=8;for(var Te=144;Te<256;++Te)Pr[Te]=9;for(var Te=256;Te<280;++Te)Pr[Te]=7;for(var Te=280;Te<288;++Te)Pr[Te]=8;var M1=new qe(32);for(var Te=0;Te<32;++Te)M1[Te]=5;var Q4=cr(Pr,9,1),X4=cr(M1,5,1),ja=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},ut=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},qa=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},eu=function(e){return(e+7)/8|0},il=function(e,t,n){(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var r=new(e.BYTES_PER_ELEMENT==2?ln:e.BYTES_PER_ELEMENT==4?O1:qe)(n-t);return r.set(e.subarray(t,n)),r},tu=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],dt=function(e,t,n){var r=new Error(t||tu[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,dt),!n)throw r;return r},nu=function(e,t,n){var r=e.length;if(!r||n&&n.f&&!n.l)return t||new qe(0);var a=!t||n,o=!n||n.i;n||(n={}),t||(t=new qe(r*3));var l=function(Re){var k=t.length;if(Re>k){var F=new qe(Math.max(k*2,Re));F.set(t),t=F}},s=n.f||0,c=n.p||0,u=n.b||0,d=n.l,p=n.d,f=n.m,h=n.n,_=r*8;do{if(!d){s=ut(e,c,1);var A=ut(e,c+1,3);if(c+=3,A)if(A==1)d=Q4,p=X4,f=9,h=5;else if(A==2){var S=ut(e,c,31)+257,R=ut(e,c+10,15)+4,U=S+ut(e,c+5,31)+1;c+=14;for(var O=new qe(U),W=new qe(19),T=0;T>>4;if(x<16)O[T++]=x;else{var X=0,q=0;for(x==16?(q=3+ut(e,c,3),c+=2,X=O[T-1]):x==17?(q=3+ut(e,c,7),c+=3):x==18&&(q=11+ut(e,c,127),c+=7);q--;)O[T++]=X}}var ze=O.subarray(0,S),ne=O.subarray(S);f=ja(ze),h=ja(ne),d=cr(ze,f,1),p=cr(ne,h,1)}else dt(1);else{var x=eu(c)+4,g=e[x-4]|e[x-3]<<8,b=x+g;if(b>r){o&&dt(0);break}a&&l(u+g),t.set(e.subarray(x,b),u),n.b=u+=g,n.p=c=b*8,n.f=s;continue}if(c>_){o&&dt(0);break}}a&&l(u+131072);for(var ye=(1<>>4;if(c+=X&15,c>_){o&&dt(0);break}if(X||dt(2),He<256)t[u++]=He;else if(He==256){Ye=c,d=null;break}else{var Ze=He-254;if(He>264){var T=He-257,Oe=I1[T];Ze=ut(e,c,(1<>>4;wt||dt(3),c+=wt&15;var ne=Z4[At];if(At>3){var Oe=S1[At];ne+=qa(e,c)&(1<_){o&&dt(0);break}a&&l(u+131072);for(var Xt=u+Ze;u>>4>7||(e[0]<<8|e[1])%31)&&dt(6,"invalid zlib data"),e[1]&32&&dt(6,"invalid zlib data: preset dictionaries not supported")};function ou(e,t){return nu((au(e),e.subarray(2,-4)),t)}var Es=typeof TextEncoder<"u"&&new TextEncoder,mo=typeof TextDecoder<"u"&&new TextDecoder,lu=0;try{mo.decode(ru,{stream:!0}),lu=1}catch{}var su=function(e){for(var t="",n=0;;){var r=e[n++],a=(r>127)+(r>223)+(r>239);if(n+a>e.length)return[t,il(e,n-1)];a?a==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):a&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function iu(e,t){if(t){for(var n=new qe(e.length),r=0;r>1)),l=0,s=function(d){o[l++]=d},r=0;ro.length){var c=new qe(l+8+(a-r<<1));c.set(o),o=c}var u=e.charCodeAt(r);u<128||t?s(u):u<2048?(s(192|u>>6),s(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|e.charCodeAt(++r)&1023,s(240|u>>18),s(128|u>>12&63),s(128|u>>6&63),s(128|u&63)):(s(224|u>>12),s(128|u>>6&63),s(128|u&63))}return il(o,0,l)}function cu(e,t){if(t){for(var n="",r=0;r{var r;return i("svg",{xmlns:"http://www.w3.org/2000/svg",class:["icon",`${e}-icon`],viewBox:"0 0 1024 1024",fill:t,"aria-label":`${e} icon`},(r=n.default)==null?void 0:r.call(n))};ae.displayName="IconBase";const Yt=({size:e=48,stroke:t=4,wrapper:n=!0,height:r=2*e})=>{const a=i("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,preserveAspectRatio:"xMidYMid",viewBox:"25 25 50 50"},[i("animateTransform",{attributeName:"transform",type:"rotate",dur:"2s",keyTimes:"0;1",repeatCount:"indefinite",values:"0;360"}),i("circle",{cx:"50",cy:"50",r:"20",fill:"none",stroke:"currentColor","stroke-width":t,"stroke-linecap":"round"},[i("animate",{attributeName:"stroke-dasharray",dur:"1.5s",keyTimes:"0;0.5;1",repeatCount:"indefinite",values:"1,200;90,200;1,200"}),i("animate",{attributeName:"stroke-dashoffset",dur:"1.5s",keyTimes:"0;0.5;1",repeatCount:"indefinite",values:"0;-35px;-125px"})])]);return n?i("div",{class:"loading-icon-wrapper",style:`display:flex;align-items:center;justify-content:center;height:${r}px`},a):a};Yt.displayName="LoadingIcon";const B1=(e,{slots:t})=>{var n;return(n=t.default)==null?void 0:n.call(t)},V1=()=>i(ae,{name:"github"},()=>i("path",{d:"M511.957 21.333C241.024 21.333 21.333 240.981 21.333 512c0 216.832 140.544 400.725 335.574 465.664 24.49 4.395 32.256-10.07 32.256-23.083 0-11.69.256-44.245 0-85.205-136.448 29.61-164.736-64.64-164.736-64.64-22.315-56.704-54.4-71.765-54.4-71.765-44.587-30.464 3.285-29.824 3.285-29.824 49.195 3.413 75.179 50.517 75.179 50.517 43.776 75.008 114.816 53.333 142.762 40.79 4.523-31.66 17.152-53.377 31.19-65.537-108.971-12.458-223.488-54.485-223.488-242.602 0-53.547 19.114-97.323 50.517-131.67-5.035-12.33-21.93-62.293 4.779-129.834 0 0 41.258-13.184 134.912 50.346a469.803 469.803 0 0 1 122.88-16.554c41.642.213 83.626 5.632 122.88 16.554 93.653-63.488 134.784-50.346 134.784-50.346 26.752 67.541 9.898 117.504 4.864 129.834 31.402 34.347 50.474 78.123 50.474 131.67 0 188.586-114.73 230.016-224.042 242.09 17.578 15.232 33.578 44.672 33.578 90.454v135.85c0 13.142 7.936 27.606 32.854 22.87C862.25 912.597 1002.667 728.747 1002.667 512c0-271.019-219.648-490.667-490.71-490.667z"}));V1.displayName="GitHubIcon";const F1=()=>i(ae,{name:"gitlab"},()=>i("path",{d:"M229.333 78.688C223.52 62 199.895 62 193.895 78.688L87.958 406.438h247.5c-.188 0-106.125-327.75-106.125-327.75zM33.77 571.438c-4.875 15 .563 31.687 13.313 41.25l464.812 345L87.77 406.438zm301.5-165 176.813 551.25 176.812-551.25zm655.125 165-54-165-424.312 551.25 464.812-345c12.938-9.563 18.188-26.25 13.5-41.25zM830.27 78.688c-5.812-16.688-29.437-16.688-35.437 0l-106.125 327.75h247.5z"}));F1.displayName="GitLabIcon";const H1=()=>i(ae,{name:"gitee"},()=>i("path",{d:"M512 992C246.92 992 32 777.08 32 512S246.92 32 512 32s480 214.92 480 480-214.92 480-480 480zm242.97-533.34H482.39a23.7 23.7 0 0 0-23.7 23.7l-.03 59.28c0 13.08 10.59 23.7 23.7 23.7h165.96a23.7 23.7 0 0 1 23.7 23.7v11.85a71.1 71.1 0 0 1-71.1 71.1H375.71a23.7 23.7 0 0 1-23.7-23.7V423.11a71.1 71.1 0 0 1 71.1-71.1h331.8a23.7 23.7 0 0 0 23.7-23.7l.06-59.25a23.73 23.73 0 0 0-23.7-23.73H423.11a177.78 177.78 0 0 0-177.78 177.75v331.83c0 13.08 10.62 23.7 23.7 23.7h349.62a159.99 159.99 0 0 0 159.99-159.99V482.33a23.7 23.7 0 0 0-23.7-23.7z"}));H1.displayName="GiteeIcon";const N1=()=>i(ae,{name:"bitbucket"},()=>i("path",{d:"M575.256 490.862c6.29 47.981-52.005 85.723-92.563 61.147-45.714-20.004-45.714-92.562-1.133-113.152 38.29-23.442 93.696 7.424 93.696 52.005zm63.451-11.996c-10.276-81.152-102.29-134.839-177.152-101.156-47.433 21.138-79.433 71.424-77.129 124.562 2.853 69.705 69.157 126.866 138.862 120.576S647.3 548.571 638.708 478.83zm136.558-309.723c-25.161-33.134-67.986-38.839-105.728-45.13-106.862-17.151-216.576-17.7-323.438 1.134-35.438 5.706-75.447 11.996-97.719 43.996 36.572 34.304 88.576 39.424 135.424 45.129 84.553 10.862 171.447 11.447 256 .585 47.433-5.705 99.987-10.276 135.424-45.714zm32.585 591.433c-16.018 55.99-6.839 131.438-66.304 163.986-102.29 56.576-226.304 62.867-338.87 42.862-59.43-10.862-129.135-29.696-161.72-85.723-14.3-54.858-23.442-110.848-32.585-166.84l3.438-9.142 10.276-5.157c170.277 112.567 408.576 112.567 579.438 0 26.844 8.01 6.84 40.558 6.29 60.014zm103.424-549.157c-19.42 125.148-41.728 249.71-63.415 374.272-6.29 36.572-41.728 57.162-71.424 72.558-106.862 53.724-231.424 62.866-348.562 50.286-79.433-8.558-160.585-29.696-225.134-79.433-30.28-23.443-30.28-63.415-35.986-97.134-20.005-117.138-42.862-234.277-57.161-352.585 6.839-51.42 64.585-73.728 107.447-89.71 57.16-21.138 118.272-30.866 178.87-36.571 129.134-12.58 261.157-8.01 386.304 28.562 44.581 13.13 92.563 31.415 122.844 69.705 13.714 17.7 9.143 40.01 6.29 60.014z"}));N1.displayName="BitbucketIcon";const j1=()=>i(ae,{name:"source"},()=>i("path",{d:"M601.92 475.2c0 76.428-8.91 83.754-28.512 99.594-14.652 11.88-43.956 14.058-78.012 16.434-18.81 1.386-40.392 2.97-62.172 6.534-18.612 2.97-36.432 9.306-53.064 17.424V299.772c37.818-21.978 63.36-62.766 63.36-109.692 0-69.894-56.826-126.72-126.72-126.72S190.08 120.186 190.08 190.08c0 46.926 25.542 87.714 63.36 109.692v414.216c-37.818 21.978-63.36 62.766-63.36 109.692 0 69.894 56.826 126.72 126.72 126.72s126.72-56.826 126.72-126.72c0-31.086-11.286-59.598-29.7-81.576 13.266-9.504 27.522-17.226 39.996-19.206 16.038-2.574 32.868-3.762 50.688-5.148 48.312-3.366 103.158-7.326 148.896-44.55 61.182-49.698 74.25-103.158 75.24-187.902V475.2h-126.72zM316.8 126.72c34.848 0 63.36 28.512 63.36 63.36s-28.512 63.36-63.36 63.36-63.36-28.512-63.36-63.36 28.512-63.36 63.36-63.36zm0 760.32c-34.848 0-63.36-28.512-63.36-63.36s28.512-63.36 63.36-63.36 63.36 28.512 63.36 63.36-28.512 63.36-63.36 63.36zM823.68 158.4h-95.04V63.36h-126.72v95.04h-95.04v126.72h95.04v95.04h126.72v-95.04h95.04z"}));j1.displayName="SourceIcon";const cl=Array.isArray,uu=e=>typeof e=="function",du=e=>typeof e=="string";var q1=e=>/^(https?:)?\/\//.test(e),ur=e=>Object.prototype.toString.call(e)==="[object Object]";const gt=(e,t)=>{const n=t?t._instance:Yn();return ur(n==null?void 0:n.appContext.components)&&(e in n.appContext.components||st(e)in n.appContext.components||xr(st(e))in n.appContext.components)};function pu(){const e=H(!1);return Yn()&&de(()=>{e.value=!0}),e}function fu(e){return pu(),w(()=>!!e())}const hu=()=>fu(()=>typeof window<"u"&&window.navigator&&"userAgent"in window.navigator),vu=()=>{const e=hu();return w(()=>e.value&&/\b(?:Android|iPhone)/i.test(navigator.userAgent))},zr=e=>{const t=kt();return w(()=>e[t.value])},ul=(e="")=>{if(e){if(typeof e=="number")return new Date(e);const t=Date.parse(e.toString());if(!Number.isNaN(t))return new Date(t)}return null},ka=(e,t)=>{let n=1;for(let r=0;r>6;return n+=n<<3,n^=n>>11,n%t},dn=e=>typeof e=="string",Hn=(e,t)=>dn(e)&&e.startsWith(t),En=(e,t)=>dn(e)&&e.endsWith(t),yn=Object.entries,mu=Object.fromEntries,Ke=Object.keys,ws=(e,...t)=>{if(t.length===0)return e;const n=t.shift()||null;return n&&yn(n).forEach(([r,a])=>{r==="__proto__"||r==="constructor"||(ur(e[r])&&ur(a)?ws(e[r],a):cl(a)?e[r]=[...a]:ur(a)?e[r]={...a}:e[r]=n[r])}),ws(e,...t)},As=e=>ur(e)&&dn(e.name),br=(e,t=!1)=>e?cl(e)?e.map(n=>dn(n)?{name:n}:As(n)?n:null).filter(n=>n!==null):dn(e)?[{name:e}]:As(e)?[e]:(console.error(`Expect "author" to be \`AuthorInfo[] | AuthorInfo | string[] | string ${t?"":"| false"} | undefined\`, but got`,e),[]):[],U1=(e,t)=>{if(e){if(cl(e)&&e.every(dn))return e;if(dn(e))return[e];console.error(`Expect ${t||"value"} to be \`string[] | string | undefined\`, but got`,e)}return[]},G1=e=>U1(e,"category"),W1=e=>U1(e,"tag"),La=e=>Hn(e,"/");let gu=class{constructor(){this.messageElements={};const t="message-container",n=document.getElementById(t);n?this.containerElement=n:(this.containerElement=document.createElement("div"),this.containerElement.id=t,document.body.appendChild(this.containerElement))}pop(t,n=2e3){const r=document.createElement("div"),a=Date.now();return r.className="message move-in",r.innerHTML=t,this.containerElement.appendChild(r),this.messageElements[a]=r,n>0&&setTimeout(()=>{this.close(a)},n),a}close(t){if(t){const n=this.messageElements[t];n.classList.remove("move-in"),n.classList.add("move-out"),n.addEventListener("animationend",()=>{n.remove(),delete this.messageElements[t]})}else Ke(this.messageElements).forEach(n=>this.close(Number(n)))}destroy(){document.body.removeChild(this.containerElement)}};const K1=/#.*$/u,yu=e=>{const t=K1.exec(e);return t?t[0]:""},xs=e=>decodeURI(e).replace(K1,"").replace(/(index)?\.(md|html)$/,""),dl=(e,t)=>{if(t===void 0)return!1;const n=xs(e.path),r=xs(t),a=yu(t);return a?a===e.hash&&(!r||n===r):n===r},pn=e=>{const t=atob(e);return cu(ou(iu(t,!0)))},_u=e=>q1(e)?e:`https://github.com/${e}`,J1=e=>!q1(e)||/github\.com/.test(e)?"GitHub":/bitbucket\.org/.test(e)?"Bitbucket":/gitlab\.com/.test(e)?"GitLab":/gitee\.com/.test(e)?"Gitee":null,Or=(e,...t)=>{const n=e.resolve(...t),r=n.matched[n.matched.length-1];if(!(r!=null&&r.redirect))return n;const{redirect:a}=r,o=uu(a)?a(n):a,l=du(o)?{path:o}:o;return Or(e,{hash:n.hash,query:n.query,params:n.params,...l})};function Zt(e){return Ai()?(l0(e),!0):!1}function it(e){return typeof e=="function"?e():cn(e)}const Ir=typeof window<"u",fn=()=>{},go=bu();function bu(){var e;return Ir&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent)}function pl(e,t){function n(...r){return new Promise((a,o)=>{Promise.resolve(e(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})).then(a).catch(o)})}return n}const Y1=e=>e();function Eu(e,t={}){let n,r,a=fn;const o=s=>{clearTimeout(s),a(),a=fn};return s=>{const c=it(e),u=it(t.maxWait);return n&&o(n),c<=0||u!==void 0&&u<=0?(r&&(o(r),r=null),Promise.resolve(s())):new Promise((d,p)=>{a=t.rejectOnCancel?p:d,u&&!r&&(r=setTimeout(()=>{n&&o(n),r=null,d(s())},u)),n=setTimeout(()=>{r&&o(r),r=null,d(s())},c)})}}function wu(e,t=!0,n=!0,r=!1){let a=0,o,l=!0,s=fn,c;const u=()=>{o&&(clearTimeout(o),o=void 0,s(),s=fn)};return p=>{const f=it(e),h=Date.now()-a,_=()=>c=p();return u(),f<=0?(a=Date.now(),_()):(h>f&&(n||!l)?(a=Date.now(),_()):t&&(c=new Promise((A,x)=>{s=r?x:A,o=setTimeout(()=>{a=Date.now(),l=!0,A(_()),u()},Math.max(0,f-h))})),!n&&!o&&(o=setTimeout(()=>l=!0,f)),l=!1,c)}}function Au(e=Y1){const t=H(!0);function n(){t.value=!1}function r(){t.value=!0}const a=(...o)=>{t.value&&e(...o)};return{isActive:vn(t),pause:n,resume:r,eventFilter:a}}function Z1(...e){if(e.length!==1)return Kn(...e);const t=e[0];return typeof t=="function"?vn(B0(()=>({get:t,set:fn}))):H(t)}function Q1(e,t=200,n={}){return pl(Eu(t,n),e)}function xu(e,t=200,n=!1,r=!0,a=!1){return pl(wu(t,n,r,a),e)}function X1(e,t=!0){Yn()?de(e):t?e():mn(e)}function Cu(e,t,n={}){const{immediate:r=!0}=n,a=H(!1);let o=null;function l(){o&&(clearTimeout(o),o=null)}function s(){a.value=!1,l()}function c(...u){l(),a.value=!0,o=setTimeout(()=>{a.value=!1,o=null,e(...u)},it(t))}return r&&(a.value=!0,Ir&&c()),Zt(s),{isPending:vn(a),start:c,stop:s}}function yo(e=!1,t={}){const{truthyValue:n=!0,falsyValue:r=!1}=t,a=$e(e),o=H(e);function l(s){if(arguments.length)return o.value=s,o.value;{const c=it(n);return o.value=o.value===c?it(r):c,o.value}}return a?l:[o,l]}var Cs=Object.getOwnPropertySymbols,Tu=Object.prototype.hasOwnProperty,ku=Object.prototype.propertyIsEnumerable,Lu=(e,t)=>{var n={};for(var r in e)Tu.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Cs)for(var r of Cs(e))t.indexOf(r)<0&&ku.call(e,r)&&(n[r]=e[r]);return n};function Pu(e,t,n={}){const r=n,{eventFilter:a=Y1}=r,o=Lu(r,["eventFilter"]);return se(e,pl(a,t),o)}var zu=Object.defineProperty,Ou=Object.defineProperties,Iu=Object.getOwnPropertyDescriptors,ha=Object.getOwnPropertySymbols,e2=Object.prototype.hasOwnProperty,t2=Object.prototype.propertyIsEnumerable,Ts=(e,t,n)=>t in e?zu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Su=(e,t)=>{for(var n in t||(t={}))e2.call(t,n)&&Ts(e,n,t[n]);if(ha)for(var n of ha(t))t2.call(t,n)&&Ts(e,n,t[n]);return e},Ru=(e,t)=>Ou(e,Iu(t)),Du=(e,t)=>{var n={};for(var r in e)e2.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ha)for(var r of ha(e))t.indexOf(r)<0&&t2.call(e,r)&&(n[r]=e[r]);return n};function $u(e,t,n={}){const r=n,{eventFilter:a}=r,o=Du(r,["eventFilter"]),{eventFilter:l,pause:s,resume:c,isActive:u}=Au(a);return{stop:Pu(e,t,Ru(Su({},o),{eventFilter:l})),pause:s,resume:c,isActive:u}}function et(e){var t;const n=it(e);return(t=n==null?void 0:n.$el)!=null?t:n}const yt=Ir?window:void 0,n2=Ir?window.document:void 0,Mu=Ir?window.navigator:void 0;function Me(...e){let t,n,r,a;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,r,a]=e,t=yt):[t,n,r,a]=e,!t)return fn;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],l=()=>{o.forEach(d=>d()),o.length=0},s=(d,p,f,h)=>(d.addEventListener(p,f,h),()=>d.removeEventListener(p,f,h)),c=se(()=>[et(t),it(a)],([d,p])=>{l(),d&&o.push(...n.flatMap(f=>r.map(h=>s(d,f,h,p))))},{immediate:!0,flush:"post"}),u=()=>{c(),l()};return Zt(u),u}let ks=!1;function Bu(e,t,n={}){const{window:r=yt,ignore:a=[],capture:o=!0,detectIframe:l=!1}=n;if(!r)return;go&&!ks&&(ks=!0,Array.from(r.document.body.children).forEach(f=>f.addEventListener("click",fn)));let s=!0;const c=f=>a.some(h=>{if(typeof h=="string")return Array.from(r.document.querySelectorAll(h)).some(_=>_===f.target||f.composedPath().includes(_));{const _=et(h);return _&&(f.target===_||f.composedPath().includes(_))}}),d=[Me(r,"click",f=>{const h=et(e);if(!(!h||h===f.target||f.composedPath().includes(h))){if(f.detail===0&&(s=!c(f)),!s){s=!0;return}t(f)}},{passive:!0,capture:o}),Me(r,"pointerdown",f=>{const h=et(e);h&&(s=!f.composedPath().includes(h)&&!c(f))},{passive:!0}),l&&Me(r,"blur",f=>{var h;const _=et(e);((h=r.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!(_!=null&&_.contains(r.document.activeElement))&&t(f)})].filter(Boolean);return()=>d.forEach(f=>f())}function Vu(){const e=H(!1);return Yn()&&de(()=>{e.value=!0}),e}function Sr(e){const t=Vu();return w(()=>(t.value,!!e()))}function r2(e,t={}){const{window:n=yt}=t,r=Sr(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let a;const o=H(!1),l=()=>{a&&("removeEventListener"in a?a.removeEventListener("change",s):a.removeListener(s))},s=()=>{r.value&&(l(),a=n.matchMedia(Z1(e).value),o.value=!!(a!=null&&a.matches),a&&("addEventListener"in a?a.addEventListener("change",s):a.addListener(s)))};return n3(s),Zt(()=>l()),o}function Fu(e={}){const{navigator:t=Mu,read:n=!1,source:r,copiedDuring:a=1500,legacy:o=!1}=e,l=["copy","cut"],s=Sr(()=>t&&"clipboard"in t),c=w(()=>s.value||o),u=H(""),d=H(!1),p=Cu(()=>d.value=!1,a);function f(){s.value?t.clipboard.readText().then(x=>{u.value=x}):u.value=A()}if(c.value&&n)for(const x of l)Me(x,f);async function h(x=it(r)){c.value&&x!=null&&(s.value?await t.clipboard.writeText(x):_(x),u.value=x,d.value=!0,p.start())}function _(x){const g=document.createElement("textarea");g.value=x??"",g.style.position="absolute",g.style.opacity="0",document.body.appendChild(g),g.select(),document.execCommand("copy"),g.remove()}function A(){var x,g,b;return(b=(g=(x=document==null?void 0:document.getSelection)==null?void 0:x.call(document))==null?void 0:g.toString())!=null?b:""}return{isSupported:c,text:u,copied:d,copy:h}}const Jr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Yr="__vueuse_ssr_handlers__",Hu=Nu();function Nu(){return Yr in Jr||(Jr[Yr]=Jr[Yr]||{}),Jr[Yr]}function ju(e,t){return Hu[e]||t}function qu(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}var Uu=Object.defineProperty,Ls=Object.getOwnPropertySymbols,Gu=Object.prototype.hasOwnProperty,Wu=Object.prototype.propertyIsEnumerable,Ps=(e,t,n)=>t in e?Uu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zs=(e,t)=>{for(var n in t||(t={}))Gu.call(t,n)&&Ps(e,n,t[n]);if(Ls)for(var n of Ls(t))Wu.call(t,n)&&Ps(e,n,t[n]);return e};const Ku={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},Os="vueuse-storage";function Zn(e,t,n,r={}){var a;const{flush:o="pre",deep:l=!0,listenToStorageChanges:s=!0,writeDefaults:c=!0,mergeDefaults:u=!1,shallow:d,window:p=yt,eventFilter:f,onError:h=T=>{console.error(T)}}=r,_=(d?Pe:H)(t);if(!n)try{n=ju("getDefaultStorage",()=>{var T;return(T=yt)==null?void 0:T.localStorage})()}catch(T){h(T)}if(!n)return _;const A=it(t),x=qu(A),g=(a=r.serializer)!=null?a:Ku[x],{pause:b,resume:S}=$u(_,()=>R(_.value),{flush:o,deep:l,eventFilter:f});return p&&s&&(Me(p,"storage",W),Me(p,Os,O)),W(),_;function R(T){try{if(T==null)n.removeItem(e);else{const j=g.write(T),J=n.getItem(e);J!==j&&(n.setItem(e,j),p&&p.dispatchEvent(new CustomEvent(Os,{detail:{key:e,oldValue:J,newValue:j,storageArea:n}})))}}catch(j){h(j)}}function U(T){const j=T?T.newValue:n.getItem(e);if(j==null)return c&&A!==null&&n.setItem(e,g.write(A)),A;if(!T&&u){const J=g.read(j);return typeof u=="function"?u(J,A):x==="object"&&!Array.isArray(J)?zs(zs({},A),J):J}else return typeof j!="string"?j:g.read(j)}function O(T){W(T.detail)}function W(T){if(!(T&&T.storageArea!==n)){if(T&&T.key==null){_.value=A;return}if(!(T&&T.key!==e)){b();try{_.value=U(T)}catch(j){h(j)}finally{T?mn(S):S()}}}}}function Ju(e){return r2("(prefers-color-scheme: dark)",e)}var Is=Object.getOwnPropertySymbols,Yu=Object.prototype.hasOwnProperty,Zu=Object.prototype.propertyIsEnumerable,Qu=(e,t)=>{var n={};for(var r in e)Yu.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Is)for(var r of Is(e))t.indexOf(r)<0&&Zu.call(e,r)&&(n[r]=e[r]);return n};function Xu(e,t,n={}){const r=n,{window:a=yt}=r,o=Qu(r,["window"]);let l;const s=Sr(()=>a&&"MutationObserver"in a),c=()=>{l&&(l.disconnect(),l=void 0)},u=se(()=>et(e),p=>{c(),s.value&&a&&p&&(l=new MutationObserver(t),l.observe(p,o))},{immediate:!0}),d=()=>{c(),u()};return Zt(d),{isSupported:s,stop:d}}var Ss=Object.getOwnPropertySymbols,e6=Object.prototype.hasOwnProperty,t6=Object.prototype.propertyIsEnumerable,n6=(e,t)=>{var n={};for(var r in e)e6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ss)for(var r of Ss(e))t.indexOf(r)<0&&t6.call(e,r)&&(n[r]=e[r]);return n};function r6(e,t,n={}){const r=n,{window:a=yt}=r,o=n6(r,["window"]);let l;const s=Sr(()=>a&&"ResizeObserver"in a),c=()=>{l&&(l.disconnect(),l=void 0)},u=w(()=>Array.isArray(e)?e.map(f=>et(f)):[et(e)]),d=se(u,f=>{if(c(),s.value&&a){l=new ResizeObserver(t);for(const h of f)h&&l.observe(h,o)}},{immediate:!0,flush:"post",deep:!0}),p=()=>{c(),d()};return Zt(p),{isSupported:s,stop:p}}function a6(e,t={width:0,height:0},n={}){const{window:r=yt,box:a="content-box"}=n,o=w(()=>{var c,u;return(u=(c=et(e))==null?void 0:c.namespaceURI)==null?void 0:u.includes("svg")}),l=H(t.width),s=H(t.height);return r6(e,([c])=>{const u=a==="border-box"?c.borderBoxSize:a==="content-box"?c.contentBoxSize:c.devicePixelContentBoxSize;if(r&&o.value){const d=et(e);if(d){const p=r.getComputedStyle(d);l.value=parseFloat(p.width),s.value=parseFloat(p.height)}}else if(u){const d=Array.isArray(u)?u:[u];l.value=d.reduce((p,{inlineSize:f})=>p+f,0),s.value=d.reduce((p,{blockSize:f})=>p+f,0)}else l.value=c.contentRect.width,s.value=c.contentRect.height},n),se(()=>et(e),c=>{l.value=c?t.width:0,s.value=c?t.height:0}),{width:l,height:s}}const Rs=["fullscreenchange","webkitfullscreenchange","webkitendfullscreen","mozfullscreenchange","MSFullscreenChange"];function fl(e,t={}){const{document:n=n2,autoExit:r=!1}=t,a=w(()=>{var g;return(g=et(e))!=null?g:n==null?void 0:n.querySelector("html")}),o=H(!1),l=w(()=>["requestFullscreen","webkitRequestFullscreen","webkitEnterFullscreen","webkitEnterFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"].find(g=>n&&g in n||a.value&&g in a.value)),s=w(()=>["exitFullscreen","webkitExitFullscreen","webkitExitFullScreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"].find(g=>n&&g in n||a.value&&g in a.value)),c=w(()=>["fullScreen","webkitIsFullScreen","webkitDisplayingFullscreen","mozFullScreen","msFullscreenElement"].find(g=>n&&g in n||a.value&&g in a.value)),u=["fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement"].find(g=>n&&g in n),d=Sr(()=>a.value&&n&&l.value!==void 0&&s.value!==void 0&&c.value!==void 0),p=()=>u?(n==null?void 0:n[u])===a.value:!1,f=()=>{if(c.value){if(n&&n[c.value]!=null)return n[c.value];{const g=a.value;if((g==null?void 0:g[c.value])!=null)return!!g[c.value]}}return!1};async function h(){if(d.value){if(s.value)if((n==null?void 0:n[s.value])!=null)await n[s.value]();else{const g=a.value;(g==null?void 0:g[s.value])!=null&&await g[s.value]()}o.value=!1}}async function _(){if(!d.value)return;f()&&await h();const g=a.value;l.value&&(g==null?void 0:g[l.value])!=null&&(await g[l.value](),o.value=!0)}async function A(){await(o.value?h():_())}const x=()=>{const g=f();(!g||g&&p())&&(o.value=g)};return Me(n,Rs,x,!1),Me(()=>et(a),Rs,x,!1),r&&Zt(h),{isSupported:d,isFullscreen:o,enter:_,exit:h,toggle:A}}function a2(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientHeight1?!0:(t.preventDefault&&t.preventDefault(),!1)}function o2(e,t=!1){const n=H(t);let r=null,a;se(Z1(e),s=>{if(s){const c=s;a=c.style.overflow,n.value&&(c.style.overflow="hidden")}},{immediate:!0});const o=()=>{const s=it(e);!s||n.value||(go&&(r=Me(s,"touchmove",c=>{o6(c)},{passive:!1})),s.style.overflow="hidden",n.value=!0)},l=()=>{const s=it(e);!s||!n.value||(go&&(r==null||r()),s.style.overflow=a,n.value=!1)};return Zt(l),w({get(){return n.value},set(s){s?o():l()}})}function l2(e,t,n={}){const{window:r=yt}=n;return Zn(e,t,r==null?void 0:r.sessionStorage,n)}let l6=0;function s6(e,t={}){const n=H(!1),{document:r=n2,immediate:a=!0,manual:o=!1,id:l=`vueuse_styletag_${++l6}`}=t,s=H(e);let c=()=>{};const u=()=>{if(!r)return;const p=r.getElementById(l)||r.createElement("style");p.isConnected||(p.type="text/css",p.id=l,t.media&&(p.media=t.media),r.head.appendChild(p)),!n.value&&(c=se(s,f=>{p.textContent=f},{immediate:!0}),n.value=!0)},d=()=>{!r||!n.value||(c(),r.head.removeChild(r.getElementById(l)),n.value=!1)};return a&&!o&&X1(u),o||Zt(d),{id:l,css:s,unload:d,load:u,isLoaded:vn(n)}}function i6({window:e=yt}={}){if(!e)return{x:H(0),y:H(0)};const t=H(e.scrollX),n=H(e.scrollY);return Me(e,"scroll",()=>{t.value=e.scrollX,n.value=e.scrollY},{capture:!1,passive:!0}),{x:t,y:n}}function c6(e={}){const{window:t=yt,initialWidth:n=1/0,initialHeight:r=1/0,listenOrientation:a=!0,includeScrollbar:o=!0}=e,l=H(n),s=H(r),c=()=>{t&&(o?(l.value=t.innerWidth,s.value=t.innerHeight):(l.value=t.document.documentElement.clientWidth,s.value=t.document.documentElement.clientHeight))};if(c(),X1(c),Me("resize",c,{passive:!0}),a){const u=r2("(orientation: portrait)");se(u,()=>c())}return{width:l,height:s}}const s2=({type:e="info",text:t="",vertical:n="top",color:r},{slots:a})=>{var o;return i("span",{class:["badge",e,{diy:r}],style:{verticalAlign:n,...r?{backgroundColor:r}:{}}},((o=a.default)==null?void 0:o.call(a))||t)};s2.displayName="Badge";var u6=D({name:"FontIcon",props:{icon:{type:String,default:""},color:{type:String,default:""},size:{type:[String,Number],default:""}},setup(e){const t=w(()=>{const r=["font-icon icon"],a=`iconfont icon-${e.icon}`;return r.push(a),r}),n=w(()=>{const r={};return e.color&&(r.color=e.color),e.size&&(r["font-size"]=Number.isNaN(Number(e.size))?e.size:`${e.size}px`),Ke(r).length?r:null});return()=>e.icon?i("span",{key:e.icon,class:t.value,style:n.value}):null}});const i2=()=>i(ae,{name:"back-to-top"},()=>[i("path",{d:"M512 843.2c-36.2 0-66.4-13.6-85.8-21.8-10.8-4.6-22.6 3.6-21.8 15.2l7 102c.4 6.2 7.6 9.4 12.6 5.6l29-22c3.6-2.8 9-1.8 11.4 2l41 64.2c3 4.8 10.2 4.8 13.2 0l41-64.2c2.4-3.8 7.8-4.8 11.4-2l29 22c5 3.8 12.2.6 12.6-5.6l7-102c.8-11.6-11-20-21.8-15.2-19.6 8.2-49.6 21.8-85.8 21.8z"}),i("path",{d:"m795.4 586.2-96-98.2C699.4 172 513 32 513 32S324.8 172 324.8 488l-96 98.2c-3.6 3.6-5.2 9-4.4 14.2L261.2 824c1.8 11.4 14.2 17 23.6 10.8L419 744s41.4 40 94.2 40c52.8 0 92.2-40 92.2-40l134.2 90.8c9.2 6.2 21.6.6 23.6-10.8l37-223.8c.4-5.2-1.2-10.4-4.8-14zM513 384c-34 0-61.4-28.6-61.4-64s27.6-64 61.4-64c34 0 61.4 28.6 61.4 64S547 384 513 384z"})]);i2.displayName="BackToTopIcon";var d6=D({name:"BackToTop",props:{threshold:{type:Number,default:100},noProgress:Boolean},setup(e){const t=be(),n=zr({"/zh/":{backToTop:"返回顶部"},"/":{backToTop:"Back to top"}}),r=Pe(),{height:a}=a6(r),{height:o}=c6(),{y:l}=i6(),s=w(()=>t.value.backToTop!==!1&&l.value>e.threshold),c=w(()=>l.value/(a.value-o.value));return de(()=>{r.value=document.body}),()=>i(Jt,{name:"fade"},()=>s.value?i("button",{type:"button",class:"back-to-top","aria-label":n.value.backToTop,"data-balloon-pos":"left",onClick:()=>{window.scrollTo({top:0,behavior:"smooth"})}},[e.noProgress?null:i("svg",{class:"scroll-progress"},i("circle",{cx:"50%",cy:"50%",style:{"stroke-dasharray":`calc(${Math.PI*c.value*100}% - ${4*Math.PI}px) calc(${Math.PI*100}% - ${4*Math.PI}px)`}})),i(i2)]):null)}});const p6=bt({enhance:({app:e})=>{gt("Badge")||e.component("Badge",s2),gt("FontIcon")||e.component("FontIcon",u6)},setup:()=>{s6(` @import url("https://at.alicdn.com/t/c/font_2410206_5vb9zlyghj.css"); - `)},rootComponents:[()=>i(d6,{})]});function f6(e,t,n){var r,a,o;t===void 0&&(t=50),n===void 0&&(n={});var l=(r=n.isImmediate)!=null&&r,s=(a=n.callback)!=null&&a,c=n.maxWait,u=Date.now(),d=[];function p(){if(c!==void 0){var h=Date.now()-u;if(h+t>=c)return c-h}return t}var f=function(){var h=[].slice.call(arguments),_=this;return new Promise(function(A,x){var g=l&&o===void 0;if(o!==void 0&&clearTimeout(o),o=setTimeout(function(){if(o=void 0,u=Date.now(),!l){var S=e.apply(_,h);s&&s(S),d.forEach(function(R){return(0,R.resolve)(S)}),d=[]}},p()),g){var b=e.apply(_,h);return s&&s(b),A(b)}d.push({resolve:A,reject:x})})};return f.cancel=function(h){o!==void 0&&clearTimeout(o),d.forEach(function(_){return(0,_.reject)(h)}),d=[]},f}/*! +const jc="modulepreload",qc=function(e){return"/"+e},$l={},m=function(t,n,r){if(!n||n.length===0)return t();const a=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=qc(o),o in $l)return;$l[o]=!0;const l=o.endsWith(".css"),s=l?'[rel="stylesheet"]':"";if(!!r)for(let d=a.length-1;d>=0;d--){const p=a[d];if(p.href===o&&(!l||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${s}`))return;const u=document.createElement("link");if(u.rel=l?"stylesheet":jc,l||(u.as="script",u.crossOrigin=""),u.href=o,document.head.appendChild(u),l)return new Promise((d,p)=>{u.addEventListener("load",d),u.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t())};function So(e,t){const n=Object.create(null),r=e.split(",");for(let a=0;a!!n[a.toLowerCase()]:a=>!!n[a]}const Ce={},Ln=[],vt=()=>{},Uc=()=>!1,Gc=/^on[^a-z]/,Ar=e=>Gc.test(e),Do=e=>e.startsWith("onUpdate:"),Le=Object.assign,$o=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Wc=Object.prototype.hasOwnProperty,fe=(e,t)=>Wc.call(e,t),Q=Array.isArray,Pn=e=>ga(e)==="[object Map]",gi=e=>ga(e)==="[object Set]",te=e=>typeof e=="function",he=e=>typeof e=="string",Mo=e=>typeof e=="symbol",xe=e=>e!==null&&typeof e=="object",yi=e=>xe(e)&&te(e.then)&&te(e.catch),_i=Object.prototype.toString,ga=e=>_i.call(e),Kc=e=>ga(e).slice(8,-1),bi=e=>ga(e)==="[object Object]",Bo=e=>he(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,or=So(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ya=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Yc=/-(\w)/g,st=ya(e=>e.replace(Yc,(t,n)=>n?n.toUpperCase():"")),Jc=/\B([A-Z])/g,hn=ya(e=>e.replace(Jc,"-$1").toLowerCase()),xr=ya(e=>e.charAt(0).toUpperCase()+e.slice(1)),Sa=ya(e=>e?`on${xr(e)}`:""),fr=(e,t)=>!Object.is(e,t),na=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},ro=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Zc=e=>{const t=he(e)?Number(e):NaN;return isNaN(t)?e:t};let Ml;const ao=()=>Ml||(Ml=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Vo(e){if(Q(e)){const t={};for(let n=0;n{if(n){const r=n.split(Xc);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function Fo(e){let t="";if(he(e))t=e;else if(Q(e))for(let n=0;nhe(e)?e:e==null?"":Q(e)||xe(e)&&(e.toString===_i||!te(e.toString))?JSON.stringify(e,wi,2):String(e),wi=(e,t)=>t&&t.__v_isRef?wi(e,t.value):Pn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,a])=>(n[`${r} =>`]=a,n),{})}:gi(t)?{[`Set(${t.size})`]:[...t.values()]}:xe(t)&&!Q(t)&&!bi(t)?String(t):t;let Xe;class a0{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Xe,!t&&Xe&&(this.index=(Xe.scopes||(Xe.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=Xe;try{return Xe=this,t()}finally{Xe=n}}}on(){Xe=this}off(){Xe=this.parent}stop(t){if(this._active){let n,r;for(n=0,r=this.effects.length;n{const t=new Set(e);return t.w=0,t.n=0,t},xi=e=>(e.w&Wt)>0,Ci=e=>(e.n&Wt)>0,s0=({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let r=0;r{(d==="length"||d>=c)&&s.push(u)})}else switch(n!==void 0&&s.push(l.get(n)),t){case"add":Q(e)?Bo(n)&&s.push(l.get("length")):(s.push(l.get(sn)),Pn(e)&&s.push(l.get(lo)));break;case"delete":Q(e)||(s.push(l.get(sn)),Pn(e)&&s.push(l.get(lo)));break;case"set":Pn(e)&&s.push(l.get(sn));break}if(s.length===1)s[0]&&so(s[0]);else{const c=[];for(const u of s)u&&c.push(...u);so(Ho(c))}}function so(e,t){const n=Q(e)?e:[...e];for(const r of n)r.computed&&Vl(r);for(const r of n)r.computed||Vl(r)}function Vl(e,t){(e!==ft||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}function c0(e,t){var n;return(n=oa.get(e))==null?void 0:n.get(t)}const u0=So("__proto__,__v_isRef,__isVue"),Li=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Mo)),d0=jo(),p0=jo(!1,!0),f0=jo(!0),Fl=h0();function h0(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const r=ce(this);for(let o=0,l=this.length;o{e[t]=function(...n){Un();const r=ce(this)[t].apply(this,n);return Gn(),r}}),e}function v0(e){const t=ce(this);return We(t,"has",e),t.hasOwnProperty(e)}function jo(e=!1,t=!1){return function(r,a,o){if(a==="__v_isReactive")return!e;if(a==="__v_isReadonly")return e;if(a==="__v_isShallow")return t;if(a==="__v_raw"&&o===(e?t?O0:Ri:t?Ii:Oi).get(r))return r;const l=Q(r);if(!e){if(l&&fe(Fl,a))return Reflect.get(Fl,a,o);if(a==="hasOwnProperty")return v0}const s=Reflect.get(r,a,o);return(Mo(a)?Li.has(a):u0(a))||(e||We(r,"get",a),t)?s:$e(s)?l&&Bo(a)?s:s.value:xe(s)?e?vn(s):Wn(s):s}}const m0=Pi(),g0=Pi(!0);function Pi(e=!1){return function(n,r,a,o){let l=n[r];if(Mn(l)&&$e(l)&&!$e(a))return!1;if(!e&&(!la(a)&&!Mn(a)&&(l=ce(l),a=ce(a)),!Q(n)&&$e(l)&&!$e(a)))return l.value=a,!0;const s=Q(n)&&Bo(r)?Number(r)e,_a=e=>Reflect.getPrototypeOf(e);function Hr(e,t,n=!1,r=!1){e=e.__v_raw;const a=ce(e),o=ce(t);n||(t!==o&&We(a,"get",t),We(a,"get",o));const{has:l}=_a(a),s=r?qo:n?Wo:hr;if(l.call(a,t))return s(e.get(t));if(l.call(a,o))return s(e.get(o));e!==a&&e.get(t)}function Nr(e,t=!1){const n=this.__v_raw,r=ce(n),a=ce(e);return t||(e!==a&&We(r,"has",e),We(r,"has",a)),e===a?n.has(e):n.has(e)||n.has(a)}function jr(e,t=!1){return e=e.__v_raw,!t&&We(ce(e),"iterate",sn),Reflect.get(e,"size",e)}function Hl(e){e=ce(e);const t=ce(this);return _a(t).has.call(t,e)||(t.add(e),Rt(t,"add",e,e)),this}function Nl(e,t){t=ce(t);const n=ce(this),{has:r,get:a}=_a(n);let o=r.call(n,e);o||(e=ce(e),o=r.call(n,e));const l=a.call(n,e);return n.set(e,t),o?fr(t,l)&&Rt(n,"set",e,t):Rt(n,"add",e,t),this}function jl(e){const t=ce(this),{has:n,get:r}=_a(t);let a=n.call(t,e);a||(e=ce(e),a=n.call(t,e)),r&&r.call(t,e);const o=t.delete(e);return a&&Rt(t,"delete",e,void 0),o}function ql(){const e=ce(this),t=e.size!==0,n=e.clear();return t&&Rt(e,"clear",void 0,void 0),n}function qr(e,t){return function(r,a){const o=this,l=o.__v_raw,s=ce(l),c=t?qo:e?Wo:hr;return!e&&We(s,"iterate",sn),l.forEach((u,d)=>r.call(a,c(u),c(d),o))}}function Ur(e,t,n){return function(...r){const a=this.__v_raw,o=ce(a),l=Pn(o),s=e==="entries"||e===Symbol.iterator&&l,c=e==="keys"&&l,u=a[e](...r),d=n?qo:t?Wo:hr;return!t&&We(o,"iterate",c?lo:sn),{next(){const{value:p,done:f}=u.next();return f?{value:p,done:f}:{value:s?[d(p[0]),d(p[1])]:d(p),done:f}},[Symbol.iterator](){return this}}}}function $t(e){return function(...t){return e==="delete"?!1:this}}function A0(){const e={get(o){return Hr(this,o)},get size(){return jr(this)},has:Nr,add:Hl,set:Nl,delete:jl,clear:ql,forEach:qr(!1,!1)},t={get(o){return Hr(this,o,!1,!0)},get size(){return jr(this)},has:Nr,add:Hl,set:Nl,delete:jl,clear:ql,forEach:qr(!1,!0)},n={get(o){return Hr(this,o,!0)},get size(){return jr(this,!0)},has(o){return Nr.call(this,o,!0)},add:$t("add"),set:$t("set"),delete:$t("delete"),clear:$t("clear"),forEach:qr(!0,!1)},r={get(o){return Hr(this,o,!0,!0)},get size(){return jr(this,!0)},has(o){return Nr.call(this,o,!0)},add:$t("add"),set:$t("set"),delete:$t("delete"),clear:$t("clear"),forEach:qr(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{e[o]=Ur(o,!1,!1),n[o]=Ur(o,!0,!1),t[o]=Ur(o,!1,!0),r[o]=Ur(o,!0,!0)}),[e,n,t,r]}const[x0,C0,T0,k0]=A0();function Uo(e,t){const n=t?e?k0:T0:e?C0:x0;return(r,a,o)=>a==="__v_isReactive"?!e:a==="__v_isReadonly"?e:a==="__v_raw"?r:Reflect.get(fe(n,a)&&a in r?n:r,a,o)}const L0={get:Uo(!1,!1)},P0={get:Uo(!1,!0)},z0={get:Uo(!0,!1)},Oi=new WeakMap,Ii=new WeakMap,Ri=new WeakMap,O0=new WeakMap;function I0(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function R0(e){return e.__v_skip||!Object.isExtensible(e)?0:I0(Kc(e))}function Wn(e){return Mn(e)?e:Go(e,!1,zi,L0,Oi)}function S0(e){return Go(e,!1,w0,P0,Ii)}function vn(e){return Go(e,!0,E0,z0,Ri)}function Go(e,t,n,r,a){if(!xe(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=a.get(e);if(o)return o;const l=R0(e);if(l===0)return e;const s=new Proxy(e,l===2?r:n);return a.set(e,s),s}function zn(e){return Mn(e)?zn(e.__v_raw):!!(e&&e.__v_isReactive)}function Mn(e){return!!(e&&e.__v_isReadonly)}function la(e){return!!(e&&e.__v_isShallow)}function Si(e){return zn(e)||Mn(e)}function ce(e){const t=e&&e.__v_raw;return t?ce(t):e}function Di(e){return aa(e,"__v_skip",!0),e}const hr=e=>xe(e)?Wn(e):e,Wo=e=>xe(e)?vn(e):e;function Ko(e){Ut&&ft&&(e=ce(e),ki(e.dep||(e.dep=Ho())))}function Yo(e,t){e=ce(e);const n=e.dep;n&&so(n)}function $e(e){return!!(e&&e.__v_isRef===!0)}function H(e){return $i(e,!1)}function Pe(e){return $i(e,!0)}function $i(e,t){return $e(e)?e:new D0(e,t)}class D0{constructor(t,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?t:ce(t),this._value=n?t:hr(t)}get value(){return Ko(this),this._value}set value(t){const n=this.__v_isShallow||la(t)||Mn(t);t=n?t:ce(t),fr(t,this._rawValue)&&(this._rawValue=t,this._value=n?t:hr(t),Yo(this))}}function cn(e){return $e(e)?e.value:e}const $0={get:(e,t,n)=>cn(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const a=e[t];return $e(a)&&!$e(n)?(a.value=n,!0):Reflect.set(e,t,n,r)}};function Mi(e){return zn(e)?e:new Proxy(e,$0)}class M0{constructor(t){this.dep=void 0,this.__v_isRef=!0;const{get:n,set:r}=t(()=>Ko(this),()=>Yo(this));this._get=n,this._set=r}get value(){return this._get()}set value(t){this._set(t)}}function B0(e){return new M0(e)}class V0{constructor(t,n,r){this._object=t,this._key=n,this._defaultValue=r,this.__v_isRef=!0}get value(){const t=this._object[this._key];return t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return c0(ce(this._object),this._key)}}class F0{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Kn(e,t,n){return $e(e)?e:te(e)?new F0(e):xe(e)&&arguments.length>1?H0(e,t,n):H(e)}function H0(e,t,n){const r=e[t];return $e(r)?r:new V0(e,t,n)}class N0{constructor(t,n,r,a){this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new No(t,()=>{this._dirty||(this._dirty=!0,Yo(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!a,this.__v_isReadonly=r}get value(){const t=ce(this);return Ko(t),(t._dirty||!t._cacheable)&&(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}function j0(e,t,n=!1){let r,a;const o=te(e);return o?(r=e,a=vt):(r=e.get,a=e.set),new N0(r,a,o||!a,n)}function Gt(e,t,n,r){let a;try{a=r?e(...r):e()}catch(o){Cr(o,t,n)}return a}function lt(e,t,n,r){if(te(e)){const o=Gt(e,t,n,r);return o&&yi(o)&&o.catch(l=>{Cr(l,t,n)}),o}const a=[];for(let o=0;o>>1;mr(Ve[r])Tt&&Ve.splice(t,1)}function W0(e){Q(e)?On.push(...e):(!It||!It.includes(e,e.allowRecurse?nn+1:nn))&&On.push(e),Vi()}function Ul(e,t=vr?Tt+1:0){for(;tmr(n)-mr(r)),nn=0;nne.id==null?1/0:e.id,K0=(e,t)=>{const n=mr(e)-mr(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Fi(e){io=!1,vr=!0,Ve.sort(K0);const t=vt;try{for(Tt=0;Tthe(h)?h.trim():h)),p&&(a=n.map(ro))}let s,c=r[s=Sa(t)]||r[s=Sa(st(t))];!c&&o&&(c=r[s=Sa(hn(t))]),c&<(c,e,6,a);const u=r[s+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,lt(u,e,6,a)}}function Hi(e,t,n=!1){const r=t.emitsCache,a=r.get(e);if(a!==void 0)return a;const o=e.emits;let l={},s=!1;if(!te(e)){const c=u=>{const d=Hi(u,t,!0);d&&(s=!0,Le(l,d))};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!o&&!s?(xe(e)&&r.set(e,null),null):(Q(o)?o.forEach(c=>l[c]=null):Le(l,o),xe(e)&&r.set(e,l),l)}function Ea(e,t){return!e||!Ar(t)?!1:(t=t.slice(2).replace(/Once$/,""),fe(e,t[0].toLowerCase()+t.slice(1))||fe(e,hn(t))||fe(e,t))}let Be=null,wa=null;function ia(e){const t=Be;return Be=e,wa=e&&e.type.__scopeId||null,t}function w9(e){wa=e}function A9(){wa=null}function J0(e,t=Be,n){if(!t||e._n)return e;const r=(...a)=>{r._d&&rs(-1);const o=ia(t);let l;try{l=e(...a)}finally{ia(o),r._d&&rs(1)}return l};return r._n=!0,r._c=!0,r._d=!0,r}function Da(e){const{type:t,vnode:n,proxy:r,withProxy:a,props:o,propsOptions:[l],slots:s,attrs:c,emit:u,render:d,renderCache:p,data:f,setupState:h,ctx:_,inheritAttrs:A}=e;let x,g;const b=ia(e);try{if(n.shapeFlag&4){const S=a||r;x=pt(d.call(S,S,p,o,h,f,_)),g=c}else{const S=t;x=pt(S.length>1?S(o,{attrs:c,slots:s,emit:u}):S(o,null)),g=t.props?c:Z0(c)}}catch(S){ir.length=0,Cr(S,e,1),x=ke(nt)}let R=x;if(g&&A!==!1){const S=Object.keys(g),{shapeFlag:U}=R;S.length&&U&7&&(l&&S.some(Do)&&(g=Q0(g,l)),R=Kt(R,g))}return n.dirs&&(R=Kt(R),R.dirs=R.dirs?R.dirs.concat(n.dirs):n.dirs),n.transition&&(R.transition=n.transition),x=R,ia(b),x}const Z0=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ar(n))&&((t||(t={}))[n]=e[n]);return t},Q0=(e,t)=>{const n={};for(const r in e)(!Do(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function X0(e,t,n){const{props:r,children:a,component:o}=e,{props:l,children:s,patchFlag:c}=t,u=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Gl(r,l,u):!!l;if(c&8){const d=t.dynamicProps;for(let p=0;pe.__isSuspense;function Ni(e,t){t&&t.pendingBranch?Q(e)?t.effects.push(...e):t.effects.push(e):W0(e)}function n3(e,t){return Zo(e,null,t)}const Gr={};function se(e,t,n){return Zo(e,t,n)}function Zo(e,t,{immediate:n,deep:r,flush:a,onTrack:o,onTrigger:l}=Ce){var s;const c=Ai()===((s=De)==null?void 0:s.scope)?De:null;let u,d=!1,p=!1;if($e(e)?(u=()=>e.value,d=la(e)):zn(e)?(u=()=>e,r=!0):Q(e)?(p=!0,d=e.some(S=>zn(S)||la(S)),u=()=>e.map(S=>{if($e(S))return S.value;if(zn(S))return on(S);if(te(S))return Gt(S,c,2)})):te(e)?t?u=()=>Gt(e,c,2):u=()=>{if(!(c&&c.isUnmounted))return f&&f(),lt(e,c,3,[h])}:u=vt,t&&r){const S=u;u=()=>on(S())}let f,h=S=>{f=b.onStop=()=>{Gt(S,c,4)}},_;if(Fn)if(h=vt,t?n&<(t,c,3,[u(),p?[]:void 0,h]):u(),a==="sync"){const S=Y3();_=S.__watcherHandles||(S.__watcherHandles=[])}else return vt;let A=p?new Array(e.length).fill(Gr):Gr;const x=()=>{if(b.active)if(t){const S=b.run();(r||d||(p?S.some((U,O)=>fr(U,A[O])):fr(S,A)))&&(f&&f(),lt(t,c,3,[S,A===Gr?void 0:p&&A[0]===Gr?[]:A,h]),A=S)}else b.run()};x.allowRecurse=!!t;let g;a==="sync"?g=x:a==="post"?g=()=>Ue(x,c&&c.suspense):(x.pre=!0,c&&(x.id=c.uid),g=()=>ba(x));const b=new No(u,g);t?n?x():A=b.run():a==="post"?Ue(b.run.bind(b),c&&c.suspense):b.run();const R=()=>{b.stop(),c&&c.scope&&$o(c.scope.effects,b)};return _&&_.push(R),R}function r3(e,t,n){const r=this.proxy,a=he(e)?e.includes(".")?ji(r,e):()=>r[e]:e.bind(r,r);let o;te(t)?o=t:(o=t.handler,n=t);const l=De;Vn(this);const s=Zo(a,o.bind(r),n);return l?Vn(l):un(),s}function ji(e,t){const n=t.split(".");return()=>{let r=e;for(let a=0;a{on(n,t)});else if(bi(e))for(const n in e)on(e[n],t);return e}function x9(e,t){const n=Be;if(n===null)return e;const r=Ca(n)||n.proxy,a=e.dirs||(e.dirs=[]);for(let o=0;o{e.isMounted=!0}),Xo(()=>{e.isUnmounting=!0}),e}const at=[Function,Array],Ui={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:at,onEnter:at,onAfterEnter:at,onEnterCancelled:at,onBeforeLeave:at,onLeave:at,onAfterLeave:at,onLeaveCancelled:at,onBeforeAppear:at,onAppear:at,onAfterAppear:at,onAppearCancelled:at},a3={name:"BaseTransition",props:Ui,setup(e,{slots:t}){const n=Jn(),r=qi();let a;return()=>{const o=t.default&&Qo(t.default(),!0);if(!o||!o.length)return;let l=o[0];if(o.length>1){for(const A of o)if(A.type!==nt){l=A;break}}const s=ce(e),{mode:c}=s;if(r.isLeaving)return $a(l);const u=Wl(l);if(!u)return $a(l);const d=gr(u,s,r,n);yr(u,d);const p=n.subTree,f=p&&Wl(p);let h=!1;const{getTransitionKey:_}=u.type;if(_){const A=_();a===void 0?a=A:A!==a&&(a=A,h=!0)}if(f&&f.type!==nt&&(!rn(u,f)||h)){const A=gr(f,s,r,n);if(yr(f,A),c==="out-in")return r.isLeaving=!0,A.afterLeave=()=>{r.isLeaving=!1,n.update.active!==!1&&n.update()},$a(l);c==="in-out"&&u.type!==nt&&(A.delayLeave=(x,g,b)=>{const R=Gi(r,f);R[String(f.key)]=f,x._leaveCb=()=>{g(),x._leaveCb=void 0,delete d.delayedLeave},d.delayedLeave=b})}return l}}},o3=a3;function Gi(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function gr(e,t,n,r){const{appear:a,mode:o,persisted:l=!1,onBeforeEnter:s,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:p,onLeave:f,onAfterLeave:h,onLeaveCancelled:_,onBeforeAppear:A,onAppear:x,onAfterAppear:g,onAppearCancelled:b}=t,R=String(e.key),S=Gi(n,e),U=(T,j)=>{T&<(T,r,9,j)},O=(T,j)=>{const Y=j[1];U(T,j),Q(T)?T.every(re=>re.length<=1)&&Y():T.length<=1&&Y()},W={mode:o,persisted:l,beforeEnter(T){let j=s;if(!n.isMounted)if(a)j=A||s;else return;T._leaveCb&&T._leaveCb(!0);const Y=S[R];Y&&rn(e,Y)&&Y.el._leaveCb&&Y.el._leaveCb(),U(j,[T])},enter(T){let j=c,Y=u,re=d;if(!n.isMounted)if(a)j=x||c,Y=g||u,re=b||d;else return;let N=!1;const X=T._enterCb=q=>{N||(N=!0,q?U(re,[T]):U(Y,[T]),W.delayedLeave&&W.delayedLeave(),T._enterCb=void 0)};j?O(j,[T,X]):X()},leave(T,j){const Y=String(e.key);if(T._enterCb&&T._enterCb(!0),n.isUnmounting)return j();U(p,[T]);let re=!1;const N=T._leaveCb=X=>{re||(re=!0,j(),X?U(_,[T]):U(h,[T]),T._leaveCb=void 0,S[Y]===e&&delete S[Y])};S[Y]=e,f?O(f,[T,N]):N()},clone(T){return gr(T,t,n,r)}};return W}function $a(e){if(Tr(e))return e=Kt(e),e.children=null,e}function Wl(e){return Tr(e)?e.children?e.children[0]:void 0:e}function yr(e,t){e.shapeFlag&6&&e.component?yr(e.component.subTree,t):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Qo(e,t=!1,n){let r=[],a=0;for(let o=0;o1)for(let o=0;oLe({name:e.name},t,{setup:e}))():e}const In=e=>!!e.type.__asyncLoader;function P(e){te(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:a=200,timeout:o,suspensible:l=!0,onError:s}=e;let c=null,u,d=0;const p=()=>(d++,c=null,f()),f=()=>{let h;return c||(h=c=t().catch(_=>{if(_=_ instanceof Error?_:new Error(String(_)),s)return new Promise((A,x)=>{s(_,()=>A(p()),()=>x(_),d+1)});throw _}).then(_=>h!==c&&c?c:(_&&(_.__esModule||_[Symbol.toStringTag]==="Module")&&(_=_.default),u=_,_)))};return D({name:"AsyncComponentWrapper",__asyncLoader:f,get __asyncResolved(){return u},setup(){const h=De;if(u)return()=>Ma(u,h);const _=b=>{c=null,Cr(b,h,13,!r)};if(l&&h.suspense||Fn)return f().then(b=>()=>Ma(b,h)).catch(b=>(_(b),()=>r?ke(r,{error:b}):null));const A=H(!1),x=H(),g=H(!!a);return a&&setTimeout(()=>{g.value=!1},a),o!=null&&setTimeout(()=>{if(!A.value&&!x.value){const b=new Error(`Async component timed out after ${o}ms.`);_(b),x.value=b}},o),f().then(()=>{A.value=!0,h.parent&&Tr(h.parent.vnode)&&ba(h.parent.update)}).catch(b=>{_(b),x.value=b}),()=>{if(A.value&&u)return Ma(u,h);if(x.value&&r)return ke(r,{error:x.value});if(n&&!g.value)return ke(n)}}})}function Ma(e,t){const{ref:n,props:r,children:a,ce:o}=t.vnode,l=ke(e,r,a);return l.ref=n,l.ce=o,delete t.vnode.ce,l}const Tr=e=>e.type.__isKeepAlive;function l3(e,t){Wi(e,"a",t)}function s3(e,t){Wi(e,"da",t)}function Wi(e,t,n=De){const r=e.__wdc||(e.__wdc=()=>{let a=n;for(;a;){if(a.isDeactivated)return;a=a.parent}return e()});if(Aa(t,r,n),n){let a=n.parent;for(;a&&a.parent;)Tr(a.parent.vnode)&&i3(r,t,n,a),a=a.parent}}function i3(e,t,n,r){const a=Aa(t,e,r,!0);Yn(()=>{$o(r[t],a)},n)}function Aa(e,t,n=De,r=!1){if(n){const a=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...l)=>{if(n.isUnmounted)return;Un(),Vn(n);const s=lt(t,n,e,l);return un(),Gn(),s});return r?a.unshift(o):a.push(o),o}}const St=e=>(t,n=De)=>(!Fn||e==="sp")&&Aa(e,(...r)=>t(...r),n),c3=St("bm"),de=St("m"),u3=St("bu"),Ki=St("u"),Xo=St("bum"),Yn=St("um"),d3=St("sp"),p3=St("rtg"),f3=St("rtc");function h3(e,t=De){Aa("ec",e,t)}const Yi="components";function tt(e,t){return m3(Yi,e,!0,t)||e}const v3=Symbol.for("v-ndc");function m3(e,t,n=!0,r=!1){const a=Be||De;if(a){const o=a.type;if(e===Yi){const s=G3(o,!1);if(s&&(s===t||s===st(t)||s===xr(st(t))))return o}const l=Kl(a[e]||o[e],t)||Kl(a.appContext[e],t);return!l&&r?o:l}}function Kl(e,t){return e&&(e[t]||e[st(t)]||e[xr(st(t))])}function C9(e,t,n,r){let a;const o=n&&n[r];if(Q(e)||he(e)){a=new Array(e.length);for(let l=0,s=e.length;lt(l,s,void 0,o&&o[s]));else{const l=Object.keys(e);a=new Array(l.length);for(let s=0,c=l.length;spa(t)?!(t.type===nt||t.type===je&&!Ji(t.children)):!0)?e:null}const co=e=>e?d1(e)?Ca(e)||e.proxy:co(e.parent):null,lr=Le(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>co(e.parent),$root:e=>co(e.root),$emit:e=>e.emit,$options:e=>el(e),$forceUpdate:e=>e.f||(e.f=()=>ba(e.update)),$nextTick:e=>e.n||(e.n=mn.bind(e.proxy)),$watch:e=>r3.bind(e)}),Ba=(e,t)=>e!==Ce&&!e.__isScriptSetup&&fe(e,t),g3={get({_:e},t){const{ctx:n,setupState:r,data:a,props:o,accessCache:l,type:s,appContext:c}=e;let u;if(t[0]!=="$"){const h=l[t];if(h!==void 0)switch(h){case 1:return r[t];case 2:return a[t];case 4:return n[t];case 3:return o[t]}else{if(Ba(r,t))return l[t]=1,r[t];if(a!==Ce&&fe(a,t))return l[t]=2,a[t];if((u=e.propsOptions[0])&&fe(u,t))return l[t]=3,o[t];if(n!==Ce&&fe(n,t))return l[t]=4,n[t];uo&&(l[t]=0)}}const d=lr[t];let p,f;if(d)return t==="$attrs"&&We(e,"get",t),d(e);if((p=s.__cssModules)&&(p=p[t]))return p;if(n!==Ce&&fe(n,t))return l[t]=4,n[t];if(f=c.config.globalProperties,fe(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:a,ctx:o}=e;return Ba(a,t)?(a[t]=n,!0):r!==Ce&&fe(r,t)?(r[t]=n,!0):fe(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:a,propsOptions:o}},l){let s;return!!n[l]||e!==Ce&&fe(e,l)||Ba(t,l)||(s=o[0])&&fe(s,l)||fe(r,l)||fe(lr,l)||fe(a.config.globalProperties,l)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:fe(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Yl(e){return Q(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let uo=!0;function y3(e){const t=el(e),n=e.proxy,r=e.ctx;uo=!1,t.beforeCreate&&Jl(t.beforeCreate,e,"bc");const{data:a,computed:o,methods:l,watch:s,provide:c,inject:u,created:d,beforeMount:p,mounted:f,beforeUpdate:h,updated:_,activated:A,deactivated:x,beforeDestroy:g,beforeUnmount:b,destroyed:R,unmounted:S,render:U,renderTracked:O,renderTriggered:W,errorCaptured:T,serverPrefetch:j,expose:Y,inheritAttrs:re,components:N,directives:X,filters:q}=t;if(u&&_3(u,r,null),l)for(const ye in l){const ve=l[ye];te(ve)&&(r[ye]=ve.bind(n))}if(a){const ye=a.call(n,n);xe(ye)&&(e.data=Wn(ye))}if(uo=!0,o)for(const ye in o){const ve=o[ye],Je=te(ve)?ve.bind(n,n):te(ve.get)?ve.get.bind(n,n):vt,He=!te(ve)&&te(ve.set)?ve.set.bind(n):vt,Ze=w({get:Je,set:He});Object.defineProperty(r,ye,{enumerable:!0,configurable:!0,get:()=>Ze.value,set:Oe=>Ze.value=Oe})}if(s)for(const ye in s)Zi(s[ye],r,n,ye);if(c){const ye=te(c)?c.call(n):c;Reflect.ownKeys(ye).forEach(ve=>{mt(ve,ye[ve])})}d&&Jl(d,e,"c");function ne(ye,ve){Q(ve)?ve.forEach(Je=>ye(Je.bind(n))):ve&&ye(ve.bind(n))}if(ne(c3,p),ne(de,f),ne(u3,h),ne(Ki,_),ne(l3,A),ne(s3,x),ne(h3,T),ne(f3,O),ne(p3,W),ne(Xo,b),ne(Yn,S),ne(d3,j),Q(Y))if(Y.length){const ye=e.exposed||(e.exposed={});Y.forEach(ve=>{Object.defineProperty(ye,ve,{get:()=>n[ve],set:Je=>n[ve]=Je})})}else e.exposed||(e.exposed={});U&&e.render===vt&&(e.render=U),re!=null&&(e.inheritAttrs=re),N&&(e.components=N),X&&(e.directives=X)}function _3(e,t,n=vt){Q(e)&&(e=po(e));for(const r in e){const a=e[r];let o;xe(a)?"default"in a?o=ue(a.from||r,a.default,!0):o=ue(a.from||r):o=ue(a),$e(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:l=>o.value=l}):t[r]=o}}function Jl(e,t,n){lt(Q(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Zi(e,t,n,r){const a=r.includes(".")?ji(n,r):()=>n[r];if(he(e)){const o=t[e];te(o)&&se(a,o)}else if(te(e))se(a,e.bind(n));else if(xe(e))if(Q(e))e.forEach(o=>Zi(o,t,n,r));else{const o=te(e.handler)?e.handler.bind(n):t[e.handler];te(o)&&se(a,o,e)}}function el(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:a,optionsCache:o,config:{optionMergeStrategies:l}}=e.appContext,s=o.get(t);let c;return s?c=s:!a.length&&!n&&!r?c=t:(c={},a.length&&a.forEach(u=>ca(c,u,l,!0)),ca(c,t,l)),xe(t)&&o.set(t,c),c}function ca(e,t,n,r=!1){const{mixins:a,extends:o}=t;o&&ca(e,o,n,!0),a&&a.forEach(l=>ca(e,l,n,!0));for(const l in t)if(!(r&&l==="expose")){const s=b3[l]||n&&n[l];e[l]=s?s(e[l],t[l]):t[l]}return e}const b3={data:Zl,props:Ql,emits:Ql,methods:ar,computed:ar,beforeCreate:Ne,created:Ne,beforeMount:Ne,mounted:Ne,beforeUpdate:Ne,updated:Ne,beforeDestroy:Ne,beforeUnmount:Ne,destroyed:Ne,unmounted:Ne,activated:Ne,deactivated:Ne,errorCaptured:Ne,serverPrefetch:Ne,components:ar,directives:ar,watch:w3,provide:Zl,inject:E3};function Zl(e,t){return t?e?function(){return Le(te(e)?e.call(this,this):e,te(t)?t.call(this,this):t)}:t:e}function E3(e,t){return ar(po(e),po(t))}function po(e){if(Q(e)){const t={};for(let n=0;n1)return n&&te(t)?t.call(r&&r.proxy):t}}function C3(e,t,n,r=!1){const a={},o={};aa(o,xa,1),e.propsDefaults=Object.create(null),Xi(e,t,a,o);for(const l in e.propsOptions[0])l in a||(a[l]=void 0);n?e.props=r?a:S0(a):e.type.props?e.props=a:e.props=o,e.attrs=o}function T3(e,t,n,r){const{props:a,attrs:o,vnode:{patchFlag:l}}=e,s=ce(a),[c]=e.propsOptions;let u=!1;if((r||l>0)&&!(l&16)){if(l&8){const d=e.vnode.dynamicProps;for(let p=0;p{c=!0;const[f,h]=e1(p,t,!0);Le(l,f),h&&s.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!o&&!c)return xe(e)&&r.set(e,Ln),Ln;if(Q(o))for(let d=0;d-1,h[1]=A<0||_-1||fe(h,"default"))&&s.push(p)}}}const u=[l,s];return xe(e)&&r.set(e,u),u}function Xl(e){return e[0]!=="$"}function es(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:e===null?"null":""}function ts(e,t){return es(e)===es(t)}function ns(e,t){return Q(t)?t.findIndex(n=>ts(n,e)):te(t)&&ts(t,e)?0:-1}const t1=e=>e[0]==="_"||e==="$stable",tl=e=>Q(e)?e.map(pt):[pt(e)],k3=(e,t,n)=>{if(t._n)return t;const r=J0((...a)=>tl(t(...a)),n);return r._c=!1,r},n1=(e,t,n)=>{const r=e._ctx;for(const a in e){if(t1(a))continue;const o=e[a];if(te(o))t[a]=k3(a,o,r);else if(o!=null){const l=tl(o);t[a]=()=>l}}},r1=(e,t)=>{const n=tl(t);e.slots.default=()=>n},L3=(e,t)=>{if(e.vnode.shapeFlag&32){const n=t._;n?(e.slots=ce(t),aa(t,"_",n)):n1(t,e.slots={})}else e.slots={},t&&r1(e,t);aa(e.slots,xa,1)},P3=(e,t,n)=>{const{vnode:r,slots:a}=e;let o=!0,l=Ce;if(r.shapeFlag&32){const s=t._;s?n&&s===1?o=!1:(Le(a,t),!n&&s===1&&delete a._):(o=!t.$stable,n1(t,a)),l=t}else t&&(r1(e,t),l={default:1});if(o)for(const s in a)!t1(s)&&!(s in l)&&delete a[s]};function da(e,t,n,r,a=!1){if(Q(e)){e.forEach((f,h)=>da(f,t&&(Q(t)?t[h]:t),n,r,a));return}if(In(r)&&!a)return;const o=r.shapeFlag&4?Ca(r.component)||r.component.proxy:r.el,l=a?null:o,{i:s,r:c}=e,u=t&&t.r,d=s.refs===Ce?s.refs={}:s.refs,p=s.setupState;if(u!=null&&u!==c&&(he(u)?(d[u]=null,fe(p,u)&&(p[u]=null)):$e(u)&&(u.value=null)),te(c))Gt(c,s,12,[l,d]);else{const f=he(c),h=$e(c);if(f||h){const _=()=>{if(e.f){const A=f?fe(p,c)?p[c]:d[c]:c.value;a?Q(A)&&$o(A,o):Q(A)?A.includes(o)||A.push(o):f?(d[c]=[o],fe(p,c)&&(p[c]=d[c])):(c.value=[o],e.k&&(d[e.k]=c.value))}else f?(d[c]=l,fe(p,c)&&(p[c]=l)):h&&(c.value=l,e.k&&(d[e.k]=l))};l?(_.id=-1,Ue(_,n)):_()}}}let Mt=!1;const Wr=e=>/svg/.test(e.namespaceURI)&&e.tagName!=="foreignObject",Kr=e=>e.nodeType===8;function z3(e){const{mt:t,p:n,o:{patchProp:r,createText:a,nextSibling:o,parentNode:l,remove:s,insert:c,createComment:u}}=e,d=(g,b)=>{if(!b.hasChildNodes()){n(null,g,b),sa(),b._vnode=g;return}Mt=!1,p(b.firstChild,g,null,null,null),sa(),b._vnode=g,Mt&&console.error("Hydration completed but contains mismatches.")},p=(g,b,R,S,U,O=!1)=>{const W=Kr(g)&&g.data==="[",T=()=>A(g,b,R,S,U,W),{type:j,ref:Y,shapeFlag:re,patchFlag:N}=b;let X=g.nodeType;b.el=g,N===-2&&(O=!1,b.dynamicChildren=null);let q=null;switch(j){case Bn:X!==3?b.children===""?(c(b.el=a(""),l(g),g),q=g):q=T():(g.data!==b.children&&(Mt=!0,g.data=b.children),q=o(g));break;case nt:X!==8||W?q=T():q=o(g);break;case sr:if(W&&(g=o(g),X=g.nodeType),X===1||X===3){q=g;const ze=!b.children.length;for(let ne=0;ne{O=O||!!b.dynamicChildren;const{type:W,props:T,patchFlag:j,shapeFlag:Y,dirs:re}=b,N=W==="input"&&re||W==="option";if(N||j!==-1){if(re&&Ct(b,null,R,"created"),T)if(N||!O||j&48)for(const q in T)(N&&q.endsWith("value")||Ar(q)&&!or(q))&&r(g,q,null,T[q],!1,void 0,R);else T.onClick&&r(g,"onClick",null,T.onClick,!1,void 0,R);let X;if((X=T&&T.onVnodeBeforeMount)&&ot(X,R,b),re&&Ct(b,null,R,"beforeMount"),((X=T&&T.onVnodeMounted)||re)&&Ni(()=>{X&&ot(X,R,b),re&&Ct(b,null,R,"mounted")},S),Y&16&&!(T&&(T.innerHTML||T.textContent))){let q=h(g.firstChild,b,g,R,S,U,O);for(;q;){Mt=!0;const ze=q;q=q.nextSibling,s(ze)}}else Y&8&&g.textContent!==b.children&&(Mt=!0,g.textContent=b.children)}return g.nextSibling},h=(g,b,R,S,U,O,W)=>{W=W||!!b.dynamicChildren;const T=b.children,j=T.length;for(let Y=0;Y{const{slotScopeIds:W}=b;W&&(U=U?U.concat(W):W);const T=l(g),j=h(o(g),b,T,R,S,U,O);return j&&Kr(j)&&j.data==="]"?o(b.anchor=j):(Mt=!0,c(b.anchor=u("]"),T,j),j)},A=(g,b,R,S,U,O)=>{if(Mt=!0,b.el=null,O){const j=x(g);for(;;){const Y=o(g);if(Y&&Y!==j)s(Y);else break}}const W=o(g),T=l(g);return s(g),n(null,b,T,W,R,S,Wr(T),U),W},x=g=>{let b=0;for(;g;)if(g=o(g),g&&Kr(g)&&(g.data==="["&&b++,g.data==="]")){if(b===0)return o(g);b--}return g};return[d,p]}const Ue=Ni;function O3(e){return I3(e,z3)}function I3(e,t){const n=ao();n.__VUE__=!0;const{insert:r,remove:a,patchProp:o,createElement:l,createText:s,createComment:c,setText:u,setElementText:d,parentNode:p,nextSibling:f,setScopeId:h=vt,insertStaticContent:_}=e,A=(v,y,E,C=null,L=null,z=null,V=!1,$=null,M=!!y.dynamicChildren)=>{if(v===y)return;v&&!rn(v,y)&&(C=k(v),Oe(v,L,z,!0),v=null),y.patchFlag===-2&&(M=!1,y.dynamicChildren=null);const{type:I,ref:J,shapeFlag:G}=y;switch(I){case Bn:x(v,y,E,C);break;case nt:g(v,y,E,C);break;case sr:v==null&&b(y,E,C,V);break;case je:N(v,y,E,C,L,z,V,$,M);break;default:G&1?U(v,y,E,C,L,z,V,$,M):G&6?X(v,y,E,C,L,z,V,$,M):(G&64||G&128)&&I.process(v,y,E,C,L,z,V,$,M,B)}J!=null&&L&&da(J,v&&v.ref,z,y||v,!y)},x=(v,y,E,C)=>{if(v==null)r(y.el=s(y.children),E,C);else{const L=y.el=v.el;y.children!==v.children&&u(L,y.children)}},g=(v,y,E,C)=>{v==null?r(y.el=c(y.children||""),E,C):y.el=v.el},b=(v,y,E,C)=>{[v.el,v.anchor]=_(v.children,y,E,C,v.el,v.anchor)},R=({el:v,anchor:y},E,C)=>{let L;for(;v&&v!==y;)L=f(v),r(v,E,C),v=L;r(y,E,C)},S=({el:v,anchor:y})=>{let E;for(;v&&v!==y;)E=f(v),a(v),v=E;a(y)},U=(v,y,E,C,L,z,V,$,M)=>{V=V||y.type==="svg",v==null?O(y,E,C,L,z,V,$,M):j(v,y,L,z,V,$,M)},O=(v,y,E,C,L,z,V,$)=>{let M,I;const{type:J,props:G,shapeFlag:Z,transition:ee,dirs:le}=v;if(M=v.el=l(v.type,z,G&&G.is,G),Z&8?d(M,v.children):Z&16&&T(v.children,M,null,C,L,z&&J!=="foreignObject",V,$),le&&Ct(v,null,C,"created"),W(M,v,v.scopeId,V,C),G){for(const Ee in G)Ee!=="value"&&!or(Ee)&&o(M,Ee,null,G[Ee],z,v.children,C,L,Se);"value"in G&&o(M,"value",null,G.value),(I=G.onVnodeBeforeMount)&&ot(I,C,v)}le&&Ct(v,null,C,"beforeMount");const Ae=(!L||L&&!L.pendingBranch)&&ee&&!ee.persisted;Ae&&ee.beforeEnter(M),r(M,y,E),((I=G&&G.onVnodeMounted)||Ae||le)&&Ue(()=>{I&&ot(I,C,v),Ae&&ee.enter(M),le&&Ct(v,null,C,"mounted")},L)},W=(v,y,E,C,L)=>{if(E&&h(v,E),C)for(let z=0;z{for(let I=M;I{const $=y.el=v.el;let{patchFlag:M,dynamicChildren:I,dirs:J}=y;M|=v.patchFlag&16;const G=v.props||Ce,Z=y.props||Ce;let ee;E&&en(E,!1),(ee=Z.onVnodeBeforeUpdate)&&ot(ee,E,y,v),J&&Ct(y,v,E,"beforeUpdate"),E&&en(E,!0);const le=L&&y.type!=="foreignObject";if(I?Y(v.dynamicChildren,I,$,E,C,le,z):V||ve(v,y,$,null,E,C,le,z,!1),M>0){if(M&16)re($,y,G,Z,E,C,L);else if(M&2&&G.class!==Z.class&&o($,"class",null,Z.class,L),M&4&&o($,"style",G.style,Z.style,L),M&8){const Ae=y.dynamicProps;for(let Ee=0;Ee{ee&&ot(ee,E,y,v),J&&Ct(y,v,E,"updated")},C)},Y=(v,y,E,C,L,z,V)=>{for(let $=0;${if(E!==C){if(E!==Ce)for(const $ in E)!or($)&&!($ in C)&&o(v,$,E[$],null,V,y.children,L,z,Se);for(const $ in C){if(or($))continue;const M=C[$],I=E[$];M!==I&&$!=="value"&&o(v,$,I,M,V,y.children,L,z,Se)}"value"in C&&o(v,"value",E.value,C.value)}},N=(v,y,E,C,L,z,V,$,M)=>{const I=y.el=v?v.el:s(""),J=y.anchor=v?v.anchor:s("");let{patchFlag:G,dynamicChildren:Z,slotScopeIds:ee}=y;ee&&($=$?$.concat(ee):ee),v==null?(r(I,E,C),r(J,E,C),T(y.children,E,J,L,z,V,$,M)):G>0&&G&64&&Z&&v.dynamicChildren?(Y(v.dynamicChildren,Z,E,L,z,V,$),(y.key!=null||L&&y===L.subTree)&&a1(v,y,!0)):ve(v,y,E,J,L,z,V,$,M)},X=(v,y,E,C,L,z,V,$,M)=>{y.slotScopeIds=$,v==null?y.shapeFlag&512?L.ctx.activate(y,E,C,V,M):q(y,E,C,L,z,V,M):ze(v,y,M)},q=(v,y,E,C,L,z,V)=>{const $=v.component=H3(v,C,L);if(Tr(v)&&($.ctx.renderer=B),N3($),$.asyncDep){if(L&&L.registerDep($,ne),!v.el){const M=$.subTree=ke(nt);g(null,M,y,E)}return}ne($,v,y,E,L,z,V)},ze=(v,y,E)=>{const C=y.component=v.component;if(X0(v,y,E))if(C.asyncDep&&!C.asyncResolved){ye(C,y,E);return}else C.next=y,G0(C.update),C.update();else y.el=v.el,C.vnode=y},ne=(v,y,E,C,L,z,V)=>{const $=()=>{if(v.isMounted){let{next:J,bu:G,u:Z,parent:ee,vnode:le}=v,Ae=J,Ee;en(v,!1),J?(J.el=le.el,ye(v,J,V)):J=le,G&&na(G),(Ee=J.props&&J.props.onVnodeBeforeUpdate)&&ot(Ee,ee,J,le),en(v,!0);const Ie=Da(v),ct=v.subTree;v.subTree=Ie,A(ct,Ie,p(ct.el),k(ct),v,L,z),J.el=Ie.el,Ae===null&&e3(v,Ie.el),Z&&Ue(Z,L),(Ee=J.props&&J.props.onVnodeUpdated)&&Ue(()=>ot(Ee,ee,J,le),L)}else{let J;const{el:G,props:Z}=y,{bm:ee,m:le,parent:Ae}=v,Ee=In(y);if(en(v,!1),ee&&na(ee),!Ee&&(J=Z&&Z.onVnodeBeforeMount)&&ot(J,Ae,y),en(v,!0),G&&ge){const Ie=()=>{v.subTree=Da(v),ge(G,v.subTree,v,L,null)};Ee?y.type.__asyncLoader().then(()=>!v.isUnmounted&&Ie()):Ie()}else{const Ie=v.subTree=Da(v);A(null,Ie,E,C,v,L,z),y.el=Ie.el}if(le&&Ue(le,L),!Ee&&(J=Z&&Z.onVnodeMounted)){const Ie=y;Ue(()=>ot(J,Ae,Ie),L)}(y.shapeFlag&256||Ae&&In(Ae.vnode)&&Ae.vnode.shapeFlag&256)&&v.a&&Ue(v.a,L),v.isMounted=!0,y=E=C=null}},M=v.effect=new No($,()=>ba(I),v.scope),I=v.update=()=>M.run();I.id=v.uid,en(v,!0),I()},ye=(v,y,E)=>{y.component=v;const C=v.vnode.props;v.vnode=y,v.next=null,T3(v,y.props,C,E),P3(v,y.children,E),Un(),Ul(),Gn()},ve=(v,y,E,C,L,z,V,$,M=!1)=>{const I=v&&v.children,J=v?v.shapeFlag:0,G=y.children,{patchFlag:Z,shapeFlag:ee}=y;if(Z>0){if(Z&128){He(I,G,E,C,L,z,V,$,M);return}else if(Z&256){Je(I,G,E,C,L,z,V,$,M);return}}ee&8?(J&16&&Se(I,L,z),G!==I&&d(E,G)):J&16?ee&16?He(I,G,E,C,L,z,V,$,M):Se(I,L,z,!0):(J&8&&d(E,""),ee&16&&T(G,E,C,L,z,V,$,M))},Je=(v,y,E,C,L,z,V,$,M)=>{v=v||Ln,y=y||Ln;const I=v.length,J=y.length,G=Math.min(I,J);let Z;for(Z=0;ZJ?Se(v,L,z,!0,!1,G):T(y,E,C,L,z,V,$,M,G)},He=(v,y,E,C,L,z,V,$,M)=>{let I=0;const J=y.length;let G=v.length-1,Z=J-1;for(;I<=G&&I<=Z;){const ee=v[I],le=y[I]=M?Nt(y[I]):pt(y[I]);if(rn(ee,le))A(ee,le,E,null,L,z,V,$,M);else break;I++}for(;I<=G&&I<=Z;){const ee=v[G],le=y[Z]=M?Nt(y[Z]):pt(y[Z]);if(rn(ee,le))A(ee,le,E,null,L,z,V,$,M);else break;G--,Z--}if(I>G){if(I<=Z){const ee=Z+1,le=eeZ)for(;I<=G;)Oe(v[I],L,z,!0),I++;else{const ee=I,le=I,Ae=new Map;for(I=le;I<=Z;I++){const Qe=y[I]=M?Nt(y[I]):pt(y[I]);Qe.key!=null&&Ae.set(Qe.key,I)}let Ee,Ie=0;const ct=Z-le+1;let _n=!1,Rl=0;const Xn=new Array(ct);for(I=0;I=ct){Oe(Qe,L,z,!0);continue}let xt;if(Qe.key!=null)xt=Ae.get(Qe.key);else for(Ee=le;Ee<=Z;Ee++)if(Xn[Ee-le]===0&&rn(Qe,y[Ee])){xt=Ee;break}xt===void 0?Oe(Qe,L,z,!0):(Xn[xt-le]=I+1,xt>=Rl?Rl=xt:_n=!0,A(Qe,y[xt],E,null,L,z,V,$,M),Ie++)}const Sl=_n?R3(Xn):Ln;for(Ee=Sl.length-1,I=ct-1;I>=0;I--){const Qe=le+I,xt=y[Qe],Dl=Qe+1{const{el:z,type:V,transition:$,children:M,shapeFlag:I}=v;if(I&6){Ze(v.component.subTree,y,E,C);return}if(I&128){v.suspense.move(y,E,C);return}if(I&64){V.move(v,y,E,B);return}if(V===je){r(z,y,E);for(let G=0;G$.enter(z),L);else{const{leave:G,delayLeave:Z,afterLeave:ee}=$,le=()=>r(z,y,E),Ae=()=>{G(z,()=>{le(),ee&&ee()})};Z?Z(z,le,Ae):Ae()}else r(z,y,E)},Oe=(v,y,E,C=!1,L=!1)=>{const{type:z,props:V,ref:$,children:M,dynamicChildren:I,shapeFlag:J,patchFlag:G,dirs:Z}=v;if($!=null&&da($,null,E,v,!0),J&256){y.ctx.deactivate(v);return}const ee=J&1&&Z,le=!In(v);let Ae;if(le&&(Ae=V&&V.onVnodeBeforeUnmount)&&ot(Ae,y,v),J&6)Xt(v.component,E,C);else{if(J&128){v.suspense.unmount(E,C);return}ee&&Ct(v,null,y,"beforeUnmount"),J&64?v.type.remove(v,y,E,L,B,C):I&&(z!==je||G>0&&G&64)?Se(I,y,E,!1,!0):(z===je&&G&384||!L&&J&16)&&Se(M,y,E),C&&wt(v)}(le&&(Ae=V&&V.onVnodeUnmounted)||ee)&&Ue(()=>{Ae&&ot(Ae,y,v),ee&&Ct(v,null,y,"unmounted")},E)},wt=v=>{const{type:y,el:E,anchor:C,transition:L}=v;if(y===je){At(E,C);return}if(y===sr){S(v);return}const z=()=>{a(E),L&&!L.persisted&&L.afterLeave&&L.afterLeave()};if(v.shapeFlag&1&&L&&!L.persisted){const{leave:V,delayLeave:$}=L,M=()=>V(E,z);$?$(v.el,z,M):M()}else z()},At=(v,y)=>{let E;for(;v!==y;)E=f(v),a(v),v=E;a(y)},Xt=(v,y,E)=>{const{bum:C,scope:L,update:z,subTree:V,um:$}=v;C&&na(C),L.stop(),z&&(z.active=!1,Oe(V,v,y,E)),$&&Ue($,y),Ue(()=>{v.isUnmounted=!0},y),y&&y.pendingBranch&&!y.isUnmounted&&v.asyncDep&&!v.asyncResolved&&v.suspenseId===y.pendingId&&(y.deps--,y.deps===0&&y.resolve())},Se=(v,y,E,C=!1,L=!1,z=0)=>{for(let V=z;Vv.shapeFlag&6?k(v.component.subTree):v.shapeFlag&128?v.suspense.next():f(v.anchor||v.el),F=(v,y,E)=>{v==null?y._vnode&&Oe(y._vnode,null,null,!0):A(y._vnode||null,v,y,null,null,null,E),Ul(),sa(),y._vnode=v},B={p:A,um:Oe,m:Ze,r:wt,mt:q,mc:T,pc:ve,pbc:Y,n:k,o:e};let K,ge;return t&&([K,ge]=t(B)),{render:F,hydrate:K,createApp:x3(F,K)}}function en({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function a1(e,t,n=!1){const r=e.children,a=t.children;if(Q(r)&&Q(a))for(let o=0;o>1,e[n[s]]0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,l=n[o-1];o-- >0;)n[o]=l,l=t[l];return n}const S3=e=>e.__isTeleport,je=Symbol.for("v-fgt"),Bn=Symbol.for("v-txt"),nt=Symbol.for("v-cmt"),sr=Symbol.for("v-stc"),ir=[];let ht=null;function o1(e=!1){ir.push(ht=e?null:[])}function D3(){ir.pop(),ht=ir[ir.length-1]||null}let _r=1;function rs(e){_r+=e}function l1(e){return e.dynamicChildren=_r>0?ht||Ln:null,D3(),_r>0&&ht&&ht.push(e),e}function k9(e,t,n,r,a,o){return l1(c1(e,t,n,r,a,o,!0))}function s1(e,t,n,r,a){return l1(ke(e,t,n,r,a,!0))}function pa(e){return e?e.__v_isVNode===!0:!1}function rn(e,t){return e.type===t.type&&e.key===t.key}const xa="__vInternal",i1=({key:e})=>e??null,ra=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?he(e)||$e(e)||te(e)?{i:Be,r:e,k:t,f:!!n}:e:null);function c1(e,t=null,n=null,r=0,a=null,o=e===je?0:1,l=!1,s=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&i1(t),ref:t&&ra(t),scopeId:wa,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:a,dynamicChildren:null,appContext:null,ctx:Be};return s?(nl(c,n),o&128&&e.normalize(c)):n&&(c.shapeFlag|=he(n)?8:16),_r>0&&!l&&ht&&(c.patchFlag>0||o&6)&&c.patchFlag!==32&&ht.push(c),c}const ke=$3;function $3(e,t=null,n=null,r=0,a=null,o=!1){if((!e||e===v3)&&(e=nt),pa(e)){const s=Kt(e,t,!0);return n&&nl(s,n),_r>0&&!o&&ht&&(s.shapeFlag&6?ht[ht.indexOf(e)]=s:ht.push(s)),s.patchFlag|=-2,s}if(W3(e)&&(e=e.__vccOpts),t){t=M3(t);let{class:s,style:c}=t;s&&!he(s)&&(t.class=Fo(s)),xe(c)&&(Si(c)&&!Q(c)&&(c=Le({},c)),t.style=Vo(c))}const l=he(e)?1:t3(e)?128:S3(e)?64:xe(e)?4:te(e)?2:0;return c1(e,t,n,r,a,l,o,!0)}function M3(e){return e?Si(e)||xa in e?Le({},e):e:null}function Kt(e,t,n=!1){const{props:r,ref:a,patchFlag:o,children:l}=e,s=t?B3(r||{},t):r;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:s,key:s&&i1(s),ref:t&&t.ref?n&&a?Q(a)?a.concat(ra(t)):[a,ra(t)]:ra(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==je?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Kt(e.ssContent),ssFallback:e.ssFallback&&Kt(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function u1(e=" ",t=0){return ke(Bn,null,e,t)}function L9(e,t){const n=ke(sr,null,e);return n.staticCount=t,n}function P9(e="",t=!1){return t?(o1(),s1(nt,null,e)):ke(nt,null,e)}function pt(e){return e==null||typeof e=="boolean"?ke(nt):Q(e)?ke(je,null,e.slice()):typeof e=="object"?Nt(e):ke(Bn,null,String(e))}function Nt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Kt(e)}function nl(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Q(t))n=16;else if(typeof t=="object")if(r&65){const a=t.default;a&&(a._c&&(a._d=!1),nl(e,a()),a._c&&(a._d=!0));return}else{n=32;const a=t._;!a&&!(xa in t)?t._ctx=Be:a===3&&Be&&(Be.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else te(t)?(t={default:t,_ctx:Be},n=32):(t=String(t),r&64?(n=16,t=[u1(t)]):n=8);e.children=t,e.shapeFlag|=n}function B3(...e){const t={};for(let n=0;nDe||Be;let rl,bn,as="__VUE_INSTANCE_SETTERS__";(bn=ao()[as])||(bn=ao()[as]=[]),bn.push(e=>De=e),rl=e=>{bn.length>1?bn.forEach(t=>t(e)):bn[0](e)};const Vn=e=>{rl(e),e.scope.on()},un=()=>{De&&De.scope.off(),rl(null)};function d1(e){return e.vnode.shapeFlag&4}let Fn=!1;function N3(e,t=!1){Fn=t;const{props:n,children:r}=e.vnode,a=d1(e);C3(e,n,a,t),L3(e,r);const o=a?j3(e,t):void 0;return Fn=!1,o}function j3(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=Di(new Proxy(e.ctx,g3));const{setup:r}=n;if(r){const a=e.setupContext=r.length>1?U3(e):null;Vn(e),Un();const o=Gt(r,e,0,[e.props,a]);if(Gn(),un(),yi(o)){if(o.then(un,un),t)return o.then(l=>{os(e,l,t)}).catch(l=>{Cr(l,e,0)});e.asyncDep=o}else os(e,o,t)}else p1(e,t)}function os(e,t,n){te(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:xe(t)&&(e.setupState=Mi(t)),p1(e,n)}let ls;function p1(e,t,n){const r=e.type;if(!e.render){if(!t&&ls&&!r.render){const a=r.template||el(e).template;if(a){const{isCustomElement:o,compilerOptions:l}=e.appContext.config,{delimiters:s,compilerOptions:c}=r,u=Le(Le({isCustomElement:o,delimiters:s},l),c);r.render=ls(a,u)}}e.render=r.render||vt}Vn(e),Un(),y3(e),Gn(),un()}function q3(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get(t,n){return We(e,"get","$attrs"),t[n]}}))}function U3(e){const t=n=>{e.exposed=n||{}};return{get attrs(){return q3(e)},slots:e.slots,emit:e.emit,expose:t}}function Ca(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Mi(Di(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in lr)return lr[n](e)},has(t,n){return n in t||n in lr}}))}function G3(e,t=!0){return te(e)?e.displayName||e.name:e.name||t&&e.__name}function W3(e){return te(e)&&"__vccOpts"in e}const w=(e,t)=>j0(e,t,Fn);function i(e,t,n){const r=arguments.length;return r===2?xe(t)&&!Q(t)?pa(t)?ke(e,null,[t]):ke(e,t):ke(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&pa(n)&&(n=[n]),ke(e,t,n))}const K3=Symbol.for("v-scx"),Y3=()=>ue(K3),J3="3.3.2",Z3="http://www.w3.org/2000/svg",an=typeof document<"u"?document:null,ss=an&&an.createElement("template"),Q3={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const a=t?an.createElementNS(Z3,e):an.createElement(e,n?{is:n}:void 0);return e==="select"&&r&&r.multiple!=null&&a.setAttribute("multiple",r.multiple),a},createText:e=>an.createTextNode(e),createComment:e=>an.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>an.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,a,o){const l=n?n.previousSibling:t.lastChild;if(a&&(a===o||a.nextSibling))for(;t.insertBefore(a.cloneNode(!0),n),!(a===o||!(a=a.nextSibling)););else{ss.innerHTML=r?`${e}`:e;const s=ss.content;if(r){const c=s.firstChild;for(;c.firstChild;)s.appendChild(c.firstChild);s.removeChild(c)}t.insertBefore(s,n)}return[l?l.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};function X3(e,t,n){const r=e._vtc;r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}function e4(e,t,n){const r=e.style,a=he(n);if(n&&!a){if(t&&!he(t))for(const o in t)n[o]==null&&ho(r,o,"");for(const o in n)ho(r,o,n[o])}else{const o=r.display;a?t!==n&&(r.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(r.display=o)}}const is=/\s*!important$/;function ho(e,t,n){if(Q(n))n.forEach(r=>ho(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=t4(e,t);is.test(n)?e.setProperty(hn(r),n.replace(is,""),"important"):e[r]=n}}const cs=["Webkit","Moz","ms"],Va={};function t4(e,t){const n=Va[t];if(n)return n;let r=st(t);if(r!=="filter"&&r in e)return Va[t]=r;r=xr(r);for(let a=0;aFa||(s4.then(()=>Fa=0),Fa=Date.now());function c4(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;lt(u4(r,n.value),t,5,[r])};return n.value=e,n.attached=i4(),n}function u4(e,t){if(Q(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>a=>!a._stopped&&r&&r(a))}else return t}const ps=/^on[a-z]/,d4=(e,t,n,r,a=!1,o,l,s,c)=>{t==="class"?X3(e,r,a):t==="style"?e4(e,n,r):Ar(t)?Do(t)||o4(e,t,n,r,l):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):p4(e,t,r,a))?r4(e,t,r,o,l,s,c):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),n4(e,t,r,a))};function p4(e,t,n,r){return r?!!(t==="innerHTML"||t==="textContent"||t in e&&ps.test(t)&&te(n)):t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA"||ps.test(t)&&he(n)?!1:t in e}const Bt="transition",er="animation",Yt=(e,{slots:t})=>i(o3,h1(e),t);Yt.displayName="Transition";const f1={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},f4=Yt.props=Le({},Ui,f1),tn=(e,t=[])=>{Q(e)?e.forEach(n=>n(...t)):e&&e(...t)},fs=e=>e?Q(e)?e.some(t=>t.length>1):e.length>1:!1;function h1(e){const t={};for(const N in e)N in f1||(t[N]=e[N]);if(e.css===!1)return t;const{name:n="v",type:r,duration:a,enterFromClass:o=`${n}-enter-from`,enterActiveClass:l=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=o,appearActiveClass:u=l,appearToClass:d=s,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,_=h4(a),A=_&&_[0],x=_&&_[1],{onBeforeEnter:g,onEnter:b,onEnterCancelled:R,onLeave:S,onLeaveCancelled:U,onBeforeAppear:O=g,onAppear:W=b,onAppearCancelled:T=R}=t,j=(N,X,q)=>{Ht(N,X?d:s),Ht(N,X?u:l),q&&q()},Y=(N,X)=>{N._isLeaving=!1,Ht(N,p),Ht(N,h),Ht(N,f),X&&X()},re=N=>(X,q)=>{const ze=N?W:b,ne=()=>j(X,N,q);tn(ze,[X,ne]),hs(()=>{Ht(X,N?c:o),Pt(X,N?d:s),fs(ze)||vs(X,r,A,ne)})};return Le(t,{onBeforeEnter(N){tn(g,[N]),Pt(N,o),Pt(N,l)},onBeforeAppear(N){tn(O,[N]),Pt(N,c),Pt(N,u)},onEnter:re(!1),onAppear:re(!0),onLeave(N,X){N._isLeaving=!0;const q=()=>Y(N,X);Pt(N,p),m1(),Pt(N,f),hs(()=>{N._isLeaving&&(Ht(N,p),Pt(N,h),fs(S)||vs(N,r,x,q))}),tn(S,[N,q])},onEnterCancelled(N){j(N,!1),tn(R,[N])},onAppearCancelled(N){j(N,!0),tn(T,[N])},onLeaveCancelled(N){Y(N),tn(U,[N])}})}function h4(e){if(e==null)return null;if(xe(e))return[Ha(e.enter),Ha(e.leave)];{const t=Ha(e);return[t,t]}}function Ha(e){return Zc(e)}function Pt(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e._vtc||(e._vtc=new Set)).add(t)}function Ht(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const{_vtc:n}=e;n&&(n.delete(t),n.size||(e._vtc=void 0))}function hs(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let v4=0;function vs(e,t,n,r){const a=e._endId=++v4,o=()=>{a===e._endId&&r()};if(n)return setTimeout(o,n);const{type:l,timeout:s,propCount:c}=v1(e,t);if(!l)return r();const u=l+"end";let d=0;const p=()=>{e.removeEventListener(u,f),o()},f=h=>{h.target===e&&++d>=c&&p()};setTimeout(()=>{d(n[_]||"").split(", "),a=r(`${Bt}Delay`),o=r(`${Bt}Duration`),l=ms(a,o),s=r(`${er}Delay`),c=r(`${er}Duration`),u=ms(s,c);let d=null,p=0,f=0;t===Bt?l>0&&(d=Bt,p=l,f=o.length):t===er?u>0&&(d=er,p=u,f=c.length):(p=Math.max(l,u),d=p>0?l>u?Bt:er:null,f=d?d===Bt?o.length:c.length:0);const h=d===Bt&&/\b(transform|all)(,|$)/.test(r(`${Bt}Property`).toString());return{type:d,timeout:p,propCount:f,hasTransform:h}}function ms(e,t){for(;e.lengthgs(n)+gs(e[r])))}function gs(e){return Number(e.slice(0,-1).replace(",","."))*1e3}function m1(){return document.body.offsetHeight}const g1=new WeakMap,y1=new WeakMap,_1={name:"TransitionGroup",props:Le({},f4,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Jn(),r=qi();let a,o;return Ki(()=>{if(!a.length)return;const l=e.moveClass||`${e.name||"v"}-move`;if(!E4(a[0].el,n.vnode.el,l))return;a.forEach(y4),a.forEach(_4);const s=a.filter(b4);m1(),s.forEach(c=>{const u=c.el,d=u.style;Pt(u,l),d.transform=d.webkitTransform=d.transitionDuration="";const p=u._moveCb=f=>{f&&f.target!==u||(!f||/transform$/.test(f.propertyName))&&(u.removeEventListener("transitionend",p),u._moveCb=null,Ht(u,l))};u.addEventListener("transitionend",p)})}),()=>{const l=ce(e),s=h1(l);let c=l.tag||je;a=o,o=t.default?Qo(t.default()):[];for(let u=0;udelete e.mode;_1.props;const g4=_1;function y4(e){const t=e.el;t._moveCb&&t._moveCb(),t._enterCb&&t._enterCb()}function _4(e){y1.set(e,e.el.getBoundingClientRect())}function b4(e){const t=g1.get(e),n=y1.get(e),r=t.left-n.left,a=t.top-n.top;if(r||a){const o=e.el.style;return o.transform=o.webkitTransform=`translate(${r}px,${a}px)`,o.transitionDuration="0s",e}}function E4(e,t,n){const r=e.cloneNode();e._vtc&&e._vtc.forEach(l=>{l.split(/\s+/).forEach(s=>s&&r.classList.remove(s))}),n.split(/\s+/).forEach(l=>l&&r.classList.add(l)),r.style.display="none";const a=t.nodeType===1?t:t.parentNode;a.appendChild(r);const{hasTransform:o}=v1(r);return a.removeChild(r),o}const ys=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Q(t)?n=>na(t,n):t};function w4(e){e.target.composing=!0}function _s(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const z9={created(e,{modifiers:{lazy:t,trim:n,number:r}},a){e._assign=ys(a);const o=r||a.props&&a.props.type==="number";xn(e,t?"change":"input",l=>{if(l.target.composing)return;let s=e.value;n&&(s=s.trim()),o&&(s=ro(s)),e._assign(s)}),n&&xn(e,"change",()=>{e.value=e.value.trim()}),t||(xn(e,"compositionstart",w4),xn(e,"compositionend",_s),xn(e,"change",_s))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,modifiers:{lazy:n,trim:r,number:a}},o){if(e._assign=ys(o),e.composing||document.activeElement===e&&e.type!=="range"&&(n||r&&e.value.trim()===t||(a||e.type==="number")&&ro(e.value)===t))return;const l=t??"";e.value!==l&&(e.value=l)}},A4=["ctrl","shift","alt","meta"],x4={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>A4.some(n=>e[`${n}Key`]&&!t.includes(n))},O9=(e,t)=>(n,...r)=>{for(let a=0;an=>{if(!("key"in n))return;const r=hn(n.key);if(t.some(a=>a===r||C4[a]===r))return e(n)},R9={beforeMount(e,{value:t},{transition:n}){e._vod=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):tr(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),tr(e,!0),r.enter(e)):r.leave(e,()=>{tr(e,!1)}):tr(e,t))},beforeUnmount(e,{value:t}){tr(e,t)}};function tr(e,t){e.style.display=t?e._vod:"none"}const T4=Le({patchProp:d4},Q3);let Na,bs=!1;function k4(){return Na=bs?Na:O3(T4),bs=!0,Na}const L4=(...e)=>{const t=k4().createApp(...e),{mount:n}=t;return t.mount=r=>{const a=P4(r);if(a)return n(a,!0,a instanceof SVGElement)},t};function P4(e){return he(e)?document.querySelector(e):e}const z4={"v-8daa1a0e":()=>m(()=>import("./index.html-e2d78b40.js"),[]).then(({data:e})=>e),"v-184f4da6":()=>m(()=>import("./intro.html-66251a3e.js"),[]).then(({data:e})=>e),"v-2e3eac9e":()=>m(()=>import("./slides.html-0184e10d.js"),[]).then(({data:e})=>e),"v-1473bf53":()=>m(()=>import("./index.html-8917e60a.js"),[]).then(({data:e})=>e),"v-4e65ec78":()=>m(()=>import("./disable.html-3d980691.js"),[]).then(({data:e})=>e),"v-c151bf32":()=>m(()=>import("./encrypt.html-5eace103.js"),[]).then(({data:e})=>e),"v-438ffe52":()=>m(()=>import("./markdown.html-21e949f0.js"),[]).then(({data:e})=>e),"v-6e19edb7":()=>m(()=>import("./page.html-79c95730.js"),[]).then(({data:e})=>e),"v-2bc6566a":()=>m(()=>import("./cherry.html-9f35de0f.js"),[]).then(({data:e})=>e),"v-24b7c48d":()=>m(()=>import("./dragonfruit.html-d0774ab6.js"),[]).then(({data:e})=>e),"v-f0ec4556":()=>m(()=>import("./strawberry.html-848856a6.js"),[]).then(({data:e})=>e),"v-df8b6e0c":()=>m(()=>import("./tomato.html-73929c01.js"),[]).then(({data:e})=>e),"v-2d0ad528":()=>m(()=>import("./index.html-0e18d554.js"),[]).then(({data:e})=>e),"v-858cfdd6":()=>m(()=>import("./intro.html-ec82353f.js"),[]).then(({data:e})=>e),"v-269ae70f":()=>m(()=>import("./slides.html-5854bb5e.js"),[]).then(({data:e})=>e),"v-67b8c712":()=>m(()=>import("./1.html-0f8639e1.js"),[]).then(({data:e})=>e),"v-696d9fb1":()=>m(()=>import("./2.html-6d5aa095.js"),[]).then(({data:e})=>e),"v-6b227850":()=>m(()=>import("./3.html-63e4f954.js"),[]).then(({data:e})=>e),"v-6cd750ef":()=>m(()=>import("./4.html-c5758e5e.js"),[]).then(({data:e})=>e),"v-7a07405d":()=>m(()=>import("./1.html-ba22902f.js"),[]).then(({data:e})=>e),"v-7bbc18fc":()=>m(()=>import("./2.html-f0772481.js"),[]).then(({data:e})=>e),"v-7d70f19b":()=>m(()=>import("./3.html-9e1cd135.js"),[]).then(({data:e})=>e),"v-7f25ca3a":()=>m(()=>import("./4.html-034a95e0.js"),[]).then(({data:e})=>e),"v-2b64e284":()=>m(()=>import("./index.html-fe1322c2.js"),[]).then(({data:e})=>e),"v-c1942916":()=>m(()=>import("./disable.html-7d39a99e.js"),[]).then(({data:e})=>e),"v-65c00218":()=>m(()=>import("./encrypt.html-bf2de9f2.js"),[]).then(({data:e})=>e),"v-36295574":()=>m(()=>import("./markdown.html-1c617bdb.js"),[]).then(({data:e})=>e),"v-62ced1a6":()=>m(()=>import("./page.html-ae9c7723.js"),[]).then(({data:e})=>e),"v-9ef49308":()=>m(()=>import("./cherry.html-4ae7488a.js"),[]).then(({data:e})=>e),"v-3fbd497c":()=>m(()=>import("./dragonfruit.html-366382a2.js"),[]).then(({data:e})=>e),"v-46587e86":()=>m(()=>import("./strawberry.html-8d908b02.js"),[]).then(({data:e})=>e),"v-56a32aab":()=>m(()=>import("./tomato.html-0713861e.js"),[]).then(({data:e})=>e),"v-49be79ce":()=>m(()=>import("./1.html-0b642b0c.js"),[]).then(({data:e})=>e),"v-4b73526d":()=>m(()=>import("./2.html-d27c997b.js"),[]).then(({data:e})=>e),"v-4d282b0c":()=>m(()=>import("./3.html-68855027.js"),[]).then(({data:e})=>e),"v-4edd03ab":()=>m(()=>import("./4.html-31cefaff.js"),[]).then(({data:e})=>e),"v-6ac108ec":()=>m(()=>import("./Chapter0 前言.html-5e6f7ae2.js"),[]).then(({data:e})=>e),"v-974cb780":()=>m(()=>import("./Chapter1 编译器组成.html-6d0733eb.js"),[]).then(({data:e})=>e),"v-bdae3856":()=>m(()=>import("./Chapter2 词法分析.html-6b849e8e.js"),[]).then(({data:e})=>e),"v-61e78b6d":()=>m(()=>import("./Chapter3 语法分析.html-e922cfec.js"),[]).then(({data:e})=>e),"v-82296c9e":()=>m(()=>import("./Chapter4 语义分析.html-e129e39d.js"),[]).then(({data:e})=>e),"v-2248c4e9":()=>m(()=>import("./Chapter5 代码生成.html-b53a2f8f.js"),[]).then(({data:e})=>e),"v-a12e2b60":()=>m(()=>import("./震惊,1_0!?.html-6985c468.js"),[]).then(({data:e})=>e),"v-3706649a":()=>m(()=>import("./404.html-a141a261.js"),[]).then(({data:e})=>e),"v-e1e3da16":()=>m(()=>import("./index.html-36c3878d.js"),[]).then(({data:e})=>e),"v-08f42f4a":()=>m(()=>import("./index.html-69480aa3.js"),[]).then(({data:e})=>e),"v-30be3cd5":()=>m(()=>import("./index.html-5c057e54.js"),[]).then(({data:e})=>e),"v-564155e4":()=>m(()=>import("./index.html-470441a0.js"),[]).then(({data:e})=>e),"v-fa14c1f4":()=>m(()=>import("./index.html-5db1bcf8.js"),[]).then(({data:e})=>e),"v-0d2efb0a":()=>m(()=>import("./index.html-8d0464aa.js"),[]).then(({data:e})=>e),"v-089df10d":()=>m(()=>import("./index.html-7c9a45ff.js"),[]).then(({data:e})=>e),"v-07744026":()=>m(()=>import("./index.html-3eedd500.js"),[]).then(({data:e})=>e),"v-5bc93818":()=>m(()=>import("./index.html-ee561570.js"),[]).then(({data:e})=>e),"v-744d024e":()=>m(()=>import("./index.html-a3654b4d.js"),[]).then(({data:e})=>e),"v-e52c881c":()=>m(()=>import("./index.html-d0a6bff5.js"),[]).then(({data:e})=>e),"v-154dc4c4":()=>m(()=>import("./index.html-c008990b.js"),[]).then(({data:e})=>e),"v-01560935":()=>m(()=>import("./index.html-31fe1954.js"),[]).then(({data:e})=>e),"v-ac0c2a6a":()=>m(()=>import("./index.html-0d37cd3a.js"),[]).then(({data:e})=>e),"v-c5a9e2d6":()=>m(()=>import("./index.html-fa98b48d.js"),[]).then(({data:e})=>e),"v-54d7ff21":()=>m(()=>import("./index.html-6556585d.js"),[]).then(({data:e})=>e),"v-2c3ee7f5":()=>m(()=>import("./index.html-a7e92c7c.js"),[]).then(({data:e})=>e),"v-27b02be6":()=>m(()=>import("./index.html-e84bae74.js"),[]).then(({data:e})=>e),"v-a96c8ac4":()=>m(()=>import("./index.html-4e9ce9dd.js"),[]).then(({data:e})=>e),"v-cbedfc04":()=>m(()=>import("./index.html-decef7ec.js"),[]).then(({data:e})=>e),"v-84a70306":()=>m(()=>import("./index.html-4fd84dd2.js"),[]).then(({data:e})=>e),"v-484552dc":()=>m(()=>import("./index.html-a180934e.js"),[]).then(({data:e})=>e),"v-afbf569a":()=>m(()=>import("./index.html-8bc3abb0.js"),[]).then(({data:e})=>e),"v-26f8293d":()=>m(()=>import("./index.html-4e7293f4.js"),[]).then(({data:e})=>e),"v-6c3f91a8":()=>m(()=>import("./index.html-6e297a09.js"),[]).then(({data:e})=>e),"v-30e296fe":()=>m(()=>import("./index.html-da9b643c.js"),[]).then(({data:e})=>e),"v-7fd39646":()=>m(()=>import("./index.html-72b354e5.js"),[]).then(({data:e})=>e),"v-b306f5e8":()=>m(()=>import("./index.html-ec9caa22.js"),[]).then(({data:e})=>e),"v-c10ca3a6":()=>m(()=>import("./index.html-2b734471.js"),[]).then(({data:e})=>e),"v-08d6c854":()=>m(()=>import("./index.html-acb512e8.js"),[]).then(({data:e})=>e),"v-6ae89a52":()=>m(()=>import("./index.html-ba666728.js"),[]).then(({data:e})=>e),"v-0bf5dfa2":()=>m(()=>import("./index.html-ab329651.js"),[]).then(({data:e})=>e),"v-fbb94a6e":()=>m(()=>import("./index.html-5ef4f88d.js"),[]).then(({data:e})=>e),"v-b3156306":()=>m(()=>import("./index.html-e23f1f98.js"),[]).then(({data:e})=>e),"v-2a32a3a8":()=>m(()=>import("./index.html-1689d654.js"),[]).then(({data:e})=>e),"v-4446a48e":()=>m(()=>import("./index.html-ca0cf526.js"),[]).then(({data:e})=>e),"v-16890533":()=>m(()=>import("./index.html-45269fc1.js"),[]).then(({data:e})=>e),"v-b14ed7a6":()=>m(()=>import("./index.html-2eaf1428.js"),[]).then(({data:e})=>e),"v-d28a2a8a":()=>m(()=>import("./index.html-22b3a076.js"),[]).then(({data:e})=>e),"v-3e80ec60":()=>m(()=>import("./index.html-12248d5a.js"),[]).then(({data:e})=>e),"v-1397518c":()=>m(()=>import("./index.html-39cd6071.js"),[]).then(({data:e})=>e),"v-28c447a5":()=>m(()=>import("./index.html-f58734b4.js"),[]).then(({data:e})=>e),"v-41412eae":()=>m(()=>import("./index.html-7df53659.js"),[]).then(({data:e})=>e),"v-540234fd":()=>m(()=>import("./index.html-ab36ce7a.js"),[]).then(({data:e})=>e),"v-d908375e":()=>m(()=>import("./index.html-bbc0acc4.js"),[]).then(({data:e})=>e),"v-03ba1c5a":()=>m(()=>import("./index.html-f7e2aac4.js"),[]).then(({data:e})=>e),"v-6905c52d":()=>m(()=>import("./index.html-7bd0f4ec.js"),[]).then(({data:e})=>e),"v-05bf9c12":()=>m(()=>import("./index.html-f6310996.js"),[]).then(({data:e})=>e),"v-660629f4":()=>m(()=>import("./index.html-ba4fc6d2.js"),[]).then(({data:e})=>e),"v-2e14b8c3":()=>m(()=>import("./index.html-1257554b.js"),[]).then(({data:e})=>e),"v-111f01be":()=>m(()=>import("./index.html-84336144.js"),[]).then(({data:e})=>e),"v-d4827004":()=>m(()=>import("./index.html-3689c8ba.js"),[]).then(({data:e})=>e),"v-ac203710":()=>m(()=>import("./index.html-bd993855.js"),[]).then(({data:e})=>e),"v-03d1f283":()=>m(()=>import("./index.html-02a3be5c.js"),[]).then(({data:e})=>e),"v-331fe9d7":()=>m(()=>import("./index.html-519fa8a2.js"),[]).then(({data:e})=>e),"v-24d008e3":()=>m(()=>import("./index.html-9a0eddb3.js"),[]).then(({data:e})=>e),"v-31a38f34":()=>m(()=>import("./index.html-a4e473d7.js"),[]).then(({data:e})=>e),"v-58bb7b92":()=>m(()=>import("./index.html-30860f2b.js"),[]).then(({data:e})=>e),"v-012340a5":()=>m(()=>import("./index.html-f0da7875.js"),[]).then(({data:e})=>e),"v-78e0ca6a":()=>m(()=>import("./index.html-7dc30a0b.js"),[]).then(({data:e})=>e),"v-e5784e02":()=>m(()=>import("./index.html-989a8a1b.js"),[]).then(({data:e})=>e),"v-3a531ab1":()=>m(()=>import("./index.html-90de2315.js"),[]).then(({data:e})=>e)},O4=JSON.parse('{"base":"/","lang":"en-US","title":"","description":"","head":[],"locales":{"/":{"lang":"en-US","title":"Blog Demo","description":"A blog demo for vuepress-theme-hope"},"/zh/":{"lang":"zh-CN","title":"博客演示","description":"vuepress-theme-hope 的博客演示"}}}');var I4=([e,t,n])=>e==="meta"&&t.name?`${e}.${t.name}`:["title","base"].includes(e)?e:e==="template"&&t.id?`${e}.${t.id}`:JSON.stringify([e,t,n]),R4=e=>{const t=new Set,n=[];return e.forEach(r=>{const a=I4(r);t.has(a)||(t.add(a),n.push(r))}),n},S4=e=>e[e.length-1]==="/"||e.endsWith(".html")?e:`${e}/`,D4=e=>e.startsWith("ftp://"),gn=e=>/^(https?:)?\/\//.test(e),$4=/.md((\?|#).*)?$/,fa=(e,t="/")=>!!(gn(e)||D4(e)||e.startsWith("/")&&!e.startsWith(t)&&!$4.test(e)),b1=e=>/^mailto:/.test(e),M4=e=>/^tel:/.test(e),kr=e=>Object.prototype.toString.call(e)==="[object Object]",al=e=>e[e.length-1]==="/"?e.slice(0,-1):e,E1=e=>e[0]==="/"?e.slice(1):e,B4=(e,t)=>{const n=Object.keys(e).sort((r,a)=>{const o=a.split("/").length-r.split("/").length;return o!==0?o:a.length-r.length});for(const r of n)if(t.startsWith(r))return r;return"/"};const w1={"v-8daa1a0e":P(()=>m(()=>import("./index.html-ccb72aa6.js"),["assets/index.html-ccb72aa6.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-184f4da6":P(()=>m(()=>import("./intro.html-dda4a75a.js"),["assets/intro.html-dda4a75a.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-2e3eac9e":P(()=>m(()=>import("./slides.html-cc79890d.js"),["assets/slides.html-cc79890d.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-1473bf53":P(()=>m(()=>import("./index.html-d3a3c3f2.js"),["assets/index.html-d3a3c3f2.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-4e65ec78":P(()=>m(()=>import("./disable.html-bdfcf139.js"),["assets/disable.html-bdfcf139.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-c151bf32":P(()=>m(()=>import("./encrypt.html-525f9ee8.js"),["assets/encrypt.html-525f9ee8.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-438ffe52":P(()=>m(()=>import("./markdown.html-7c13ae33.js"),["assets/markdown.html-7c13ae33.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-6e19edb7":P(()=>m(()=>import("./page.html-64d77899.js"),["assets/page.html-64d77899.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-2bc6566a":P(()=>m(()=>import("./cherry.html-be8b7b64.js"),["assets/cherry.html-be8b7b64.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-24b7c48d":P(()=>m(()=>import("./dragonfruit.html-9762d1d3.js"),["assets/dragonfruit.html-9762d1d3.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-f0ec4556":P(()=>m(()=>import("./strawberry.html-d8034118.js"),["assets/strawberry.html-d8034118.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-df8b6e0c":P(()=>m(()=>import("./tomato.html-b2f4cbf2.js"),["assets/tomato.html-b2f4cbf2.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-2d0ad528":P(()=>m(()=>import("./index.html-e6001c0e.js"),["assets/index.html-e6001c0e.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-858cfdd6":P(()=>m(()=>import("./intro.html-c710abf3.js"),["assets/intro.html-c710abf3.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-269ae70f":P(()=>m(()=>import("./slides.html-83f8859c.js"),["assets/slides.html-83f8859c.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-67b8c712":P(()=>m(()=>import("./1.html-41c2f4ce.js"),["assets/1.html-41c2f4ce.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-696d9fb1":P(()=>m(()=>import("./2.html-24f2a0a4.js"),["assets/2.html-24f2a0a4.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-6b227850":P(()=>m(()=>import("./3.html-727ef523.js"),["assets/3.html-727ef523.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-6cd750ef":P(()=>m(()=>import("./4.html-68f7b9c6.js"),["assets/4.html-68f7b9c6.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-7a07405d":P(()=>m(()=>import("./1.html-8d92ef9a.js"),["assets/1.html-8d92ef9a.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-7bbc18fc":P(()=>m(()=>import("./2.html-666fc187.js"),["assets/2.html-666fc187.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-7d70f19b":P(()=>m(()=>import("./3.html-79c2e26f.js"),["assets/3.html-79c2e26f.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-7f25ca3a":P(()=>m(()=>import("./4.html-a3ba8fe8.js"),["assets/4.html-a3ba8fe8.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-2b64e284":P(()=>m(()=>import("./index.html-9c77daa3.js"),["assets/index.html-9c77daa3.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-c1942916":P(()=>m(()=>import("./disable.html-3978f9df.js"),["assets/disable.html-3978f9df.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-65c00218":P(()=>m(()=>import("./encrypt.html-20ef40df.js"),["assets/encrypt.html-20ef40df.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-36295574":P(()=>m(()=>import("./markdown.html-2e42d0db.js"),["assets/markdown.html-2e42d0db.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-62ced1a6":P(()=>m(()=>import("./page.html-7e919006.js"),["assets/page.html-7e919006.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-9ef49308":P(()=>m(()=>import("./cherry.html-bf097d24.js"),["assets/cherry.html-bf097d24.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-3fbd497c":P(()=>m(()=>import("./dragonfruit.html-04fdaf61.js"),["assets/dragonfruit.html-04fdaf61.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-46587e86":P(()=>m(()=>import("./strawberry.html-cd88738f.js"),["assets/strawberry.html-cd88738f.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-56a32aab":P(()=>m(()=>import("./tomato.html-35306829.js"),["assets/tomato.html-35306829.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-49be79ce":P(()=>m(()=>import("./1.html-7f42b9fe.js"),["assets/1.html-7f42b9fe.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-4b73526d":P(()=>m(()=>import("./2.html-afc6b7a8.js"),["assets/2.html-afc6b7a8.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-4d282b0c":P(()=>m(()=>import("./3.html-479a173d.js"),["assets/3.html-479a173d.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-4edd03ab":P(()=>m(()=>import("./4.html-538c2896.js"),["assets/4.html-538c2896.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-6ac108ec":P(()=>m(()=>import("./Chapter0 前言.html-abfc2045.js"),["assets/Chapter0 前言.html-abfc2045.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-974cb780":P(()=>m(()=>import("./Chapter1 编译器组成.html-abab28d5.js"),["assets/Chapter1 编译器组成.html-abab28d5.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-bdae3856":P(()=>m(()=>import("./Chapter2 词法分析.html-cb683558.js"),["assets/Chapter2 词法分析.html-cb683558.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-61e78b6d":P(()=>m(()=>import("./Chapter3 语法分析.html-67b15795.js"),["assets/Chapter3 语法分析.html-67b15795.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-82296c9e":P(()=>m(()=>import("./Chapter4 语义分析.html-b0e59602.js"),["assets/Chapter4 语义分析.html-b0e59602.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-2248c4e9":P(()=>m(()=>import("./Chapter5 代码生成.html-bfb40f25.js"),["assets/Chapter5 代码生成.html-bfb40f25.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-a12e2b60":P(()=>m(()=>import("./震惊,1_0!?.html-650ab2f3.js"),["assets/震惊,1_0!?.html-650ab2f3.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-3706649a":P(()=>m(()=>import("./404.html-c419a746.js"),["assets/404.html-c419a746.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-e1e3da16":P(()=>m(()=>import("./index.html-922faedb.js"),["assets/index.html-922faedb.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-08f42f4a":P(()=>m(()=>import("./index.html-8a8343f2.js"),["assets/index.html-8a8343f2.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-30be3cd5":P(()=>m(()=>import("./index.html-5e9504e6.js"),["assets/index.html-5e9504e6.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-564155e4":P(()=>m(()=>import("./index.html-1d40c993.js"),["assets/index.html-1d40c993.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-fa14c1f4":P(()=>m(()=>import("./index.html-b70c62aa.js"),["assets/index.html-b70c62aa.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-0d2efb0a":P(()=>m(()=>import("./index.html-8b544649.js"),["assets/index.html-8b544649.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-089df10d":P(()=>m(()=>import("./index.html-96e759c9.js"),["assets/index.html-96e759c9.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-07744026":P(()=>m(()=>import("./index.html-4d924b6e.js"),["assets/index.html-4d924b6e.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-5bc93818":P(()=>m(()=>import("./index.html-f11f3ef8.js"),["assets/index.html-f11f3ef8.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-744d024e":P(()=>m(()=>import("./index.html-60c261b9.js"),["assets/index.html-60c261b9.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-e52c881c":P(()=>m(()=>import("./index.html-54ea7f4b.js"),["assets/index.html-54ea7f4b.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-154dc4c4":P(()=>m(()=>import("./index.html-39e4f317.js"),["assets/index.html-39e4f317.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-01560935":P(()=>m(()=>import("./index.html-2c783916.js"),["assets/index.html-2c783916.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-ac0c2a6a":P(()=>m(()=>import("./index.html-f28901ab.js"),["assets/index.html-f28901ab.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-c5a9e2d6":P(()=>m(()=>import("./index.html-0e6c1225.js"),["assets/index.html-0e6c1225.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-54d7ff21":P(()=>m(()=>import("./index.html-391d2634.js"),["assets/index.html-391d2634.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-2c3ee7f5":P(()=>m(()=>import("./index.html-ce915ead.js"),["assets/index.html-ce915ead.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-27b02be6":P(()=>m(()=>import("./index.html-cf49465e.js"),["assets/index.html-cf49465e.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-a96c8ac4":P(()=>m(()=>import("./index.html-393dc655.js"),["assets/index.html-393dc655.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-cbedfc04":P(()=>m(()=>import("./index.html-ae8e8f7d.js"),["assets/index.html-ae8e8f7d.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-84a70306":P(()=>m(()=>import("./index.html-3ed30783.js"),["assets/index.html-3ed30783.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-484552dc":P(()=>m(()=>import("./index.html-97eea022.js"),["assets/index.html-97eea022.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-afbf569a":P(()=>m(()=>import("./index.html-ed51bb7c.js"),["assets/index.html-ed51bb7c.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-26f8293d":P(()=>m(()=>import("./index.html-2b532de7.js"),["assets/index.html-2b532de7.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-6c3f91a8":P(()=>m(()=>import("./index.html-ec4561e5.js"),["assets/index.html-ec4561e5.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-30e296fe":P(()=>m(()=>import("./index.html-31dbf075.js"),["assets/index.html-31dbf075.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-7fd39646":P(()=>m(()=>import("./index.html-8dc4c41e.js"),["assets/index.html-8dc4c41e.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-b306f5e8":P(()=>m(()=>import("./index.html-3c1222f5.js"),["assets/index.html-3c1222f5.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-c10ca3a6":P(()=>m(()=>import("./index.html-34ed445a.js"),["assets/index.html-34ed445a.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-08d6c854":P(()=>m(()=>import("./index.html-c896b8cd.js"),["assets/index.html-c896b8cd.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-6ae89a52":P(()=>m(()=>import("./index.html-18ce8b37.js"),["assets/index.html-18ce8b37.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-0bf5dfa2":P(()=>m(()=>import("./index.html-54827d45.js"),["assets/index.html-54827d45.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-fbb94a6e":P(()=>m(()=>import("./index.html-5ac3d727.js"),["assets/index.html-5ac3d727.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-b3156306":P(()=>m(()=>import("./index.html-82b65023.js"),["assets/index.html-82b65023.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-2a32a3a8":P(()=>m(()=>import("./index.html-78375217.js"),["assets/index.html-78375217.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-4446a48e":P(()=>m(()=>import("./index.html-4c3dff1d.js"),["assets/index.html-4c3dff1d.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-16890533":P(()=>m(()=>import("./index.html-12796d28.js"),["assets/index.html-12796d28.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-b14ed7a6":P(()=>m(()=>import("./index.html-5eb97ce5.js"),["assets/index.html-5eb97ce5.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-d28a2a8a":P(()=>m(()=>import("./index.html-4ddb8c14.js"),["assets/index.html-4ddb8c14.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-3e80ec60":P(()=>m(()=>import("./index.html-fed48ed8.js"),["assets/index.html-fed48ed8.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-1397518c":P(()=>m(()=>import("./index.html-c318e04f.js"),["assets/index.html-c318e04f.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-28c447a5":P(()=>m(()=>import("./index.html-46c2a70a.js"),["assets/index.html-46c2a70a.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-41412eae":P(()=>m(()=>import("./index.html-45d2ef36.js"),["assets/index.html-45d2ef36.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-540234fd":P(()=>m(()=>import("./index.html-98f8ba39.js"),["assets/index.html-98f8ba39.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-d908375e":P(()=>m(()=>import("./index.html-b41d0fec.js"),["assets/index.html-b41d0fec.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-03ba1c5a":P(()=>m(()=>import("./index.html-513a427e.js"),["assets/index.html-513a427e.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-6905c52d":P(()=>m(()=>import("./index.html-c3afb00a.js"),["assets/index.html-c3afb00a.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-05bf9c12":P(()=>m(()=>import("./index.html-cfcb925d.js"),["assets/index.html-cfcb925d.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-660629f4":P(()=>m(()=>import("./index.html-3cbc45c5.js"),["assets/index.html-3cbc45c5.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-2e14b8c3":P(()=>m(()=>import("./index.html-75d51ec5.js"),["assets/index.html-75d51ec5.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-111f01be":P(()=>m(()=>import("./index.html-48eda3ef.js"),["assets/index.html-48eda3ef.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-d4827004":P(()=>m(()=>import("./index.html-49b23f93.js"),["assets/index.html-49b23f93.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-ac203710":P(()=>m(()=>import("./index.html-4016dc2e.js"),["assets/index.html-4016dc2e.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-03d1f283":P(()=>m(()=>import("./index.html-ac5c9c42.js"),["assets/index.html-ac5c9c42.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-331fe9d7":P(()=>m(()=>import("./index.html-f202bb4a.js"),["assets/index.html-f202bb4a.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-24d008e3":P(()=>m(()=>import("./index.html-1f89dd5a.js"),["assets/index.html-1f89dd5a.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-31a38f34":P(()=>m(()=>import("./index.html-33bdd7e9.js"),["assets/index.html-33bdd7e9.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-58bb7b92":P(()=>m(()=>import("./index.html-c423e253.js"),["assets/index.html-c423e253.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-012340a5":P(()=>m(()=>import("./index.html-64ab3d12.js"),["assets/index.html-64ab3d12.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-78e0ca6a":P(()=>m(()=>import("./index.html-8c368962.js"),["assets/index.html-8c368962.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-e5784e02":P(()=>m(()=>import("./index.html-ea083a25.js"),["assets/index.html-ea083a25.js","assets/plugin-vue_export-helper-c27b6911.js"])),"v-3a531ab1":P(()=>m(()=>import("./index.html-fd1e230c.js"),["assets/index.html-fd1e230c.js","assets/plugin-vue_export-helper-c27b6911.js"]))};var V4=Symbol(""),F4=H(z4),A1=vn({key:"",path:"",title:"",lang:"",frontmatter:{},headers:[]}),jt=H(A1),ie=()=>jt,x1=Symbol(""),be=()=>{const e=ue(x1);if(!e)throw new Error("usePageFrontmatter() is called without provider.");return e},C1=Symbol(""),H4=()=>{const e=ue(C1);if(!e)throw new Error("usePageHead() is called without provider.");return e},T1=Symbol(""),N4=()=>{const e=ue(T1);if(!e)throw new Error("usePageHeadTitle() is called without provider.");return e},k1=Symbol(""),ol=()=>{const e=ue(k1);if(!e)throw new Error("usePageLang() is called without provider.");return e},L1=Symbol(""),j4=()=>{const e=ue(L1);if(!e)throw new Error("usePageLayout() is called without provider.");return e},ll=Symbol(""),kt=()=>{const e=ue(ll);if(!e)throw new Error("useRouteLocale() is called without provider.");return e},kn=H(O4),P1=()=>kn,z1=Symbol(""),Lr=()=>{const e=ue(z1);if(!e)throw new Error("useSiteLocaleData() is called without provider.");return e},q4=Symbol(""),U4="Layout",G4="NotFound",zt=Wn({resolveLayouts:e=>e.reduce((t,n)=>({...t,...n.layouts}),{}),resolvePageData:async e=>{const t=F4.value[e];return await(t==null?void 0:t())??A1},resolvePageFrontmatter:e=>e.frontmatter,resolvePageHead:(e,t,n)=>{const r=he(t.description)?t.description:n.description,a=[...Q(t.head)?t.head:[],...n.head,["title",{},e],["meta",{name:"description",content:r}]];return R4(a)},resolvePageHeadTitle:(e,t)=>[e.title,t.title].filter(n=>!!n).join(" | "),resolvePageLang:e=>e.lang||"en",resolvePageLayout:(e,t)=>{let n;if(e.path){const r=e.frontmatter.layout;he(r)?n=r:n=U4}else n=G4;return t[n]},resolveRouteLocale:(e,t)=>B4(e,t),resolveSiteLocaleData:(e,t)=>({...e,...e.locales[t]})}),Ta=D({name:"ClientOnly",setup(e,t){const n=H(!1);return de(()=>{n.value=!0}),()=>{var r,a;return n.value?(a=(r=t.slots).default)==null?void 0:a.call(r):null}}}),sl=D({name:"Content",props:{pageKey:{type:String,required:!1,default:""}},setup(e){const t=ie(),n=w(()=>w1[e.pageKey||t.value.key]);return()=>n.value?i(n.value):i("div","404 Not Found")}}),bt=(e={})=>e,Fe=e=>gn(e)?e:`/${E1(e)}`;const W4={};var qe=Uint8Array,ln=Uint16Array,O1=Uint32Array,I1=new qe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),R1=new qe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),K4=new qe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),S1=function(e,t){for(var n=new ln(31),r=0;r<31;++r)n[r]=t+=1<>>1|(Te&21845)<<1;Vt=(Vt&52428)>>>2|(Vt&13107)<<2,Vt=(Vt&61680)>>>4|(Vt&3855)<<4,vo[Te]=((Vt&65280)>>>8|(Vt&255)<<8)>>>1}var cr=function(e,t,n){for(var r=e.length,a=0,o=new ln(t);a>>c]=u}else for(s=new ln(r),a=0;a>>15-e[a]);return s},Pr=new qe(288);for(var Te=0;Te<144;++Te)Pr[Te]=8;for(var Te=144;Te<256;++Te)Pr[Te]=9;for(var Te=256;Te<280;++Te)Pr[Te]=7;for(var Te=280;Te<288;++Te)Pr[Te]=8;var M1=new qe(32);for(var Te=0;Te<32;++Te)M1[Te]=5;var Q4=cr(Pr,9,1),X4=cr(M1,5,1),ja=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},ut=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},qa=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},eu=function(e){return(e+7)/8|0},il=function(e,t,n){(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var r=new(e.BYTES_PER_ELEMENT==2?ln:e.BYTES_PER_ELEMENT==4?O1:qe)(n-t);return r.set(e.subarray(t,n)),r},tu=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],dt=function(e,t,n){var r=new Error(t||tu[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,dt),!n)throw r;return r},nu=function(e,t,n){var r=e.length;if(!r||n&&n.f&&!n.l)return t||new qe(0);var a=!t||n,o=!n||n.i;n||(n={}),t||(t=new qe(r*3));var l=function(Se){var k=t.length;if(Se>k){var F=new qe(Math.max(k*2,Se));F.set(t),t=F}},s=n.f||0,c=n.p||0,u=n.b||0,d=n.l,p=n.d,f=n.m,h=n.n,_=r*8;do{if(!d){s=ut(e,c,1);var A=ut(e,c+1,3);if(c+=3,A)if(A==1)d=Q4,p=X4,f=9,h=5;else if(A==2){var R=ut(e,c,31)+257,S=ut(e,c+10,15)+4,U=R+ut(e,c+5,31)+1;c+=14;for(var O=new qe(U),W=new qe(19),T=0;T>>4;if(x<16)O[T++]=x;else{var X=0,q=0;for(x==16?(q=3+ut(e,c,3),c+=2,X=O[T-1]):x==17?(q=3+ut(e,c,7),c+=3):x==18&&(q=11+ut(e,c,127),c+=7);q--;)O[T++]=X}}var ze=O.subarray(0,R),ne=O.subarray(R);f=ja(ze),h=ja(ne),d=cr(ze,f,1),p=cr(ne,h,1)}else dt(1);else{var x=eu(c)+4,g=e[x-4]|e[x-3]<<8,b=x+g;if(b>r){o&&dt(0);break}a&&l(u+g),t.set(e.subarray(x,b),u),n.b=u+=g,n.p=c=b*8,n.f=s;continue}if(c>_){o&&dt(0);break}}a&&l(u+131072);for(var ye=(1<>>4;if(c+=X&15,c>_){o&&dt(0);break}if(X||dt(2),He<256)t[u++]=He;else if(He==256){Je=c,d=null;break}else{var Ze=He-254;if(He>264){var T=He-257,Oe=I1[T];Ze=ut(e,c,(1<>>4;wt||dt(3),c+=wt&15;var ne=Z4[At];if(At>3){var Oe=R1[At];ne+=qa(e,c)&(1<_){o&&dt(0);break}a&&l(u+131072);for(var Xt=u+Ze;u>>4>7||(e[0]<<8|e[1])%31)&&dt(6,"invalid zlib data"),e[1]&32&&dt(6,"invalid zlib data: preset dictionaries not supported")};function ou(e,t){return nu((au(e),e.subarray(2,-4)),t)}var Es=typeof TextEncoder<"u"&&new TextEncoder,mo=typeof TextDecoder<"u"&&new TextDecoder,lu=0;try{mo.decode(ru,{stream:!0}),lu=1}catch{}var su=function(e){for(var t="",n=0;;){var r=e[n++],a=(r>127)+(r>223)+(r>239);if(n+a>e.length)return[t,il(e,n-1)];a?a==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):a&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function iu(e,t){if(t){for(var n=new qe(e.length),r=0;r>1)),l=0,s=function(d){o[l++]=d},r=0;ro.length){var c=new qe(l+8+(a-r<<1));c.set(o),o=c}var u=e.charCodeAt(r);u<128||t?s(u):u<2048?(s(192|u>>6),s(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|e.charCodeAt(++r)&1023,s(240|u>>18),s(128|u>>12&63),s(128|u>>6&63),s(128|u&63)):(s(224|u>>12),s(128|u>>6&63),s(128|u&63))}return il(o,0,l)}function cu(e,t){if(t){for(var n="",r=0;r{var r;return i("svg",{xmlns:"http://www.w3.org/2000/svg",class:["icon",`${e}-icon`],viewBox:"0 0 1024 1024",fill:t,"aria-label":`${e} icon`},(r=n.default)==null?void 0:r.call(n))};ae.displayName="IconBase";const Jt=({size:e=48,stroke:t=4,wrapper:n=!0,height:r=2*e})=>{const a=i("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,preserveAspectRatio:"xMidYMid",viewBox:"25 25 50 50"},[i("animateTransform",{attributeName:"transform",type:"rotate",dur:"2s",keyTimes:"0;1",repeatCount:"indefinite",values:"0;360"}),i("circle",{cx:"50",cy:"50",r:"20",fill:"none",stroke:"currentColor","stroke-width":t,"stroke-linecap":"round"},[i("animate",{attributeName:"stroke-dasharray",dur:"1.5s",keyTimes:"0;0.5;1",repeatCount:"indefinite",values:"1,200;90,200;1,200"}),i("animate",{attributeName:"stroke-dashoffset",dur:"1.5s",keyTimes:"0;0.5;1",repeatCount:"indefinite",values:"0;-35px;-125px"})])]);return n?i("div",{class:"loading-icon-wrapper",style:`display:flex;align-items:center;justify-content:center;height:${r}px`},a):a};Jt.displayName="LoadingIcon";const B1=(e,{slots:t})=>{var n;return(n=t.default)==null?void 0:n.call(t)},V1=()=>i(ae,{name:"github"},()=>i("path",{d:"M511.957 21.333C241.024 21.333 21.333 240.981 21.333 512c0 216.832 140.544 400.725 335.574 465.664 24.49 4.395 32.256-10.07 32.256-23.083 0-11.69.256-44.245 0-85.205-136.448 29.61-164.736-64.64-164.736-64.64-22.315-56.704-54.4-71.765-54.4-71.765-44.587-30.464 3.285-29.824 3.285-29.824 49.195 3.413 75.179 50.517 75.179 50.517 43.776 75.008 114.816 53.333 142.762 40.79 4.523-31.66 17.152-53.377 31.19-65.537-108.971-12.458-223.488-54.485-223.488-242.602 0-53.547 19.114-97.323 50.517-131.67-5.035-12.33-21.93-62.293 4.779-129.834 0 0 41.258-13.184 134.912 50.346a469.803 469.803 0 0 1 122.88-16.554c41.642.213 83.626 5.632 122.88 16.554 93.653-63.488 134.784-50.346 134.784-50.346 26.752 67.541 9.898 117.504 4.864 129.834 31.402 34.347 50.474 78.123 50.474 131.67 0 188.586-114.73 230.016-224.042 242.09 17.578 15.232 33.578 44.672 33.578 90.454v135.85c0 13.142 7.936 27.606 32.854 22.87C862.25 912.597 1002.667 728.747 1002.667 512c0-271.019-219.648-490.667-490.71-490.667z"}));V1.displayName="GitHubIcon";const F1=()=>i(ae,{name:"gitlab"},()=>i("path",{d:"M229.333 78.688C223.52 62 199.895 62 193.895 78.688L87.958 406.438h247.5c-.188 0-106.125-327.75-106.125-327.75zM33.77 571.438c-4.875 15 .563 31.687 13.313 41.25l464.812 345L87.77 406.438zm301.5-165 176.813 551.25 176.812-551.25zm655.125 165-54-165-424.312 551.25 464.812-345c12.938-9.563 18.188-26.25 13.5-41.25zM830.27 78.688c-5.812-16.688-29.437-16.688-35.437 0l-106.125 327.75h247.5z"}));F1.displayName="GitLabIcon";const H1=()=>i(ae,{name:"gitee"},()=>i("path",{d:"M512 992C246.92 992 32 777.08 32 512S246.92 32 512 32s480 214.92 480 480-214.92 480-480 480zm242.97-533.34H482.39a23.7 23.7 0 0 0-23.7 23.7l-.03 59.28c0 13.08 10.59 23.7 23.7 23.7h165.96a23.7 23.7 0 0 1 23.7 23.7v11.85a71.1 71.1 0 0 1-71.1 71.1H375.71a23.7 23.7 0 0 1-23.7-23.7V423.11a71.1 71.1 0 0 1 71.1-71.1h331.8a23.7 23.7 0 0 0 23.7-23.7l.06-59.25a23.73 23.73 0 0 0-23.7-23.73H423.11a177.78 177.78 0 0 0-177.78 177.75v331.83c0 13.08 10.62 23.7 23.7 23.7h349.62a159.99 159.99 0 0 0 159.99-159.99V482.33a23.7 23.7 0 0 0-23.7-23.7z"}));H1.displayName="GiteeIcon";const N1=()=>i(ae,{name:"bitbucket"},()=>i("path",{d:"M575.256 490.862c6.29 47.981-52.005 85.723-92.563 61.147-45.714-20.004-45.714-92.562-1.133-113.152 38.29-23.442 93.696 7.424 93.696 52.005zm63.451-11.996c-10.276-81.152-102.29-134.839-177.152-101.156-47.433 21.138-79.433 71.424-77.129 124.562 2.853 69.705 69.157 126.866 138.862 120.576S647.3 548.571 638.708 478.83zm136.558-309.723c-25.161-33.134-67.986-38.839-105.728-45.13-106.862-17.151-216.576-17.7-323.438 1.134-35.438 5.706-75.447 11.996-97.719 43.996 36.572 34.304 88.576 39.424 135.424 45.129 84.553 10.862 171.447 11.447 256 .585 47.433-5.705 99.987-10.276 135.424-45.714zm32.585 591.433c-16.018 55.99-6.839 131.438-66.304 163.986-102.29 56.576-226.304 62.867-338.87 42.862-59.43-10.862-129.135-29.696-161.72-85.723-14.3-54.858-23.442-110.848-32.585-166.84l3.438-9.142 10.276-5.157c170.277 112.567 408.576 112.567 579.438 0 26.844 8.01 6.84 40.558 6.29 60.014zm103.424-549.157c-19.42 125.148-41.728 249.71-63.415 374.272-6.29 36.572-41.728 57.162-71.424 72.558-106.862 53.724-231.424 62.866-348.562 50.286-79.433-8.558-160.585-29.696-225.134-79.433-30.28-23.443-30.28-63.415-35.986-97.134-20.005-117.138-42.862-234.277-57.161-352.585 6.839-51.42 64.585-73.728 107.447-89.71 57.16-21.138 118.272-30.866 178.87-36.571 129.134-12.58 261.157-8.01 386.304 28.562 44.581 13.13 92.563 31.415 122.844 69.705 13.714 17.7 9.143 40.01 6.29 60.014z"}));N1.displayName="BitbucketIcon";const j1=()=>i(ae,{name:"source"},()=>i("path",{d:"M601.92 475.2c0 76.428-8.91 83.754-28.512 99.594-14.652 11.88-43.956 14.058-78.012 16.434-18.81 1.386-40.392 2.97-62.172 6.534-18.612 2.97-36.432 9.306-53.064 17.424V299.772c37.818-21.978 63.36-62.766 63.36-109.692 0-69.894-56.826-126.72-126.72-126.72S190.08 120.186 190.08 190.08c0 46.926 25.542 87.714 63.36 109.692v414.216c-37.818 21.978-63.36 62.766-63.36 109.692 0 69.894 56.826 126.72 126.72 126.72s126.72-56.826 126.72-126.72c0-31.086-11.286-59.598-29.7-81.576 13.266-9.504 27.522-17.226 39.996-19.206 16.038-2.574 32.868-3.762 50.688-5.148 48.312-3.366 103.158-7.326 148.896-44.55 61.182-49.698 74.25-103.158 75.24-187.902V475.2h-126.72zM316.8 126.72c34.848 0 63.36 28.512 63.36 63.36s-28.512 63.36-63.36 63.36-63.36-28.512-63.36-63.36 28.512-63.36 63.36-63.36zm0 760.32c-34.848 0-63.36-28.512-63.36-63.36s28.512-63.36 63.36-63.36 63.36 28.512 63.36 63.36-28.512 63.36-63.36 63.36zM823.68 158.4h-95.04V63.36h-126.72v95.04h-95.04v126.72h95.04v95.04h126.72v-95.04h95.04z"}));j1.displayName="SourceIcon";const cl=Array.isArray,uu=e=>typeof e=="function",du=e=>typeof e=="string";var q1=e=>/^(https?:)?\/\//.test(e),ur=e=>Object.prototype.toString.call(e)==="[object Object]";const gt=(e,t)=>{const n=t?t._instance:Jn();return ur(n==null?void 0:n.appContext.components)&&(e in n.appContext.components||st(e)in n.appContext.components||xr(st(e))in n.appContext.components)};function pu(){const e=H(!1);return Jn()&&de(()=>{e.value=!0}),e}function fu(e){return pu(),w(()=>!!e())}const hu=()=>fu(()=>typeof window<"u"&&window.navigator&&"userAgent"in window.navigator),vu=()=>{const e=hu();return w(()=>e.value&&/\b(?:Android|iPhone)/i.test(navigator.userAgent))},zr=e=>{const t=kt();return w(()=>e[t.value])},ul=(e="")=>{if(e){if(typeof e=="number")return new Date(e);const t=Date.parse(e.toString());if(!Number.isNaN(t))return new Date(t)}return null},ka=(e,t)=>{let n=1;for(let r=0;r>6;return n+=n<<3,n^=n>>11,n%t},dn=e=>typeof e=="string",Hn=(e,t)=>dn(e)&&e.startsWith(t),En=(e,t)=>dn(e)&&e.endsWith(t),yn=Object.entries,mu=Object.fromEntries,Ke=Object.keys,ws=(e,...t)=>{if(t.length===0)return e;const n=t.shift()||null;return n&&yn(n).forEach(([r,a])=>{r==="__proto__"||r==="constructor"||(ur(e[r])&&ur(a)?ws(e[r],a):cl(a)?e[r]=[...a]:ur(a)?e[r]={...a}:e[r]=n[r])}),ws(e,...t)},As=e=>ur(e)&&dn(e.name),br=(e,t=!1)=>e?cl(e)?e.map(n=>dn(n)?{name:n}:As(n)?n:null).filter(n=>n!==null):dn(e)?[{name:e}]:As(e)?[e]:(console.error(`Expect "author" to be \`AuthorInfo[] | AuthorInfo | string[] | string ${t?"":"| false"} | undefined\`, but got`,e),[]):[],U1=(e,t)=>{if(e){if(cl(e)&&e.every(dn))return e;if(dn(e))return[e];console.error(`Expect ${t||"value"} to be \`string[] | string | undefined\`, but got`,e)}return[]},G1=e=>U1(e,"category"),W1=e=>U1(e,"tag"),La=e=>Hn(e,"/");let gu=class{constructor(){this.messageElements={};const t="message-container",n=document.getElementById(t);n?this.containerElement=n:(this.containerElement=document.createElement("div"),this.containerElement.id=t,document.body.appendChild(this.containerElement))}pop(t,n=2e3){const r=document.createElement("div"),a=Date.now();return r.className="message move-in",r.innerHTML=t,this.containerElement.appendChild(r),this.messageElements[a]=r,n>0&&setTimeout(()=>{this.close(a)},n),a}close(t){if(t){const n=this.messageElements[t];n.classList.remove("move-in"),n.classList.add("move-out"),n.addEventListener("animationend",()=>{n.remove(),delete this.messageElements[t]})}else Ke(this.messageElements).forEach(n=>this.close(Number(n)))}destroy(){document.body.removeChild(this.containerElement)}};const K1=/#.*$/u,yu=e=>{const t=K1.exec(e);return t?t[0]:""},xs=e=>decodeURI(e).replace(K1,"").replace(/(index)?\.(md|html)$/,""),dl=(e,t)=>{if(t===void 0)return!1;const n=xs(e.path),r=xs(t),a=yu(t);return a?a===e.hash&&(!r||n===r):n===r},pn=e=>{const t=atob(e);return cu(ou(iu(t,!0)))},_u=e=>q1(e)?e:`https://github.com/${e}`,Y1=e=>!q1(e)||/github\.com/.test(e)?"GitHub":/bitbucket\.org/.test(e)?"Bitbucket":/gitlab\.com/.test(e)?"GitLab":/gitee\.com/.test(e)?"Gitee":null,Or=(e,...t)=>{const n=e.resolve(...t),r=n.matched[n.matched.length-1];if(!(r!=null&&r.redirect))return n;const{redirect:a}=r,o=uu(a)?a(n):a,l=du(o)?{path:o}:o;return Or(e,{hash:n.hash,query:n.query,params:n.params,...l})};function Zt(e){return Ai()?(l0(e),!0):!1}function it(e){return typeof e=="function"?e():cn(e)}const Ir=typeof window<"u",fn=()=>{},go=bu();function bu(){var e;return Ir&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent)}function pl(e,t){function n(...r){return new Promise((a,o)=>{Promise.resolve(e(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})).then(a).catch(o)})}return n}const J1=e=>e();function Eu(e,t={}){let n,r,a=fn;const o=s=>{clearTimeout(s),a(),a=fn};return s=>{const c=it(e),u=it(t.maxWait);return n&&o(n),c<=0||u!==void 0&&u<=0?(r&&(o(r),r=null),Promise.resolve(s())):new Promise((d,p)=>{a=t.rejectOnCancel?p:d,u&&!r&&(r=setTimeout(()=>{n&&o(n),r=null,d(s())},u)),n=setTimeout(()=>{r&&o(r),r=null,d(s())},c)})}}function wu(e,t=!0,n=!0,r=!1){let a=0,o,l=!0,s=fn,c;const u=()=>{o&&(clearTimeout(o),o=void 0,s(),s=fn)};return p=>{const f=it(e),h=Date.now()-a,_=()=>c=p();return u(),f<=0?(a=Date.now(),_()):(h>f&&(n||!l)?(a=Date.now(),_()):t&&(c=new Promise((A,x)=>{s=r?x:A,o=setTimeout(()=>{a=Date.now(),l=!0,A(_()),u()},Math.max(0,f-h))})),!n&&!o&&(o=setTimeout(()=>l=!0,f)),l=!1,c)}}function Au(e=J1){const t=H(!0);function n(){t.value=!1}function r(){t.value=!0}const a=(...o)=>{t.value&&e(...o)};return{isActive:vn(t),pause:n,resume:r,eventFilter:a}}function Z1(...e){if(e.length!==1)return Kn(...e);const t=e[0];return typeof t=="function"?vn(B0(()=>({get:t,set:fn}))):H(t)}function Q1(e,t=200,n={}){return pl(Eu(t,n),e)}function xu(e,t=200,n=!1,r=!0,a=!1){return pl(wu(t,n,r,a),e)}function X1(e,t=!0){Jn()?de(e):t?e():mn(e)}function Cu(e,t,n={}){const{immediate:r=!0}=n,a=H(!1);let o=null;function l(){o&&(clearTimeout(o),o=null)}function s(){a.value=!1,l()}function c(...u){l(),a.value=!0,o=setTimeout(()=>{a.value=!1,o=null,e(...u)},it(t))}return r&&(a.value=!0,Ir&&c()),Zt(s),{isPending:vn(a),start:c,stop:s}}function yo(e=!1,t={}){const{truthyValue:n=!0,falsyValue:r=!1}=t,a=$e(e),o=H(e);function l(s){if(arguments.length)return o.value=s,o.value;{const c=it(n);return o.value=o.value===c?it(r):c,o.value}}return a?l:[o,l]}var Cs=Object.getOwnPropertySymbols,Tu=Object.prototype.hasOwnProperty,ku=Object.prototype.propertyIsEnumerable,Lu=(e,t)=>{var n={};for(var r in e)Tu.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Cs)for(var r of Cs(e))t.indexOf(r)<0&&ku.call(e,r)&&(n[r]=e[r]);return n};function Pu(e,t,n={}){const r=n,{eventFilter:a=J1}=r,o=Lu(r,["eventFilter"]);return se(e,pl(a,t),o)}var zu=Object.defineProperty,Ou=Object.defineProperties,Iu=Object.getOwnPropertyDescriptors,ha=Object.getOwnPropertySymbols,e2=Object.prototype.hasOwnProperty,t2=Object.prototype.propertyIsEnumerable,Ts=(e,t,n)=>t in e?zu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ru=(e,t)=>{for(var n in t||(t={}))e2.call(t,n)&&Ts(e,n,t[n]);if(ha)for(var n of ha(t))t2.call(t,n)&&Ts(e,n,t[n]);return e},Su=(e,t)=>Ou(e,Iu(t)),Du=(e,t)=>{var n={};for(var r in e)e2.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ha)for(var r of ha(e))t.indexOf(r)<0&&t2.call(e,r)&&(n[r]=e[r]);return n};function $u(e,t,n={}){const r=n,{eventFilter:a}=r,o=Du(r,["eventFilter"]),{eventFilter:l,pause:s,resume:c,isActive:u}=Au(a);return{stop:Pu(e,t,Su(Ru({},o),{eventFilter:l})),pause:s,resume:c,isActive:u}}function et(e){var t;const n=it(e);return(t=n==null?void 0:n.$el)!=null?t:n}const yt=Ir?window:void 0,n2=Ir?window.document:void 0,Mu=Ir?window.navigator:void 0;function Me(...e){let t,n,r,a;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,r,a]=e,t=yt):[t,n,r,a]=e,!t)return fn;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],l=()=>{o.forEach(d=>d()),o.length=0},s=(d,p,f,h)=>(d.addEventListener(p,f,h),()=>d.removeEventListener(p,f,h)),c=se(()=>[et(t),it(a)],([d,p])=>{l(),d&&o.push(...n.flatMap(f=>r.map(h=>s(d,f,h,p))))},{immediate:!0,flush:"post"}),u=()=>{c(),l()};return Zt(u),u}let ks=!1;function Bu(e,t,n={}){const{window:r=yt,ignore:a=[],capture:o=!0,detectIframe:l=!1}=n;if(!r)return;go&&!ks&&(ks=!0,Array.from(r.document.body.children).forEach(f=>f.addEventListener("click",fn)));let s=!0;const c=f=>a.some(h=>{if(typeof h=="string")return Array.from(r.document.querySelectorAll(h)).some(_=>_===f.target||f.composedPath().includes(_));{const _=et(h);return _&&(f.target===_||f.composedPath().includes(_))}}),d=[Me(r,"click",f=>{const h=et(e);if(!(!h||h===f.target||f.composedPath().includes(h))){if(f.detail===0&&(s=!c(f)),!s){s=!0;return}t(f)}},{passive:!0,capture:o}),Me(r,"pointerdown",f=>{const h=et(e);h&&(s=!f.composedPath().includes(h)&&!c(f))},{passive:!0}),l&&Me(r,"blur",f=>{var h;const _=et(e);((h=r.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!(_!=null&&_.contains(r.document.activeElement))&&t(f)})].filter(Boolean);return()=>d.forEach(f=>f())}function Vu(){const e=H(!1);return Jn()&&de(()=>{e.value=!0}),e}function Rr(e){const t=Vu();return w(()=>(t.value,!!e()))}function r2(e,t={}){const{window:n=yt}=t,r=Rr(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let a;const o=H(!1),l=()=>{a&&("removeEventListener"in a?a.removeEventListener("change",s):a.removeListener(s))},s=()=>{r.value&&(l(),a=n.matchMedia(Z1(e).value),o.value=!!(a!=null&&a.matches),a&&("addEventListener"in a?a.addEventListener("change",s):a.addListener(s)))};return n3(s),Zt(()=>l()),o}function Fu(e={}){const{navigator:t=Mu,read:n=!1,source:r,copiedDuring:a=1500,legacy:o=!1}=e,l=["copy","cut"],s=Rr(()=>t&&"clipboard"in t),c=w(()=>s.value||o),u=H(""),d=H(!1),p=Cu(()=>d.value=!1,a);function f(){s.value?t.clipboard.readText().then(x=>{u.value=x}):u.value=A()}if(c.value&&n)for(const x of l)Me(x,f);async function h(x=it(r)){c.value&&x!=null&&(s.value?await t.clipboard.writeText(x):_(x),u.value=x,d.value=!0,p.start())}function _(x){const g=document.createElement("textarea");g.value=x??"",g.style.position="absolute",g.style.opacity="0",document.body.appendChild(g),g.select(),document.execCommand("copy"),g.remove()}function A(){var x,g,b;return(b=(g=(x=document==null?void 0:document.getSelection)==null?void 0:x.call(document))==null?void 0:g.toString())!=null?b:""}return{isSupported:c,text:u,copied:d,copy:h}}const Yr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Jr="__vueuse_ssr_handlers__",Hu=Nu();function Nu(){return Jr in Yr||(Yr[Jr]=Yr[Jr]||{}),Yr[Jr]}function ju(e,t){return Hu[e]||t}function qu(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}var Uu=Object.defineProperty,Ls=Object.getOwnPropertySymbols,Gu=Object.prototype.hasOwnProperty,Wu=Object.prototype.propertyIsEnumerable,Ps=(e,t,n)=>t in e?Uu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zs=(e,t)=>{for(var n in t||(t={}))Gu.call(t,n)&&Ps(e,n,t[n]);if(Ls)for(var n of Ls(t))Wu.call(t,n)&&Ps(e,n,t[n]);return e};const Ku={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},Os="vueuse-storage";function Zn(e,t,n,r={}){var a;const{flush:o="pre",deep:l=!0,listenToStorageChanges:s=!0,writeDefaults:c=!0,mergeDefaults:u=!1,shallow:d,window:p=yt,eventFilter:f,onError:h=T=>{console.error(T)}}=r,_=(d?Pe:H)(t);if(!n)try{n=ju("getDefaultStorage",()=>{var T;return(T=yt)==null?void 0:T.localStorage})()}catch(T){h(T)}if(!n)return _;const A=it(t),x=qu(A),g=(a=r.serializer)!=null?a:Ku[x],{pause:b,resume:R}=$u(_,()=>S(_.value),{flush:o,deep:l,eventFilter:f});return p&&s&&(Me(p,"storage",W),Me(p,Os,O)),W(),_;function S(T){try{if(T==null)n.removeItem(e);else{const j=g.write(T),Y=n.getItem(e);Y!==j&&(n.setItem(e,j),p&&p.dispatchEvent(new CustomEvent(Os,{detail:{key:e,oldValue:Y,newValue:j,storageArea:n}})))}}catch(j){h(j)}}function U(T){const j=T?T.newValue:n.getItem(e);if(j==null)return c&&A!==null&&n.setItem(e,g.write(A)),A;if(!T&&u){const Y=g.read(j);return typeof u=="function"?u(Y,A):x==="object"&&!Array.isArray(Y)?zs(zs({},A),Y):Y}else return typeof j!="string"?j:g.read(j)}function O(T){W(T.detail)}function W(T){if(!(T&&T.storageArea!==n)){if(T&&T.key==null){_.value=A;return}if(!(T&&T.key!==e)){b();try{_.value=U(T)}catch(j){h(j)}finally{T?mn(R):R()}}}}}function Yu(e){return r2("(prefers-color-scheme: dark)",e)}var Is=Object.getOwnPropertySymbols,Ju=Object.prototype.hasOwnProperty,Zu=Object.prototype.propertyIsEnumerable,Qu=(e,t)=>{var n={};for(var r in e)Ju.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Is)for(var r of Is(e))t.indexOf(r)<0&&Zu.call(e,r)&&(n[r]=e[r]);return n};function Xu(e,t,n={}){const r=n,{window:a=yt}=r,o=Qu(r,["window"]);let l;const s=Rr(()=>a&&"MutationObserver"in a),c=()=>{l&&(l.disconnect(),l=void 0)},u=se(()=>et(e),p=>{c(),s.value&&a&&p&&(l=new MutationObserver(t),l.observe(p,o))},{immediate:!0}),d=()=>{c(),u()};return Zt(d),{isSupported:s,stop:d}}var Rs=Object.getOwnPropertySymbols,e6=Object.prototype.hasOwnProperty,t6=Object.prototype.propertyIsEnumerable,n6=(e,t)=>{var n={};for(var r in e)e6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Rs)for(var r of Rs(e))t.indexOf(r)<0&&t6.call(e,r)&&(n[r]=e[r]);return n};function r6(e,t,n={}){const r=n,{window:a=yt}=r,o=n6(r,["window"]);let l;const s=Rr(()=>a&&"ResizeObserver"in a),c=()=>{l&&(l.disconnect(),l=void 0)},u=w(()=>Array.isArray(e)?e.map(f=>et(f)):[et(e)]),d=se(u,f=>{if(c(),s.value&&a){l=new ResizeObserver(t);for(const h of f)h&&l.observe(h,o)}},{immediate:!0,flush:"post",deep:!0}),p=()=>{c(),d()};return Zt(p),{isSupported:s,stop:p}}function a6(e,t={width:0,height:0},n={}){const{window:r=yt,box:a="content-box"}=n,o=w(()=>{var c,u;return(u=(c=et(e))==null?void 0:c.namespaceURI)==null?void 0:u.includes("svg")}),l=H(t.width),s=H(t.height);return r6(e,([c])=>{const u=a==="border-box"?c.borderBoxSize:a==="content-box"?c.contentBoxSize:c.devicePixelContentBoxSize;if(r&&o.value){const d=et(e);if(d){const p=r.getComputedStyle(d);l.value=parseFloat(p.width),s.value=parseFloat(p.height)}}else if(u){const d=Array.isArray(u)?u:[u];l.value=d.reduce((p,{inlineSize:f})=>p+f,0),s.value=d.reduce((p,{blockSize:f})=>p+f,0)}else l.value=c.contentRect.width,s.value=c.contentRect.height},n),se(()=>et(e),c=>{l.value=c?t.width:0,s.value=c?t.height:0}),{width:l,height:s}}const Ss=["fullscreenchange","webkitfullscreenchange","webkitendfullscreen","mozfullscreenchange","MSFullscreenChange"];function fl(e,t={}){const{document:n=n2,autoExit:r=!1}=t,a=w(()=>{var g;return(g=et(e))!=null?g:n==null?void 0:n.querySelector("html")}),o=H(!1),l=w(()=>["requestFullscreen","webkitRequestFullscreen","webkitEnterFullscreen","webkitEnterFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"].find(g=>n&&g in n||a.value&&g in a.value)),s=w(()=>["exitFullscreen","webkitExitFullscreen","webkitExitFullScreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"].find(g=>n&&g in n||a.value&&g in a.value)),c=w(()=>["fullScreen","webkitIsFullScreen","webkitDisplayingFullscreen","mozFullScreen","msFullscreenElement"].find(g=>n&&g in n||a.value&&g in a.value)),u=["fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement"].find(g=>n&&g in n),d=Rr(()=>a.value&&n&&l.value!==void 0&&s.value!==void 0&&c.value!==void 0),p=()=>u?(n==null?void 0:n[u])===a.value:!1,f=()=>{if(c.value){if(n&&n[c.value]!=null)return n[c.value];{const g=a.value;if((g==null?void 0:g[c.value])!=null)return!!g[c.value]}}return!1};async function h(){if(d.value){if(s.value)if((n==null?void 0:n[s.value])!=null)await n[s.value]();else{const g=a.value;(g==null?void 0:g[s.value])!=null&&await g[s.value]()}o.value=!1}}async function _(){if(!d.value)return;f()&&await h();const g=a.value;l.value&&(g==null?void 0:g[l.value])!=null&&(await g[l.value](),o.value=!0)}async function A(){await(o.value?h():_())}const x=()=>{const g=f();(!g||g&&p())&&(o.value=g)};return Me(n,Ss,x,!1),Me(()=>et(a),Ss,x,!1),r&&Zt(h),{isSupported:d,isFullscreen:o,enter:_,exit:h,toggle:A}}function a2(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientHeight1?!0:(t.preventDefault&&t.preventDefault(),!1)}function o2(e,t=!1){const n=H(t);let r=null,a;se(Z1(e),s=>{if(s){const c=s;a=c.style.overflow,n.value&&(c.style.overflow="hidden")}},{immediate:!0});const o=()=>{const s=it(e);!s||n.value||(go&&(r=Me(s,"touchmove",c=>{o6(c)},{passive:!1})),s.style.overflow="hidden",n.value=!0)},l=()=>{const s=it(e);!s||!n.value||(go&&(r==null||r()),s.style.overflow=a,n.value=!1)};return Zt(l),w({get(){return n.value},set(s){s?o():l()}})}function l2(e,t,n={}){const{window:r=yt}=n;return Zn(e,t,r==null?void 0:r.sessionStorage,n)}let l6=0;function s6(e,t={}){const n=H(!1),{document:r=n2,immediate:a=!0,manual:o=!1,id:l=`vueuse_styletag_${++l6}`}=t,s=H(e);let c=()=>{};const u=()=>{if(!r)return;const p=r.getElementById(l)||r.createElement("style");p.isConnected||(p.type="text/css",p.id=l,t.media&&(p.media=t.media),r.head.appendChild(p)),!n.value&&(c=se(s,f=>{p.textContent=f},{immediate:!0}),n.value=!0)},d=()=>{!r||!n.value||(c(),r.head.removeChild(r.getElementById(l)),n.value=!1)};return a&&!o&&X1(u),o||Zt(d),{id:l,css:s,unload:d,load:u,isLoaded:vn(n)}}function i6({window:e=yt}={}){if(!e)return{x:H(0),y:H(0)};const t=H(e.scrollX),n=H(e.scrollY);return Me(e,"scroll",()=>{t.value=e.scrollX,n.value=e.scrollY},{capture:!1,passive:!0}),{x:t,y:n}}function c6(e={}){const{window:t=yt,initialWidth:n=1/0,initialHeight:r=1/0,listenOrientation:a=!0,includeScrollbar:o=!0}=e,l=H(n),s=H(r),c=()=>{t&&(o?(l.value=t.innerWidth,s.value=t.innerHeight):(l.value=t.document.documentElement.clientWidth,s.value=t.document.documentElement.clientHeight))};if(c(),X1(c),Me("resize",c,{passive:!0}),a){const u=r2("(orientation: portrait)");se(u,()=>c())}return{width:l,height:s}}const s2=({type:e="info",text:t="",vertical:n="top",color:r},{slots:a})=>{var o;return i("span",{class:["badge",e,{diy:r}],style:{verticalAlign:n,...r?{backgroundColor:r}:{}}},((o=a.default)==null?void 0:o.call(a))||t)};s2.displayName="Badge";var u6=D({name:"FontIcon",props:{icon:{type:String,default:""},color:{type:String,default:""},size:{type:[String,Number],default:""}},setup(e){const t=w(()=>{const r=["font-icon icon"],a=`iconfont icon-${e.icon}`;return r.push(a),r}),n=w(()=>{const r={};return e.color&&(r.color=e.color),e.size&&(r["font-size"]=Number.isNaN(Number(e.size))?e.size:`${e.size}px`),Ke(r).length?r:null});return()=>e.icon?i("span",{key:e.icon,class:t.value,style:n.value}):null}});const i2=()=>i(ae,{name:"back-to-top"},()=>[i("path",{d:"M512 843.2c-36.2 0-66.4-13.6-85.8-21.8-10.8-4.6-22.6 3.6-21.8 15.2l7 102c.4 6.2 7.6 9.4 12.6 5.6l29-22c3.6-2.8 9-1.8 11.4 2l41 64.2c3 4.8 10.2 4.8 13.2 0l41-64.2c2.4-3.8 7.8-4.8 11.4-2l29 22c5 3.8 12.2.6 12.6-5.6l7-102c.8-11.6-11-20-21.8-15.2-19.6 8.2-49.6 21.8-85.8 21.8z"}),i("path",{d:"m795.4 586.2-96-98.2C699.4 172 513 32 513 32S324.8 172 324.8 488l-96 98.2c-3.6 3.6-5.2 9-4.4 14.2L261.2 824c1.8 11.4 14.2 17 23.6 10.8L419 744s41.4 40 94.2 40c52.8 0 92.2-40 92.2-40l134.2 90.8c9.2 6.2 21.6.6 23.6-10.8l37-223.8c.4-5.2-1.2-10.4-4.8-14zM513 384c-34 0-61.4-28.6-61.4-64s27.6-64 61.4-64c34 0 61.4 28.6 61.4 64S547 384 513 384z"})]);i2.displayName="BackToTopIcon";var d6=D({name:"BackToTop",props:{threshold:{type:Number,default:100},noProgress:Boolean},setup(e){const t=be(),n=zr({"/zh/":{backToTop:"返回顶部"},"/":{backToTop:"Back to top"}}),r=Pe(),{height:a}=a6(r),{height:o}=c6(),{y:l}=i6(),s=w(()=>t.value.backToTop!==!1&&l.value>e.threshold),c=w(()=>l.value/(a.value-o.value));return de(()=>{r.value=document.body}),()=>i(Yt,{name:"fade"},()=>s.value?i("button",{type:"button",class:"back-to-top","aria-label":n.value.backToTop,"data-balloon-pos":"left",onClick:()=>{window.scrollTo({top:0,behavior:"smooth"})}},[e.noProgress?null:i("svg",{class:"scroll-progress"},i("circle",{cx:"50%",cy:"50%",style:{"stroke-dasharray":`calc(${Math.PI*c.value*100}% - ${4*Math.PI}px) calc(${Math.PI*100}% - ${4*Math.PI}px)`}})),i(i2)]):null)}});const p6=bt({enhance:({app:e})=>{gt("Badge")||e.component("Badge",s2),gt("FontIcon")||e.component("FontIcon",u6)},setup:()=>{s6(` @import url("https://at.alicdn.com/t/c/font_2410206_5vb9zlyghj.css"); + `)},rootComponents:[()=>i(d6,{})]});function f6(e,t,n){var r,a,o;t===void 0&&(t=50),n===void 0&&(n={});var l=(r=n.isImmediate)!=null&&r,s=(a=n.callback)!=null&&a,c=n.maxWait,u=Date.now(),d=[];function p(){if(c!==void 0){var h=Date.now()-u;if(h+t>=c)return c-h}return t}var f=function(){var h=[].slice.call(arguments),_=this;return new Promise(function(A,x){var g=l&&o===void 0;if(o!==void 0&&clearTimeout(o),o=setTimeout(function(){if(o=void 0,u=Date.now(),!l){var R=e.apply(_,h);s&&s(R),d.forEach(function(S){return(0,S.resolve)(R)}),d=[]}},p()),g){var b=e.apply(_,h);return s&&s(b),A(b)}d.push({resolve:A,reject:x})})};return f.cancel=function(h){o!==void 0&&clearTimeout(o),d.forEach(function(_){return(0,_.reject)(h)}),d=[]},f}/*! * vue-router v4.2.0 * (c) 2023 Eduardo San Martin Morote * @license MIT - */const Cn=typeof window<"u";function h6(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const _e=Object.assign;function Ua(e,t){const n={};for(const r in t){const a=t[r];n[r]=_t(a)?a.map(e):e(a)}return n}const dr=()=>{},_t=Array.isArray,v6=/\/$/,m6=e=>e.replace(v6,"");function Ga(e,t,n="/"){let r,a={},o="",l="";const s=t.indexOf("#");let c=t.indexOf("?");return s=0&&(c=-1),c>-1&&(r=t.slice(0,c),o=t.slice(c+1,s>-1?s:t.length),a=e(o)),s>-1&&(r=r||t.slice(0,s),l=t.slice(s,t.length)),r=b6(r??t,n),{fullPath:r+(o&&"?")+o+l,path:r,query:a,hash:l}}function g6(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Ds(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function y6(e,t,n){const r=t.matched.length-1,a=n.matched.length-1;return r>-1&&r===a&&Nn(t.matched[r],n.matched[a])&&c2(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Nn(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function c2(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!_6(e[n],t[n]))return!1;return!0}function _6(e,t){return _t(e)?$s(e,t):_t(t)?$s(t,e):e===t}function $s(e,t){return _t(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function b6(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),a=r[r.length-1];(a===".."||a===".")&&r.push("");let o=n.length-1,l,s;for(l=0;l1&&o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(l-(l===r.length?1:0)).join("/")}var Er;(function(e){e.pop="pop",e.push="push"})(Er||(Er={}));var pr;(function(e){e.back="back",e.forward="forward",e.unknown=""})(pr||(pr={}));function E6(e){if(!e)if(Cn){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),m6(e)}const w6=/^[^#]+#/;function A6(e,t){return e.replace(w6,"#")+t}function x6(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const Pa=()=>({left:window.pageXOffset,top:window.pageYOffset});function C6(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),a=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!a)return;t=x6(a,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function Ms(e,t){return(history.state?history.state.position-t:-1)+e}const _o=new Map;function T6(e,t){_o.set(e,t)}function k6(e){const t=_o.get(e);return _o.delete(e),t}let L6=()=>location.protocol+"//"+location.host;function u2(e,t){const{pathname:n,search:r,hash:a}=t,o=e.indexOf("#");if(o>-1){let s=a.includes(e.slice(o))?e.slice(o).length:1,c=a.slice(s);return c[0]!=="/"&&(c="/"+c),Ds(c,"")}return Ds(n,e)+r+a}function P6(e,t,n,r){let a=[],o=[],l=null;const s=({state:f})=>{const h=u2(e,location),_=n.value,A=t.value;let x=0;if(f){if(n.value=h,t.value=f,l&&l===_){l=null;return}x=A?f.position-A.position:0}else r(h);a.forEach(g=>{g(n.value,_,{delta:x,type:Er.pop,direction:x?x>0?pr.forward:pr.back:pr.unknown})})};function c(){l=n.value}function u(f){a.push(f);const h=()=>{const _=a.indexOf(f);_>-1&&a.splice(_,1)};return o.push(h),h}function d(){const{history:f}=window;f.state&&f.replaceState(_e({},f.state,{scroll:Pa()}),"")}function p(){for(const f of o)f();o=[],window.removeEventListener("popstate",s),window.removeEventListener("beforeunload",d)}return window.addEventListener("popstate",s),window.addEventListener("beforeunload",d,{passive:!0}),{pauseListeners:c,listen:u,destroy:p}}function Bs(e,t,n,r=!1,a=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:a?Pa():null}}function z6(e){const{history:t,location:n}=window,r={value:u2(e,n)},a={value:t.state};a.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(c,u,d){const p=e.indexOf("#"),f=p>-1?(n.host&&document.querySelector("base")?e:e.slice(p))+c:L6()+e+c;try{t[d?"replaceState":"pushState"](u,"",f),a.value=u}catch(h){console.error(h),n[d?"replace":"assign"](f)}}function l(c,u){const d=_e({},t.state,Bs(a.value.back,c,a.value.forward,!0),u,{position:a.value.position});o(c,d,!0),r.value=c}function s(c,u){const d=_e({},a.value,t.state,{forward:c,scroll:Pa()});o(d.current,d,!0);const p=_e({},Bs(r.value,c,null),{position:d.position+1},u);o(c,p,!1),r.value=c}return{location:r,state:a,push:s,replace:l}}function O6(e){e=E6(e);const t=z6(e),n=P6(e,t.state,t.location,t.replace);function r(o,l=!0){l||n.pauseListeners(),history.go(o)}const a=_e({location:"",base:e,go:r,createHref:A6.bind(null,e)},t,n);return Object.defineProperty(a,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(a,"state",{enumerable:!0,get:()=>t.state.value}),a}function I6(e){return typeof e=="string"||e&&typeof e=="object"}function d2(e){return typeof e=="string"||typeof e=="symbol"}const Ot={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},p2=Symbol("");var Vs;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(Vs||(Vs={}));function jn(e,t){return _e(new Error,{type:e,[p2]:!0},t)}function Lt(e,t){return e instanceof Error&&p2 in e&&(t==null||!!(e.type&t))}const Fs="[^/]+?",S6={sensitive:!1,strict:!1,start:!0,end:!0},R6=/[.+*?^${}()[\]/\\]/g;function D6(e,t){const n=_e({},S6,t),r=[];let a=n.start?"^":"";const o=[];for(const u of e){const d=u.length?[]:[90];n.strict&&!u.length&&(a+="/");for(let p=0;pt.length?t.length===1&&t[0]===40+40?1:-1:0}function M6(e,t){let n=0;const r=e.score,a=t.score;for(;n0&&t[t.length-1]<0}const B6={type:0,value:""},V6=/[a-zA-Z0-9_]/;function F6(e){if(!e)return[[]];if(e==="/")return[[B6]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(h){throw new Error(`ERR (${n})/"${u}": ${h}`)}let n=0,r=n;const a=[];let o;function l(){o&&a.push(o),o=[]}let s=0,c,u="",d="";function p(){u&&(n===0?o.push({type:0,value:u}):n===1||n===2||n===3?(o.length>1&&(c==="*"||c==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),o.push({type:1,value:u,regexp:d,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):t("Invalid state to consume buffer"),u="")}function f(){u+=c}for(;s{l(b)}:dr}function l(d){if(d2(d)){const p=r.get(d);p&&(r.delete(d),n.splice(n.indexOf(p),1),p.children.forEach(l),p.alias.forEach(l))}else{const p=n.indexOf(d);p>-1&&(n.splice(p,1),d.record.name&&r.delete(d.record.name),d.children.forEach(l),d.alias.forEach(l))}}function s(){return n}function c(d){let p=0;for(;p=0&&(d.record.path!==n[p].record.path||!f2(d,n[p]));)p++;n.splice(p,0,d),d.record.name&&!js(d)&&r.set(d.record.name,d)}function u(d,p){let f,h={},_,A;if("name"in d&&d.name){if(f=r.get(d.name),!f)throw jn(1,{location:d});A=f.record.name,h=_e(Ns(p.params,f.keys.filter(b=>!b.optional).map(b=>b.name)),d.params&&Ns(d.params,f.keys.map(b=>b.name))),_=f.stringify(h)}else if("path"in d)_=d.path,f=n.find(b=>b.re.test(_)),f&&(h=f.parse(_),A=f.record.name);else{if(f=p.name?r.get(p.name):n.find(b=>b.re.test(p.path)),!f)throw jn(1,{location:d,currentLocation:p});A=f.record.name,h=_e({},p.params,d.params),_=f.stringify(h)}const x=[];let g=f;for(;g;)x.unshift(g.record),g=g.parent;return{name:A,path:_,params:h,matched:x,meta:U6(x)}}return e.forEach(d=>o(d)),{addRoute:o,resolve:u,removeRoute:l,getRoutes:s,getRecordMatcher:a}}function Ns(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function j6(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:q6(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function q6(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="boolean"?n:n[r];return t}function js(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function U6(e){return e.reduce((t,n)=>_e(t,n.meta),{})}function qs(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}function f2(e,t){return t.children.some(n=>n===e||f2(e,n))}const h2=/#/g,G6=/&/g,W6=/\//g,K6=/=/g,J6=/\?/g,v2=/\+/g,Y6=/%5B/g,Z6=/%5D/g,m2=/%5E/g,Q6=/%60/g,g2=/%7B/g,X6=/%7C/g,y2=/%7D/g,e8=/%20/g;function hl(e){return encodeURI(""+e).replace(X6,"|").replace(Y6,"[").replace(Z6,"]")}function t8(e){return hl(e).replace(g2,"{").replace(y2,"}").replace(m2,"^")}function bo(e){return hl(e).replace(v2,"%2B").replace(e8,"+").replace(h2,"%23").replace(G6,"%26").replace(Q6,"`").replace(g2,"{").replace(y2,"}").replace(m2,"^")}function n8(e){return bo(e).replace(K6,"%3D")}function r8(e){return hl(e).replace(h2,"%23").replace(J6,"%3F")}function a8(e){return e==null?"":r8(e).replace(W6,"%2F")}function va(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function o8(e){const t={};if(e===""||e==="?")return t;const r=(e[0]==="?"?e.slice(1):e).split("&");for(let a=0;ao&&bo(o)):[r&&bo(r)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function l8(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=_t(r)?r.map(a=>a==null?null:""+a):r==null?r:""+r)}return t}const s8=Symbol(""),Gs=Symbol(""),za=Symbol(""),vl=Symbol(""),Eo=Symbol("");function nr(){let e=[];function t(r){return e.push(r),()=>{const a=e.indexOf(r);a>-1&&e.splice(a,1)}}function n(){e=[]}return{add:t,list:()=>e,reset:n}}function qt(e,t,n,r,a){const o=r&&(r.enterCallbacks[a]=r.enterCallbacks[a]||[]);return()=>new Promise((l,s)=>{const c=p=>{p===!1?s(jn(4,{from:n,to:t})):p instanceof Error?s(p):I6(p)?s(jn(2,{from:t,to:p})):(o&&r.enterCallbacks[a]===o&&typeof p=="function"&&o.push(p),l())},u=e.call(r&&r.instances[a],t,n,c);let d=Promise.resolve(u);e.length<3&&(d=d.then(c)),d.catch(p=>s(p))})}function Wa(e,t,n,r){const a=[];for(const o of e)for(const l in o.components){let s=o.components[l];if(!(t!=="beforeRouteEnter"&&!o.instances[l]))if(i8(s)){const u=(s.__vccOpts||s)[t];u&&a.push(qt(u,n,r,o,l))}else{let c=s();a.push(()=>c.then(u=>{if(!u)return Promise.reject(new Error(`Couldn't resolve component "${l}" at "${o.path}"`));const d=h6(u)?u.default:u;o.components[l]=d;const f=(d.__vccOpts||d)[t];return f&&qt(f,n,r,o,l)()}))}}return a}function i8(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function wo(e){const t=ue(za),n=ue(vl),r=w(()=>t.resolve(cn(e.to))),a=w(()=>{const{matched:c}=r.value,{length:u}=c,d=c[u-1],p=n.matched;if(!d||!p.length)return-1;const f=p.findIndex(Nn.bind(null,d));if(f>-1)return f;const h=Ws(c[u-2]);return u>1&&Ws(d)===h&&p[p.length-1].path!==h?p.findIndex(Nn.bind(null,c[u-2])):f}),o=w(()=>a.value>-1&&d8(n.params,r.value.params)),l=w(()=>a.value>-1&&a.value===n.matched.length-1&&c2(n.params,r.value.params));function s(c={}){return u8(c)?t[cn(e.replace)?"replace":"push"](cn(e.to)).catch(dr):Promise.resolve()}return{route:r,href:w(()=>r.value.href),isActive:o,isExactActive:l,navigate:s}}const c8=D({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:wo,setup(e,{slots:t}){const n=Wn(wo(e)),{options:r}=ue(za),a=w(()=>({[Ks(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Ks(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&t.default(n);return e.custom?o:i("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:a.value},o)}}}),Se=c8;function u8(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function d8(e,t){for(const n in t){const r=t[n],a=e[n];if(typeof r=="string"){if(r!==a)return!1}else if(!_t(a)||a.length!==r.length||r.some((o,l)=>o!==a[l]))return!1}return!0}function Ws(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Ks=(e,t,n)=>e??t??n,p8=D({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=ue(Eo),a=w(()=>e.route||r.value),o=ue(Gs,0),l=w(()=>{let u=cn(o);const{matched:d}=a.value;let p;for(;(p=d[u])&&!p.components;)u++;return u}),s=w(()=>a.value.matched[l.value]);mt(Gs,w(()=>l.value+1)),mt(s8,s),mt(Eo,a);const c=H();return se(()=>[c.value,s.value,e.name],([u,d,p],[f,h,_])=>{d&&(d.instances[p]=u,h&&h!==d&&u&&u===f&&(d.leaveGuards.size||(d.leaveGuards=h.leaveGuards),d.updateGuards.size||(d.updateGuards=h.updateGuards))),u&&d&&(!h||!Nn(d,h)||!f)&&(d.enterCallbacks[p]||[]).forEach(A=>A(u))},{flush:"post"}),()=>{const u=a.value,d=e.name,p=s.value,f=p&&p.components[d];if(!f)return Js(n.default,{Component:f,route:u});const h=p.props[d],_=h?h===!0?u.params:typeof h=="function"?h(u):h:null,x=i(f,_e({},_,t,{onVnodeUnmounted:g=>{g.component.isUnmounted&&(p.instances[d]=null)},ref:c}));return Js(n.default,{Component:x,route:u})||x}}});function Js(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const _2=p8;function f8(e){const t=N6(e.routes,e),n=e.parseQuery||o8,r=e.stringifyQuery||Us,a=e.history,o=nr(),l=nr(),s=nr(),c=Pe(Ot);let u=Ot;Cn&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=Ua.bind(null,k=>""+k),p=Ua.bind(null,a8),f=Ua.bind(null,va);function h(k,F){let B,K;return d2(k)?(B=t.getRecordMatcher(k),K=F):K=k,t.addRoute(K,B)}function _(k){const F=t.getRecordMatcher(k);F&&t.removeRoute(F)}function A(){return t.getRoutes().map(k=>k.record)}function x(k){return!!t.getRecordMatcher(k)}function g(k,F){if(F=_e({},F||c.value),typeof k=="string"){const E=Ga(n,k,F.path),C=t.resolve({path:E.path},F),L=a.createHref(E.fullPath);return _e(E,C,{params:f(C.params),hash:va(E.hash),redirectedFrom:void 0,href:L})}let B;if("path"in k)B=_e({},k,{path:Ga(n,k.path,F.path).path});else{const E=_e({},k.params);for(const C in E)E[C]==null&&delete E[C];B=_e({},k,{params:p(E)}),F.params=p(F.params)}const K=t.resolve(B,F),ge=k.hash||"";K.params=d(f(K.params));const v=g6(r,_e({},k,{hash:t8(ge),path:K.path})),y=a.createHref(v);return _e({fullPath:v,hash:ge,query:r===Us?l8(k.query):k.query||{}},K,{redirectedFrom:void 0,href:y})}function b(k){return typeof k=="string"?Ga(n,k,c.value.path):_e({},k)}function S(k,F){if(u!==k)return jn(8,{from:F,to:k})}function R(k){return W(k)}function U(k){return R(_e(b(k),{replace:!0}))}function O(k){const F=k.matched[k.matched.length-1];if(F&&F.redirect){const{redirect:B}=F;let K=typeof B=="function"?B(k):B;return typeof K=="string"&&(K=K.includes("?")||K.includes("#")?K=b(K):{path:K},K.params={}),_e({query:k.query,hash:k.hash,params:"path"in K?{}:k.params},K)}}function W(k,F){const B=u=g(k),K=c.value,ge=k.state,v=k.force,y=k.replace===!0,E=O(B);if(E)return W(_e(b(E),{state:typeof E=="object"?_e({},ge,E.state):ge,force:v,replace:y}),F||B);const C=B;C.redirectedFrom=F;let L;return!v&&y6(r,K,B)&&(L=jn(16,{to:C,from:K}),Ze(K,K,!0,!1)),(L?Promise.resolve(L):J(C,K)).catch(z=>Lt(z)?Lt(z,2)?z:He(z):ve(z,C,K)).then(z=>{if(z){if(Lt(z,2))return W(_e({replace:y},b(z.to),{state:typeof z.to=="object"?_e({},ge,z.to.state):ge,force:v}),F||C)}else z=N(C,K,!0,y,ge);return re(C,K,z),z})}function T(k,F){const B=S(k,F);return B?Promise.reject(B):Promise.resolve()}function j(k){const F=At.values().next().value;return F&&typeof F.runWithContext=="function"?F.runWithContext(k):k()}function J(k,F){let B;const[K,ge,v]=h8(k,F);B=Wa(K.reverse(),"beforeRouteLeave",k,F);for(const E of K)E.leaveGuards.forEach(C=>{B.push(qt(C,k,F))});const y=T.bind(null,k,F);return B.push(y),Re(B).then(()=>{B=[];for(const E of o.list())B.push(qt(E,k,F));return B.push(y),Re(B)}).then(()=>{B=Wa(ge,"beforeRouteUpdate",k,F);for(const E of ge)E.updateGuards.forEach(C=>{B.push(qt(C,k,F))});return B.push(y),Re(B)}).then(()=>{B=[];for(const E of k.matched)if(E.beforeEnter&&!F.matched.includes(E))if(_t(E.beforeEnter))for(const C of E.beforeEnter)B.push(qt(C,k,F));else B.push(qt(E.beforeEnter,k,F));return B.push(y),Re(B)}).then(()=>(k.matched.forEach(E=>E.enterCallbacks={}),B=Wa(v,"beforeRouteEnter",k,F),B.push(y),Re(B))).then(()=>{B=[];for(const E of l.list())B.push(qt(E,k,F));return B.push(y),Re(B)}).catch(E=>Lt(E,8)?E:Promise.reject(E))}function re(k,F,B){for(const K of s.list())j(()=>K(k,F,B))}function N(k,F,B,K,ge){const v=S(k,F);if(v)return v;const y=F===Ot,E=Cn?history.state:{};B&&(K||y?a.replace(k.fullPath,_e({scroll:y&&E&&E.scroll},ge)):a.push(k.fullPath,ge)),c.value=k,Ze(k,F,B,y),He()}let X;function q(){X||(X=a.listen((k,F,B)=>{if(!Xt.listening)return;const K=g(k),ge=O(K);if(ge){W(_e(ge,{replace:!0}),K).catch(dr);return}u=K;const v=c.value;Cn&&T6(Ms(v.fullPath,B.delta),Pa()),J(K,v).catch(y=>Lt(y,12)?y:Lt(y,2)?(W(y.to,K).then(E=>{Lt(E,20)&&!B.delta&&B.type===Er.pop&&a.go(-1,!1)}).catch(dr),Promise.reject()):(B.delta&&a.go(-B.delta,!1),ve(y,K,v))).then(y=>{y=y||N(K,v,!1),y&&(B.delta&&!Lt(y,8)?a.go(-B.delta,!1):B.type===Er.pop&&Lt(y,20)&&a.go(-1,!1)),re(K,v,y)}).catch(dr)}))}let ze=nr(),ne=nr(),ye;function ve(k,F,B){He(k);const K=ne.list();return K.length?K.forEach(ge=>ge(k,F,B)):console.error(k),Promise.reject(k)}function Ye(){return ye&&c.value!==Ot?Promise.resolve():new Promise((k,F)=>{ze.add([k,F])})}function He(k){return ye||(ye=!k,q(),ze.list().forEach(([F,B])=>k?B(k):F()),ze.reset()),k}function Ze(k,F,B,K){const{scrollBehavior:ge}=e;if(!Cn||!ge)return Promise.resolve();const v=!B&&k6(Ms(k.fullPath,0))||(K||!B)&&history.state&&history.state.scroll||null;return mn().then(()=>ge(k,F,v)).then(y=>y&&C6(y)).catch(y=>ve(y,k,F))}const Oe=k=>a.go(k);let wt;const At=new Set,Xt={currentRoute:c,listening:!0,addRoute:h,removeRoute:_,hasRoute:x,getRoutes:A,resolve:g,options:e,push:R,replace:U,go:Oe,back:()=>Oe(-1),forward:()=>Oe(1),beforeEach:o.add,beforeResolve:l.add,afterEach:s.add,onError:ne.add,isReady:Ye,install(k){const F=this;k.component("RouterLink",Se),k.component("RouterView",_2),k.config.globalProperties.$router=F,Object.defineProperty(k.config.globalProperties,"$route",{enumerable:!0,get:()=>cn(c)}),Cn&&!wt&&c.value===Ot&&(wt=!0,R(a.location).catch(ge=>{}));const B={};for(const ge in Ot)B[ge]=w(()=>c.value[ge]);k.provide(za,F),k.provide(vl,Wn(B)),k.provide(Eo,c);const K=k.unmount;At.add(k),k.unmount=function(){At.delete(k),At.size<1&&(u=Ot,X&&X(),X=null,c.value=Ot,wt=!1,ye=!1),K()}}};function Re(k){return k.reduce((F,B)=>F.then(()=>j(B)),Promise.resolve())}return Xt}function h8(e,t){const n=[],r=[],a=[],o=Math.max(t.matched.length,e.matched.length);for(let l=0;lNn(u,s))?r.push(s):n.push(s));const c=e.matched[l];c&&(t.matched.find(u=>Nn(u,c))||a.push(c))}return[n,r,a]}function Je(){return ue(za)}function Et(){return ue(vl)}const v8=({headerLinkSelector:e,headerAnchorSelector:t,delay:n,offset:r=5})=>{const a=Je(),l=f6(()=>{var A,x;const s=Math.max(window.scrollY,document.documentElement.scrollTop,document.body.scrollTop);if(Math.abs(s-0)f.some(b=>b.hash===g.hash));for(let g=0;g<_.length;g++){const b=_[g],S=_[g+1],R=s>=(((A=b.parentElement)==null?void 0:A.offsetTop)??0)-r,U=!S||s<(((x=S.parentElement)==null?void 0:x.offsetTop)??0)-r;if(!(R&&U))continue;const W=decodeURIComponent(a.currentRoute.value.hash),T=decodeURIComponent(b.hash);if(W===T)return;if(p){for(let j=g+1;j<_.length;j++)if(W===decodeURIComponent(_[j].hash))return}Ys(a,T);return}},n);de(()=>{window.addEventListener("scroll",l)}),Xo(()=>{window.removeEventListener("scroll",l)})},Ys=async(e,t)=>{const{scrollBehavior:n}=e.options;e.options.scrollBehavior=void 0,await e.replace({query:e.currentRoute.value.query,hash:t,force:!0}).finally(()=>e.options.scrollBehavior=n)},m8=".sidebar-link, .toc-link",g8=".header-anchor",y8=200,_8=5,b8=bt({setup(){v8({headerLinkSelector:m8,headerAnchorSelector:g8,delay:y8,offset:_8})}});let b2=()=>null;const E2=Symbol(""),E8=e=>{b2=e},w8=()=>ue(E2),A8=e=>{e.provide(E2,b2)};var x8=D({name:"AutoCatalog",props:{base:{type:String,default:""},level:{type:Number,default:3},index:Boolean},setup(e){const t=w8(),n=zr({"/zh/":{title:"目录"},"/":{title:"Catalog"}}),r=ie(),a=Je(),o=P1(),l=u=>{const d=u.I;return typeof d>"u"||d},s=()=>{const u=e.base||r.value.path.replace(/\/[^/]+$/,"/"),d=a.getRoutes(),p=[];return d.filter(({meta:f,path:h})=>{if(!Hn(h,u)||h===u)return!1;if(u==="/"){const _=Ke(o.value.locales).filter(A=>A!=="/");if(h==="/404.html"||_.some(A=>Hn(h,A)))return!1}return(En(h,".html")&&!En(h,"/index.html")||En(h,"/"))&&l(f)}).map(({path:f,meta:h})=>{const _=f.substring(u.length).split("/").length;return{title:h.t||"",icon:h.i,base:f.replace(/\/[^/]+\/?$/,"/"),order:h.O||null,level:En(f,"/")?_-1:_,path:f}}).filter(({title:f,level:h})=>typeof f=="string"&&f&&h<=e.level).sort(({title:f,level:h,path:_,order:A},{title:x,level:g,path:b,order:S})=>h-g||(En(_,"/index.html")?-1:En(b,"/index.html")?1:A===null?S===null?f.localeCompare(x):S:S===null?A:A>0?S>0?A-S:-1:S<0?A-S:1)).forEach(f=>{var h;const{base:_,level:A}=f;switch(A){case 1:p.push(f);break;case 2:{const x=p.find(g=>g.path===_);x&&(x.children??(x.children=[])).push(f);break}default:{const x=p.find(g=>g.path===_.replace(/\/[^/]+\/$/,"/"));if(x){const g=(h=x.children)==null?void 0:h.find(b=>b.path===_);g&&(g.children??(g.children=[])).push(f)}}}}),p},c=w(()=>s());return()=>i("div",{class:"auto-catalog-wrapper"},[i("h2",{class:"main-title"},n.value.title),c.value.map(({children:u=[],icon:d,path:p,title:f},h)=>[i("h3",{id:f,class:["child-title",{"has-children":u.length}]},[i("a",{href:`#${f}`,class:"header-anchor"},"#"),i(Se,{class:"catalog-title",to:p},()=>[e.index?`${h+1}.`:null,d&&t?i(t,{icon:d}):null,f||"Unknown"])]),u.length?i("ul",{class:"child-catalog-wrapper"},u.map(({children:_=[],icon:A,path:x,title:g},b)=>i("li",{class:"child-catalog-item"},[i("div",{class:["sub-title",{"has-children":_.length}]},[i("a",{href:`#${g}`,class:"header-anchor"},"#"),i(Se,{class:"catalog-title",to:x},()=>[e.index?`${h+1}.${b+1}`:null,A&&t?i(t,{icon:A}):null,g||"Unknown"])]),_.length?i("div",{class:"sub-catalog-wrapper"},_.map(({icon:S,path:R,title:U},O)=>i(Se,{class:"sub-catalog-item",to:R},()=>[e.index?`${h+1}.${b+1}.${O+1}`:null,S&&t?i(t,{icon:S}):null,U||"Unknown"]))):null]))):null])])}}),C8=bt({enhance:({app:e})=>{A8(e),gt("AutoCatalog",e)||e.component("AutoCatalog",x8)}});const T8=i("svg",{class:"external-link-icon",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"},[i("path",{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}),i("polygon",{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"})]),w2=D({name:"ExternalLinkIcon",props:{locales:{type:Object,required:!1,default:()=>({})}},setup(e){const t=kt(),n=w(()=>e.locales[t.value]??{openInNewWindow:"open in new window"});return()=>i("span",[T8,i("span",{class:"external-link-icon-sr-only"},n.value.openInNewWindow)])}}),k8={},L8=bt({enhance({app:e}){e.component("ExternalLinkIcon",i(w2,{locales:k8}))}});/** + */const Cn=typeof window<"u";function h6(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const _e=Object.assign;function Ua(e,t){const n={};for(const r in t){const a=t[r];n[r]=_t(a)?a.map(e):e(a)}return n}const dr=()=>{},_t=Array.isArray,v6=/\/$/,m6=e=>e.replace(v6,"");function Ga(e,t,n="/"){let r,a={},o="",l="";const s=t.indexOf("#");let c=t.indexOf("?");return s=0&&(c=-1),c>-1&&(r=t.slice(0,c),o=t.slice(c+1,s>-1?s:t.length),a=e(o)),s>-1&&(r=r||t.slice(0,s),l=t.slice(s,t.length)),r=b6(r??t,n),{fullPath:r+(o&&"?")+o+l,path:r,query:a,hash:l}}function g6(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Ds(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function y6(e,t,n){const r=t.matched.length-1,a=n.matched.length-1;return r>-1&&r===a&&Nn(t.matched[r],n.matched[a])&&c2(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Nn(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function c2(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!_6(e[n],t[n]))return!1;return!0}function _6(e,t){return _t(e)?$s(e,t):_t(t)?$s(t,e):e===t}function $s(e,t){return _t(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function b6(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),a=r[r.length-1];(a===".."||a===".")&&r.push("");let o=n.length-1,l,s;for(l=0;l1&&o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(l-(l===r.length?1:0)).join("/")}var Er;(function(e){e.pop="pop",e.push="push"})(Er||(Er={}));var pr;(function(e){e.back="back",e.forward="forward",e.unknown=""})(pr||(pr={}));function E6(e){if(!e)if(Cn){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),m6(e)}const w6=/^[^#]+#/;function A6(e,t){return e.replace(w6,"#")+t}function x6(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const Pa=()=>({left:window.pageXOffset,top:window.pageYOffset});function C6(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),a=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!a)return;t=x6(a,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function Ms(e,t){return(history.state?history.state.position-t:-1)+e}const _o=new Map;function T6(e,t){_o.set(e,t)}function k6(e){const t=_o.get(e);return _o.delete(e),t}let L6=()=>location.protocol+"//"+location.host;function u2(e,t){const{pathname:n,search:r,hash:a}=t,o=e.indexOf("#");if(o>-1){let s=a.includes(e.slice(o))?e.slice(o).length:1,c=a.slice(s);return c[0]!=="/"&&(c="/"+c),Ds(c,"")}return Ds(n,e)+r+a}function P6(e,t,n,r){let a=[],o=[],l=null;const s=({state:f})=>{const h=u2(e,location),_=n.value,A=t.value;let x=0;if(f){if(n.value=h,t.value=f,l&&l===_){l=null;return}x=A?f.position-A.position:0}else r(h);a.forEach(g=>{g(n.value,_,{delta:x,type:Er.pop,direction:x?x>0?pr.forward:pr.back:pr.unknown})})};function c(){l=n.value}function u(f){a.push(f);const h=()=>{const _=a.indexOf(f);_>-1&&a.splice(_,1)};return o.push(h),h}function d(){const{history:f}=window;f.state&&f.replaceState(_e({},f.state,{scroll:Pa()}),"")}function p(){for(const f of o)f();o=[],window.removeEventListener("popstate",s),window.removeEventListener("beforeunload",d)}return window.addEventListener("popstate",s),window.addEventListener("beforeunload",d,{passive:!0}),{pauseListeners:c,listen:u,destroy:p}}function Bs(e,t,n,r=!1,a=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:a?Pa():null}}function z6(e){const{history:t,location:n}=window,r={value:u2(e,n)},a={value:t.state};a.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(c,u,d){const p=e.indexOf("#"),f=p>-1?(n.host&&document.querySelector("base")?e:e.slice(p))+c:L6()+e+c;try{t[d?"replaceState":"pushState"](u,"",f),a.value=u}catch(h){console.error(h),n[d?"replace":"assign"](f)}}function l(c,u){const d=_e({},t.state,Bs(a.value.back,c,a.value.forward,!0),u,{position:a.value.position});o(c,d,!0),r.value=c}function s(c,u){const d=_e({},a.value,t.state,{forward:c,scroll:Pa()});o(d.current,d,!0);const p=_e({},Bs(r.value,c,null),{position:d.position+1},u);o(c,p,!1),r.value=c}return{location:r,state:a,push:s,replace:l}}function O6(e){e=E6(e);const t=z6(e),n=P6(e,t.state,t.location,t.replace);function r(o,l=!0){l||n.pauseListeners(),history.go(o)}const a=_e({location:"",base:e,go:r,createHref:A6.bind(null,e)},t,n);return Object.defineProperty(a,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(a,"state",{enumerable:!0,get:()=>t.state.value}),a}function I6(e){return typeof e=="string"||e&&typeof e=="object"}function d2(e){return typeof e=="string"||typeof e=="symbol"}const Ot={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},p2=Symbol("");var Vs;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(Vs||(Vs={}));function jn(e,t){return _e(new Error,{type:e,[p2]:!0},t)}function Lt(e,t){return e instanceof Error&&p2 in e&&(t==null||!!(e.type&t))}const Fs="[^/]+?",R6={sensitive:!1,strict:!1,start:!0,end:!0},S6=/[.+*?^${}()[\]/\\]/g;function D6(e,t){const n=_e({},R6,t),r=[];let a=n.start?"^":"";const o=[];for(const u of e){const d=u.length?[]:[90];n.strict&&!u.length&&(a+="/");for(let p=0;pt.length?t.length===1&&t[0]===40+40?1:-1:0}function M6(e,t){let n=0;const r=e.score,a=t.score;for(;n0&&t[t.length-1]<0}const B6={type:0,value:""},V6=/[a-zA-Z0-9_]/;function F6(e){if(!e)return[[]];if(e==="/")return[[B6]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(h){throw new Error(`ERR (${n})/"${u}": ${h}`)}let n=0,r=n;const a=[];let o;function l(){o&&a.push(o),o=[]}let s=0,c,u="",d="";function p(){u&&(n===0?o.push({type:0,value:u}):n===1||n===2||n===3?(o.length>1&&(c==="*"||c==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),o.push({type:1,value:u,regexp:d,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):t("Invalid state to consume buffer"),u="")}function f(){u+=c}for(;s{l(b)}:dr}function l(d){if(d2(d)){const p=r.get(d);p&&(r.delete(d),n.splice(n.indexOf(p),1),p.children.forEach(l),p.alias.forEach(l))}else{const p=n.indexOf(d);p>-1&&(n.splice(p,1),d.record.name&&r.delete(d.record.name),d.children.forEach(l),d.alias.forEach(l))}}function s(){return n}function c(d){let p=0;for(;p=0&&(d.record.path!==n[p].record.path||!f2(d,n[p]));)p++;n.splice(p,0,d),d.record.name&&!js(d)&&r.set(d.record.name,d)}function u(d,p){let f,h={},_,A;if("name"in d&&d.name){if(f=r.get(d.name),!f)throw jn(1,{location:d});A=f.record.name,h=_e(Ns(p.params,f.keys.filter(b=>!b.optional).map(b=>b.name)),d.params&&Ns(d.params,f.keys.map(b=>b.name))),_=f.stringify(h)}else if("path"in d)_=d.path,f=n.find(b=>b.re.test(_)),f&&(h=f.parse(_),A=f.record.name);else{if(f=p.name?r.get(p.name):n.find(b=>b.re.test(p.path)),!f)throw jn(1,{location:d,currentLocation:p});A=f.record.name,h=_e({},p.params,d.params),_=f.stringify(h)}const x=[];let g=f;for(;g;)x.unshift(g.record),g=g.parent;return{name:A,path:_,params:h,matched:x,meta:U6(x)}}return e.forEach(d=>o(d)),{addRoute:o,resolve:u,removeRoute:l,getRoutes:s,getRecordMatcher:a}}function Ns(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function j6(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:q6(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function q6(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="boolean"?n:n[r];return t}function js(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function U6(e){return e.reduce((t,n)=>_e(t,n.meta),{})}function qs(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}function f2(e,t){return t.children.some(n=>n===e||f2(e,n))}const h2=/#/g,G6=/&/g,W6=/\//g,K6=/=/g,Y6=/\?/g,v2=/\+/g,J6=/%5B/g,Z6=/%5D/g,m2=/%5E/g,Q6=/%60/g,g2=/%7B/g,X6=/%7C/g,y2=/%7D/g,e8=/%20/g;function hl(e){return encodeURI(""+e).replace(X6,"|").replace(J6,"[").replace(Z6,"]")}function t8(e){return hl(e).replace(g2,"{").replace(y2,"}").replace(m2,"^")}function bo(e){return hl(e).replace(v2,"%2B").replace(e8,"+").replace(h2,"%23").replace(G6,"%26").replace(Q6,"`").replace(g2,"{").replace(y2,"}").replace(m2,"^")}function n8(e){return bo(e).replace(K6,"%3D")}function r8(e){return hl(e).replace(h2,"%23").replace(Y6,"%3F")}function a8(e){return e==null?"":r8(e).replace(W6,"%2F")}function va(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function o8(e){const t={};if(e===""||e==="?")return t;const r=(e[0]==="?"?e.slice(1):e).split("&");for(let a=0;ao&&bo(o)):[r&&bo(r)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function l8(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=_t(r)?r.map(a=>a==null?null:""+a):r==null?r:""+r)}return t}const s8=Symbol(""),Gs=Symbol(""),za=Symbol(""),vl=Symbol(""),Eo=Symbol("");function nr(){let e=[];function t(r){return e.push(r),()=>{const a=e.indexOf(r);a>-1&&e.splice(a,1)}}function n(){e=[]}return{add:t,list:()=>e,reset:n}}function qt(e,t,n,r,a){const o=r&&(r.enterCallbacks[a]=r.enterCallbacks[a]||[]);return()=>new Promise((l,s)=>{const c=p=>{p===!1?s(jn(4,{from:n,to:t})):p instanceof Error?s(p):I6(p)?s(jn(2,{from:t,to:p})):(o&&r.enterCallbacks[a]===o&&typeof p=="function"&&o.push(p),l())},u=e.call(r&&r.instances[a],t,n,c);let d=Promise.resolve(u);e.length<3&&(d=d.then(c)),d.catch(p=>s(p))})}function Wa(e,t,n,r){const a=[];for(const o of e)for(const l in o.components){let s=o.components[l];if(!(t!=="beforeRouteEnter"&&!o.instances[l]))if(i8(s)){const u=(s.__vccOpts||s)[t];u&&a.push(qt(u,n,r,o,l))}else{let c=s();a.push(()=>c.then(u=>{if(!u)return Promise.reject(new Error(`Couldn't resolve component "${l}" at "${o.path}"`));const d=h6(u)?u.default:u;o.components[l]=d;const f=(d.__vccOpts||d)[t];return f&&qt(f,n,r,o,l)()}))}}return a}function i8(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function wo(e){const t=ue(za),n=ue(vl),r=w(()=>t.resolve(cn(e.to))),a=w(()=>{const{matched:c}=r.value,{length:u}=c,d=c[u-1],p=n.matched;if(!d||!p.length)return-1;const f=p.findIndex(Nn.bind(null,d));if(f>-1)return f;const h=Ws(c[u-2]);return u>1&&Ws(d)===h&&p[p.length-1].path!==h?p.findIndex(Nn.bind(null,c[u-2])):f}),o=w(()=>a.value>-1&&d8(n.params,r.value.params)),l=w(()=>a.value>-1&&a.value===n.matched.length-1&&c2(n.params,r.value.params));function s(c={}){return u8(c)?t[cn(e.replace)?"replace":"push"](cn(e.to)).catch(dr):Promise.resolve()}return{route:r,href:w(()=>r.value.href),isActive:o,isExactActive:l,navigate:s}}const c8=D({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:wo,setup(e,{slots:t}){const n=Wn(wo(e)),{options:r}=ue(za),a=w(()=>({[Ks(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Ks(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&t.default(n);return e.custom?o:i("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:a.value},o)}}}),Re=c8;function u8(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function d8(e,t){for(const n in t){const r=t[n],a=e[n];if(typeof r=="string"){if(r!==a)return!1}else if(!_t(a)||a.length!==r.length||r.some((o,l)=>o!==a[l]))return!1}return!0}function Ws(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Ks=(e,t,n)=>e??t??n,p8=D({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=ue(Eo),a=w(()=>e.route||r.value),o=ue(Gs,0),l=w(()=>{let u=cn(o);const{matched:d}=a.value;let p;for(;(p=d[u])&&!p.components;)u++;return u}),s=w(()=>a.value.matched[l.value]);mt(Gs,w(()=>l.value+1)),mt(s8,s),mt(Eo,a);const c=H();return se(()=>[c.value,s.value,e.name],([u,d,p],[f,h,_])=>{d&&(d.instances[p]=u,h&&h!==d&&u&&u===f&&(d.leaveGuards.size||(d.leaveGuards=h.leaveGuards),d.updateGuards.size||(d.updateGuards=h.updateGuards))),u&&d&&(!h||!Nn(d,h)||!f)&&(d.enterCallbacks[p]||[]).forEach(A=>A(u))},{flush:"post"}),()=>{const u=a.value,d=e.name,p=s.value,f=p&&p.components[d];if(!f)return Ys(n.default,{Component:f,route:u});const h=p.props[d],_=h?h===!0?u.params:typeof h=="function"?h(u):h:null,x=i(f,_e({},_,t,{onVnodeUnmounted:g=>{g.component.isUnmounted&&(p.instances[d]=null)},ref:c}));return Ys(n.default,{Component:x,route:u})||x}}});function Ys(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const _2=p8;function f8(e){const t=N6(e.routes,e),n=e.parseQuery||o8,r=e.stringifyQuery||Us,a=e.history,o=nr(),l=nr(),s=nr(),c=Pe(Ot);let u=Ot;Cn&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=Ua.bind(null,k=>""+k),p=Ua.bind(null,a8),f=Ua.bind(null,va);function h(k,F){let B,K;return d2(k)?(B=t.getRecordMatcher(k),K=F):K=k,t.addRoute(K,B)}function _(k){const F=t.getRecordMatcher(k);F&&t.removeRoute(F)}function A(){return t.getRoutes().map(k=>k.record)}function x(k){return!!t.getRecordMatcher(k)}function g(k,F){if(F=_e({},F||c.value),typeof k=="string"){const E=Ga(n,k,F.path),C=t.resolve({path:E.path},F),L=a.createHref(E.fullPath);return _e(E,C,{params:f(C.params),hash:va(E.hash),redirectedFrom:void 0,href:L})}let B;if("path"in k)B=_e({},k,{path:Ga(n,k.path,F.path).path});else{const E=_e({},k.params);for(const C in E)E[C]==null&&delete E[C];B=_e({},k,{params:p(E)}),F.params=p(F.params)}const K=t.resolve(B,F),ge=k.hash||"";K.params=d(f(K.params));const v=g6(r,_e({},k,{hash:t8(ge),path:K.path})),y=a.createHref(v);return _e({fullPath:v,hash:ge,query:r===Us?l8(k.query):k.query||{}},K,{redirectedFrom:void 0,href:y})}function b(k){return typeof k=="string"?Ga(n,k,c.value.path):_e({},k)}function R(k,F){if(u!==k)return jn(8,{from:F,to:k})}function S(k){return W(k)}function U(k){return S(_e(b(k),{replace:!0}))}function O(k){const F=k.matched[k.matched.length-1];if(F&&F.redirect){const{redirect:B}=F;let K=typeof B=="function"?B(k):B;return typeof K=="string"&&(K=K.includes("?")||K.includes("#")?K=b(K):{path:K},K.params={}),_e({query:k.query,hash:k.hash,params:"path"in K?{}:k.params},K)}}function W(k,F){const B=u=g(k),K=c.value,ge=k.state,v=k.force,y=k.replace===!0,E=O(B);if(E)return W(_e(b(E),{state:typeof E=="object"?_e({},ge,E.state):ge,force:v,replace:y}),F||B);const C=B;C.redirectedFrom=F;let L;return!v&&y6(r,K,B)&&(L=jn(16,{to:C,from:K}),Ze(K,K,!0,!1)),(L?Promise.resolve(L):Y(C,K)).catch(z=>Lt(z)?Lt(z,2)?z:He(z):ve(z,C,K)).then(z=>{if(z){if(Lt(z,2))return W(_e({replace:y},b(z.to),{state:typeof z.to=="object"?_e({},ge,z.to.state):ge,force:v}),F||C)}else z=N(C,K,!0,y,ge);return re(C,K,z),z})}function T(k,F){const B=R(k,F);return B?Promise.reject(B):Promise.resolve()}function j(k){const F=At.values().next().value;return F&&typeof F.runWithContext=="function"?F.runWithContext(k):k()}function Y(k,F){let B;const[K,ge,v]=h8(k,F);B=Wa(K.reverse(),"beforeRouteLeave",k,F);for(const E of K)E.leaveGuards.forEach(C=>{B.push(qt(C,k,F))});const y=T.bind(null,k,F);return B.push(y),Se(B).then(()=>{B=[];for(const E of o.list())B.push(qt(E,k,F));return B.push(y),Se(B)}).then(()=>{B=Wa(ge,"beforeRouteUpdate",k,F);for(const E of ge)E.updateGuards.forEach(C=>{B.push(qt(C,k,F))});return B.push(y),Se(B)}).then(()=>{B=[];for(const E of k.matched)if(E.beforeEnter&&!F.matched.includes(E))if(_t(E.beforeEnter))for(const C of E.beforeEnter)B.push(qt(C,k,F));else B.push(qt(E.beforeEnter,k,F));return B.push(y),Se(B)}).then(()=>(k.matched.forEach(E=>E.enterCallbacks={}),B=Wa(v,"beforeRouteEnter",k,F),B.push(y),Se(B))).then(()=>{B=[];for(const E of l.list())B.push(qt(E,k,F));return B.push(y),Se(B)}).catch(E=>Lt(E,8)?E:Promise.reject(E))}function re(k,F,B){for(const K of s.list())j(()=>K(k,F,B))}function N(k,F,B,K,ge){const v=R(k,F);if(v)return v;const y=F===Ot,E=Cn?history.state:{};B&&(K||y?a.replace(k.fullPath,_e({scroll:y&&E&&E.scroll},ge)):a.push(k.fullPath,ge)),c.value=k,Ze(k,F,B,y),He()}let X;function q(){X||(X=a.listen((k,F,B)=>{if(!Xt.listening)return;const K=g(k),ge=O(K);if(ge){W(_e(ge,{replace:!0}),K).catch(dr);return}u=K;const v=c.value;Cn&&T6(Ms(v.fullPath,B.delta),Pa()),Y(K,v).catch(y=>Lt(y,12)?y:Lt(y,2)?(W(y.to,K).then(E=>{Lt(E,20)&&!B.delta&&B.type===Er.pop&&a.go(-1,!1)}).catch(dr),Promise.reject()):(B.delta&&a.go(-B.delta,!1),ve(y,K,v))).then(y=>{y=y||N(K,v,!1),y&&(B.delta&&!Lt(y,8)?a.go(-B.delta,!1):B.type===Er.pop&&Lt(y,20)&&a.go(-1,!1)),re(K,v,y)}).catch(dr)}))}let ze=nr(),ne=nr(),ye;function ve(k,F,B){He(k);const K=ne.list();return K.length?K.forEach(ge=>ge(k,F,B)):console.error(k),Promise.reject(k)}function Je(){return ye&&c.value!==Ot?Promise.resolve():new Promise((k,F)=>{ze.add([k,F])})}function He(k){return ye||(ye=!k,q(),ze.list().forEach(([F,B])=>k?B(k):F()),ze.reset()),k}function Ze(k,F,B,K){const{scrollBehavior:ge}=e;if(!Cn||!ge)return Promise.resolve();const v=!B&&k6(Ms(k.fullPath,0))||(K||!B)&&history.state&&history.state.scroll||null;return mn().then(()=>ge(k,F,v)).then(y=>y&&C6(y)).catch(y=>ve(y,k,F))}const Oe=k=>a.go(k);let wt;const At=new Set,Xt={currentRoute:c,listening:!0,addRoute:h,removeRoute:_,hasRoute:x,getRoutes:A,resolve:g,options:e,push:S,replace:U,go:Oe,back:()=>Oe(-1),forward:()=>Oe(1),beforeEach:o.add,beforeResolve:l.add,afterEach:s.add,onError:ne.add,isReady:Je,install(k){const F=this;k.component("RouterLink",Re),k.component("RouterView",_2),k.config.globalProperties.$router=F,Object.defineProperty(k.config.globalProperties,"$route",{enumerable:!0,get:()=>cn(c)}),Cn&&!wt&&c.value===Ot&&(wt=!0,S(a.location).catch(ge=>{}));const B={};for(const ge in Ot)B[ge]=w(()=>c.value[ge]);k.provide(za,F),k.provide(vl,Wn(B)),k.provide(Eo,c);const K=k.unmount;At.add(k),k.unmount=function(){At.delete(k),At.size<1&&(u=Ot,X&&X(),X=null,c.value=Ot,wt=!1,ye=!1),K()}}};function Se(k){return k.reduce((F,B)=>F.then(()=>j(B)),Promise.resolve())}return Xt}function h8(e,t){const n=[],r=[],a=[],o=Math.max(t.matched.length,e.matched.length);for(let l=0;lNn(u,s))?r.push(s):n.push(s));const c=e.matched[l];c&&(t.matched.find(u=>Nn(u,c))||a.push(c))}return[n,r,a]}function Ye(){return ue(za)}function Et(){return ue(vl)}const v8=({headerLinkSelector:e,headerAnchorSelector:t,delay:n,offset:r=5})=>{const a=Ye(),l=f6(()=>{var A,x;const s=Math.max(window.scrollY,document.documentElement.scrollTop,document.body.scrollTop);if(Math.abs(s-0)f.some(b=>b.hash===g.hash));for(let g=0;g<_.length;g++){const b=_[g],R=_[g+1],S=s>=(((A=b.parentElement)==null?void 0:A.offsetTop)??0)-r,U=!R||s<(((x=R.parentElement)==null?void 0:x.offsetTop)??0)-r;if(!(S&&U))continue;const W=decodeURIComponent(a.currentRoute.value.hash),T=decodeURIComponent(b.hash);if(W===T)return;if(p){for(let j=g+1;j<_.length;j++)if(W===decodeURIComponent(_[j].hash))return}Js(a,T);return}},n);de(()=>{window.addEventListener("scroll",l)}),Xo(()=>{window.removeEventListener("scroll",l)})},Js=async(e,t)=>{const{scrollBehavior:n}=e.options;e.options.scrollBehavior=void 0,await e.replace({query:e.currentRoute.value.query,hash:t,force:!0}).finally(()=>e.options.scrollBehavior=n)},m8=".sidebar-link, .toc-link",g8=".header-anchor",y8=200,_8=5,b8=bt({setup(){v8({headerLinkSelector:m8,headerAnchorSelector:g8,delay:y8,offset:_8})}});let b2=()=>null;const E2=Symbol(""),E8=e=>{b2=e},w8=()=>ue(E2),A8=e=>{e.provide(E2,b2)};var x8=D({name:"AutoCatalog",props:{base:{type:String,default:""},level:{type:Number,default:3},index:Boolean},setup(e){const t=w8(),n=zr({"/zh/":{title:"目录"},"/":{title:"Catalog"}}),r=ie(),a=Ye(),o=P1(),l=u=>{const d=u.I;return typeof d>"u"||d},s=()=>{const u=e.base||r.value.path.replace(/\/[^/]+$/,"/"),d=a.getRoutes(),p=[];return d.filter(({meta:f,path:h})=>{if(!Hn(h,u)||h===u)return!1;if(u==="/"){const _=Ke(o.value.locales).filter(A=>A!=="/");if(h==="/404.html"||_.some(A=>Hn(h,A)))return!1}return(En(h,".html")&&!En(h,"/index.html")||En(h,"/"))&&l(f)}).map(({path:f,meta:h})=>{const _=f.substring(u.length).split("/").length;return{title:h.t||"",icon:h.i,base:f.replace(/\/[^/]+\/?$/,"/"),order:h.O||null,level:En(f,"/")?_-1:_,path:f}}).filter(({title:f,level:h})=>typeof f=="string"&&f&&h<=e.level).sort(({title:f,level:h,path:_,order:A},{title:x,level:g,path:b,order:R})=>h-g||(En(_,"/index.html")?-1:En(b,"/index.html")?1:A===null?R===null?f.localeCompare(x):R:R===null?A:A>0?R>0?A-R:-1:R<0?A-R:1)).forEach(f=>{var h;const{base:_,level:A}=f;switch(A){case 1:p.push(f);break;case 2:{const x=p.find(g=>g.path===_);x&&(x.children??(x.children=[])).push(f);break}default:{const x=p.find(g=>g.path===_.replace(/\/[^/]+\/$/,"/"));if(x){const g=(h=x.children)==null?void 0:h.find(b=>b.path===_);g&&(g.children??(g.children=[])).push(f)}}}}),p},c=w(()=>s());return()=>i("div",{class:"auto-catalog-wrapper"},[i("h2",{class:"main-title"},n.value.title),c.value.map(({children:u=[],icon:d,path:p,title:f},h)=>[i("h3",{id:f,class:["child-title",{"has-children":u.length}]},[i("a",{href:`#${f}`,class:"header-anchor"},"#"),i(Re,{class:"catalog-title",to:p},()=>[e.index?`${h+1}.`:null,d&&t?i(t,{icon:d}):null,f||"Unknown"])]),u.length?i("ul",{class:"child-catalog-wrapper"},u.map(({children:_=[],icon:A,path:x,title:g},b)=>i("li",{class:"child-catalog-item"},[i("div",{class:["sub-title",{"has-children":_.length}]},[i("a",{href:`#${g}`,class:"header-anchor"},"#"),i(Re,{class:"catalog-title",to:x},()=>[e.index?`${h+1}.${b+1}`:null,A&&t?i(t,{icon:A}):null,g||"Unknown"])]),_.length?i("div",{class:"sub-catalog-wrapper"},_.map(({icon:R,path:S,title:U},O)=>i(Re,{class:"sub-catalog-item",to:S},()=>[e.index?`${h+1}.${b+1}.${O+1}`:null,R&&t?i(t,{icon:R}):null,U||"Unknown"]))):null]))):null])])}}),C8=bt({enhance:({app:e})=>{A8(e),gt("AutoCatalog",e)||e.component("AutoCatalog",x8)}});const T8=i("svg",{class:"external-link-icon",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"},[i("path",{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}),i("polygon",{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"})]),w2=D({name:"ExternalLinkIcon",props:{locales:{type:Object,required:!1,default:()=>({})}},setup(e){const t=kt(),n=w(()=>e.locales[t.value]??{openInNewWindow:"open in new window"});return()=>i("span",[T8,i("span",{class:"external-link-icon-sr-only"},n.value.openInNewWindow)])}}),k8={},L8=bt({enhance({app:e}){e.component("ExternalLinkIcon",i(w2,{locales:k8}))}});/** * NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress * @license MIT - */const pe={settings:{minimum:.08,easing:"ease",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,barSelector:'[role="bar"]',parent:"body",template:'
'},status:null,set:e=>{const t=pe.isStarted();e=Ka(e,pe.settings.minimum,1),pe.status=e===1?null:e;const n=pe.render(!t),r=n.querySelector(pe.settings.barSelector),a=pe.settings.speed,o=pe.settings.easing;return n.offsetWidth,P8(l=>{Zr(r,{transform:"translate3d("+Zs(e)+"%,0,0)",transition:"all "+a+"ms "+o}),e===1?(Zr(n,{transition:"none",opacity:"1"}),n.offsetWidth,setTimeout(function(){Zr(n,{transition:"all "+a+"ms linear",opacity:"0"}),setTimeout(function(){pe.remove(),l()},a)},a)):setTimeout(()=>l(),a)}),pe},isStarted:()=>typeof pe.status=="number",start:()=>{pe.status||pe.set(0);const e=()=>{setTimeout(()=>{pe.status&&(pe.trickle(),e())},pe.settings.trickleSpeed)};return pe.settings.trickle&&e(),pe},done:e=>!e&&!pe.status?pe:pe.inc(.3+.5*Math.random()).set(1),inc:e=>{let t=pe.status;return t?(typeof e!="number"&&(e=(1-t)*Ka(Math.random()*t,.1,.95)),t=Ka(t+e,0,.994),pe.set(t)):pe.start()},trickle:()=>pe.inc(Math.random()*pe.settings.trickleRate),render:e=>{if(pe.isRendered())return document.getElementById("nprogress");Qs(document.documentElement,"nprogress-busy");const t=document.createElement("div");t.id="nprogress",t.innerHTML=pe.settings.template;const n=t.querySelector(pe.settings.barSelector),r=e?"-100":Zs(pe.status||0),a=document.querySelector(pe.settings.parent);return Zr(n,{transition:"all 0 linear",transform:"translate3d("+r+"%,0,0)"}),a!==document.body&&Qs(a,"nprogress-custom-parent"),a==null||a.appendChild(t),t},remove:()=>{Xs(document.documentElement,"nprogress-busy"),Xs(document.querySelector(pe.settings.parent),"nprogress-custom-parent");const e=document.getElementById("nprogress");e&&z8(e)},isRendered:()=>!!document.getElementById("nprogress")},Ka=(e,t,n)=>en?n:e,Zs=e=>(-1+e)*100,P8=function(){const e=[];function t(){const n=e.shift();n&&n(t)}return function(n){e.push(n),e.length===1&&t()}}(),Zr=function(){const e=["Webkit","O","Moz","ms"],t={};function n(l){return l.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(s,c){return c.toUpperCase()})}function r(l){const s=document.body.style;if(l in s)return l;let c=e.length;const u=l.charAt(0).toUpperCase()+l.slice(1);let d;for(;c--;)if(d=e[c]+u,d in s)return d;return l}function a(l){return l=n(l),t[l]??(t[l]=r(l))}function o(l,s,c){s=a(s),l.style[s]=c}return function(l,s){for(const c in s){const u=s[c];u!==void 0&&Object.prototype.hasOwnProperty.call(s,c)&&o(l,c,u)}}}(),A2=(e,t)=>(typeof e=="string"?e:ml(e)).indexOf(" "+t+" ")>=0,Qs=(e,t)=>{const n=ml(e),r=n+t;A2(n,t)||(e.className=r.substring(1))},Xs=(e,t)=>{const n=ml(e);if(!A2(e,t))return;const r=n.replace(" "+t+" "," ");e.className=r.substring(1,r.length-1)},ml=e=>(" "+(e.className||"")+" ").replace(/\s+/gi," "),z8=e=>{e&&e.parentNode&&e.parentNode.removeChild(e)};const O8=()=>{de(()=>{const e=Je(),t=new Set;t.add(e.currentRoute.value.path),e.beforeEach(n=>{t.has(n.path)||pe.start()}),e.afterEach(n=>{t.add(n.path),pe.done()})})},I8=bt({setup(){O8()}}),S8=JSON.parse(`{"encrypt":{"config":{"/demo/encrypt.html":["$2a$10$u5W5BV44NclYplmq.yOZ6ObJnHjIk358pRiFSzLAsRS.P8xoOFEge"],"/zh/demo/encrypt.html":["$2a$10$EZlH1o6JNIbx4/vImV/mZevYRJ3EHhnGWV1zarnjgsw0vgJcCPzH2"]}},"author":{"name":"Chi"},"logo":"/logo.svg","repo":"vuepress-theme-hope/vuepress-theme-hope","docsDir":"docs","blog":{"medias":{"Baidu":"https://example.com","BiliBili":"https://example.com","Bitbucket":"https://example.com","Dingding":"https://example.com","Discord":"https://example.com","Dribbble":"https://example.com","Email":"mailto:info@example.com","Evernote":"https://example.com","Facebook":"https://example.com","Flipboard":"https://example.com","Gitee":"https://example.com","GitHub":"https://example.com","Gitlab":"https://example.com","Gmail":"mailto:info@example.com","Instagram":"https://example.com","Lark":"https://example.com","Lines":"https://example.com","Linkedin":"https://example.com","Pinterest":"https://example.com","Pocket":"https://example.com","QQ":"https://example.com","Qzone":"https://example.com","Reddit":"https://example.com","Rss":"https://example.com","Steam":"https://example.com","Twitter":"https://example.com","Wechat":"https://example.com","Weibo":"https://example.com","Whatsapp":"https://example.com","Youtube":"https://example.com","Zhihu":"https://example.com","MrHope":"https://mrhope.site"}},"locales":{"/zh/":{"lang":"zh-CN","navbarLocales":{"langName":"简体中文","selectLangAriaLabel":"选择语言"},"metaLocales":{"author":"作者","date":"写作日期","origin":"原创","views":"访问量","category":"分类","tag":"标签","readingTime":"阅读时间","words":"字数","toc":"此页内容","prev":"上一页","next":"下一页","lastUpdated":"上次编辑于","contributors":"贡献者","editLink":"在 GitHub 上编辑此页","print":"打印"},"blogLocales":{"article":"文章","articleList":"文章列表","category":"分类","tag":"标签","timeline":"时间轴","timelineTitle":"昨日不在","all":"全部","intro":"个人介绍","star":"收藏"},"paginationLocales":{"prev":"上一页","next":"下一页","navigate":"跳转到","action":"前往","errorText":"请输入 1 到 $page 之前的页码!"},"outlookLocales":{"themeColor":"主题色","darkmode":"外观","fullscreen":"全屏"},"encryptLocales":{"iconLabel":"文章已加密","placeholder":"输入密码","remember":"记住密码","errorHint":"请输入正确的密码"},"routeLocales":{"skipToContent":"跳至主要內容","notFoundTitle":"页面不存在","notFoundMsg":["这里什么也没有","我们是怎么来到这儿的?","这 是 四 零 四 !","看起来你访问了一个失效的链接"],"back":"返回上一页","home":"带我回家","openInNewWindow":"Open in new window"},"navbar":["/zh/",{"text":"演示","icon":"discover","link":"/zh/demo/"},{"text":"博文","icon":"edit","prefix":"/zh/posts/","children":[{"text":"编译原理","icon":"edit","prefix":"编译原理/","children":[{"text":"Chapter1 编译器组成","icon":"edit","link":"Chapter1 编译器组成"},{"text":"Chapter2 词法分析","icon":"edit","link":"Chapter2 词法分析"},{"text":"Chapter3 语法分析","icon":"edit","link":"Chapter3 语法分析"},{"text":"Chapter4 语义分析","icon":"edit","link":"Chapter4 语义分析"},{"text":"Chapter5 代码生成","icon":"edit","link":"Chapter5 代码生成"}]},{"text":"杂谈","icon":"edit","prefix":"杂谈/","children":[{"text":"震惊,1=0!?","icon":"edit","link":"编程杂谈/震惊,1=0!?.md"},{"text":"香蕉 2","icon":"edit","link":"2"},"3","4"]},{"text":"樱桃","icon":"edit","link":"cherry"},{"text":"火龙果","icon":"edit","link":"dragonfruit"},"tomato","strawberry"]},{"text":"V2 文档","icon":"note","link":"https://theme-hope.vuejs.press/zh/"}],"sidebar":{"/zh/":["",{"text":"如何使用","icon":"creative","prefix":"demo/","link":"demo/","children":"structure"},{"text":"文章","icon":"note","prefix":"posts/","children":"structure"},"intro","slides"]},"footer":"默认页脚","displayFooter":true,"blog":{"description":"一个前端开发者","intro":"/zh/intro.html"}},"/":{"lang":"en-US","navbarLocales":{"langName":"English","selectLangAriaLabel":"Select language"},"metaLocales":{"author":"Author","date":"Writing Date","origin":"Original","views":"Page views","category":"Category","tag":"Tag","readingTime":"Reading Time","words":"Words","toc":"On This Page","prev":"Prev","next":"Next","lastUpdated":"Last update","contributors":"Contributors","editLink":"Edit this page on GitHub","print":"Print"},"blogLocales":{"article":"Articles","articleList":"Article List","category":"Category","tag":"Tag","timeline":"Timeline","timelineTitle":"Yesterday Once More!","all":"All","intro":"Personal Intro","star":"Star"},"paginationLocales":{"prev":"Prev","next":"Next","navigate":"Jump to","action":"Go","errorText":"Please enter a number between 1 and $page !"},"outlookLocales":{"themeColor":"Theme Color","darkmode":"Theme Mode","fullscreen":"Full Screen"},"encryptLocales":{"iconLabel":"Page Encrypted","placeholder":"Enter password","remember":"Remember password","errorHint":"Please enter the correct password!"},"routeLocales":{"skipToContent":"Skip to main content","notFoundTitle":"Page not found","notFoundMsg":["There’s nothing here.","How did we get here?","That’s a Four-Oh-Four.","Looks like we've got some broken links."],"back":"Go back","home":"Take me home","openInNewWindow":"Open in new window"},"navbar":["/",{"text":"Demo","icon":"discover","link":"/demo/"},{"text":"Posts","icon":"edit","prefix":"/posts/","children":[{"text":"Apple","icon":"edit","prefix":"apple/","children":[{"text":"Apple1","icon":"edit","link":"1"},{"text":"Apple2","icon":"edit","link":"2"},"3","4"]},{"text":"Banana","icon":"edit","prefix":"banana/","children":[{"text":"Banana 1","icon":"edit","link":"1"},{"text":"Banana 2","icon":"edit","link":"2"},"3","4"]},{"text":"Cherry","icon":"edit","link":"cherry"},{"text":"Dragon Fruit","icon":"edit","link":"dragonfruit"},"tomato","strawberry"]},{"text":"V2 Docs","icon":"note","link":"https://theme-hope.vuejs.press/"}],"sidebar":{"/":["",{"icon":"discover","text":"Demo","prefix":"demo/","link":"demo/","children":"structure"},{"text":"Articles","icon":"note","prefix":"posts/","children":"structure"},"intro","slides"]},"footer":"Default footer","displayFooter":true,"blog":{"description":"A FrontEnd programmer","intro":"/intro.html"}}}}`),R8=H(S8),x2=()=>R8,C2=Symbol(""),D8=()=>{const e=ue(C2);if(!e)throw new Error("useThemeLocaleData() is called without provider.");return e},$8=(e,t)=>{const{locales:n,...r}=e;return{...r,...n==null?void 0:n[t]}},M8=bt({enhance({app:e}){const t=x2(),n=e._context.provides[ll],r=w(()=>$8(t.value,n.value));e.provide(C2,r),Object.defineProperties(e.config.globalProperties,{$theme:{get(){return t.value}},$themeLocale:{get(){return r.value}}})}});const B8={provider:"Giscus",lightTheme:"https://unpkg.com/vuepress-theme-hope@2.0.0-beta.211/templates/giscus/light.css",darkTheme:"https://unpkg.com/vuepress-theme-hope@2.0.0-beta.211/templates/giscus/dark.css"};let V8=B8;const T2=Symbol(""),k2=()=>ue(T2),F8=k2,H8=e=>{e.provide(T2,V8)},ei=["ar","de","gsw","en","es","fa","fr","id","it","ja","ko","nl","pl","pt","ro","ru","th","tr","uk","vi","zh-CN","zh-TW"];var N8=D({name:"GiscusComment",props:{darkmode:Boolean},setup(e){const t=F8(),n=ie(),r=!!(t.repo&&t.repoId&&t.category&&t.categoryId),{repo:a,repoId:o,category:l,categoryId:s}=t,c=H(!1),u=w(()=>{const p=ol().value;if(ei.includes(p))return p;const f=p.split("-")[0];return ei.includes(f)?f:"en"}),d=w(()=>({repo:a,repoId:o,category:l,categoryId:s,lang:u.value,theme:e.darkmode?t.darkTheme||"dark":t.lightTheme||"light",mapping:t.mapping||"pathname",term:Fe(n.value.path),inputPosition:t.inputPosition||"top",reactionsEnabled:t.reactionsEnabled===!1?"0":"1",strict:t.strict===!1?"0":"1",loading:t.lazyLoading===!1?"eager":"lazy",emitMetadata:"0"}));return de(async()=>{await m(()=>import("./giscus-52604b1e.js"),[]),c.value=!0}),()=>r?i("div",{class:["giscus-wrapper",{"input-top":t.inputPosition!=="bottom"}],id:"comment"},c.value?i("giscus-widget",d.value):i(Yt)):null}}),j8=D({name:"CommentService",props:{darkmode:Boolean},setup(e){const t=k2(),n=be(),r=t.comment!==!1,a=w(()=>n.value.comment||r&&n.value.comment!==!1);return()=>i(N8,{darkmode:e.darkmode,style:{display:a.value?"block":"none"}})}}),q8=bt({enhance:({app:e})=>{H8(e),e.component("CommentService",j8)}});const U8=800,G8=2e3,W8={"/zh/":{copy:"复制代码",copied:"已复制",hint:"复制成功"},"/":{copy:"Copy code",copied:"Copied",hint:"Copied successfully"}},K8=!1,J8=['.theme-hope-content div[class*="language-"] pre'],ti=!1,Ja=new Map,Y8=()=>{const{copy:e}=Fu({legacy:!0}),t=zr(W8),n=ie(),r=vu(),a=s=>{if(!s.hasAttribute("copy-code-registered")){const c=document.createElement("button");c.type="button",c.classList.add("copy-code-button"),c.innerHTML='
',c.setAttribute("aria-label",t.value.copy),c.setAttribute("data-copied",t.value.copied),s.parentElement&&s.parentElement.insertBefore(c,s),s.setAttribute("copy-code-registered","")}},o=()=>mn().then(()=>new Promise(s=>{setTimeout(()=>{J8.forEach(c=>{document.querySelectorAll(c).forEach(a)}),s()},U8)})),l=(s,c,u)=>{let{innerText:d=""}=c;/language-(shellscript|shell|bash|sh|zsh)/.test(s.classList.toString())&&(d=d.replace(/^ *(\$|>) /gm,"")),e(d).then(()=>{u.classList.add("copied"),clearTimeout(Ja.get(u));const p=setTimeout(()=>{u.classList.remove("copied"),u.blur(),Ja.delete(u)},G8);Ja.set(u,p)})};de(()=>{(!r.value||ti)&&o(),Me("click",s=>{const c=s.target;if(c.matches('div[class*="language-"] > button.copy')){const u=c.parentElement,d=c.nextElementSibling;d&&l(u,d,c)}else if(c.matches('div[class*="language-"] div.copy-icon')){const u=c.parentElement,d=u.parentElement,p=u.nextElementSibling;p&&l(d,p,u)}}),se(()=>n.value.path,()=>{(!r.value||ti)&&o()})})};var Z8=bt({setup:()=>{Y8()}});const Q8=(e,t)=>t==="json"?JSON.parse(e):new Function(`let config,__chart_js_config__; + */const pe={settings:{minimum:.08,easing:"ease",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,barSelector:'[role="bar"]',parent:"body",template:'
'},status:null,set:e=>{const t=pe.isStarted();e=Ka(e,pe.settings.minimum,1),pe.status=e===1?null:e;const n=pe.render(!t),r=n.querySelector(pe.settings.barSelector),a=pe.settings.speed,o=pe.settings.easing;return n.offsetWidth,P8(l=>{Zr(r,{transform:"translate3d("+Zs(e)+"%,0,0)",transition:"all "+a+"ms "+o}),e===1?(Zr(n,{transition:"none",opacity:"1"}),n.offsetWidth,setTimeout(function(){Zr(n,{transition:"all "+a+"ms linear",opacity:"0"}),setTimeout(function(){pe.remove(),l()},a)},a)):setTimeout(()=>l(),a)}),pe},isStarted:()=>typeof pe.status=="number",start:()=>{pe.status||pe.set(0);const e=()=>{setTimeout(()=>{pe.status&&(pe.trickle(),e())},pe.settings.trickleSpeed)};return pe.settings.trickle&&e(),pe},done:e=>!e&&!pe.status?pe:pe.inc(.3+.5*Math.random()).set(1),inc:e=>{let t=pe.status;return t?(typeof e!="number"&&(e=(1-t)*Ka(Math.random()*t,.1,.95)),t=Ka(t+e,0,.994),pe.set(t)):pe.start()},trickle:()=>pe.inc(Math.random()*pe.settings.trickleRate),render:e=>{if(pe.isRendered())return document.getElementById("nprogress");Qs(document.documentElement,"nprogress-busy");const t=document.createElement("div");t.id="nprogress",t.innerHTML=pe.settings.template;const n=t.querySelector(pe.settings.barSelector),r=e?"-100":Zs(pe.status||0),a=document.querySelector(pe.settings.parent);return Zr(n,{transition:"all 0 linear",transform:"translate3d("+r+"%,0,0)"}),a!==document.body&&Qs(a,"nprogress-custom-parent"),a==null||a.appendChild(t),t},remove:()=>{Xs(document.documentElement,"nprogress-busy"),Xs(document.querySelector(pe.settings.parent),"nprogress-custom-parent");const e=document.getElementById("nprogress");e&&z8(e)},isRendered:()=>!!document.getElementById("nprogress")},Ka=(e,t,n)=>en?n:e,Zs=e=>(-1+e)*100,P8=function(){const e=[];function t(){const n=e.shift();n&&n(t)}return function(n){e.push(n),e.length===1&&t()}}(),Zr=function(){const e=["Webkit","O","Moz","ms"],t={};function n(l){return l.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(s,c){return c.toUpperCase()})}function r(l){const s=document.body.style;if(l in s)return l;let c=e.length;const u=l.charAt(0).toUpperCase()+l.slice(1);let d;for(;c--;)if(d=e[c]+u,d in s)return d;return l}function a(l){return l=n(l),t[l]??(t[l]=r(l))}function o(l,s,c){s=a(s),l.style[s]=c}return function(l,s){for(const c in s){const u=s[c];u!==void 0&&Object.prototype.hasOwnProperty.call(s,c)&&o(l,c,u)}}}(),A2=(e,t)=>(typeof e=="string"?e:ml(e)).indexOf(" "+t+" ")>=0,Qs=(e,t)=>{const n=ml(e),r=n+t;A2(n,t)||(e.className=r.substring(1))},Xs=(e,t)=>{const n=ml(e);if(!A2(e,t))return;const r=n.replace(" "+t+" "," ");e.className=r.substring(1,r.length-1)},ml=e=>(" "+(e.className||"")+" ").replace(/\s+/gi," "),z8=e=>{e&&e.parentNode&&e.parentNode.removeChild(e)};const O8=()=>{de(()=>{const e=Ye(),t=new Set;t.add(e.currentRoute.value.path),e.beforeEach(n=>{t.has(n.path)||pe.start()}),e.afterEach(n=>{t.add(n.path),pe.done()})})},I8=bt({setup(){O8()}}),R8=JSON.parse(`{"encrypt":{"config":{"/demo/encrypt.html":["$2a$10$qWzM2LnIaDOxo7K0oZgXEeZcSCSAeO3Rr7hCoSE/kTnuSKd9upRVG"],"/zh/demo/encrypt.html":["$2a$10$4zqcnmaRjoNKREX56eI0Y.aRTtgNq8.VvV.CoFfRcOVGu8iNUbRei"]}},"author":{"name":"Chi"},"logo":"/logo.svg","repo":"vuepress-theme-hope/vuepress-theme-hope","docsDir":"docs","blog":{"medias":{"Baidu":"https://example.com","BiliBili":"https://example.com","Bitbucket":"https://example.com","Dingding":"https://example.com","Discord":"https://example.com","Dribbble":"https://example.com","Email":"mailto:info@example.com","Evernote":"https://example.com","Facebook":"https://example.com","Flipboard":"https://example.com","Gitee":"https://example.com","GitHub":"https://example.com","Gitlab":"https://example.com","Gmail":"mailto:info@example.com","Instagram":"https://example.com","Lark":"https://example.com","Lines":"https://example.com","Linkedin":"https://example.com","Pinterest":"https://example.com","Pocket":"https://example.com","QQ":"https://example.com","Qzone":"https://example.com","Reddit":"https://example.com","Rss":"https://example.com","Steam":"https://example.com","Twitter":"https://example.com","Wechat":"https://example.com","Weibo":"https://example.com","Whatsapp":"https://example.com","Youtube":"https://example.com","Zhihu":"https://example.com","MrHope":"https://mrhope.site"}},"locales":{"/zh/":{"lang":"zh-CN","navbarLocales":{"langName":"简体中文","selectLangAriaLabel":"选择语言"},"metaLocales":{"author":"作者","date":"写作日期","origin":"原创","views":"访问量","category":"分类","tag":"标签","readingTime":"阅读时间","words":"字数","toc":"此页内容","prev":"上一页","next":"下一页","lastUpdated":"上次编辑于","contributors":"贡献者","editLink":"在 GitHub 上编辑此页","print":"打印"},"blogLocales":{"article":"文章","articleList":"文章列表","category":"分类","tag":"标签","timeline":"时间轴","timelineTitle":"昨日不在","all":"全部","intro":"个人介绍","star":"收藏"},"paginationLocales":{"prev":"上一页","next":"下一页","navigate":"跳转到","action":"前往","errorText":"请输入 1 到 $page 之前的页码!"},"outlookLocales":{"themeColor":"主题色","darkmode":"外观","fullscreen":"全屏"},"encryptLocales":{"iconLabel":"文章已加密","placeholder":"输入密码","remember":"记住密码","errorHint":"请输入正确的密码"},"routeLocales":{"skipToContent":"跳至主要內容","notFoundTitle":"页面不存在","notFoundMsg":["这里什么也没有","我们是怎么来到这儿的?","这 是 四 零 四 !","看起来你访问了一个失效的链接"],"back":"返回上一页","home":"带我回家","openInNewWindow":"Open in new window"},"navbar":["/zh/",{"text":"演示","icon":"discover","link":"/zh/demo/"},{"text":"博文","icon":"edit","prefix":"/zh/posts/","children":[{"text":"编译原理","icon":"edit","prefix":"编译原理/","children":[{"text":"Chapter1 编译器组成","icon":"edit","link":"Chapter1 编译器组成"},{"text":"Chapter2 词法分析","icon":"edit","link":"Chapter2 词法分析"},{"text":"Chapter3 语法分析","icon":"edit","link":"Chapter3 语法分析"},{"text":"Chapter4 语义分析","icon":"edit","link":"Chapter4 语义分析"},{"text":"Chapter5 代码生成","icon":"edit","link":"Chapter5 代码生成"}]},{"text":"杂谈","icon":"edit","prefix":"杂谈/","children":[{"text":"震惊,1=0!?","icon":"edit","link":"编程杂谈/震惊,1=0!?.md"},{"text":"香蕉 2","icon":"edit","link":"2"},"3","4"]},{"text":"樱桃","icon":"edit","link":"cherry"},{"text":"火龙果","icon":"edit","link":"dragonfruit"},"tomato","strawberry"]},{"text":"V2 文档","icon":"note","link":"https://theme-hope.vuejs.press/zh/"}],"sidebar":{"/zh/":["",{"text":"如何使用","icon":"creative","prefix":"demo/","link":"demo/","children":"structure"},{"text":"文章","icon":"note","prefix":"posts/","children":"structure"},"intro","slides"]},"footer":"默认页脚","displayFooter":true,"blog":{"description":"一个前端开发者","intro":"/zh/intro.html"}},"/":{"lang":"en-US","navbarLocales":{"langName":"English","selectLangAriaLabel":"Select language"},"metaLocales":{"author":"Author","date":"Writing Date","origin":"Original","views":"Page views","category":"Category","tag":"Tag","readingTime":"Reading Time","words":"Words","toc":"On This Page","prev":"Prev","next":"Next","lastUpdated":"Last update","contributors":"Contributors","editLink":"Edit this page on GitHub","print":"Print"},"blogLocales":{"article":"Articles","articleList":"Article List","category":"Category","tag":"Tag","timeline":"Timeline","timelineTitle":"Yesterday Once More!","all":"All","intro":"Personal Intro","star":"Star"},"paginationLocales":{"prev":"Prev","next":"Next","navigate":"Jump to","action":"Go","errorText":"Please enter a number between 1 and $page !"},"outlookLocales":{"themeColor":"Theme Color","darkmode":"Theme Mode","fullscreen":"Full Screen"},"encryptLocales":{"iconLabel":"Page Encrypted","placeholder":"Enter password","remember":"Remember password","errorHint":"Please enter the correct password!"},"routeLocales":{"skipToContent":"Skip to main content","notFoundTitle":"Page not found","notFoundMsg":["There’s nothing here.","How did we get here?","That’s a Four-Oh-Four.","Looks like we've got some broken links."],"back":"Go back","home":"Take me home","openInNewWindow":"Open in new window"},"navbar":["/",{"text":"Demo","icon":"discover","link":"/demo/"},{"text":"Posts","icon":"edit","prefix":"/posts/","children":[{"text":"Apple","icon":"edit","prefix":"apple/","children":[{"text":"Apple1","icon":"edit","link":"1"},{"text":"Apple2","icon":"edit","link":"2"},"3","4"]},{"text":"Banana","icon":"edit","prefix":"banana/","children":[{"text":"Banana 1","icon":"edit","link":"1"},{"text":"Banana 2","icon":"edit","link":"2"},"3","4"]},{"text":"Cherry","icon":"edit","link":"cherry"},{"text":"Dragon Fruit","icon":"edit","link":"dragonfruit"},"tomato","strawberry"]},{"text":"V2 Docs","icon":"note","link":"https://theme-hope.vuejs.press/"}],"sidebar":{"/":["",{"icon":"discover","text":"Demo","prefix":"demo/","link":"demo/","children":"structure"},{"text":"Articles","icon":"note","prefix":"posts/","children":"structure"},"intro","slides"]},"footer":"Default footer","displayFooter":true,"blog":{"description":"A FrontEnd programmer","intro":"/intro.html"}}}}`),S8=H(R8),x2=()=>S8,C2=Symbol(""),D8=()=>{const e=ue(C2);if(!e)throw new Error("useThemeLocaleData() is called without provider.");return e},$8=(e,t)=>{const{locales:n,...r}=e;return{...r,...n==null?void 0:n[t]}},M8=bt({enhance({app:e}){const t=x2(),n=e._context.provides[ll],r=w(()=>$8(t.value,n.value));e.provide(C2,r),Object.defineProperties(e.config.globalProperties,{$theme:{get(){return t.value}},$themeLocale:{get(){return r.value}}})}});const B8={provider:"Giscus",lightTheme:"https://unpkg.com/vuepress-theme-hope@2.0.0-beta.211/templates/giscus/light.css",darkTheme:"https://unpkg.com/vuepress-theme-hope@2.0.0-beta.211/templates/giscus/dark.css"};let V8=B8;const T2=Symbol(""),k2=()=>ue(T2),F8=k2,H8=e=>{e.provide(T2,V8)},ei=["ar","de","gsw","en","es","fa","fr","id","it","ja","ko","nl","pl","pt","ro","ru","th","tr","uk","vi","zh-CN","zh-TW"];var N8=D({name:"GiscusComment",props:{darkmode:Boolean},setup(e){const t=F8(),n=ie(),r=!!(t.repo&&t.repoId&&t.category&&t.categoryId),{repo:a,repoId:o,category:l,categoryId:s}=t,c=H(!1),u=w(()=>{const p=ol().value;if(ei.includes(p))return p;const f=p.split("-")[0];return ei.includes(f)?f:"en"}),d=w(()=>({repo:a,repoId:o,category:l,categoryId:s,lang:u.value,theme:e.darkmode?t.darkTheme||"dark":t.lightTheme||"light",mapping:t.mapping||"pathname",term:Fe(n.value.path),inputPosition:t.inputPosition||"top",reactionsEnabled:t.reactionsEnabled===!1?"0":"1",strict:t.strict===!1?"0":"1",loading:t.lazyLoading===!1?"eager":"lazy",emitMetadata:"0"}));return de(async()=>{await m(()=>import("./giscus-52604b1e.js"),[]),c.value=!0}),()=>r?i("div",{class:["giscus-wrapper",{"input-top":t.inputPosition!=="bottom"}],id:"comment"},c.value?i("giscus-widget",d.value):i(Jt)):null}}),j8=D({name:"CommentService",props:{darkmode:Boolean},setup(e){const t=k2(),n=be(),r=t.comment!==!1,a=w(()=>n.value.comment||r&&n.value.comment!==!1);return()=>i(N8,{darkmode:e.darkmode,style:{display:a.value?"block":"none"}})}}),q8=bt({enhance:({app:e})=>{H8(e),e.component("CommentService",j8)}});const U8=800,G8=2e3,W8={"/zh/":{copy:"复制代码",copied:"已复制",hint:"复制成功"},"/":{copy:"Copy code",copied:"Copied",hint:"Copied successfully"}},K8=!1,Y8=['.theme-hope-content div[class*="language-"] pre'],ti=!1,Ya=new Map,J8=()=>{const{copy:e}=Fu({legacy:!0}),t=zr(W8),n=ie(),r=vu(),a=s=>{if(!s.hasAttribute("copy-code-registered")){const c=document.createElement("button");c.type="button",c.classList.add("copy-code-button"),c.innerHTML='
',c.setAttribute("aria-label",t.value.copy),c.setAttribute("data-copied",t.value.copied),s.parentElement&&s.parentElement.insertBefore(c,s),s.setAttribute("copy-code-registered","")}},o=()=>mn().then(()=>new Promise(s=>{setTimeout(()=>{Y8.forEach(c=>{document.querySelectorAll(c).forEach(a)}),s()},U8)})),l=(s,c,u)=>{let{innerText:d=""}=c;/language-(shellscript|shell|bash|sh|zsh)/.test(s.classList.toString())&&(d=d.replace(/^ *(\$|>) /gm,"")),e(d).then(()=>{u.classList.add("copied"),clearTimeout(Ya.get(u));const p=setTimeout(()=>{u.classList.remove("copied"),u.blur(),Ya.delete(u)},G8);Ya.set(u,p)})};de(()=>{(!r.value||ti)&&o(),Me("click",s=>{const c=s.target;if(c.matches('div[class*="language-"] > button.copy')){const u=c.parentElement,d=c.nextElementSibling;d&&l(u,d,c)}else if(c.matches('div[class*="language-"] div.copy-icon')){const u=c.parentElement,d=u.parentElement,p=u.nextElementSibling;p&&l(d,p,u)}}),se(()=>n.value.path,()=>{(!r.value||ti)&&o()})})};var Z8=bt({setup:()=>{J8()}});const Q8=(e,t)=>t==="json"?JSON.parse(e):new Function(`let config,__chart_js_config__; { ${e} __chart_js_config__=config; } -return __chart_js_config__;`)();var X8=D({name:"ChartJS",props:{config:{type:String,required:!0},id:{type:String,required:!0},title:{type:String,default:""},type:{type:String,default:"json"}},setup(e){const t=Pe(),n=Pe(),r=H(!0);return de(async()=>{const[{default:a}]=await Promise.all([m(()=>import("./auto-fa8841cf.js"),[]),new Promise(s=>setTimeout(s,800))]);a.defaults.maintainAspectRatio=!1;const o=Q8(pn(e.config),e.type),l=n.value.getContext("2d");new a(l,o),r.value=!1}),()=>[e.title?i("div",{class:"chart-title"},decodeURIComponent(e.title)):null,r.value?i(Yt,{class:"chart-loading",height:192}):null,i("div",{ref:t,class:"chart-wrapper",id:e.id,style:{display:r.value?"none":"block"}},i("canvas",{ref:n,height:400}))]}});const Qr=Zn("VUEPRESS_CODE_TAB_STORE",{});var e5=D({name:"CodeTabs",props:{active:{type:Number,default:0},data:{type:Array,required:!0},id:{type:String,required:!0},tabId:{type:String,default:""}},slots:Object,setup(e,{slots:t}){const n=H(e.active),r=Pe([]),a=()=>{if(e.tabId){const{title:u,id:d=u}=e.data[n.value];Qr.value[e.tabId]=d}},o=(u=n.value)=>{n.value=u{n.value=u>0?u-1:r.value.length-1,r.value[n.value].focus()},s=(u,d)=>{if(u.key===" "||u.key==="Enter"?(u.preventDefault(),n.value=d):u.key==="ArrowRight"?(u.preventDefault(),o()):u.key==="ArrowLeft"&&(u.preventDefault(),l()),e.tabId){const{title:p,id:f=p}=e.data[n.value];Qr.value[e.tabId]=f}},c=()=>{if(e.tabId){const u=e.data.findIndex(({title:d,id:p=d})=>Qr.value[e.tabId]===p);if(u!==-1)return u}return e.active};return de(()=>{n.value=c(),se(()=>Qr.value[e.tabId],(u,d)=>{if(e.tabId&&u!==d){const p=e.data.findIndex(({title:f,id:h=f})=>h===u);p!==-1&&(n.value=p)}})}),()=>e.data.length?i("div",{class:"code-tabs"},[i("div",{class:"code-tabs-nav",role:"tablist"},e.data.map(({title:u},d)=>{const p=d===n.value;return i("button",{type:"button",ref:f=>{f&&(r.value[d]=f)},class:["code-tabs-nav-tab",{active:p}],role:"tab","aria-controls":`codetab-${e.id}-${d}`,"aria-selected":p,onClick:()=>{n.value=d,a()},onKeydown:f=>s(f,d)},u)})),e.data.map(({title:u,id:d=u},p)=>{const f=p===n.value;return i("div",{class:["code-tab",{active:f}],id:`codetab-${e.id}-${p}`,role:"tabpanel","aria-expanded":f},t[`tab${p}`]({title:u,value:d,isActive:f}))})]):null}});const L2=({active:e=!1},{slots:t})=>{var n;return i("div",{class:["code-group-item",{active:e}],"aria-selected":e},(n=t.default)==null?void 0:n.call(t))};L2.displayName="CodeGroupItem";const t5=D({name:"CodeGroup",slots:Object,setup(e,{slots:t}){const n=H(-1),r=Pe([]),a=(s=n.value)=>{n.value=s{n.value=s>0?s-1:r.value.length-1,r.value[n.value].focus()},l=(s,c)=>{s.key===" "||s.key==="Enter"?(s.preventDefault(),n.value=c):s.key==="ArrowRight"?(s.preventDefault(),a(c)):s.key==="ArrowLeft"&&(s.preventDefault(),o(c))};return()=>{var s;const c=(((s=t.default)==null?void 0:s.call(t))||[]).filter(u=>u.type.name==="CodeGroupItem").map(u=>(u.props===null&&(u.props={}),u));return c.length===0?null:(n.value<0||n.value>c.length-1?(n.value=c.findIndex(u=>"active"in u.props),n.value===-1&&(n.value=0)):c.forEach((u,d)=>{u.props.active=d===n.value}),i("div",{class:"code-group"},[i("div",{class:"code-group-nav"},c.map((u,d)=>{const p=d===n.value;return i("button",{type:"button",ref:f=>{f&&(r.value[d]=f)},class:["code-group-nav-tab",{active:p}],"aria-pressed":p,"aria-expanded":p,onClick:()=>{n.value=d},onKeydown:f=>l(f,d)},u.props.title)})),c]))}}});const n5=()=>i(ae,{name:"back"},()=>i("path",{d:"M1014.749 449.156v125.688H260.626l345.64 345.64-89.239 89.237L19.307 512l497.72-497.721 89.238 89.238-345.64 345.64h754.124z"})),r5=()=>i(ae,{name:"home"},()=>i("path",{d:"M780.106 420.978L506.994 147.866 233.882 420.978h.045v455.11H780.06v-455.11h.046zm90.977 90.976V876.09a91.022 91.022 0 01-91.023 91.022H233.927a91.022 91.022 0 01-91.022-91.022V511.954l-67.22 67.175-64.307-64.307 431.309-431.31c35.498-35.498 93.115-35.498 128.614 0l431.309 431.31-64.307 64.307L871.083 512z"})),a5='',o5='',l5='';const Ya={useBabel:!1,jsLib:[],cssLib:[],codepenLayout:"left",codepenEditors:"101",babel:"https://unpkg.com/@babel/standalone/babel.min.js",vue:"https://unpkg.com/vue/dist/vue.global.prod.js",react:"https://unpkg.com/react/umd/react.production.min.js",reactDOM:"https://unpkg.com/react-dom/umd/react-dom.production.min.js"},ni={html:{types:["html","slim","haml","md","markdown","vue"],map:{html:"none",vue:"none",md:"markdown"}},js:{types:["js","javascript","coffee","coffeescript","ts","typescript","ls","livescript"],map:{js:"none",javascript:"none",coffee:"coffeescript",ls:"livescript",ts:"typescript"}},css:{types:["css","less","sass","scss","stylus","styl"],map:{css:"none",styl:"stylus"}}},s5=(e,t,n)=>{const r=document.createElement(e);return kr(t)&&Ke(t).forEach(a=>{if(a.indexOf("data"))r[a]=t[a];else{const o=a.replace("data","");r.dataset[o]=t[a]}}),n&&n.forEach(a=>{r.appendChild(a)}),r},gl=e=>({...Ya,...e,jsLib:Array.from(new Set([...Ya.jsLib||[],...e.jsLib||[]])),cssLib:Array.from(new Set([...Ya.cssLib||[],...e.cssLib||[]]))}),Sn=(e,t)=>{if(e[t]!==void 0)return e[t];const n=new Promise(r=>{var a;const o=document.createElement("script");o.src=t,(a=document.querySelector("body"))==null||a.appendChild(o),o.onload=()=>{r()}});return e[t]=n,n},i5=(e,t)=>{if(t.css&&Array.from(e.childNodes).every(n=>n.nodeName!=="STYLE")){const n=s5("style",{innerHTML:t.css});e.appendChild(n)}},c5=(e,t,n)=>{const r=n.getScript();if(r&&Array.from(t.childNodes).every(a=>a.nodeName!=="SCRIPT")){const a=document.createElement("script");a.appendChild(document.createTextNode(`{const document=window.document.querySelector('#${e} .code-demo-container').shadowRoot; +return __chart_js_config__;`)();var X8=D({name:"ChartJS",props:{config:{type:String,required:!0},id:{type:String,required:!0},title:{type:String,default:""},type:{type:String,default:"json"}},setup(e){const t=Pe(),n=Pe(),r=H(!0);return de(async()=>{const[{default:a}]=await Promise.all([m(()=>import("./auto-fa8841cf.js"),[]),new Promise(s=>setTimeout(s,800))]);a.defaults.maintainAspectRatio=!1;const o=Q8(pn(e.config),e.type),l=n.value.getContext("2d");new a(l,o),r.value=!1}),()=>[e.title?i("div",{class:"chart-title"},decodeURIComponent(e.title)):null,r.value?i(Jt,{class:"chart-loading",height:192}):null,i("div",{ref:t,class:"chart-wrapper",id:e.id,style:{display:r.value?"none":"block"}},i("canvas",{ref:n,height:400}))]}});const Qr=Zn("VUEPRESS_CODE_TAB_STORE",{});var e5=D({name:"CodeTabs",props:{active:{type:Number,default:0},data:{type:Array,required:!0},id:{type:String,required:!0},tabId:{type:String,default:""}},slots:Object,setup(e,{slots:t}){const n=H(e.active),r=Pe([]),a=()=>{if(e.tabId){const{title:u,id:d=u}=e.data[n.value];Qr.value[e.tabId]=d}},o=(u=n.value)=>{n.value=u{n.value=u>0?u-1:r.value.length-1,r.value[n.value].focus()},s=(u,d)=>{if(u.key===" "||u.key==="Enter"?(u.preventDefault(),n.value=d):u.key==="ArrowRight"?(u.preventDefault(),o()):u.key==="ArrowLeft"&&(u.preventDefault(),l()),e.tabId){const{title:p,id:f=p}=e.data[n.value];Qr.value[e.tabId]=f}},c=()=>{if(e.tabId){const u=e.data.findIndex(({title:d,id:p=d})=>Qr.value[e.tabId]===p);if(u!==-1)return u}return e.active};return de(()=>{n.value=c(),se(()=>Qr.value[e.tabId],(u,d)=>{if(e.tabId&&u!==d){const p=e.data.findIndex(({title:f,id:h=f})=>h===u);p!==-1&&(n.value=p)}})}),()=>e.data.length?i("div",{class:"code-tabs"},[i("div",{class:"code-tabs-nav",role:"tablist"},e.data.map(({title:u},d)=>{const p=d===n.value;return i("button",{type:"button",ref:f=>{f&&(r.value[d]=f)},class:["code-tabs-nav-tab",{active:p}],role:"tab","aria-controls":`codetab-${e.id}-${d}`,"aria-selected":p,onClick:()=>{n.value=d,a()},onKeydown:f=>s(f,d)},u)})),e.data.map(({title:u,id:d=u},p)=>{const f=p===n.value;return i("div",{class:["code-tab",{active:f}],id:`codetab-${e.id}-${p}`,role:"tabpanel","aria-expanded":f},t[`tab${p}`]({title:u,value:d,isActive:f}))})]):null}});const L2=({active:e=!1},{slots:t})=>{var n;return i("div",{class:["code-group-item",{active:e}],"aria-selected":e},(n=t.default)==null?void 0:n.call(t))};L2.displayName="CodeGroupItem";const t5=D({name:"CodeGroup",slots:Object,setup(e,{slots:t}){const n=H(-1),r=Pe([]),a=(s=n.value)=>{n.value=s{n.value=s>0?s-1:r.value.length-1,r.value[n.value].focus()},l=(s,c)=>{s.key===" "||s.key==="Enter"?(s.preventDefault(),n.value=c):s.key==="ArrowRight"?(s.preventDefault(),a(c)):s.key==="ArrowLeft"&&(s.preventDefault(),o(c))};return()=>{var s;const c=(((s=t.default)==null?void 0:s.call(t))||[]).filter(u=>u.type.name==="CodeGroupItem").map(u=>(u.props===null&&(u.props={}),u));return c.length===0?null:(n.value<0||n.value>c.length-1?(n.value=c.findIndex(u=>"active"in u.props),n.value===-1&&(n.value=0)):c.forEach((u,d)=>{u.props.active=d===n.value}),i("div",{class:"code-group"},[i("div",{class:"code-group-nav"},c.map((u,d)=>{const p=d===n.value;return i("button",{type:"button",ref:f=>{f&&(r.value[d]=f)},class:["code-group-nav-tab",{active:p}],"aria-pressed":p,"aria-expanded":p,onClick:()=>{n.value=d},onKeydown:f=>l(f,d)},u.props.title)})),c]))}}});const n5=()=>i(ae,{name:"back"},()=>i("path",{d:"M1014.749 449.156v125.688H260.626l345.64 345.64-89.239 89.237L19.307 512l497.72-497.721 89.238 89.238-345.64 345.64h754.124z"})),r5=()=>i(ae,{name:"home"},()=>i("path",{d:"M780.106 420.978L506.994 147.866 233.882 420.978h.045v455.11H780.06v-455.11h.046zm90.977 90.976V876.09a91.022 91.022 0 01-91.023 91.022H233.927a91.022 91.022 0 01-91.022-91.022V511.954l-67.22 67.175-64.307-64.307 431.309-431.31c35.498-35.498 93.115-35.498 128.614 0l431.309 431.31-64.307 64.307L871.083 512z"})),a5='',o5='',l5='';const Ja={useBabel:!1,jsLib:[],cssLib:[],codepenLayout:"left",codepenEditors:"101",babel:"https://unpkg.com/@babel/standalone/babel.min.js",vue:"https://unpkg.com/vue/dist/vue.global.prod.js",react:"https://unpkg.com/react/umd/react.production.min.js",reactDOM:"https://unpkg.com/react-dom/umd/react-dom.production.min.js"},ni={html:{types:["html","slim","haml","md","markdown","vue"],map:{html:"none",vue:"none",md:"markdown"}},js:{types:["js","javascript","coffee","coffeescript","ts","typescript","ls","livescript"],map:{js:"none",javascript:"none",coffee:"coffeescript",ls:"livescript",ts:"typescript"}},css:{types:["css","less","sass","scss","stylus","styl"],map:{css:"none",styl:"stylus"}}},s5=(e,t,n)=>{const r=document.createElement(e);return kr(t)&&Ke(t).forEach(a=>{if(a.indexOf("data"))r[a]=t[a];else{const o=a.replace("data","");r.dataset[o]=t[a]}}),n&&n.forEach(a=>{r.appendChild(a)}),r},gl=e=>({...Ja,...e,jsLib:Array.from(new Set([...Ja.jsLib||[],...e.jsLib||[]])),cssLib:Array.from(new Set([...Ja.cssLib||[],...e.cssLib||[]]))}),Rn=(e,t)=>{if(e[t]!==void 0)return e[t];const n=new Promise(r=>{var a;const o=document.createElement("script");o.src=t,(a=document.querySelector("body"))==null||a.appendChild(o),o.onload=()=>{r()}});return e[t]=n,n},i5=(e,t)=>{if(t.css&&Array.from(e.childNodes).every(n=>n.nodeName!=="STYLE")){const n=s5("style",{innerHTML:t.css});e.appendChild(n)}},c5=(e,t,n)=>{const r=n.getScript();if(r&&Array.from(t.childNodes).every(a=>a.nodeName!=="SCRIPT")){const a=document.createElement("script");a.appendChild(document.createTextNode(`{const document=window.document.querySelector('#${e} .code-demo-container').shadowRoot; ${r}}`)),t.appendChild(a)}},u5=e=>{const t=Ke(e),n={html:[],js:[],css:[],isLegal:!1};return["html","js","css"].forEach(r=>{const a=t.filter(o=>ni[r].types.includes(o));if(a.length){const o=a[0];n[r]=[e[o].replace(/^\n|\n$/g,""),ni[r].map[o]||o]}}),n.isLegal=(!n.html.length||n.html[1]==="none")&&(!n.js.length||n.js[1]==="none")&&(!n.css.length||n.css[1]==="none"),n},P2=e=>e.replace(/
/g,"
").replace(/<((\S+)[^<]*?)\s+\/>/g,"<$1>"),z2=e=>`
${P2(e)}
`,d5=e=>`${e.replace("export default ","const $reactApp = ").replace(/App\.__style__(\s*)=(\s*)`([\s\S]*)?`/,"")}; -ReactDOM.createRoot(document.getElementById("app")).render(React.createElement($reactApp))`,p5=e=>e.replace(/export\s+default\s*\{(\n*[\s\S]*)\n*\}\s*;?$/u,"Vue.createApp({$1}).mount('#app')").replace(/export\s+default\s*define(Async)?Component\s*\(\s*\{(\n*[\s\S]*)\n*\}\s*\)\s*;?$/u,"Vue.createApp({$1}).mount('#app')").trim(),O2=e=>`(function(exports){var module={};module.exports=exports;${e};return module.exports.__esModule?module.exports.default:module.exports;})({})`,f5=(e,t)=>{const n=gl(t),r=e.js[0]||"";return{...n,html:P2(e.html[0]||""),js:r,css:e.css[0]||"",isLegal:e.isLegal,getScript:()=>{var a;return n.useBabel?((a=window.Babel.transform(r,{presets:["es2015"]}))==null?void 0:a.code)||"":r}}},h5=/