Abstract syntax tree: Difference between revisions

Content deleted Content added
Citation bot (talk | contribs)
Alter: template type. Removed parameters. | You can use this bot yourself. Report bugs here. | Suggested by Abductive | All pages linked from cached copy of User:Abductive/sandbox | via #UCB_webform_linked 96/997
mNo edit summary
Line 11:
 
== Application in compilers ==
 
Abstract syntax trees are [[data structures]] widely used in [[compilers]] to represent the structure of program code. An AST is usually the result of the [[syntax analysis]] phase of a compiler. It often serves as an intermediate representation of the program through several stages that the compiler requires, and has a strong impact on the final output of the compiler.
 
Line 25 ⟶ 24:
 
=== Design ===
 
The design of an AST is often closely linked with the design of a compiler and its expected features.
 
Line 42 ⟶ 40:
 
=== Usage ===
 
The AST is used intensively during [[Semantic analysis (compilers)|semantic analysis]], where the compiler checks for correct usage of the elements of the program and the language. The compiler also generates [[symbol table]]s based on the AST during semantic analysis. A complete traversal of the tree allows verification of the correctness of the program.
 
Line 50 ⟶ 47:
* [[Abstract semantic graph]] (ASG), also called ''term graph''
* [[Composite pattern]]
* [[Control -flow graph]]
* [[Directed acyclic graph]] (DAG)
* [[Document Object Model]] (DOM)
Line 68 ⟶ 65:
{{refend}}
 
== Further reading ==
* {{cite document |last=Jones |first=Joel |title=Abstract Syntax Tree Implementation Idioms |url=http://www.hillside.net/plop/plop2003/Papers/Jones-ImplementingASTs.pdf }} (overview of AST implementation in various language families)
* {{cite conference |last1=Neamtiu |first1=Iulian |last2=Foster |first2=Jeffrey S. |last3=Hicks |first3=Michael |date=May 17, 2005 |title=Understanding Source Code Evolution Using Abstract Syntax Tree Matching |conference=MSR'05 |___location=Saint Louis, Missouri |publisher=ACM |citeseerx=10.1.1.88.5815}}