wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

SDT1

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Difference between SDD & SDT is

a)

in Grammar

b)

in semantic rules

c)

in hiding implementation details

d)

none

2.

SDT /SDD is also called

a)

Annotated parse tree

b)

Concrete Syntax Tree

c)

postfix SDT

d)

Attribute grammar

3.

The attribute at a node is evaluated with attributes of its siblings is called

a)

Synthesized attribute

b)

Inherited attribute

c)

SDT

d)

SDD

4.

IN SDT, A--> PQR

where .i is inherited attribute, which of the following is correct

a)

A.i=Q.i

b)

P.i= Q.i * R.i

c)

A.i = Q.i + P.i + R.i

d)

none

5.

An attribute can be

a)

value,

b)

string, value

c)

type, address

d)

all

6.

Consider following language construct

main() { int i,n;

fro(i=0; i<n; i++) }

when this is compiled, compiler response is

a)

No error

b)

lexical error

c)

syntax error

d)

both lexical & syntax error

7.

The start symbol in grammar can have

a)

synthesized attribute

b)

inherited attribute

c)

both

d)

none

8.

Parse tree showing attribute values at each node is called

a)

syntax tree

b)

concrete syntax tree

c)

annotated parse tree

d)

Derived parse tree

9.

compiler spends more time in

a)

Lexical analysis

b)

syntax analysis

c)

semantic analysis

d)

code optimizer

10.

Most of the errors in compilation are captured by

a)

lexical analyzer

b)

syntax analyzer

c)

semantic analyzer

d)

all the above