Question 5556 – Compiler-Design
May 17, 2024
Question 5642 – Compiler-Design
May 17, 2024
Question 5556 – Compiler-Design
May 17, 2024
Question 5642 – Compiler-Design
May 17, 2024

Compiler-Design

Question 255
Given a grammar : S1 → Sc, S → SA | A, A → aSb | ab, there is a rightmost derivation
     S1 ⇒ Sc ⇒ SAC ⇒ SaSbc
Thus, SaSbc is a right sentential form, and its handle is
A
SaS
B
bc
C
Sbc
D
aSb
Question 255 Explanation: 
A “handle” of a string is a substring that matches the RHS of a production and whose reduction to the non-terminal (on the LHS of the production) represents one step along the reverse of a rightmost derivation toward reducing to the start symbol.
And in above question aSb is a handle because it’s reduction to the LHS of production A → aSb represents one step along the reverse of a rightmost derivation toward reducing to the start symbol.
Correct Answer: D
Question 255 Explanation: 
A “handle” of a string is a substring that matches the RHS of a production and whose reduction to the non-terminal (on the LHS of the production) represents one step along the reverse of a rightmost derivation toward reducing to the start symbol.
And in above question aSb is a handle because it’s reduction to the LHS of production A → aSb represents one step along the reverse of a rightmost derivation toward reducing to the start symbol.
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!