Search Header Logo

25-4-22 2S5 WS21-22

Authored by P S RAMESH

Computers

University

25-4-22 2S5 WS21-22
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements is false?

Left as well as right most derivations can be in Unambiguous grammar

An LL (1) parser is a top-down parser

LALR is more powerful than SLR

Ambiguous grammar can’t be LR (k)

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given the following expression grammar:

E -> E * F | F+E | F

F -> F-F | id

which of the following is true?

* has higher precedence than +

– has higher precedence than *

+ and — have same precedence

+ has higher precedence than *

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following suffices to convert an arbitrary CFG to an LL(1) grammar?

Removing left recursion only

Factoring the grammar alone

Factoring & left recursion removal

None of the mentioned

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Assume that the SLR parser for a grammar G has n1 states and the LALR parser for G has n2 states.

n1 is necessarily less than n2

n1 is necessarily equal to n2

n1 is necessarily greater than n2

none of the mentioned

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following describes a handle (as applicable to LR-parsing) appropriately?

Position where next reduce or shift operation will occur

The next step has use of Non-terminal for reduction

Used for reduction in a coming-up step along with a position in the sentential form where the next shift or reduce operation will occur

Used in the next step for reduction along with a position in the sentential form where the right hand side of the production may be found

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which one of the following is a top-down parser?

Recursive descent parser

Operator precedence parser

An LR(k) parser

An LALR(k) parser

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The grammar A → AA | (A) | e is not suitable for predictive-parsing because the grammar is?

Ambiguous

Left recursive

Right recursive

An operator grammar

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?