img
Question:
Published on: 21 November, 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