0% found this document useful (0 votes)
25 views3 pages

BSC - Computer Science Cs - Semester 6 - 2023 - November - Compiler Construction II 2019 Pattern

This document is an examination paper for T.Y. B.Sc. (Computer Science) on Compiler Construction, consisting of 5 questions divided into multiple parts. The exam covers topics such as cross compilers, parsing techniques, grammar analysis, and code optimization. Students are instructed to attempt a specified number of questions from each section within a 2-hour time limit.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views3 pages

BSC - Computer Science Cs - Semester 6 - 2023 - November - Compiler Construction II 2019 Pattern

This document is an examination paper for T.Y. B.Sc. (Computer Science) on Compiler Construction, consisting of 5 questions divided into multiple parts. The exam covers topics such as cross compilers, parsing techniques, grammar analysis, and code optimization. Students are instructed to attempt a specified number of questions from each section within a 2-hour time limit.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Total No. of Questions : 5] SEAT No.

:
P6403 [Total No. of Pages : 3

[6155]-66
T.Y. B.Sc. (Computer Science)
CS - 366 : COMPILER CONSTRUCTION
(2019 Pattern) (Semester - VI)

Time : 2 Hours] [Max. Marks : 35


Instructions to the candidates:
1) All questions are compulsory.
2) Figures to the right indicate full marks.

Q1) Attempt any Eight of the following (out of 10). [8×1=8]

a) Define cross compiler.

b) List the two classes of SDD.

c) Define the term dead code.

d) List the differnt types of conflicts that occur in LR parser.

e) State one difference between annotated Parse tree and dependency graph.

f) List the techniques used in code optimization.

g) What is the purpose of augmenting the grammar?

h) Define term Attribute Grammar.

i) What is output of Lexical Analysis?

j) State True or False : Shift - Shift conflict does not occur in LR Parser.

Q2) Attempt any four of the following (out of 5): [4×2=8]


a) Compute First and Follow for the following
S  i CtSS| a
S  e S| 
Cb

P.T.O.
b) Write difference between LL parser and LR Parser.
c) Compute Leading and Trailing symbols of the following Grammar:

S  (T) | a | 
T  T, S | $

d) Write execution steps of VACC program.


e) Give two difference between synthesized and inherited attributes.

Q3) Attempt any Two of the following (out of 3) [2×4=8]


a) Write a Recursive Descent Parser (RDP) for the following grammar.
E  E+T | T
T  TF|F
F  (E) | id

b) Construct DAG for following expression.


i) b * a  c  a  c * d
ii) y   y  x /  x  z * x  z

c) Check whether the following Grammar is LL(1) or not?


S  a||(R)
T  S,T | S
R T

Q4) Attempt any two of the following (out of 3) [2×4=8]


a) Check whether the given grammar is SLR (1) or not.

S  A|B
A  aA | b
B  dB / b

[6155]-66 2
b) Construct triples and Quadruples for the following expression :
(a+b)*(m–n)  (m+n)
c) Consider the following SDD and construct Annotated Parse tree for
input string 3*5* 2
Production Semantic Rules
E  TE E.inh = T.val
E.val = E.syn

E   TE E1 .inh = E.inh+T.val

E1 .syn = E1 .syn

E  E.syn  E.inh

T  FT T.inh  F.val


T.val  T.syn

T  *FT T1.inh  T.inh * F.val

T1.syn  T1.syn

T1  T.syn  T.inh

F  digit F.val  digit.lexval

Q5) Attempt any one of the following (out of 2). [1×3=3]


a) Write a LEX program to find factorial of a given number.
b) Eliminate left-Recursion from following grammar:

S  Aa | b

A  Ac | sd| 

 

[6155]-66 3

You might also like