COMPILER DESIGN

SYNTAX ANALYSIS

ROLE OF THE PARSER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
A parse tree showing the value of attributes at each node is called
A
Syntax tree
B
Annotated parse tree
C
Semantic tree
D
All of the above.
Explanation: 

Detailed explanation-1: -A parse tree showing the values of attributes at each node is called annotated parse tree. Explanation: The process of computing the attribute values at the nodes is called annotating or decorating the parse tree.

Detailed explanation-2: -A parse tree showing the values of attributes at each node is called an Annotated parse tree. The process of computing the attributes values at the nodes is called annotating (or decorating) of the parse tree. Of course, the order of these computations depends on the dependency graph induced by the semantic rules.

Detailed explanation-3: -An annotated parse tree is one in which various facts about the program have been attached to parse tree nodes. For example, one might compute the set of identifiers that each subtree mentions, and attach that set to the subtree.

Detailed explanation-4: -Explanation: The tree, known as “Parse tree” when used in a compiler, is the data structure of choice to represent the source program.

Detailed explanation-5: -A parse tree or parsing tree or derivation tree or concrete syntax tree is an ordered, rooted tree that represents the syntactic structure of a string according to some context-free grammar.

There is 1 question to complete.