Explore topic-wise MCQs in Compilers.

This section includes 8 Mcqs, each offering curated multiple-choice questions to sharpen your Compilers knowledge and support exam preparation. Choose a topic below to get started.

1.

Which of the following is incorrect for the actions of A LR-Parser I) shift s ii) reduce A->ß iii) Accept iv) reject?

A. Only I)
B. I) and ii)
C. I), ii) and iii)
D. I), ii) , iii) and iv)
Answer» D. I), ii) , iii) and iv)
2.

Assume that the SLR parser for a grammar G has n1 states and the LALR parser for G has n2 states. Hence which one is true?

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 mentioned
Answer» C. N1 is necessarily greater than n2
3.

A optimizing compiler

A. Is optimized to occupy less space
B. Is optimized to take less time for execution
C. Optimized the code
D. None of the mentioned
Answer» D. None of the mentioned
4.

A garbage is

A. Unallocated storage
B. Allocated storage whose access paths are destroyed?
C. Allocated storage
D. Uninitialized storage
Answer» C. Allocated storage
5.

A shift reduce parser carries out the actions specified within braces immediately after reducing with the corresponding rule of grammar S—-> xxW ( PRINT “1”) S—-> y { print ” 2 ” } S—-> Sz { print ” 3 ” ) What is the translation of xxxxyzz using the syntax directed translation scheme described by the above rules ?

A. 23131
B. 11233
C. 11231
D. 33211
Answer» B. 11233
6.

The address code involves

A. Exactly 3 address
B. At most Three address
C. No unary operators
D. None of the mentioned
Answer» E.
7.

Running time of a program depends on$

A. Addressing mode
B. Order of computations
C. The usage of machine idioms
D. All of the mentioned
Answer» E.
8.

In an absolute loading scheme which loader function is accomplished by assembler?

A. Re-allocation
B. Allocation
C. Linking
D. Loading
Answer» B. Allocation