Abstract Syntax Tree

In computer science, an abstract syntax tree (AST), or just syntax tree, is a tree representation of the abstract syntactic structure of source code written in a programming language. Each node of the tree denotes a construct occurring in the source code. The syntax is 'abstract' in the sense that it does not represent every detail that appears in the real syntax. For instance, grouping parentheses are implicit in the tree structure, and a syntactic construct such as an if-condition-then expression may be denoted by a single node with two branches.

This makes abstract syntax trees different from concrete syntax trees, traditionally called parse trees, which are often built by a parser as part of the source code translation and compiling process. Once built, additional information is added to the AST by subsequent processing, e.g., contextual analysis.

Abstract syntax trees are also used in program analysis and program transformation systems.

Famous quotes containing the words abstract and/or tree:

    “If our minds could get hold of one abstract truth, they would be immortal so far as that truth is concerned. My trouble is to find out how we can get hold of the truth at all.”
    Henry Brooks Adams (1838–1918)

    There is something singularly grand and impressive in the sound of a tree falling in a perfectly calm night like this, as if the agencies which overthrow it did not need to be excited, but worked with a subtle, deliberate, and conscious force, like a boa-constrictor, and more effectively then than even in a windy day.
    Henry David Thoreau (1817–1862)