img
Question:
Published on: 12 October, 2024

Consider the following grammar:

E → E+T | T

T → T*F | F

F → (E) | id

Draw a SLR state transition diagram for the above grammar. Also draw the SLR table.

Answer:

STATE TRANSITION DIAGRAM:

FOLLOW(E)=FOLLOW(E')={),$}

FOLLOW(T)=FOLLOW(T')={+,),$}

FOLLOW(F)={*,+,),$}

 

SLR PARSING TABLE:

Random questions