Compilers Questions and Answers – Bottom-Up Parsing-1

This set of Compilers Multiple Choice Questions & Answers (MCQs) focuses on “Bottom-Up Parsing”.

1. Inherited attribute is a natural choice in ___________
a) Variable declarations record is maintained
b) L values and R values
c) All of the mentioned
d) None of the mentioned
View Answer

Answer: a
Explanation: It keeps track of variable.

2. YACC builds up __________
a) SLR parsing table
b) Canonical LR parsing table
c) LALR parsing table
d) None of the mentioned
View Answer

Answer: c
Explanation: It is a parser generator.

3. In an absolute loading scheme which loader function is accomplished by assembler?
a) Re-allocation
b) Allocation
c) Linking
d) Loading
View Answer

Answer: a
Explanation: Large number variables onto a small number of CPU register.
advertisement
advertisement

4. A parser with the valid prefix property is advantageous because it __________
a) Detects errors
b) None of the mentioned
c) Errors are passed to the text phase
d) All of the mentioned
View Answer

Answer: c
Explanation: Advantage for a valid prefix property.

5. The action of parsing the source program into proper syntactic classes is called __________
a) Syntax Analysis
b) Lexical Analysis
c) Interpretation analysis
d) General Syntax Analysis
View Answer

Answer: b
Explanation: Conversion of characters to tokens.

6. Relocating bits used by relocating loader are specified by __________
a) Relocating loader itself
b) Linker
c) Assembler
d) Macro Processor
View Answer

Answer: b
Explanation: Takes an object files and combines them into a single executable file, library file, or another object file.

7. What is the binary equivalent of the decimal number 368?
a) 10111000
b) 110110000
c) 111010000
d) 111100000
View Answer

Answer: b
Explanation: 368 binary equivalents is
8=1000
6=0110
3=0011
So 1101101000.

8. AB+(A+B)’ is equivalent to __________
a) A?B
b) A+B
c) (A+B)A
d) (A+B)B
View Answer

Answer: a
Explanation: It is equivalent to A? B.
advertisement

9. A top down parser generates __________
a) Rightmost Derivation
b) Right most derivation in reverse
c) Left most derivation
d) Left most derivation in reverse
View Answer

Answer: c
Explanation: Top-down parsing is a parsing strategy where one first looks at the highest level of the parse tree and works down the parse tree by using the rewriting rules of a formal grammar.
advertisement

10. 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
View Answer

Answer: d
Explanation: Run time, runtime or execution time is the time during which a program is running (executing).

Sanfoundry Global Education & Learning Series – Compilers.

To practice all areas of Compilers, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.