Home / Engineering / Theory of Computation and Compiler Design MCQs / Page 8
Theory of Computation and Compiler Design MCQs | Page - 8
Dear candidates you will find MCQ questions of Theory of Computation and Compiler Design here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
M
Q. 71) Which of the following grammar rules violate the requirements of an operator grammar ? P, Q, R are nonterminals, and r, s, t are terminals.
1. P → Q R
2. P → Q s R
3. P → ε
4. P → Q t R r
M
Q. 72) Consider the grammar with the following translation rules and E as the start symbol.
E → E1 # T { E.value = E1.value * T.value } | T{ E.value = T.value }
T → T1 & F { T.value = T1.value + F.value } | F{ T.value = F.value }
F → num { F.value = num.value }
Compute E.value for the root of the parse tree for the expression: 2 # 3 & 5 # 6 & 4.
M
Q. 73) Assume that the SLR parser for a grammar G has n1 states and the LALR parser for G has n2 states. The relationship between n1 and n2 is:
M
Q. 74) Consider the grammar shown below S → i E t S S' | a S' → e S | ε E → b In the predictive parse table. M, of this grammar, the entries M[S', e] and M[S', $] respectively are
M
Q. 75) Consider the translation scheme shown below
S → T R
R → + T {print ('+');} R | ε
T → num {print (num.val);}
Here num is a token that represents an integer and num.val represents the
corresponding integer value. For an input string '9 + 5 + 2', this translation scheme will
print
M
Q. 76) Which of the following is essential for converting an infix expression to the postfix from efficiently?
M
Q. 77) The grammar whose productions are
<stmt> → if id then <stmt>
<stmt> → if id then <stmt> else <stmt>
<stmt> → id := id
is ambiguous because
a) the sentence if a then if b then c:= d has two parse trees
b) the left most and right most derivations of the sentence if a then if b then c:= d give rise to different parse trees
c) the sentence if a then if b then c:= d else c:= f has more than two parse trees
d) the sentence if a then if b then c:= d else c:= f has two parse trees
M
Q. 78) Consider the following grammars
(S1) :
A --> aBCD
B --> bc|c
C --> d|∈
D -> b
(S2) :
A --> aBCD
B --> bc|∈
C --> d|c
D -> b
(S3) :
A --> aBCD
B --> bc|∈
C --> d|∈
D -> b
(S4) :
A --> aBCD
B --> bc|c
C --> d|c
D -> b
Which of the following grammar has same follow set for variable B?
M
Q. 79) Which is True about SR and RR-conflict:
M
Q. 80) Which of the following statement(s) regarding a linker software is/are true ? I A function of a linker is to combine several object modules into a single load module. II A function of a linker is to replace absolute references in an object module by symbolic references to locations in other modules.
Explore Sets
Theory of Computation and Compiler Design MCQs Set 1
Theory of Computation and Compiler Design MCQs Set 2
Theory of Computation and Compiler Design MCQs Set 3
Theory of Computation and Compiler Design MCQs Set 4
Theory of Computation and Compiler Design MCQs Set 5
Theory of Computation and Compiler Design MCQs Set 6
Theory of Computation and Compiler Design MCQs Set 7
Theory of Computation and Compiler Design MCQs Set 8
Explore More Categories
Click on category to learn MCQs of that category.Electronics and Communication Engineering