You are on page 1of 11

5/31/2021 ST.MARY'S GROUP OF INSTITUTIONS HYDERABAD DEPT OF CSE, III B.

TECH CSE CD MID-1

ST.MARY'S GROUP OF INSTITUTIONS


HYDERABAD

DEPT OF CSE,

III B.TECH CSE

CD MID-1

Hi BOMMA, when you submit this form, the owner will be able to see your name and email address.

1. Enter your Hall Ticket Number

17D01A0529

2. Does the compiler program translate the whole source code in one step?
(1 Point)

Depends on the Compiler

Don't Know

YES

No

3. Parsing is categorized into how many types?


(1 Point)
https://forms.office.com/Pages/ResponsePage.aspx?id=jFYGAhUV_UmQ1Pba0HhFACu-rUWHXCBCo0RPXbccbKtUQkZQQVFXTDA2TlFPRFdMTz… 1/11
5/31/2021 ST.MARY'S GROUP OF INSTITUTIONS HYDERABAD DEPT OF CSE, III B.TECH CSE CD MID-1

a. four types

b. two types

c. five types

d. three types

4. In which parsing, the parser constructs the parse tree from the start symbol and
transforms it into the input symbol.

a. Top-down parsing

b. Bottom-up parsing

c. None of the above

d. Both a and b
(1 Point)

a. Top-down parsing

b. Bottom-up parsing

c. None of the above

d. Both a and b

5. Which is considered as the sequence of characters in a token?

a. Lexeme

b. identifier
c. mixer

d. Pattern
(1 Point)

a. Lexeme

b. identifier

c. mixer

d. Pattern

https://forms.office.com/Pages/ResponsePage.aspx?id=jFYGAhUV_UmQ1Pba0HhFACu-rUWHXCBCo0RPXbccbKtUQkZQQVFXTDA2TlFPRFdMTz… 2/11
5/31/2021 ST.MARY'S GROUP OF INSTITUTIONS HYDERABAD DEPT OF CSE, III B.TECH CSE CD MID-1

6. Which part of the compiler highly used the grammar concept?

a. Code generation

b. Parser

c. Lexical Analysis

d. Code optimization
(1 Point)

a.Code generation

b. Parser

c. Lexical Analysis

d. Code optimization

7. Which phase of the compiler checks the grammar of the programming?

a. Semantic Analysis

b. Code Generation

c. Syntax Analysis

d. Code Optimization
(1 Point)

a. Semantic Analysis

b. Code Generation

c. Syntax Analysis

d. Code Optimization

8. Which of the following component is important for semantic analysis?

a. Lex

b. Symbol Table

c. Yacc

d. Type Checking
(1 Point)

a. Lex

b. Symbol Table
https://forms.office.com/Pages/ResponsePage.aspx?id=jFYGAhUV_UmQ1Pba0HhFACu-rUWHXCBCo0RPXbccbKtUQkZQQVFXTDA2TlFPRFdMTz… 3/11
5/31/2021 ST.MARY'S GROUP OF INSTITUTIONS HYDERABAD DEPT OF CSE, III B.TECH CSE CD MID-1

c. Yacc

d. Type Checking

9. Which phase of the compiler is also known as Scanner?

a. Lexical Analysis

b. Semantic Analysis

c. Code generation

d. Syntax Analysis
(1 Point)

a. Lexical Analysis

b. Semantic Analysis

c. Code generation

d. Syntax Analysis

10. Which graph describes the basic block and successor relationship?

a. DAG

b. Flow graph

c. Hamilton graph

d. Control graph
(1 Point)

a. DAG

b. Flow graph

c. Hamilton graph

d. Control graph

https://forms.office.com/Pages/ResponsePage.aspx?id=jFYGAhUV_UmQ1Pba0HhFACu-rUWHXCBCo0RPXbccbKtUQkZQQVFXTDA2TlFPRFdMTz… 4/11
5/31/2021 ST.MARY'S GROUP OF INSTITUTIONS HYDERABAD DEPT OF CSE, III B.TECH CSE CD MID-1

11. The most general phase of structured grammar is?

a. Context-free grammar

b. Regular grammar & Context-free grammar

c. Context-Sensitive grammar

d. All of these
(1 Point)

a .Context-free grammar

b. Regular grammar & Context-free grammar

c. Context-Sensitive grammar

d. All of these

12. String that appear in leftmost derivation are called

a) right sentinel forms b) left sentinel forms c) Circular forms d)None


(1 Point)

a) right sentinel forms

b) sentinel forms

c) Circular forms

d) None

13. A grammar that produces more than one parse for some sentence is
(1 Point)

a) ambiguous

b) unambiguous

c)Context-Free

d) Terminal parsing

https://forms.office.com/Pages/ResponsePage.aspx?id=jFYGAhUV_UmQ1Pba0HhFACu-rUWHXCBCo0RPXbccbKtUQkZQQVFXTDA2TlFPRFdMTz… 5/11
5/31/2021 ST.MARY'S GROUP OF INSTITUTIONS HYDERABAD DEPT OF CSE, III B.TECH CSE CD MID-1

14. The sentinel form in the parse tree is called


(1 Point)

a) yield

b) frontier of the tree

c) Both A & B

d) None

15. Why is the code optimizations are carried out on the intermediate code?
(1 Point)

A) Because for optimization information from the front end cannot be used

B) Because program is more accurately analyzed on intermediate code than on machine


code.

C) Because for optimization information from data flow analysis cannot be used

D) Because they enhance the portability of the compiler to the other target processor.

16. In a compiler, when is the keyboards of a language are recognized?


(1 Point)

A) During the lexical analysis of a program

B) During parsing of the program

C) During the code generation

D) During the data flow analysis

17. In a compiler, the data structure responsible for the management of information
about variables and their attributes is
(1 Point)

https://forms.office.com/Pages/ResponsePage.aspx?id=jFYGAhUV_UmQ1Pba0HhFACu-rUWHXCBCo0RPXbccbKtUQkZQQVFXTDA2TlFPRFdMTz… 6/11
5/31/2021 ST.MARY'S GROUP OF INSTITUTIONS HYDERABAD DEPT OF CSE, III B.TECH CSE CD MID-1

A) Semantic stack

B) Parser table

c) Symbol table

d) Abstract syntax-tree

18. The lexical analysis for Java needs...........in a necessary and sufficient sense.
(1 Point)

A) Turing machine

B ) Non-deterministic push down automata

C) Deterministic push down automata

D) Finite state automata

19. Is not an advantage of using shared, dynamically linked libraries as opposed to


using statically linked libraries.
(1 Point)

A) Lesser overall page fault rate in the system

B) Faster program startup

C) Existing programs need not be relinked to take advantage of newer versions

D) Smaller sizes of executable files

https://forms.office.com/Pages/ResponsePage.aspx?id=jFYGAhUV_UmQ1Pba0HhFACu-rUWHXCBCo0RPXbccbKtUQkZQQVFXTDA2TlFPRFdMTz… 7/11
5/31/2021 ST.MARY'S GROUP OF INSTITUTIONS HYDERABAD DEPT OF CSE, III B.TECH CSE CD MID-1

20. The programming language given below is written in the programming language
that does not allow nested declarations of functions and allows global variables.

global int j = 100, k = 5; void M(n)

int j = 10; print (n + 10); j = 200;

k = 20;

print (n);

main()

M(j + k);

What is the output of the above program if the programming language uses
dynamic scoping and call by name parameter passing mechanism?
(1 Point)

a. 105, 25

b. 105, 115

c. 220, 25

d. 115, 220

21. Consider the language L = {ai bi I i ? j}?

The grammar that generates this language is

S->aS\Sb\a\b

S->AC\CB C->aC b\a\b A->aA\ ∈

B->Bb\ ∈
S->AC\CB C->aCb\∈

A->aA\a B->bB\b

S->AC\CB C->aC b\∈

A->aA\ ∈

B->Bb\ ∈
(1 Point)

S->aS\Sb\a\b

S->AC\CB C->aC b\a\b A->aA\ ∈

https://forms.office.com/Pages/ResponsePage.aspx?id=jFYGAhUV_UmQ1Pba0HhFACu-rUWHXCBCo0RPXbccbKtUQkZQQVFXTDA2TlFPRFdMTz… 8/11
5/31/2021 ST.MARY'S GROUP OF INSTITUTIONS HYDERABAD DEPT OF CSE, III B.TECH CSE CD MID-1

B->Bb\ ∈

S->AC\CB C->aCb\∈

22. To convert an arbitrary CFG to an LL (1) grammar

a) Factor the grammar alone

b) Remove left recursion alone

c) Remove left recursion and factor the grammar

d) None of the above


(1 Point)

a) Factor the grammar alone

b) Remove left recursion alone

c) Remove left recursion and factor the grammar

d) None of the above

23. Consider the grammar G whose SLR parser has n1 states and LALR parser has n2
states. What is the relation between n1 and n2?

a) n1 = n2

b) n1 < n2

c. n1 > n2

d. None of the above


(1 Point)

a) n1 = n2

b) n1 < n2

c. n1 > n2

d. None of the above

https://forms.office.com/Pages/ResponsePage.aspx?id=jFYGAhUV_UmQ1Pba0HhFACu-rUWHXCBCo0RPXbccbKtUQkZQQVFXTDA2TlFPRFdMTz… 9/11
5/31/2021 ST.MARY'S GROUP OF INSTITUTIONS HYDERABAD DEPT OF CSE, III B.TECH CSE CD MID-1

24. We have the grammar with the translation

rules: E->E1 # T {E.value = E1.value * T.value}

I T {E.value = T.value}

T->T1 & F {T.value = T1.value F.value} I F {T.value = F.value}

F->num {F.value = num.value}

In the above grammar E is the start symbol. What will be the value of E for the root
parser tree for the expression 2 # 3 & 5 # 6 & 4?
(1 Point)

a. 50

b. 100

c. 200

d. 160

25. For a grammar G, Shift reduce (S-R) conflicts is present in LALR (1) parser, if and
only if

a) The LR (1) parser for G has S-R conflicts

b) The LR (0) parser for G has S-R conflicts

c) The SLR (1) parser for G has S-R conflicts

d) The SLR (0) parser for G has S-R conflicts


(1 Point)

a) The LR (1) parser for G has S-R conflicts

b) The LR (0) parser for G has S-R conflicts

c) The SLR (1) parser for G has S-R conflicts

d) The SLR (0) parser for G has S-R conflicts

https://forms.office.com/Pages/ResponsePage.aspx?id=jFYGAhUV_UmQ1Pba0HhFACu-rUWHXCBCo0RPXbccbKtUQkZQQVFXTDA2TlFPRFdMT… 10/11
5/31/2021 ST.MARY'S GROUP OF INSTITUTIONS HYDERABAD DEPT OF CSE, III B.TECH CSE CD MID-1

26. Parsing Table is a two-dimensional array M[A, a], where

A) ‘A’ is a non-terminal and ‘a’ is a terminal

B) ‘a’ is a non-terminal and ‘A’ is a terminal

C) ‘A’ is a String and ‘a’ is a terminal

D) ‘A’ is a terminal and ‘a’ is parsing


(1 Point)

A) ‘A’ is a non-terminal and ‘a’ is a terminal

B) ‘a’ is a non-terminal and ‘A’ is a terminal

C) ‘A’ is a String and ‘a’ is a terminal

D) ‘A’ is a terminal and ‘a’ is parsing

Submit

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=jFYGAhUV_UmQ1Pba0HhFACu-rUWHXCBCo0RPXbccbKtUQkZQQVFXTDA2TlFPRFdMT… 11/11

You might also like