Parse tree
Wikipedia, the free encyclopedia - Cite This SourceA parse tree or concrete syntax tree is a tree node that represents the syntactic structure of a string according to some formal grammar. In a parse tree, the interior nodes are labelled by nonterminals of the grammar, while the leaf nodes are labelled by terminals of the grammar. A program that produces such trees is called a parser. Parse trees may be generated for sentences in natural languages (see natural language processing), as well as during processing of computer languages, such as programming languages. Parse trees are distinct from abstract syntax trees (also known simply as syntax trees) which are a related concept in compilers.
Basic description
A parse tree is made up of nodes and branches. Below is a linguistic parse tree, here representing the English sentence "John hit the ball". (Note: this is only one possible parse tree for this sentence; different kinds of linguistic parse trees exist.) The parse tree is the entire structure, starting from S and ending in each of the leaf nodes (John, hit, the, ball).
In a parse tree, each node is either a root node, a branch node, or a leaf node. In the above example, S is a root node, NP and VP are branch nodes, while John, hit, the, and ball are all leaf nodes. (To understand better what "S", "VP", "NP" etc. mean, see
)
A node can also be referred to as parent node or a child node. A parent node is one that has at least one other node linked by a branch under it. In the example, S is a parent of both NP and VP. A child node is one that has at least one node directly above it to which it is linked by a branch of the tree. Again from our example, hit is a child node of V.
See also
External links
- Linguistic Tree Constructor
- phpSyntaxTree — Online parse tree drawing site
- Qtree — LaTeX package for drawing parse trees
- Syntax Tree Drawer in SVG
- TreeForm Syntax Tree Drawing Software
- Trees Player
- VivaCore Create derivation tree for C/C++ code
Wikipedia, the free encyclopedia © 2001-2006 Wikipedia contributors (Disclaimer)
This article is licensed under the GNU Free Documentation License.
Last updated on Monday March 10, 2008 at 23:48:47 PDT (GMT -0700)
View this article at Wikipedia.org - Edit this article at Wikipedia.org - Donate to the Wikimedia Foundation