Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

09/10/2021, 12:18 Compiler Design[BTCS601]_MST QP

Compiler Design[BTCS601]_MST QP

1. Is the important component for semantic analysis? *


(1 Point)

LEX

YACC

TYPE CHECKING

ERROR CHECKING

2. What is the minimum number of phases required for compiler development? *


(1 Point)

3. Choose machine independent phase of the compiler *


(1 Point)

Lexical Analysis

Syntax Analysis

Code Optimization

Intermediate Code Generator

https://forms.office.com/Pages/ResponsePage.aspx?id=a_k_eBP-a0C0jUXcGFPLrR1yTsdtVkNKjFuRX3DQbUpURVhWT0ZaSUxFVk9KM1k2Mj… 1/5
09/10/2021, 12:18 Compiler Design[BTCS601]_MST QP

4. Which of these is not a part of Synthesis Phase. *


(1 Point)

Synthesize a machine instruction or the machine form of a constant

Perform LC processing

Obtain machine code corresponding to the mnemonic from the mnemonics table

Obtain address of a memory operands from the symbol table

5. Which of the following is/are not a lexemes? *


(1 Point)

Identifiers

Constants

Keywords

None of the above

6. Choose correct option for production α → β  *


(1 Point)

Type 1 Grammar, if α, β ∈ (T ∪ V )* and |α| <= |β|

Type 2 Grammar, if α, β ∈ (T ∪ V )* and |α| = 1

Type 3 Grammar, if α ∈ V,  β ∈ (T)* and |α| = 1

Type 0 Grammar, if α, β ∈ (T ∪ V )*  and α contain at least one Non Terminal

7. Identify the TYPE of following Grammar

S → $Ca# | a 

Ca → aaC | D

$D → $C

C# → D# 

aD → Da   *
(1 Point)

https://forms.office.com/Pages/ResponsePage.aspx?id=a_k_eBP-a0C0jUXcGFPLrR1yTsdtVkNKjFuRX3DQbUpURVhWT0ZaSUxFVk9KM1k2Mj… 2/5
09/10/2021, 12:18 Compiler Design[BTCS601]_MST QP

Context Free Grammar

Regular Grammar

Unrestricted Grammar

Context Sensitive Grammar

8. Predictive Parser can be? *


(1 Point)

Recursive

Non Recursive

Constructive

Both I and II

9. Consider the Following Grammar

Z→ XYZ | d 

X→ Y | a

Y →cX | ε 

What is the FIRST(Z) and FIRST(X) *


(1 Point)

FIRST(Z) = {a,c} and FIRST(X)={a,ε}

FIRST(Z) = {d} and FIRST(X)={a}

FIRST(Z) = {a,c,d} and FIRST(X)={a,c,ε}

FIRST(Z) = {a,ε} and FIRST(X)={a}

10. Use backtracking top-down parsing on the following grammar 

S → aSa 

S →  aa

Check it generate following sequence or not

aaaaaaaaaa *
(1 Point)

Yes

https://forms.office.com/Pages/ResponsePage.aspx?id=a_k_eBP-a0C0jUXcGFPLrR1yTsdtVkNKjFuRX3DQbUpURVhWT0ZaSUxFVk9KM1k2Mj… 3/5
09/10/2021, 12:18 Compiler Design[BTCS601]_MST QP

No

11. Explain in detail the various phases of compilers with an example.


(Non-anonymous question  )
(5 Points)

 qn11 ans (18100BTIT03073)_CHETAN MEHTA.pdf

12. (a) Differentiate between ambiguous and unambiguous grammar. (2)

(b) Compute the FIRST and FOLLOW sets for each nonterminal of the grammar
given below: (3)

S→ ABa | bCA 

A→ cBCD | a | d | ε 

B →CdA| ba

C →eC| ε

D →bSf | a

(Non-anonymous question  )
(5 Points)

 qn12 ans (18100BTIT03073)_CHETAN MEHTA.pdf

13. Consider the Following Grammar

E→ E+T | T 
T→ TF | F

F→F* | a | b 

Construct LL(1) top down parsing table for the given grammar and check
following string parse using parser or not.

 w = a+ab*  (Non-anonymous question  )


(5 Points)

This content is created by the owner of the form. The data you submit will be sent to the form owner. Microsoft is
not responsible for the privacy or security practices of its customers, including those of this form owner. Never give
out your password.

Powered by Microsoft Forms | Privacy and cookies | Terms of use


https://forms.office.com/Pages/ResponsePage.aspx?id=a_k_eBP-a0C0jUXcGFPLrR1yTsdtVkNKjFuRX3DQbUpURVhWT0ZaSUxFVk9KM1k2Mj… 4/5
09/10/2021, 12:18 Compiler Design[BTCS601]_MST QP

https://forms.office.com/Pages/ResponsePage.aspx?id=a_k_eBP-a0C0jUXcGFPLrR1yTsdtVkNKjFuRX3DQbUpURVhWT0ZaSUxFVk9KM1k2Mj… 5/5

You might also like