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 (8.5k points) | 543 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 Loyal (6.6k points) | 1k views
+2 votes
1 answer
asked Dec 2, 2015 in Compiler Design by yes Active (1.8k points) | 807 views
+2 votes
1 answer
asked Jul 18, 2015 in Compiler Design by Suvam Chatterjee Junior (523 points) | 782 views
0 votes
1 answer
asked Jan 8, 2017 in Compiler Design by Sanket_ Active (4.3k points) | 179 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

47,080 questions
51,333 answers
66,675 users