Phases-of-Compilers

Question 1
Consider the following ANSI C program:
int main()  {
      Integer x;
      return 0;
}
Which one of the following phases in a seven-phase C compiler will throw an error?
A
Syntax analyzer
B
Lexical analyzer
C
Semantic analyzer
D
Machine dependent optimizer
Question 1 Explanation: 
Integer will be considered as a variable and hence it will be treated as an undeclared identifier and so it is a semantic error.
Question 2
Consider the following statements regarding the front-end and back-end of a compiler
S1: The front-end includes phases that are independent of the target hardware
S2: The back-end includes phases that are specific to the target hardware
S3: The back-end includes phases that are specific to the programming language used in the source code. Identify the CORRECT option
A
Only S1 is TRUE
B
Only S1 and S2 are TRUE
C
S1, S2, and S3 are all TRUE
D
Only S1 and S3 are TRUE
There are 2 questions to complete.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access