Difference between revisions of "Abstract syntax tree"

From Wiki @ Karl Jones dot com
Jump to: navigation, search
(etc)
 
(Description)
Line 3: Line 3:
 
== Description ==
 
== Description ==
  
Each [[Node (computing)|node]] of the tree denotes a construct occurring in the source code.
+
Each [[Node (computer science)|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.
 
The syntax is "abstract" in not representing every detail appearing in the real syntax.

Revision as of 16:18, 31 August 2015

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