LR Parser

Question 1
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 2
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 3
Marks : +2 | -2
Pass Ratio : 100%
An LR-parser can detect a syntactic error as soon as __________
The parsing starts
It is possible to do so a left-to-right scan of the input
It is possible to do so a right-to-left scan of the input
Parsing ends
Explanation:
Error is found when it the input string is scanned.
Question 4
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 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%
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 7
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 8
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 9
Marks : +2 | -2
Pass Ratio : 100%
If a state does not know whether it will make a shift operation or reduction for a terminal is called _________
Shift/reduce conflict
Reduce /shift conflict
Shift conflict
Reduce conflict
Explanation:
As the name suggests that the conflict is between shift and reduce hence it is called shift reduce conflict.
Question 10
Marks : +2 | -2
Pass Ratio : 100%
Uniform symbol table _________
Has all constants in the program
Permanent table of rules in the form of patterns for matching with the uniform symbol table to discover syntactic structure
Consists of full or partial list of the tokens as they appear in the program created by Lexical analysis and used for syntax analysis and interpretation
A permanent table which has all key words and special symbols of the language in symbolic form
Explanation:
Each pass scans the program, the first pass generates the symbol table and the second pass generates the machine code.