Parsing
1.

In how many types parsing is divided?

A.  

2

B.  

3

C.  

4

D.  

5

2.

When the parser starts constructing the parse tree from the start symbol and then tries to transform the start symbol to the input, it is called?

A.  

bottom-up parsing

B.  

top-down parsing

C.  

Both A and B

D.  

None of the above

3.

 In ___________________, if one derivation of a production fails, the syntax analyzer restarts the process using different rules of same production

A.  

Bottom-up Parsing

B.  

Recursive descent parsing

C.  

Backtracking

D.  

All of the above

4.

A form of recursive-descent parsing that does not require any back-tracking is known as?

A.  

predictive parsing

B.  

non-predictive parsing

C.  

recursive parsing

D.  

non-recursive parsing

5.

Compute E.value for the root of the parse tree for the expression:2 # 3 & 5 # 6 &4.

A.  

40

B.  

80

C.  

120

D.  

160

6.

Compute E.value for the root of the parse tree for the expression:2 # 3 & 5 # 6 &4.

A.  

40

B.  

80

C.  

120

D.  

160

7.

Assume that the SLR parser for a grammar G has n1 states and the LALR parser for G has n2 states.n1 is necessarily less than n2

A.  

n1 is necessarily less than n2

B.  

n1 is necessarily equal to n2

C.  

n1 is necessarily greater than n2

D.  

None of the above

8.

the predictive parser puts some constraints on the grammar and accepts only a class of grammar known as LL(k) grammar.

A.  

TRUE

B.  

FALSE

C.  

Can be true or false

D.  

Can not say

9.

Which of the following suffices to convert an arbitrary CFG to an LL(1) grammar?

A.  

Removing left recursion only

B.  

Factoring the grammar alone

C.  

Factoring & left recursion removal

D.  

None of the above

10.

Which of the following derivations does a top-down parser use while parsing an input string?

A.  

Leftmost derivation

B.  

Leftmost derivation in reverse

C.  

Rightmost derivation

D.  

Rightmost derivation in reverse