Abstract syntax tree: Difference between revisions

Content deleted Content added
Citation bot (talk | contribs)
Alter: title, template type. Add: chapter-url, chapter. Removed or converted URL. Removed parameters. Some additions/deletions were parameter name changes. | Use this bot. Report bugs. | Suggested by Headbomb | Linked from Wikipedia:WikiProject_Academic_Journals/Journals_cited_by_Wikipedia/Sandbox2 | #UCB_webform_linked 55/3179
No edit summary
Line 10:
return a
</syntaxhighlight>]]
 
In [[computer science]], anAn '''abstract syntax tree''' ('''AST'''), is a data structure used in [[computer science]] to represent the structure of a program or code snippet. It is sometimes called just a '''syntax tree''',. It 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.
 
The syntax is "abstract" in the sense that it does not represent every detail appearing in the real syntax, but rather just the structural or content-related details. For instance, grouping [[Bracket#Parentheses|parentheses]] are implicit in the tree structure, so these do not have to be represented as separate nodes. Likewise, a syntactic construct like an if-condition-then statement may be denoted by means of a single node with three branches.