Courses

# Test: LR Parser

## 10 Questions MCQ Test Compiler Design | Test: LR Parser

Description
This mock test of Test: LR Parser for Computer Science Engineering (CSE) helps you for every Computer Science Engineering (CSE) entrance exam. This contains 10 Multiple Choice Questions for Computer Science Engineering (CSE) Test: LR Parser (mcq) to study with solutions a complete question bank. The solved questions answers in this Test: LR Parser quiz give you a good mix of easy questions and tough questions. Computer Science Engineering (CSE) students definitely take this Test: LR Parser exercise for a better result in the exam. You can find other Test: LR Parser extra questions, long questions & short questions for Computer Science Engineering (CSE) on EduRev as well by searching above.
QUESTION: 1

### Which of these is also known as look-head LR parser?

Solution:

LLR is the look ahead parser.

QUESTION: 2

### What is the similarity between LR, LALR and SLR?

Solution:

The common grounds of these 3 parser is the algorithm but parsing table is different

QUESTION: 3

### An LR-parser can detect a syntactic error as soon as

Solution:

LR parsers are a type of bottom-up parsers that efficiently handle deterministic context-free languages in guaranteed linear time.

QUESTION: 4

Which of the following is incorrect for the actions of A LR-Parser I) shift s ii) reduce A->ß iii) Accept iv) reject?

Solution:

Only reject out of the following is a correct LR parser action

QUESTION: 5

If a state does not know whether it will make a shift operation or reduction for a terminal is called

Solution:

As the name suggests that the conflict is between shift and reduce hence it is called shift reduce conflict

QUESTION: 6

When there is a reduce/reduce conflict?

Solution:

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: 7

When ß ( in the LR(1) item A -> ß.a,a ) is not empty, the look-head

Solution:

There is no terminal before the non terminal beta

QUESTION: 8

When ß is empty (A -> ß.,a ), the reduction by A-> a is done

Solution:

The next token is considered in this case it’s a

QUESTION: 9

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?

Solution:

Closure and goto do work differently in case of LR (0) and LR (1)

QUESTION: 10

Terminal table

Solution:

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.