Abstract syntax tree

From Wiki @ Karl Jones dot com
Revision as of 17:18, 31 August 2015 by Karl Jones (Talk | contribs) (See also)

Jump to: navigation, search

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.

Description

Each node of the tree denotes a construct occurring in the source code.

The syntax is "abstract" in not representing every detail appearing in the real syntax.

For instance, grouping parentheses are implicit in the tree structure, and a syntactic construct like an if-condition-then expression may be denoted by means of a single node with three branches.

This distinguishes abstract syntax trees from concrete syntax trees.

Subsequent processing

Once built, additional information is added to the AST by means of subsequent processing, e.g., contextual analysis.

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

Concrete syntax trees

Concrete syntax trees, traditionally designated parse trees, are often built by a parser during the source code translation and compiling process.

See also

External links