- Abstract syntax tree
In
computer science , an abstract syntax tree (AST), or just syntax tree, is a tree representation of thesyntax of somesource code (that has been written in aprogramming 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 ofoperands 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] " byNicola 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] " byIulian Neamtiu ,Jeffrey S. Foster andMichael 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] " byBeat Fluri ,Michael Würsch ,Martin Pinzger , andHarald C. Gall .
*Diploma thesis " [http://seal.ifi.unizh.ch/137/ Improving Abstract Syntax Tree based Source Code Change Detection] " byMichael Würsch
*Article " [http://blogs.msdn.com/vcblog/archive/2006/08/16/702823.aspx Thoughts on the Visual C++ Abstract Syntax Tree (AST)] " byJason 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.