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

S→AaS | b

A→c | d |B

B→AgC | AhC | DgC| DhC

C→c | d | D

D→eBf

 

Which of the following are  viable prefix ?

(1)Aab

(2)ca

(3)cab

(4)AgCS

Also find handles for this grammar?
asked in Compiler Design by Loyal (8.5k points) | 600 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
0

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
3
asked Nov 12, 2016 in Compiler Design by KISHALAY DAS Loyal (6.6k points) | 1.1k views
+2 votes
1 answer
5
asked Dec 2, 2015 in Compiler Design by yes Active (1.8k points) | 825 views
+2 votes
1 answer
6
asked Jul 18, 2015 in Compiler Design by Suvam Chatterjee Junior (523 points) | 809 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
48,756 questions
52,850 answers
183,548 comments
68,742 users