> For the complete documentation index, see [llms.txt](https://gocompiler.shizhz.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gocompiler.shizhz.me/3.b-yu-fa-fen-xi-li-lun-zhi-shi/3.3-yu-fa-jie-xi.md).

# 3A.3 语法解析

如果一个程序是良构的，那么代表该程序的 Token 序列就一定可以通过该程序的文法推导出来，并且只有一种推导方式，语法解析的核心逻辑就是还原该推导过程。如果将解析过程看着是构建一个解析树的过程，那么根据构建方式的不同，可以分为自顶向下与自底向上两种。接下来我们依次对其进行分析。
