JNTU III B.Tech Supplimentary Examinations, Aug/Sep 2008
(Computer Science & Engineering)
1. (a) Write a procedure for constructing a deterministic finite automata from a non-deterministic Automata, explain with one example.
(b) Give the general format of a LEX program.
2. (a) Explain the reasons for separating lexial analysis phase from syntax analysis.
(b) Eliminate ambiguities from the following grammar
S ! iEtSeS|iEtS|a
E ! b|c|d
3. (a) Define LR(0) grammer.
(b) Construct SLR passing table for the following grammar.
E ! E + T/T
T ! TF/F
F ! F_|a|b.
4. (a) What is type expression? Write type expression for the following types.
i. A two dimensional array of integers (i.e. an array of arrays) whose rows
are indexed from 0 to 9 and whose columns are indexed from -10 to 10.
ii. Functions whose domains are functions from integers to pointers to integers and whose ranges are records consisting of an integer and a character.
(b) What is type system. Discuss static and dynamic checking of types.
5. (a) Explain how the symbol table space can be reused. Explain through an example.
(b) Discuss various symbol table organization techniques.
6. (a) Explain with an example the abstract machine code form of Intermediate code.
(b) Give a detailed account on loop optimisation techniques.
7. (a) Write an algorithm to compute reaching definition informatory for a flow graph.
(b) Explain the working of the above algorithm using a suitable example.
8. Given the following source program
A DS 3
D EQU A+1
L2 PRINT D
ORIGIN A ?1
C DC ‘5’
ORIGIN L2 + 1
B DC ‘19’
(a) Show the contents of the symbol table at the end of the PASS I
(b) Explain the significance of EQU and ORIGIN statements in the program.
(c) Show the intermediate code generated for the given program.