Abstract syntax tree

Abstract syntax tree

In computer science, an abstract syntax tree (AST), or just syntax tree, is a tree representation of the syntax of some source code (that has been written in a programming language). Each node of the tree denotes a construct occurring in the source code. The tree is "abstract" in the sense that it may not represent some constructs that appear in the original source. For instance, the classic example of such an omission is grouping parentheses, since in an AST the grouping of operands is implicit in the tree structure.

An AST is often built by a parser as part of the processing of compiling source code. Once built additional information is added to the AST by subsequent processing, eg semantic analysis.

ee also

*Abstract semantic graph (ASG)
*Concrete syntax tree
*Document Object Model (DOM)
*Semantic resolution tree (RST)
*Shunting yard algorithm
*Symbol table
*TreeDL

References

External links

* [http://www.eclipse.org/jdt/ui/astview/index.php AST View] , an Eclipse plugin to visualize a Java abstract syntax tree
* [http://www.eclipse.org/articles/Article-JavaCodeManipulation_AST/index.html Good information about the Eclipse AST and Java Code Manipulation]
*Paper " [http://jerry.cs.uiuc.edu/~plop/plop2003/Papers/Jones-ImplementingASTs.pdf Abstract Syntax Tree Implementation Idioms] " by Joel Jones (overview of AST implementation in various language families)
*Paper " [http://www.ansa.co.uk/ANSATech/95/Primary/155101.pdf Abstract Syntax Tree Design] " by Nicola Howarth (note that this merely presents the design of *one particular* project's AST, and is not generally informative)
*Paper " [http://doi.acm.org/10.1145/1083142.1083143 Understanding source code evolution using abstract syntax tree matching] " by Iulian Neamtiu, Jeffrey S. Foster and Michael Hicks
*Paper " [http://seal.ifi.uzh.ch/fileadmin/User_Filemount/Publications/fluri-changedistilling.pdf Change Distilling: Tree Differencing for Fine-Grained Source Code Change Extraction] " by Beat Fluri, Michael Würsch, Martin Pinzger, and Harald C. Gall.
*Diploma thesis " [http://seal.ifi.unizh.ch/137/ Improving Abstract Syntax Tree based Source Code Change Detection] " by Michael Würsch
*Article " [http://blogs.msdn.com/vcblog/archive/2006/08/16/702823.aspx Thoughts on the Visual C++ Abstract Syntax Tree (AST)] " by Jason Lucas
*Tutorial " [http://www.omg.org/news/meetings/workshops/ADM_2005_Proceedings_FINAL/T-3_Newcomb.pdf Abstract Syntax Tree Metamodel Standard] "
* [http://pmd.sourceforge.net PMD] uses AST representation to control code source quality
* [http://www.cs.utah.edu/flux/flick/current/doc/guts/gutsch6.html CAST representation]
* [http://eli-project.sourceforge.net/elionline/idem_3.html Abstract Syntax Tree Unparsing]


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Abstract Syntax Tree — Der Begriff Abstrakter Syntaxbaum bzw. Abstract Syntax Tree bezeichnet eine logische Baumstruktur, welche die inhaltlichen Zusammenhänge eines Dokumentes im Sinne eines Syntaxbaumes wiedergibt. Nutzen Da komplexe Informationen meist durch eine… …   Deutsch Wikipedia

  • Abstract syntax tree — Arbre syntaxique abstrait Pour les articles homonymes, voir AST. En informatique, un arbre syntaxique abstrait (abstact syntax tree ou AST en anglais) est un arbre avec des labels dont les nœuds internes sont marqués par des opérateurs et dont… …   Wikipédia en Français

  • Abstract syntax — The abstract syntax of data is its structure described as a data type (possibly, but not necessarily, an abstract data type), independent of any particular representation or encoding. To be implemented either for computation or communications, a… …   Wikipedia

  • Higher-order abstract syntax — In computer science, higher order abstract syntax (abbreviated HOAS) is a technique for the representation of abstract syntax trees for languages with variable binders.Relation to first order abstract syntaxAn abstract syntax tree is abstract… …   Wikipedia

  • Abstract semantic graph — In computer science, an abstract semantic graph (ASG) is a data structure used in representing or deriving the semantics of an expression in a formal language (for example, a programming language).An abstract semantic graph is a higher level… …   Wikipedia

  • Syntax of programming languages — In computer science, the syntax of a programming language is the set of rules that a sequence of characters in a source code file must follow to be considered as a syntactically conforming program in that language.The rules specify how the… …   Wikipedia

  • Parse tree — For the trees used in computer science, see Abstract syntax tree. A concrete syntax tree or parse tree or parsing tree[1] is an ordered, rooted tree that represents the syntactic structure of a string according to some formal grammar. In a parse… …   Wikipedia

  • Syntax — Syntactic redirects here. For another meaning of the adjective, see Syntaxis. For other uses, see Syntax (disambiguation). Linguistics …   Wikipedia

  • SYNTAX — In computer science, SYNTAX is a system used to generate lexical and syntactic analyzers (parsers) (both deterministic and non deterministic) for all kind of context free grammars (CFGs) as well as some classes of contextual grammars. It is… …   Wikipedia

  • Musical syntax — When analysing the regularities and structure of music as well as the processing of music in the brain, certain findings lead to the question, if music is based on a syntax which could be compared with linguistic syntax. To get closer to this… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”