CT 1 - B Answer Key
CT 1 - B Answer Key
1 CO1 H H H H M L L L M M L H H H H
2 CO2 H H H H M L L L M M L H H H H
3 CO3 H H H H M L L L M M L H H H H
4 CO4 H H H H M L L L M M L H H H H
5 CO5 H H H H M L L L M M L H H H H
6 CO6 H H H H M L L L M M L H H H H
Part – A
Answer all (5 x 1=5 marks)
Q. Question Mark B C P PI
N s L O O Cod
o e
1 Match the following: 1 2 1 3 3.6.1
a) Scanners i) Context free grammars
b) Parsers ii) Language extensions
c) Preprocessor iii) Machine code
d) Interpreter iv) Lexemes
a) A-iii; b-i;c-iv; d-ii
b) A-iv; b-i; c-ii; d-iii
c) A-iii; b-i;c-ii; d-iv
d) A-iv; b-iii;c-ii; d-i
Ans b
2 What is the minimum number of states for NFA that accepts the language 1 2 1 3 3.6.1
{0101n | n >=0}?
a) 5 b) 4 c) 6 d) 16
Ans a
Ans c
4 ________ occurs before _________. 1 1 1 6 6.3.1
a) Syntax checking, type checking
b) Type checking, syntax checking
c) Syntax checking, spell checking
d) Type checking, spell checking
Ans a
5 Which is not true about symbol table? 1 1 1 1 1.6.1
a) Can be implemented as Doubly linked list
b) Declarations are managed by symbol table
c) Symbol table is updated by compiler
d) Semantic details cannot be sought from symbol table
Ans d
Part –B
Answer any two (2x 4=8 marks)
Q. Question Mark BL C PO PI
N s O Code
o
6 What is the role of syntax directed translation engine in compiler 4 1 1 1 1.6.1
construction process? What is the significance of the process done by it?
Answer
It generates intermediate code with three address format
from the input that consists of a parse tree. These engines
have routines to traverse the parse tree and then produces
the intermediate code. In this, each node of the parse tree
is associated with one or more translations.
7 Give the regular expression for binary language which generates strings 4 3 1 6 6.3.1
that start and end with same digit.
Answer
Answer
1. Panic Mode Recovery
Part –C
Answer all ( 1x 12=12 marks)
Q Question Mar B C P PI
. ks L O O Co
N de
o
9 a) A strong password generator comprises of diverse types of tokens. A 12 4 1 6 6.3.
leading IT firm decides to automate the process of password generation 1
by constructing a Regular expression for it. The permissible token are
{ %, a, b, @}. The following are the rules to be followed:
i) The password cannot start with @ or %.
ii) There is no restriction on its maximum length but it should have
at least two characters.
iii) The password cannot end with a or b
Create a Regular expression for the password generator and also give its
equivalent ε-NFA for the same. Also, give its equivalent deterministic machine.
Answer
(OR)
Answer
*Performance Indicators are available separately for Computer Science and Engineering in AICTE examination
reforms policy.