Abstract syntax tree: Difference between revisions

Content deleted Content added
top: Fixed code representation
Tags: Mobile edit Mobile app edit Android app edit
Line 3:
{{no footnotes|date=February 2013}}
{{Merge from|Abstract syntax|date=September 2021}}
[[File:Abstract syntax tree for Euclidean algorithm.svg|thumb|400px|An abstract syntax tree for the following code for the [[Euclidean algorithm]]:{{pre|1=''']]<syntaxhighlight>
while''' b ≠ 0<br>:
'''if''' a > b<br>:
a := a - b<br>
'''else'''<br>:
b := b - a<br>'''
return''' a}}]]
</syntaxhighlight>
In [[computer science]], an '''abstract syntax tree''' ('''AST'''), or just '''syntax tree''', is a [[Tree (data structure)|tree]] representation of the [[abstract syntax|abstract syntactic]] structure of text (often [[source code]]) written in a [[formal language]]. Each node of the tree denotes a construct occurring in the text.