COMPILER DESIGN

INTRODUCTION TO COMPILER DESIGN

OVERVIEW OF COMPILERS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
It checks whether the parse tree constructed follows the rules of language.
A
Lexical Analyzer
B
Syntax Analyzer
C
Semantic Analyzer
D
Code Generator
Explanation: 

Detailed explanation-1: -In most languages the semantic analyzer tracks the types of both identifiers and expressions, both to verify consistent usage and to guide the generation of code in later phases.

Detailed explanation-2: -Parse tree is a graphical representation of the replacement process in a derivation. Syntax tree is the compact form of a parse tree. Each interior node represents a grammar rule. Each leaf node represents a terminal.

Detailed explanation-3: -Semantic analyzer Verifies the parse tree, whether it is meaningful or not. It uses the parse tree and info in the symbol table to check the source program for semantic consistency with the language definition.

There is 1 question to complete.