What Is an Abstract Syntax Tree?

In computer science, the Abstract Syntax Tree (AST), or Syntax Tree for short, is an abstract representation of the syntax structure of source code. It represents the syntax structure of the programming language in a tree-like form, and each node on the tree represents a structure in the source code. The reason why grammar is "abstract" is that the grammar here does not represent every detail that appears in real grammar. For example, nested parentheses are hidden in the tree structure and are not presented in the form of nodes; conditional jump statements like if-condition-then can be represented by nodes with two branches.

IN OTHER LANGUAGES

Was this article helpful? Thanks for the feedback Thanks for the feedback

How can we help? How can we help?