retagged by
378 views

2 Answers

0 votes
0 votes
Consider the following grammar:

E → E + n | E * n |  n

and a right-most derivation is as follows:

E → n + E  → n + E * n→ n + n * n

The n’s are subscripted for notational convenience.

Note that the reduction is in the opposite direction from n+ n* n back to E, where the handle at every step
0 votes
0 votes

during input scanning ..when we found the string which can directly reduced to production variable...such part is called as handle...

now look at you string n+n*n;...

now when we read n then there is possible reduction from n to E...so first handle is 'n'..

now we have replace it with E...so we get E+n*n...now we continue scan and we can see that E+n is another one that can be reduce to E...so our next handle is E+n......so replace E+n with E only ..

now we have E*n....this is also one more handle as it can be directly reduct to E....

SO ALL HANDLES WE GET IN SEQUENCE ARE 

n , E+n , E*n

Related questions

0 votes
0 votes
2 answers
1
Jayant Isswani asked May 2, 2018
592 views
Can the following grammar be parsed by LR(0) parser?E - E+id | idIs the accept state entry considered on all the terminal symbol columns for LR(0) parser?
0 votes
0 votes
1 answer
2
Ana_101 asked 5 days ago
42 views
S - A BA - f S fA - b b B dB - ƐB - cFirst(S) =First(A) =First(B) =Follow(S) =Follow(A) =Follow(B) =