INTRODUCTION TO COMPILER DESIGN
OVERVIEW OF COMPILERS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Lexical Analysis
|
|
Syntax Analysis
|
|
Semantic Analysis
|
|
Code Generation
|
|
Code Optimisation
|
Detailed explanation-1: -In this phase, token arrangements are checked against the source code grammar, i.e. the parser checks if the expression made by the tokens is syntactically correct.
Detailed explanation-2: -Compilation process in C involves four steps: pre-processing, compiling, assembling, and linking. The preprocessor tool helps in comments removal, macros expansion, file inclusion, and conditional compilation.
Detailed explanation-3: -Syntax Analysis: It takes tokens produced by the lexical analyzer as input and generates a parse tree. Semantic Analysis: It verifies the parse tree, and any errors found are notified to the error handler. Intermediate code Generation: It represents the final machine language code produced.
Detailed explanation-4: -This is called the lexical analysis phase of the compiler. The lexical analyzer is the part of the compiler that detects the token of the program and sends it to the syntax analyzer.