INTRODUCTION TO COMPILER DESIGN
KEY COMPONENTS OF A COMPILER
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Maintain Symbol Table
|
|
Collect type of information
|
|
Create parse tree
|
|
None of the mentioned
|
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.