adplus-dvertising

Welcome to the Syntax Directed Definition and Translations MCQs Page

Dive deep into the fascinating world of Syntax Directed Definition and Translations with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Syntax Directed Definition and Translations, a crucial aspect of Compiler Design. In this section, you will encounter a diverse range of MCQs that cover various aspects of Syntax Directed Definition and Translations, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within Compiler Design.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Syntax Directed Definition and Translations. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of Compiler Design.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Syntax Directed Definition and Translations. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Syntax Directed Definition and Translations MCQs | Page 5 of 12

Q41.
Consider the grammar with non-terminals
N = {S , C , S}, terminals T = {a, b , i , t, e}, with S as the start symbol, and the following of rules

S -> iCtSS1 | a

S1 -> eS | ε

C -> b

The grammar is NOTLL(1) because:
Discuss
Answer: (a).It is left recursive
Q42.
Consider the following two statements:
P: Every regular grammar is LL(1)

Q: Every regular set has LR(1) grammar

Which of the following is TRUE?
Discuss
Answer: (a).Both P and Q are true
Q43.
In a simplified computer the instructions are:
OP R j , Ri − Performs Rj OP Ri and stores the result in register Ri

OP m, Ri − Performs val OP Ri abd stores the result in Ri. value

denotes the content of memory location m.

MCVm, Ri −Moves the content off memory loction m to register Ri .

MCVm, Ri , m −Moves the content of register Ri to memory location m.

The computer has only two registers, and OP is either ADD or SUB. Consider the following basic block:

t1 = a + b

t2 = c + d

t 3 = e − t2

t 4 = t 1 − t2

Assume that all operands are initially in memory. The final value of the computation should be in memory. What is the minimum number of MOV instructions in the code generated for this basic block?

a.

2

b.

3

c.

5

d.

6

Discuss
Answer: (b).3
Q44.
S->bA S->aB
A->a B->b

A->aS B->bS

A->bAA B->aBB

Which of the following strings is generated by the grammar?
Discuss
Answer: (c).aabbab
Q45.
S->bA S->aB
A->a B->b

A->aS B->bS

A->bAA B->aBB

how many derivation trees are there?

a.

1

b.

2

c.

3

d.

4

Discuss
Answer: (b).2
Q46.
Which of the following are true?
(i) A programming language option does not permit global variables of any king and has no nesting of procedures/functions, but permits recursion can be implemented with static storage allocation

(ii) Multi-level access link (or display) arrangement is needed to arrange activation records-only if the programming language being implemented has nesting of procedures/function

(iii) Recursion in programming languages cannot be implemented with dynamic storage allocation

(iv) Nesting of procedures/functions and recursion require a dynamic heap allocation scheme and cannot be implemented with a stack-based allocation scheme for activation records

(v) Languages which permit a function to return a function as its result cannot be implemented with a stack-based storage allocation scheme for activation records
Discuss
Answer: (a).(ii) and (v) only
Discuss
Answer: (b).The LR(1) parser for G has S-R conflicts
Q48.
Which of the following statements are TRUE ?
I There exist parsing algorithms for some programming languages hose complex are less than θ(n 3 )

II A programming language which allows recursion can be implemented with static storage allocation

III No L-attributed definition can be evaluated in the framework of bottom-up parsing

IV Code improving transformations can be performed at both source language and intermediate code level
Discuss
Answer: (b).I and IV
Q49.
What data structure in a complier is used for managing information about variables and their attributes?
Discuss
Answer: (b).Symbol table
Q50.
Which languages necessarily need heap allocation in the runtime environment?
Discuss
Answer: (c).Allow dynamic data structure
Page 5 of 12

Suggested Topics

Are you eager to expand your knowledge beyond Compiler Design? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!