MCQ - CD
MCQ - CD
GRT INSTITUTE OF
ENGINEERING AND
TECHNOLOGY, Tiruttani
(An Autonomous Institution)
Accredited by NBA (ECE), NAAC with “A++” Grade &An ISO 9001:2015 Certified Institution
Approved by AICTE, New Delhi& Affiliated to Anna University, Chennai.
Assume the conflicts part (a) of this question are resolved and an
LALR (1) parser is generated for parsing arithmetic expressions as
per the given grammar. Consider an expression 3 # 2 + 1. What
precedence and associativity properties does the generated parser
realize?
E -> number Eval number val
E E .val E .VAL E .val
E#E E .val E .VAL E .val
;
2
a) Equal precedence and left associativity; expression is evaluated to
7
b) Equal precedence and right associativity, expression is evaluated
to 9
c) Precedence of ‘x’ is higher than that of ‘+’, and both operators are
left associative; expression is evaluated to 7
d) Precedence of ‘ # ‘ is higher than that of ‘#’, and both operators
are left associative; expression is evaluated to 9
S -> S * E
S -> E
E -> F + E
E -> F
F -> id
Consider the following LR (0) items corresponding to the grammar
above.
3
(i) S -> S * .E
(ii) E -> F. + E
(iii) E “F + .E
Given the items above, which two of them will appear in the same
set in the canonical sets-of-items for the grammar?
a) (ii)
b) (i) and (iii)
c) (iii)
d) None of the mentioned
Consider the following grammar:
S -> FR
R -> * S | ε
F -> id
In the predictive parser table, M, of the grammar the entries M [S,
4 id] and M [R, $] respectively.
a) {S ” FR} and {R ” ε}
b) {S ” FR} and {}
c) {S ” FR} and {R ” * S}
d) {F ” id} and {R ” ε}
UNIT IV
Q.NO ANSWER ALL QUESTIONS (10x2) =20 Marks OPTION MARKS
This set of Compilers Multiple Choice Questions & Answers
(MCQs) focuses on “Runtime Storage Location – 1”.
1. The load instruction is mostly used to designate a transfer from
1 memory to a processor register known as _______
a) Accumulator
b) Instruction Register
c) Program counter
d) Memory address Register
A group of bits that tell the computer to perform a specific operation
is known as ________
a) Instruction code
2
b) Micro-operation
c) Accumulator
d) Register
The time interval between adjacent bits is called the __________
a) Word-time
3 b) Bit-time
c) Turnaround time
d) Slice time
A k-bit field can specify any one of __________
a) 3k registers
4 b) 2k registers
c) K2 registers
d) K3 registers
MIMD stands for __________
a) Multiple instruction multiple data
5 b) Multiple instruction memory data
c) Memory instruction multiple data
d) Multiple information memory data
Logic gates with a set of input and outputs are arrangement of
___________
6 a) Computational circuit
b) Logic circuit
c) Design circuits
d) Register
The average time required to reach a storage location in memory
and obtain its contents is called __________
7 a) Latency time
b) Access time
c) Turnaround time
d) Response time
The BSA instruction is ___________
a) Branch and store accumulator
8 b) Branch and save return address
c) Branch and shift address
d) Branch and show accumulator
A floating point number that has an O in the MSB of mantissa is
said to have __________
9 a) Overflow
b) Underflow
c) Important number
d) Undefined
Translation from symbolic program into Binary is done in
__________
10 a) Two passes
b) Directly
c) Three passes
d) Four passes
Total Marks (20 Marks)
UNIT V
Q.NO ANSWER ALL QUESTIONS (10x2) =20 Marks OPTION MARKS
What is a compiler?
a) system program that converts instructions to machine language
1 b) system program that converts machine language to high-level
language
c) system program that writes instructions to perform
d) None of the mentioned
Which of the following is a stage of compiler design?
a) Semantic analysis
2 b) Intermediate code generator
c) Code generator
d) All of the mentioned
What is the use of a symbol table in compiler design?
a) Finding name’s scope
3 b) Type checking
c) Keeping all of the names of all entities in one place
d) All of the mentioned
Which of the following error can a compiler check?
a) Syntax Error
4 b) Logical Error
c) Both Logical and Syntax Error
d) Compiler cannot check errors
A programmer, writes a program to multiply two numbers instead
of dividing them by mistake, how can this error be detected?
5 a) Compiler or interpreter
b) Compiler only
c) Interpreter only
d) None of the mentioned
Who is responsible for the creation of the symbol table?
6 a) Assembler
b) Compiler
c) Interpreter
d) All of the mentioned
Which of the following is known as a compiler for a high-level
language that runs on one machine and produces code for a different
machine?
7 a) Cross compiler
b) Multipass compiler
c) Optimizing compiler
d) One pass compiler
Which of the following is a system program that integrates a
program’s individually compiled modules into a form that can be
executed?
8 a) Interpreter
b) Assembler
c) Compiler
d) Linking Loader
Which of the following is a definition of compiler?
a) Acceptance of a program written in a high-level language and
9 produces an object program
b) Program is put into memory and executes it
c) Translation of assembly language into machine language
d) None of the mentioned
Which of the following phase of the compiler is Syntax Analysis?
a) Second
10 b) Third
c) First
d) All of the mentioned
Total Marks (20 Marks)