in Compiler Design retagged by
1,525 views
4 votes
4 votes

Which of the following statements on Viable Prefixes is incorrect?

  1. A viable prefix does not extend past the right end of the handle
  2. For any context-free grammar, the set of viable prefixes is a regular  language
  3. A viable prefix by default is a suffix of the handle
  4. As long as a parser has viable prefixes on the stack no parsing error has been detected
in Compiler Design retagged by
1.5k views

1 Answer

5 votes
5 votes
As its name also suggests, a viable prefix is always a prefix to the handle. It can never be suffix to a handle because as soon as a handle appears on the top of the stack, there will be reduce action by the parser and handle will be reduced to the LHS side of the matching production.

So, (C) is the incorrect statement which is the correct option!

4 Comments

Thanks arjun sir. So we can think of this grammar(for viable prefix) as right linear grammar which we know is regular(point 9)
1
1
Anyone please explain point d.
0
0

@vinay chauhan

to understand that point you need to read the whole documents which is written by sir

https://gateoverflow.in/blog/6215/parsing-notes

0
0
Answer:

Related questions