Thursday, June 26, 2014

System Programming and Compiler Construction (SPCC) Semester 6 (Revised Course) (3 Hours) May 2013

System Programming and Compiler

System Programming and Compiler Construction (SPCC)
Semester 6 (Revised Course)
(3 Hours) May 2013

 

GS-1078
[Total Marks : 100]
 

N.B: (1) Question No. 1 is compulsory.  
  (2) Attempt any four questions out of remaining six questions.  
  (3) Assume suitable data if necessary and justify the same.  
  (4) Figures to right indicate full marks.  
       
1. (a) Differentiate between Application program and system program. Indicate the order in which following system program are used, from developing program upto its execution.
Assemblers, loaders, linker, microprocessor,  Compiler, editor.
05
  (b) Eliminate left recursion present in following grammar (Remove Direct and Indirect recursion both)
S → Aa | b
A → Ac | Sd | ∈
10
  (c) What is activation record? Draw the diagram of General Activation record and explain the purpose of different fields of an activation record. 05
  (d) What are the different functions of loader explain in brief. 05
       
2. (a) With reference to assembler explain the following tables with suitable example.
     (i) POT
     (ii) MOT
     (iii) ST
     (iv) LT
10
  (b) Let L be the language consisting of string of a's and b's having same number of a's and b's :
(i) Construct LL (1) grammar for L
(ii) Construct a predictive parsing table for the grammar obtained in (i).
10
       
3. (a) Explain different psudo-ops used for conditional macro expansion, along with example. 10
  (b) What are the different phase of compiler? Illustrate compiler internal presentation fo source program for following statement after each phase
     position = initial + rate * 60
10
       
4. (a) Explain working of a direct linking loader with a proper example. Clearly show the entries in different databases built by the direct linking loader. 10
  (b) Generate three address code for given expression
     while (a < b) do
           if (c < d) then
                x = y + z
    else
             x = y + z
10
     
5. (a) For the given grammar below, construct operator precedence relations matrix, assuming *, + are binary operators and id as terminal symbol and E as non terminal symbol.
E → E + E
E → E * E
E → id
Apply operator precedence parsing algorithm to obtain skeletal syntax tree for the statement
     id + id * id
10
  (b) Explain role of code optimization in compiler designing with suitable example. 10
       
6. (a) For regular expression (a | b)* abb construct NFA and construct it into DFA. 10
  (b) With reference to stack allocation and help allocation explain runtime storage organization. 10
       
7. (a) Write a note on JAVA compiler environment. 05
  (b) Explain synthesized and inherited attributes used in syntax directed definitions. 05
  (c) Explain DAG. 05
  (d) Find first and follow set for given grammar below.
 
E → TE'
T → FT'
F → (E)
E' → + TE' | ∈
T → * FT' | ∈
F →  id
05

No comments:

Post a Comment