> 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.1-yu-fa-fen-xi-jian-jie.md).

# 3A.1 语法分析简介

{% hint style="info" %}
本章将简略地介绍语法分析的理论知识，以便让读者对文法、CFG、LALR 等描述编译器语法分析的专业术语有清晰的认识。但本章知识对于学习 Go 的语法解析器并不是必须的，不感兴趣的读者可以直接跳过直接进入[Golang 编译器 - 语法分析](/3.-golang-bian-yi-qi-yu-fa-fen-xi/3.1-jian-jie.md)一章。
{% endhint %}

经过词法扫描，编译器获得了一个 Token 流，语法分析会解析这些 Token 所代表的程序结构信息，并根据程序语言的文法规则，将 Token 流构造成一颗抽象语法树（Abstract Syntax Tree），简称 AST。

AST 是编译阶段的重要数据结构，也是很多后续的操作的基础。
