> 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.1-zi-ding-xiang-xia-topdown.md).

# 3A.3.1 自顶向下（Top-Down）

从解析树根节点开始，逐步向叶子节点构建整颗解析树的过程叫着自顶向下解析。自顶向下解析就是还原一个最左推导的过程。

本节我们先介绍递归下降算法，再介绍一种受限的自顶向下的解析算法 - 基于LL（1）文法的预测/匹配解析器。
