For More Quiz Questions click here to download Global Quiz on Google PlayStore

NATIONAL OPEN UNIVERSITY OF NIGERIA

UNIVERSITY VILLAGE, PLOT 91, CASDASTRAL ZONE, NNAMDI AZIKIWE EXPRESS WAY, JABI, ABUJA.
FACULTY OF SCIENCES
APRIL 2019 EXAMINATION

COURSE CODE: CIT445

COURSE TITLE: Principles and Techniques of Compilers

CREDIT: 3 Units

TIME ALLOWED: 2½ Hours

INSTRUCTION: Answer Question 1 and any other FOUR (4) Questions

 

 

1a) Define formal language (3 marks)

  b) State three areas of application of formal languages (3 marks)

  1. Define translator, hence, state the advantages of a translator in computing. (4 marks )
  2. Enumerate the functions performed by the lexical analyser (4 marks)
  3. State four benefits of LR parsing  (6 marks)
  4. Define FIRST(α) for any given grammar? (2 marks)

 

2a) Briefly describe the operation performed by the shift-reduce parser      (6 marks)

  b) Given the context-free grammar G below:

G:        E E + E

                                    E E * E

                                    E (E)

                                    E   id

State the steps performed by the shift-reduce parser when analyzing the input string:

id1 + id2 * id3   (6 marks)

3a)  List the common techniques for building tables for an “LR” parser stating the characteristics of each?    ( 6½ marks)

b) Consider the grammar,

     G:   E → E + T | T

T → T*F | F

F → (E) | i

What is the augmented grammar for this grammar. (2 marks)

c) Explain what is meant by the term Viable Prefix?            (3½ marks)

 

4) Consider the grammar G below:

      G: E ® E + T / T

T ® T * F / F

F ® (E) / i

i) Generate the non-left recursive version of the grammar (5 marks)

ii) Find FOLLOW of all the non-terminal symbols in the non-left recursive version of the grammar  (7 marks)

 

5a) Given the grammar G with the following production rules, S → a | aS | bS, determine whether the string aababbba can be generated by the grammar(6 marks)

  b) Enumerate any three of the errors which can be detected during lexical analysis (6 marks)

 

6) Consider the grammar,

G: S → a | aS | bS

  1. Find the LR(0) items for this grammar  (9 marks)

 b) Construct an NFA whose states are the LR(0) items from (a) above.      (3 marks)


For More Quiz Questions click here to download Global Quiz on Google PlayStore


Select NOUN Past Questions & Answers by Faculties

Sciences

National Open University of Nigeria (NOUN) Faculty of Sciences Past Questions and Answers.

Education

National Open University of Nigeria (NOUN) Faculty of Education Past Questions and Answers.

Arts & Social Sciences

National Open University of Nigeria (NOUN) Faculty of Arts and Social Sciences Past Questions and Answers.

Law

National Open University of Nigeria (NOUN) Faculty of Law Past Questions and Answers.

Management Sciences

National Open University of Nigeria (NOUN) Faculty of Management Sciences Past Questions and Answers.

Health Sciences

National Open University of Nigeria (NOUN) Faculty of Health Sciences Past Questions and Answers.

Agriculture Sciences

National Open University of Nigeria (NOUN) Faculty of Agricultural Sciences Past Questions and Answers.

Select Project Topics & Materials by Categories

Accounting

Universities, Polytechnic's and Colleges of Education Accounting Project Topics and Materials.

Biology

Universities, Polytechnic's and Colleges of Education Biology Project Topics and Materials.

Business Education

Universities, Polytechnic's and Colleges of Education Business Education Project Topics and Materials.

Chemistry

Universities, Polytechnic's and Colleges of Education Chemistry Project Topics and Materials.

Computer Science

Universities, Polytechnic's and Colleges of Education Computer Science Project Topics and Materials.

Criminology & Security

Universities, Polytechnic's and Colleges of Education Criminology & Security Project Topics and Materials.

Economics

Universities, Polytechnic's and Colleges of Education Economics Project Topics and Materials.

Education

Universities, Polytechnic's and Colleges of Education Education Project Topics and Materials.

English/Linguistic

Universities, Polytechnic's and Colleges of Education English/Linguistic Project Topics and Materials.

Entrepreneurship

Universities, Polytechnic's and Colleges of Education Entrepreneurship Project Topics and Materials.

Environmental Science

Universities, Polytechnic's and Colleges of Education Environmental Science Project Topics and Materials.

Law

Universities, Polytechnic's and Colleges of Education Law Project Topics and Materials.

Marketing

Universities, Polytechnic's and Colleges of Education Marketing Project Topics and Materials.

Physics

Universities, Polytechnic's and Colleges of Education Physics Project Topics and Materials.

Political Science

Universities, Polytechnic's and Colleges of Education Political Science Project Topics and Materials.

Public Administration

Universities, Polytechnic's and Colleges of Education Public Administration Project Topics and Materials.

How to login to NOUN Elearn Portal

You can now use you matric number to login as your username and  password in a lowercase.

https://elearn.nouedu2.net/login/

Note that you are to change your passw...

Facebook posts