The Gateway to Computer Science Excellence
0 votes
284 views

For the grammar S ------> 0 S 1/ 0 1  indicate the handle in each of the following right-sentential forms

a) 000111 .

b ) 00S11 .

Also for the grammar S ----->S S + / SS * / a 

indicate the handle

a) SSS + a * + .

b ) SS + a * a+.

in Compiler Design by Loyal (7.8k points) | 284 views
0

 S ------> 0 S 1     --------- 1

             / 0 1       --------- 2

Handle for 000111 is  00S11 [2] --> 0S1 [1] --> S [1]     Thus handle is 2,1,1

Similarly for b.

S ----->S S +         ---- 1

           / SS *        ---- 2

           / a             ---- 3

 Handle for SSS + a * + is S(S)a*+  [1] --> SS(S)*+  [3] ---> S(S)+  [2] --> S [1]

Similarly for b.  

Please log in or register to answer this question.

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
50,737 questions
57,357 answers
198,484 comments
105,256 users