· Question 1 is compulsory and carries 28 marks. Answer any FOUR questions from the rest. Marks are indicated against each question.
· Parts of a question should be answered at the same place.
c. List four software tools that assist a programmer during program testing and debugging.
d. What is dynamic linking? List its advantages.
e. What are machine-independent features in assembler design?
f. Design a DFA for recognizing identifiers, unsigned integers and unsigned real numbers with fractions.
g. What is a macro processor? (7 4)
Q.2 a. For the program shown below write the quadruples.
SUM, SUMSQ, I, VALUE, MEAN, VARIANCE: INTEGER
SUM : = 0 ;
SUMSQ : = 0 ;
READ (VALUE) ;
SUM : = SUM + VALUE ;
SUMSQ : = SUMSQ + VALUE * VALUE
MEAN : = SUM DIV 100;
VARIANCE : = SUMSQ DIV 100 - MEAN * MEAN ;
WRITE (MEAN, VARIANCE)
b. Describe various parameter passing mechanisms. (12+6)
Q.3 a. Explain the various techniques to identify free memory areas as a result of allocation and de-allocations in a heap.
b. Define the following:
(i) Formal language Grammars.
(ii) Terminal symbols.
(iii) Alphabet and String.
Q.4 a. What is an LL(1) parser? Is there any advantage of using LL(1) parsing? Construct a parser table for an LL(1) parser for the following grammer
E ::= TE
E ::= +TE| e
V ::= VT
T ::= *VT| e
V ::= <id>
b. Grammer containing left recursion is not amenable to top down parsing. Comment and explain giving a suitable example. (12+6)
Q.5 a. What is an assembly language? What are the advantages of using assembly language? Why do you need assembler directives-EQU and ORIGIN? Discuss with suitable example.
b. Write short notes on: (i) Debug monitors (ii) User Interfaces (10+8)
Q.6 a. Explain Lexical substitution during macro expansion.
b. Write an algorithm to outline the macro-expansion using macro-expansion counter.
c. Write a recursive macro to reverse the characters of a string. (6+6+6)
Q.7 a. Differentiate between
(i) Program translation and program interpretation.
(ii) Absolute loader and relocating loader
(iii) Problem-oriented and procedure-oriented language
b. What do you mean by code optimization? What is the aim of this phase? Explain elimination of common subexpressions during code optimisation. (12+6)