Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

F.

1) KPH FOR MCA


MCA
(SEM. I) MODEL PAPER
KCA
015: COMPILER DESIGN
Time:3 Hours Maximum Marks: 100
Note : Attempt al Sections. If require any missing data, then choose
suitably.
SECTION A
1. Attempt all questions in brief. (2 x10 = 20)
(a) What do you mean by Compiler?
(b) Explain three address codes with example.
(c) What do you mean by Lexical Analyzer?
(d) Explain the term Token, Pattern, Lexemes.
(e) Discuss the term Recursive.
() What do you mean by Symbol Table?
(g) Draw a flow chart to find finite automata from regular
expression
(h) Explain about Three address code generator.
() What is Directed acyclic graph?
Explain about Intermediate code generator.
SECTION -B
2. Attempt any three of the following : (3 x10 = 30)
(a) What do you understand by Boot Strapping? Explain with
the help of Example.
(b) Explain about basic parsing techniques. What is top down
parsing? Explain in detail.
(c) Define the following:
() Regular expression
(i) Regular grammar
(ii) 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: ET+ET
T-VTNVid
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: (1 x10 =10)
(a) Discuss the role of Syntax Directed Translation Scheme.
(b) Describe the various code optimization techniques in detal.
COMPILER DESIGN (F.2]
(1 x10 = 10)
4. Attempt any one part of the following :
(a) What is symbol table? Explain in detail. Explain the use of
symbol table.
SLR?
(b) What is L.R. Parser? How it is different from
Construct LALR table for S-S
Sa Ad /b Bd/ a Bc/b Ac
(1 x10 = 10)
5. Attempt any one part of the following:
(a) Explain any two of the following in detail:
) Lexical phase errors
(i) Syntactic phase errors
(b) What is Parsing? Explain its types.
6. Attenpt any one part of the following: (1 x10 = 10)
(a) Discuss the role of Error Detection &Recovery.
(b) Describe the LALR parsing. How to construct it?
7. Attempt any one part of the following : (1 *10 = 10)
(a) Explain about BNF notation in briefly.
(b) Describe the working of each phases of the compiler with
examples.
COMPILER DESIGN
(F.3]

MCA
(SEM. IlI) THEORY EXAMINATION,2021-22
KCA 015: COMPILER DESIGN
Time:3 Hours Total Marks: 100
Note: Attempt all Sections. If require any missing data;
then chose
suitably.
SECTION-A
Attempt all questions in brief. (2 x 10 = 20)
(a) Define Bootstrapping.
() Differentiate compiler and interpreter.
(c) Wite down drawbacks of predictive parser.
(d) List out the actions performed by shift reduce parser.
(e) Define the term abstract syntax tree.
() What are loop variant constraints?
(9) What are the various advantages of heap storage allocation?
(h) Define symbol table.
What is machine independent code optimization?
What are the issues to be considered during code generation?
SECTION-B
2. Attempt any'three of the following : (10 x 3 = 30)
(a) Define regular expression. Wite about the identity rules for
regular expressions.
(b) Discuss in brief about left recursion and left factoring with
examples,
(C) Explain reducible and non-reducible flow graphs with example.
(d) Explain various data structures for symbol table.
(e) Explain in brief about different principle sources of optimization
techniques.
SECTION-C
3. Attempt any one part of the following: (10 x 1= 10)
(a) Write a LEX program that recognizes the tokens in
Discuss it. PASCAL
(b) Discuss the role of lexical analyzèr in a compiler.
Attempt any one part of the following: (10 x 1 =10)
(a) Define ambiguous grammar. Explain it with an
(b) What are the problems in top down parsing? example.
suitable example. Explain each with
5.
Attempt any one part of the following: (10 x 1=10)
(a) Differentiate between synthesized and inherited attributes with
suitable example
(b) Translate the expression -(a + b)'(c +d) +(a+b+c) into
quadruple, triple and indirect triple.
(F.4] KPH FOR MCA
6.
:
Attempt any one part of the ívllowingtable (10 x1=10)
(a) Explain, in detail the symbol organization for block
structured languages
(b) Explain in brief about stack storage allocation strateg.
7. Attempt any one part of the folloving:stimization. (10 %1 =10)
(a) Explain in detail inter procE
(b) Explain different types of in. iate codes forms.
COMPILER DESIGN (F.5]

MCA
(SEM II) THEORY EXAMINATION, 2022 - 23
KCA 015: COMPILER DESIGN
Time:3 Hours Maximum Marks:100
Note Attempt all Sections. If you require any missing data, then
choose suitably.
SECTION -A
1. Attempt all questions in brief. (2 x 10 = 20)
(a) Discuss the need of cross compiler and how it can be
achieved?
(b) Describe the Arden's theorem.
(c) investigate the use of pass of a compiler. to clu
() Discuss the requirement of a "lookahead" feature in order to
specify their lexical Analyzers. omcIpo
(e) Demonstrate an example of parse tree and syntax tree.
Show the actions available with shift reduce parsers.
(9) Define a postfix notation.
(h) Explain peephole optimization.
() Define DAG.
What do you mean by machine dependent and machine
independent optimization?
SECTION -B
2. Attempt any three of the following: (10 x3 = 30)
(a) Describe the symbol table manager and error handler
routines.
(b) Examine the output of lexical analyzer for the following
program.
int max (x, y)
int x, y:

this program find out the maximum of two numbers*/


return (x > y? x y):

(©) What ate lhe dtflcules wili top dovn paising? Exetai with
4d) Vat are thn 4Ey8 Ci ag the pgdaco? Explein in
detai
(e) Discuss about ihe foilowing:
) Copy Propagation
(i) Dead-code Elimination
(F.6) KPH for MCA
SECTION -C
3. Attempt any one part of the following : (1x 10 =10)
(a) Consider the following grammar
E’E+E
EE*E
E’(E)
E’ id
Discover whether the above grammar is unamblguous or
not. If not convert it and also remove the left recursion from
the grammar.
(b) For the Regular expression (a/b)"a(a/b). Draw the NFA, Obtain
DFA form NFA.
Attempt any one part of the following : (1 x 10 = 10)
(a) Point out the various phases of compiler and write down the
output of each phase of the compilation for the expression a: =
(b +d) + (c* 5).
(b) lustrate how a lexical analyzer can be implemented and VWrite
a LEX program to identify octal and hexadecimal numbers and
implement specific action after identifying these tokens.
5. Attempt any one part of the following : (1 x 10= 10)
(a) Compute FIRST and FOLLOW for given Grammar
S ->aBDh
B ->cC
C->bC|¬
D ->EF
E->g|¬
F->f|¬
(b) Make use of the recursive descent parser to write the code in
CLanguage for the following grammar
E’ TE'
E+ TE'|E
T’FT'
T'*FT |¬
F’(E)| id
6. Attempt any one part of the following :
(a) (1 x 10 = 10)
Break down the 3-address code for the statements a =c*-d +
b*-c?
(b) Classify three types of implementations of
statements. three-address
7. Attempt any one part of the following: (1 x 10 = 10)
(a) What are the issues in the design of code generator? Explain
in detail.
(b) What is an activation record? Draw diagram of
General
Activation record and explain the purpose of different fields
an activation record. of

You might also like