Welcome to the Bottom Up Parsing MCQs Page

Dive deep into the fascinating world of Bottom Up Parsing with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Bottom Up Parsing, a crucial aspect of Compiler Design. In this section, you will encounter a diverse range of MCQs that cover various aspects of Bottom Up Parsing, 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.


Check out the MCQs below to embark on an enriching journey through Bottom Up Parsing. 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 Bottom Up Parsing. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Bottom Up Parsing MCQs | Page 1 of 5

S → C C
C → c C | d

The grammar is
Answer: (a).LL(1)
Given the following expression grammar:
E -> E * F | F + E | F

F -> F – F | id

Which of the following is true?
Answer: (b).– has higher precedence than *
lanation: e.g. input is 3*4-5 rFirst ‘- ‘ is be evaluated then ‘ *’5. Which one of the following is true at any valid state in shift-reduce parsing?
Answer: (c).Stack contains only viable prefixes
Answer: (c).The max no. of successors of a node in an AST and a CFG depends on the input program
Match the following:
List-I List-II

A. Lexical analysis 1. Graph coloring

B. Parsing 2. DFA minimization

C. Register allocation 3. Post-order traversal

D. Expression evaluation 4. Production tree

Answer: (c).2 4 1 3
Which of the following pairs is the most powerful?
Answer: (c).SLR canonical LR
Consider the following grammar G.
S → F ⎪ H

F → p ⎪ c

H → d ⎪ c

Which one is true?

S1: All strings generated by G can be parsed with help of LL (1).

S2: All strings generated by G can be parsed with help of LR (1).
Answer: (d).None of the mentioned
What is the maximum number of reduce moves that can be taken by a bottom-up parser for a grammar with no epsilon- and unit-production to parse a string with n tokens?
Answer: (b).n-1
Consider the following two sets of LR (1) items of an LR (1) grammar.
X -> c.X, c/d

X -> .cX, c/d

X -> .d, c/d

X -> c.X, $

X -> .cX, $

X -> .d, $

Which one is false?

1. Cannot be merged since look ahead’s are different.

2. Can be merged but will result in S-R conflict.

3. Can be merged but will result in R-R conflict.

4. Cannot be merged since goto on c will lead to two different sets.
Answer: (d).1, 2, 3 and 4 only
What is the binary equivalent of the decimal number 368
Answer: (b).110110000
Page 1 of 5

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!