How To Exam?

a knowledge trading engine...


West Bengal Institute of Technology (WBIT) 2010-7th Sem B.Tech Computer Science and Engineering Computer Science -Language Processor - Question Paper

Wednesday, 17 July 2013 02:40Web



Name : .....................................................................

Roll No. : .................................................................

Invigilator's Signature :..............................................

CS/B.Tech(CSE)/SEM-7/CS-701/2010-11 2010-11 LANGUAGE PROCESSOR

Time Allotted : 3 Hours    Full Marks : 70

The figures in the margin indicate full marks.

Candidates are required to give their answers in their own words

as far as practicable.

GROUP-A ( Multiple Choice Type Questions )

1. Choose the correct alternatives for any ten of the following :

10 x 1 = 10

i)    Symbol table can be used for

a)    checking type compatibility

b)    suppressing duplicate error messages

c)    storage allocation

d)    all of these.

ii)    Which data structure    is mainly used during shift-reduce parsing ?

a) Pointers    b) Arrays ,

c) Stacks    d) Queues.

CS/B.Tech(CSE) /SEM-7/CS-701 /2010-11

Ul) Which of the following Is not an intermediate code form ?

a) Postifix notation    b) Syntax trees

c) Three address codes d) Quadruples.

iv)    If x is a terminal then FIRST ( x) is

a) e    b) {x }

c) x    d) none of these.

v)    Which one of the following error will not be detected by the compiler ?

a) Lexical error    b) Syntactic error

cl Semantic error    d) Logical error.

vi)    The grammar E -> E + E | E * E\ a is    .

a)    ambiguous

b)    unambiguous

c)    not given sufficient information

d)    none of these.

CS/B.Tech(CSE) / SEM-7 / CS-701 /2010-11 vll) YACC builds up

a)    SLR parsing table

b)    LALR parsing table

c)    canonical LR parsing table

d)    none of these.

viii)    If a grammer is in LALR (1) then it is necessarily

a) LL(1)    b) SLR(l)

c) LR(1)    d) none of these.

ix)    Which one of the following is not true about dynamic checking ?

a)    It increases the cost of execution

b)    Type checking is done during execution

c)    All the type error are detected /

d)    None of these.    ,

x)    A basic block can be analyzed by    ' .

0 DAG    b) Flow graph

c) Graph with cycles d) None of these.

xi)    The method which merges the bodies of two loops is

a) loop unrolling    b) loop ramming

c) constant folding    d) none of these.

xii)    A top down parser generates

a)    leftmost-derivation

b)    rightmost-derivation

c)    leftmost derivation in reverse

d)    rightmost derivation in reverse.

GROUP - B

( Short Answer Type Questions )

Answer any three of the following. 3x5= 15

2.    How the following statement is translated via the different phases of compilation ?

position : = initial + rate * 70.

3.    Convert the following NFA into its equivalent DFA :

The set of all strings with 0 and 1, beginning with 1 & ending with 00.

4.    Explain inherited attribute and synthesized attribute for Syntax directed translation with suitable example.

5.    What is type checking ? Differentiate between Dynamic and Static Type checking.

6.    Differentiate Quadruple, Triples and Indirect triples with example.

GROUP -C ( Long Answer Type guestions )

Answer any three of the following. 3 x 15 = 45

7.    a) What are the analysis phase and synthesis phase of an

assembler ?

b) Suppose a robot can be instructed to move one step east, north, west or south from its current position. A sequence of such instruction is generated by the following grammar :

Seq -> Seq x instr | begin

Instr > east | north | west | south

i)    Construct a syntax directed definition to translate an instruction sequence into a robot position.

ii)    Draw a parse tree for : begin west south.

4 + 7 + 4

8 . Construct a predictive parsing table for the grammar : S-iEtSS'|a S'-eS|. e E - b

Here S is star symbol & S' are non-tenhinals & i, t, a, e, b are terminals.

Explain the steps in brief.

9.    Construct DFA directly from [ not by generating NFA ] the regular expression

L = [ a \b) * ab

What are the main contributions of Syntax Directed Translation in Compiler ? Design a Dependency Graph and Direct acylcic graph for the string

a+a*[b~c) + {b-c)*d    7 + 3 + 5

10.    Translate the expression a=-[a + b)*[c + d) + ( a + b + c ) into

a)    Quardruple

b)    Triple

c)    Indirect Triple

Draw the flow graph for the following code :

i)

location = - 1

ii)

t = 0

iii)

i100 goto 5

iv)

goto 13

v>

tj = 4i

vi)

r*

to

It

>

rt-

t*

vii)

if t2 = x goto 9

viii)

goto 10.

ix)

location = i

x)

t3 = i+ 1

xi)

i=t3

xii)

goto 3

xiii)

What do you understand by terminal table and literal table ?

6 + 6 + 3

a)    LEX and YAAC

b)    Activation record

c)    Symbol Table

d)    Peephole optimization

e)    Cross compiler.







Attachment:

( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER West Bengal Institute of Technology (WBIT) 2010-7th Sem B.Tech Computer Science and Engineering Computer Science -Language Processor - Question Paper