COMPILER DESIGN 2019 RCA404 MCA 4th Sem AKTU
Printed Pages: 1 Sub Code: RCA404
Paper Id: 214240Roll No. _____________________
MCA
(SEM IV) THEORY EXAMINATION 2018-19
COMPILER DESIGN
Time: 3 Hours Total Marks: 70
Note: Attempt all Sections. If require any missing data; then choose suitably.
SECTION A
1. Attempt all questions in brief. 2 x 7 = 14
a. What do you mean by Finite Automata?
b. Explain three address codes with example.
c. What do you mean by control flow?
d. Explain the term Token, Pattern, Lexemes.
e. Discuss the term ambiguity.
f. What do you mean by error handler?
g. Draw a flow chart to define finite automata from regular expression.
SECTION B
2. Attempt any three of the following: 7 x 3 = 21
a. What is the difference between static and dynamic memory allocation? How static scope rules and defined using stack?
b. Explain about basic parsing techniques. What is top down parsing? Explain in detail.
c. Define the following:
I. Regular expression
II. Regular grammar
III. Context free grammar
d. What do you mean by left factoring? Explain with the help of example, how left factoring can be avoided.
e. Consider the following:
E→T+E/T
T→V*T/V
T→id
Write down the procedures for the non-terminals of the grammar to make a recursive descent parser.
SECTION C
3. Attempt any one part of the following: 7 x 1 = 7
(a) What is the use of run time storage administrator? What is the difference between static and dynamic allocation?
(b) Describe the various code optimization techniques in detail.
4. Attempt any one part of the following: 7 x 1 = 7
(a) What is symbol table? Explain in detail. Explain the use of symbol table.
(b) What is L.R. Parser? How it is different from SLR? Construct LALR table for
S→S
S→aAd/bBd/aBC/bAc
5. Attempt any one part of the following: 7 x 1 = 7
(a) Explain any two of the following in detail:
i. Lexical phase errors
ii. Syntactic phase errors
(b) Discuss the role of syntax directed translation scheme.
6. Attempt any one part of the following: 7 x 1 = 7
(a) What do you mean by DAG? Explain the algorithm for constructing a DAG with the help of example.
(b) How registers are allocated in code generation? Differentiate among source code, intermediate code and object code.
7. Attempt any one part of the following: 7 x 1 = 7
(a) What is translator? Classified the translator.
(b) What is Parsing? Explain its types.
(c) Consider the following grammar:
S→S=R
S→R
L→R
L→id
R→L
Write the algorithm for FOLLOW. And find the FIRST and FOLLOW for the given grammar.
Thank You!