MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Annotated parse tree is generated by the
A
Parser
B
Semantic Analyzer
C
Scanner
D
Code generator
Explanation: 

Detailed explanation-1: -The interest of an S-attribute grammar is that any parse tree can always be annotated by evaluating the semantic rules for the attributes at each node bottom up, from the leaves to the root. AN ANNOTATED PARSE TREE. is a parse tree showing the values of the attributes at each node.

Detailed explanation-2: -Parse trees are usually constructed based on either the constituency relation of constituency grammars (phrase structure grammars) or the dependency relation of dependency grammars.

Detailed explanation-3: -Semantic analysis is the task of ensuring that the declarations and statements of a program are semantically correct, i.e, that their meaning is clear and consistent with the way in which control structures and data types are supposed to be used.

Detailed explanation-4: -Tree-Based Semantic Parsing. Page 1. Introduction. Semantic parsing is the process of mapping natural language sentences to formal meaning representations. Semantic parsing techniques can be performed on various natural languages as well as task-specific representations of meaning.

There is 1 question to complete.