The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
127 views
I am confused in the Concept of Handles in right sentential form and Viable Prefix. Can Please anybody explain these two concepts Briefly using Examples :)
asked in Compiler Design by Loyal (8.7k points) | 127 views

1 Answer

0 votes

A viable prefix of a sentential form φβt, where β denotes the handle, is any prefix of φβ. A viable prefix cannot contain symbols to the right of the handle.

(source: https://nptel.ac.in/courses/106108113/module3/Lecture9.pdf )

Example:

S → E#,

E → E + T | E − T | T,

T → id | (E)

Now,

S ⇒ E#E + T # ⇒ E + (E)# ⇒ E + (T)# ⇒ E + (id)#

(bold and underlined are the handles for that right sentential form)

And,

all viable prefixes of the right sentential form E + (id)# :

E, E+, E + (, and E + (id

as ' id ' is the handle of this sentential form so we cant take any other symbol in its right( for viable prefix)

--------------------------------------------

So,

E + (id)# is a right sentential form

id is its handle and,

E, E+, E + (, and E + (id  are its Viable prefixes.

answered by (255 points)

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) | 824 views
+2 votes
1 answer
6
asked Jul 18, 2015 in Compiler Design by Suvam Chatterjee Junior (523 points) | 808 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,720 questions
52,807 answers
183,452 comments
68,470 users