
ExamsSCHOOL OF SCIENCE AND TECHNOLOGY
National Open University Exam Past Question – CIT 445 October, 2013 Examination
NATIONAL OPEN UNIVERSITY OF NIGERIA CIT 445 Principles & Techniques of Compilers
14/16, Ahmadu Bello Way, Victoria Island
SCHOOL OF SCIENCE AND TECHNOLOGY October, 2013 Examination
Course Code: CIT 445
Course Title: Principles & Techniques of Compilers
Credit Unit: 3
Time: 2½ hours
Instruction: Answer any five (5) questions. Each question carries 14 marks
- (a) Define the term parsing (3 marks) (b) State and discuss four examples of analytic grammar formalisms (8 marks) (c) Given the grammar G with the following production rules, S → a | aS | bS, determine whether the string babbaa can be generated by the grammar (3 marks)
- (a) What is the difference between a translator and a compiler (6 marks) (b) State and describe four components of the structure of a compiler (8 marks)
- (a) With the aid of a diagram describe the functions of a T.diagram (8 marks) (b) State the Roles of a Parser (6 marks)
- (a) State four difficulties with Top-down parsing (6 marks) (b) State five benefits of LR Parsing (7 marks)
- With the aid of illustrative diagram describe the phases of a compiler (14 marks)
- (a) State and describe the three main techniques for loop optimisation (6 marks) (b) State any six qualities of a compiler (8 marks)
- Consider the grammar G below: G: E ® E + T / T
T ® T * F / F F ® (E) / i
(a) Generate the non-left recursive version of the grammar (5 marks) (b) Find FOLLOW of all the nonterminal symbols in the non-left recursive version of the grammar
(9 marks)