COMPILER DESIGN

INTRODUCTION TO COMPILER DESIGN

KEY COMPONENTS OF A COMPILER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What does a Syntactic Analyser do?
A
Maintain Symbol Table
B
Collect type of information
C
Create parse tree
D
None of the mentioned
Explanation: 

Detailed explanation-1: -A syntax analyzer or parser takes the input from a lexical analyzer in the form of token streams. The parser analyzes the source code (token stream) against the production rules to detect any errors in the code. The output of this phase is a parse tree.

Detailed explanation-2: -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.

Detailed explanation-3: -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.

There is 1 question to complete.