answersLogoWhite

0


Best Answer

Parse trees (also known as Concrete Syntax Trees) contain every token of the input as a leaf, and the interior nodes are nonterminals in the grammar used to parse.

Abstract Syntax Trees omit much of the detail that would be present in a CST. There are still leaf nodes when the associated tokens are information-bearing (such as identifiers and literals), but, for example, keywords and punctuation are not present in an AST. The interior nodes represent language constructs as defined by the grammar. An AST for an "if" statement (for example) would consist of one node to represent the "if" construct, and two or three subtrees, one for the "if" condition and another one or two for the "the" and optional "else" parts. The CST for such a construct would also contain the "if"/"then"/"else" keywords, such that you could walk the tree to obtain the original token sequence.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Difference between parse tree and syntax tree?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the difference between a lever and a pulley?

A lever is an adaptation of a stick or tree branch. A pulley is an adaptation of a wheel.


What is Difference between tree and spanning tree?

A tree is a connected graph in which only 1 path exist between any two vertices of the graph i.e. if the graph has no cycles. A spanning tree of a connected graph G is a tree which includes all the vertices of the graph G.There can be more than one spanning tree for a connected graph G.


What is syntax anlyzer?

In computer science and linguistics, parsing, or, more formally, syntactic analysis, is the process of analyzing a text, made of a sequence of tokens (for example, words), to determine its grammatical structure with respect to a given (more or less) formal grammar.Parsing is also an earlier term for the diagramming of sentences of natural languages, and is still used for the diagramming of inflected languages, such as the Romance languages or Latin. The term parsing comes from Latin pars (ōrātiōnis), meaning part (of speech).In computing, a parser is one of the components in an interpreter or compiler, which checks for correct syntax and builds a data structure (often some kind of parse tree, abstract syntax tree or other hierarchical structure) implicit in the input tokens. The parser often uses a separate lexical analyser to create tokens from the sequence of input characters. Parsers may be programmed by hand or may be (semi-)automatically generated (in some programming languages) by a tool (such as Yacc) from a grammar written in Backus-Naur form.


Difference between binary search tree and heap tree?

A binary search tree uses the definition: that for every node,the node to the left of it has a less value(key) and the node to the right of it has a greater value(key).Where as the heap,being an implementation of a binary tree uses the following definition:If A and B are nodes, where B is the child node of A,then the value(key) of A must be larger than or equal to the value(key) of B.That is,key(A) ≥ key(B).


What is the difference between dendritic and trellis drainage?

Dendritic drainage patterns are tree like while trellis drainage patterns are formed when tributaries meet at right angles so they look like squares or rectangles.

Related questions

Difference between syntax tree and parse tree?

i dont know but i


What is Parse tree?

A syntax tree is a tree representation of the syntactic structure of the source code where the node denotes a construct. For more information, visit the link below:


A -- AA AA a b what is the parse tree?

The parse tree for the given string would show the structure of the string broken down into tokens and their relationships based on the grammar rules. In this case, based on the example provided, the parse tree would illustrate how the string 'AA AA a b' can be derived from the grammar rules defined for the language.


What is difference between tree and hybrid topology?

no difference,,,tree and hybrid are same.


Difference between B-tree and B tree?

b-tree


What is the difference between tree and forest?

A tree is one tree and a forest is many trees.


What is difference between binary tree?

fish!


What is the difference between a car with a flat wheel and a tree?

The difference between a car with a flat wheel and a tree is that the wheel can be replaced, and the car will transport you. A tree will not transport you from one location to another.


What is the difference between an Australian boab tree and an African baobab tree?

the spelling


Difference between lexical and semantic analysis?

Lexical analysis breaks the source code text into small pieces called tokens.Semantic analysis is the phase in which the compiler adds semantic information to the parse tree and builds the symbol table.Source: http://en.wikipedia.org/wiki/Semantic_analysis_%28compilers%29#Front_end


What is the difference between a sick horse and a wet tree?

Tree is tree and horse is horse.And horse is sick and tree is not.


How do you generate a parse tree from an expression using C program?

c code for top down parser