CD Assignment
CD Assignment
CD Assignment
Assignment -2
Assignment-4
1. What is symbol table ? Discuss the various approaches used for organization of
symbol table.
2. What are the different data structures for the symbol table implementation.
3. Explain various allocation storage strategies. Which storage allocation model is to
be used if a language permits recursion?
4. What do you mean by heap allocation ? Explain the following terms releted to
heap allocation:
i) Fragmentation
ii) Free List
iii) Bit Map
iv) Reference Count
5. What are the various types of errors that may appear in
compilation process ? Explain the function of Error handling phase of a compiler.
6. Explain activation record and display structure.
7. Discuss the following parameter passing technique with suitable
example:
Call by value
Call by name
Call by reference
What is printed by the program given under :
a. Call–by-name
b. Call-by –reference
c. Call-by-value
Procedure PROC (X,Y,Z)
begin
Y = Y+1
Z=Z+X
end PROC
begin
A=2
B=3
PROC (A+B,A,A)
Print A
End
9. Explain static allocation and discuss its drawback.
10. What are the goals of error handler in a parser?
11. What is parameter passing? Differentiate between call-by-name and call-by-
reference.
12. What do you understand by Lexical phase error and syntactic phase error?
13. Discuss various methods for recovery of errors?
14. Define attributes of symbol table:
i) Class and related attributes
ii) Scope attributes
IEC College of Engineering & Technology
Department of Computer Science
Assignment-5
1. Give the algorithm for the elimination of local and global common sub-
expression. Discuss the algorithm with the help of an example.
2. Write short notes on following:
i) Directed Acyclic Graph
ii) Yacc parser generator
3. Give the sequence of three-address code instructions corresponding to each of the
arithmetic expressions:
2+3+4+5
4. Discuss loop optimization technique with suitable examples.
5. Explain global data flow analysis.
6. Describe how a for-statement can be systematically turned into a corresponding
while statement. Does it make sense to use this to generate code?
7. Discuss the algorithm for the elimination of induction variables with the help of
example. Also generalize this algorithm to the case where multiplicative constants
can be negative.
8. Explain the following term:
i) Shift-reduce parsing
ii) Activation Record
1. What do you mean by code optimization? What are the areas of optimization?
2. Explain how DAG helps in elimination of common sub expression?
3. Construct DAG for the following code sequence:
A [I] = B
*P = C
D = A [J]
E = *P
*P = A [I]
Assume that :
a. P can point anywhere
b. P point to only B or D
4. What is global data flow analysis? What is its use in code optimization?