LR Parser

Question 1
Marks : +2 | -2
Pass Ratio : 100%
Which of the following is a phase of a compilation process?
Lexical Analysis
Code Generation
Lexical Analysis & Code Generation
None of the mentioned
Explanation:
Lexical analysis and code generation is a phase of compilation process.
Question 2
Marks : +2 | -2
Pass Ratio : 100%
Which of the following system program forgoes the production of object code to generate absolute machine code and load it into the physical main storage location from which it will be executed immediately upon completion of the assembly?
Two pass assembler
Load and go assembler
Macro processor
Linker
Explanation:
A load and go assembler generates absolute machine code and loads it to physical memory.
Question 3
Marks : +2 | -2
Pass Ratio : 100%
System program such as compiler are designed so that they are _________
Re-enterable
Non reusable
Serially usable
None of the mentioned
Explanation:
Re-enterable is the keyword for compiler being designed.
Question 4
Marks : +2 | -2
Pass Ratio : 100%
A system program that setup an executable program in main memory ready for execution is?
Assembler
Linker
Loader
Load and go
Explanation:
A loader is the part of an operating system that is responsible for loading programs and libraries. It is one of the essential stages in the process of starting a program, as it places programs into memory and prepares them for execution.
Question 5
Marks : +2 | -2
Pass Ratio : 100%
Assembler is a program that _________
Puts programs into memory and executes them
Translates the assembly language into machine language
Writes in high level language and produces an object program
None of the mentioned
Explanation:
An assembler is a program that takes basic computer instructions and converts them into a pattern of bits that the computer’s processor can use to perform its basic operations.
Question 6
Marks : +2 | -2
Pass Ratio : 100%
When ß is empty (A -> ß.,a), the reduction by A-> a is done by _________
If next symbol is a terminal
Only If the next input symbol is a
Only If the next input symbol is A
Only if the next input symbol is a
Explanation:
The next token is considered in this case it’s a.
Question 7
Marks : +2 | -2
Pass Ratio : 100%
A loader is a program that _________
Program that places functions into memory and prepares them for execution
Program that automates the translation of assembly language into machine language
Program accepting another program written in a high level language and produces as object program
None of the mentioned
Explanation:
A loader is the part of an operating system that is responsible for loading programs and libraries. It is important in the process of placing the programs into memory and executing them.
Question 8
Marks : +2 | -2
Pass Ratio : 100%
What is the similarity between LR, LALR and SLR?
Use same algorithm, but different parsing table
Same parsing table, but different algorithm
Their Parsing tables and algorithm are similar but uses top down approach
Both Parsing tables and algorithm are different
Explanation:
The common grounds of these 3 parser is the algorithm but parsing table is different.
Question 9
Marks : +2 | -2
Pass Ratio : 100%
Which of these is true about LR parsing?
Is most general non-backtracking shift-reduce parsing
It is still efficient
Is most general non-backtracking shift-reduce parsing & It is still efficient
None of the mentioned
Explanation:
LR parsers are a type of bottom-up parsers that efficiently handle deterministic context-free languages in guaranteed linear time.
Question 10
Marks : +2 | -2
Pass Ratio : 100%
The construction of the canonical collection of the sets of LR (1) items are similar to the construction of the canonical collection of the sets of LR (0) items. Which is an exception?
Closure and goto operations work a little bit different
Closure and goto operations work similarly
Closure and additive operations work a little bit different
Closure and associatively operations work a little bit different
Explanation:
Closure and goto do work differently in case of LR (0) and LR (1).