1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-25 13:32:22 +00:00
2018-06-25 13:54:53 +08:00

4 lines
648 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 第七章 Go 和 AST
AST是抽象语法树的缩写abstract syntax tree一般可以用一个树型结构表示源代码的抽象语法结构。比如一个算术表达式可以用AST表示if分支结构、for循环结构也可以用AST表示。因为树是一个任意分叉的AST也可以非常容易if分支、for循环等嵌套的结构。了解AST不仅仅可以加深对语言本身的理解基于AST也可以做很多有意义的事情比如分析某类型的BUG、进行某种优化等。更让人兴奋的是Go语言标准库已经内置了强大易用的AST库让我们了解一下这种神秘的技术吧。