> 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/2.-golang-bian-yi-qi-ci-fa-fen-xi/2.2-dai-ma-jie-gou.md).

# 2.2 代码结构

Go 编译器中与词法分析相关的代码位置如下：

* package 位置: $GCROOT/compile/internal/syntax
* source.go: 字符扫描&#x20;
* scanner.go: 词法分析器
* tokens.go: 各种类型的 token 声明
* tokens\_string.go: token 类型的 String 函数
* operator\_string.go: 操作符好的 String 函数
