Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Tests  >  Test: Parsing Techniques- 2 - Computer Science Engineering (CSE) MCQ

Test: Parsing Techniques- 2 - Computer Science Engineering (CSE) MCQ


Test Description

15 Questions MCQ Test - Test: Parsing Techniques- 2

Test: Parsing Techniques- 2 for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Test: Parsing Techniques- 2 questions and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus.The Test: Parsing Techniques- 2 MCQs are made for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: Parsing Techniques- 2 below.
Solutions of Test: Parsing Techniques- 2 questions in English are available as part of our course for Computer Science Engineering (CSE) & Test: Parsing Techniques- 2 solutions in Hindi for Computer Science Engineering (CSE) course. Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free. Attempt Test: Parsing Techniques- 2 | 15 questions in 45 minutes | Mock test for Computer Science Engineering (CSE) preparation | Free important questions MCQ to study for Computer Science Engineering (CSE) Exam | Download free PDF with solutions
Test: Parsing Techniques- 2 - Question 1

Which of the following actions an operator- precedence parser may take to recover from an error?

Detailed Solution for Test: Parsing Techniques- 2 - Question 1

To recover from an error actions taken by operator precedence parser:
1. Insert symbols onto stack.
2. Delete symbols from the stack.
3. Insert or delete symbols from the input.

Test: Parsing Techniques- 2 - Question 2

Which of the following is the important factor that justifies the use of a stack in shift-reduce parsing?

Detailed Solution for Test: Parsing Techniques- 2 - Question 2

In shift-reduce parsing "the handle will always appear inside the stack and reversor top”.

1 Crore+ students have signed up on EduRev. Have you? Download the App
Test: Parsing Techniques- 2 - Question 3

A shift reduce parser carries out the actions specified with in braces immediately after reducing the corresponding rule of grammar.

What is the translation of bbbbacc using the syntax directed translation scheme described by the above rules?

Detailed Solution for Test: Parsing Techniques- 2 - Question 3

Test: Parsing Techniques- 2 - Question 4

Which of the following statements are TRUE?

I. Top-down parsers are equipped to handle left recursive grammar.

II. LALR parser is more powerful than an SLR parser.

III. Recursive descent parsing is an example of top-down parsing.

Detailed Solution for Test: Parsing Techniques- 2 - Question 4

II. LALR parser is more powerful than an SLR parser: TrueCanonical LR is the most powerful parser as compared to other LR parsers. Order: LR(0)< SLR < LALR < CLR.

III. Recursive descent parsing is an example of top-down parsing: TrueRecursive descent is a top-down parsing technique that constructs the parse tree from the top and the input is read from left to right. It uses procedures for every terminal and non-terminal entity. This parsing technique recursively parses the input to make a parse tree, which may or may not require back-tracking.

Hence the correct answer is II and III.

Test: Parsing Techniques- 2 - Question 5

Which statement is true?

Detailed Solution for Test: Parsing Techniques- 2 - Question 5
  • LALR is less powerful than CLR but more costly than any parser.
  • Every SLR grammar is unambigous but every unambigous grammar need not be SLR i.e. may be LALR but not SLR. 
  • LR(K) grammar never using backtracking.
Test: Parsing Techniques- 2 - Question 6

For a context-free grammar, FOLLOW(A) is the set of terminals that can appear immediately to the right of non-terminal A in some “sentential” form. We defined to sets LFOLLOW(A) and RFOLLOW(A) by replacing the word “left most sentential” and “right most sentential” respectively in the definition of FOLLOW(A).

Which of the following statements is/are true

Detailed Solution for Test: Parsing Techniques- 2 - Question 6

Definition of Follow (A) as per question “The set of terminals that can appears immediately to the right of non-terminal A in same sentential form”. If the above definition is changed to replace “ sentential” with “ left-most sentential” for L FOLLOW (A) and “right-most sentential” for R FOLLOW (A)

We are still considering the terminal symbol to the right of A ’ .
Hence all three sets would be identical

Test: Parsing Techniques- 2 - Question 7

Which one of the following statements is TRUE?

Detailed Solution for Test: Parsing Techniques- 2 - Question 7

LR(1) parsing is sufficient for deterministic context-free languages: True, LR(k) grammars (also known as deterministic context-free grammars) allow parsing (string recognition) with deterministic pushdown automata (PDA), they can only define deterministic context-free languages.

Test: Parsing Techniques- 2 - Question 8

Which of the following statements is false?

Detailed Solution for Test: Parsing Techniques- 2 - Question 8

An ambiguous grammar have more than one leftmost or rightmost derivation tree.

Test: Parsing Techniques- 2 - Question 9

Consider the following expression grammar, The semantic rules for expression calculation-are stated next to each grammar production.

The above grammar and the semantic rules are fed to a yacc tool (which is an LALR(1) parser generator) for parsing and evaluating arithmetic expressions. Which one of the following is true about the action of yacc for the given grammar?

Detailed Solution for Test: Parsing Techniques- 2 - Question 9

E→ number \ E' + E' \ E' x E'

Then YACC compiler detects shift-reduce conflict, and resolves the conflict in favor of a shift over a reduce action.
Consider the following configuration where shift- reduce conflict occurs

Stack Input

.... E + E x . E . . $

Test: Parsing Techniques- 2 - Question 10

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

Detailed Solution for Test: Parsing Techniques- 2 - Question 10

A handle may be described as the sentencial form given by the bottom up parser from left to right in reverse order.

Test: Parsing Techniques- 2 - Question 11

An LALR(1) parser for a grammar G can have shift-reduce (S-R) conflicts if and only if

Detailed Solution for Test: Parsing Techniques- 2 - Question 11

LALR(1) parser for a grammar, G can have shift- reduce ( S - R) conflicts if and only if there is a S - R conflict in its immediate sub-parsers (e.g. LR(1)). If LR(0) has S - R conflicts then they may get removed in LR (1), hence there will be no S - R conflict in LALR(1).

Test: Parsing Techniques- 2 - Question 12

Consider the following grammar production: 

Which of the following is not LR(1) item set?

Detailed Solution for Test: Parsing Techniques- 2 - Question 12

So, parsing table must not contain entry 

 since Y→a production not present in grammar.

Test: Parsing Techniques- 2 - Question 13

Consider the production:

S→ aS | b

The parsing automation is below:

Which of the following stack contents causes the parser to reduce by some production?

Detailed Solution for Test: Parsing Techniques- 2 - Question 13

Some possible stack contents are aaS, ab, b, etc.

Test: Parsing Techniques- 2 - Question 14

Consider the following grammar production: 

The expression 3 + 2 x 5 is parsed by the shift- reduce parser then which of the following is not a handle for it?

Detailed Solution for Test: Parsing Techniques- 2 - Question 14

So E + E x E is not a handle for the expression.

Test: Parsing Techniques- 2 - Question 15

Consider a grammar:

The input string ccbca is parsed by which of the following parsing method?

Detailed Solution for Test: Parsing Techniques- 2 - Question 15

Given grammar can be parsed using both Top- down and bottom up parsing methods for the input string “ccbca"

Information about Test: Parsing Techniques- 2 Page
In this test you can find the Exam questions for Test: Parsing Techniques- 2 solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Parsing Techniques- 2, EduRev gives you an ample number of Online tests for practice

Top Courses for Computer Science Engineering (CSE)

Download as PDF

Top Courses for Computer Science Engineering (CSE)