LR Parser

Question 1
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 2
Marks : +2 | -2
Pass Ratio : 100%
When ß (in the LR(1) item A -> ß.a,a) is not empty, the look-head _________
Will be affecting
Does not have any affect
Shift will take place
Reduction will take place
Explanation:
There is no terminal before the non terminal beta.
Question 3
Marks : +2 | -2
Pass Ratio : 100%
When there is a reduce/reduce conflict?
If a state does not know whether it will make a shift operation using the production rule i or j for a terminal
If a state does not know whether it will make a shift or reduction operation using the production rule i or j for a terminal
If a state does not know whether it will make a reduction operation using the production rule i or j for a terminal
None of the mentioned
Explanation:
It occurs when If a state does not know whether it will make a reduction operation using the production rule i or j for a terminal.
Question 4
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).
Question 5
Marks : +2 | -2
Pass Ratio : 100%
What is terminal table?
Contains all constants in the program
Is a permanent table of decision rules in the form of patterns for matching with the uniform symbol table to discover syntactic structure
Consist of a full or partial list of the token is as they appear in the program created by lexical analysis and used for syntax analysis and interpretation
Is a permanent table which lists all keywords and special symbols of the language in symbolic form
Explanation:
A permanent database that has entry for each terminal symbols such as arithmetic operators, keywords, punctuation characters such as ‘;’, ‘,’etc Fields: Name of the symbol.
Question 6
Marks : +2 | -2
Pass Ratio : 100%
Advantage of incorporating the macro-processor into pass 1 is that _________
Many functions have to be implemented twice
Functions are combined not necessarily creating intermediate files as output from the macro-processor and input to the assembler
More flexibility is provided to the programmer in that he may use all the features of the assembler in conjunction with macros
All of the mentioned
Explanation:
A general-purpose macro processor or general purpose pre-processor is a macro designed primarily for string manipulation, macro definition.
Question 7
Marks : +2 | -2
Pass Ratio : 100%
A series of statements explaining how the data is to be processed is called _________
Assembly
Machine
COBOL
Program
Explanation:
A program is a sequence of instructions, written to perform a task by computer. It requires programs to function, typically executing the program’s instructions in a central processor.
Question 8
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 9
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 10
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.