Discussion
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.
Answer: B
The answer is only S1 and S2 are TRUE.
A compiler's front-end (lexical analysis, parsing, semantic analysis and intermediate code generation) works on the source language and produces a machine-independent intermediate representation, so it does not depend on the target hardware (S1). The back-end (machine-dependent optimisation, register allocation, instruction selection and code generation) translates that intermediate form for a particular processor, so it is specific to the target hardware (S2).
S3 is false: it is the front-end that is specific to the programming language. The point of the split is that one back-end can serve several source languages and one front-end several targets. That rules out 'Only S1', 'all three' and 'S1 and S3'.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development