The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
0 votes
Consider the following grammar

S→AaS | b

A→c | d |B

B→AgC | AhC | DgC| DhC

C→c | d | D



Which of the following are  viable prefix ?





Also find handles for this grammar?
asked in Compiler Design by Loyal (7.4k points) | 652 views

1 Answer

+1 vote
Best answer
stack content at any time is called viable prefix

Aab is a viable prefix.

ca can't be viable prefix as after c put in stack before inserting a c will reduce to A

cab also can't be viable prefix reason is same as for ca

AgCS is also not a viable prefix reson S can't be push in stack S is not a symbol in given grammar.

so ans :-option a
answered by Active (2.7k points)
selected by

a viable prefix is a prefix of a right sentential form that does not continue past the right end of the rightmost handle of that sentential form.explain this statement pls

how viable prefix and handle are related to each other ?also what are valid item in these viable prefix

Related questions

+2 votes
1 answer
asked Nov 12, 2016 in Compiler Design by KISHALAY DAS Active (4.9k points) | 1.1k views
+2 votes
1 answer
asked Dec 2, 2015 in Compiler Design by yes Active (1.2k points) | 847 views
+2 votes
1 answer
asked Jul 18, 2015 in Compiler Design by Suvam Chatterjee (437 points) | 829 views
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,781 questions
54,511 answers
75,107 users