Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. Stack contents while parsing string *id$ by CLR (Reduced number of stack content means reduce move, increased number of stack content means shift move)
  2. ================================================
  3. [0]
  4. [0,*,4] (shift * and transit to state 4)
  5. [0,*,4,id,5] (shift id and transit to state 5)
  6. (5,$)= no shift/reduce move ---> reject string
  7.  
  8.  
  9. Stack contents while parsing string *id$ by SLR
  10. ================================================
  11. [0]
  12. [0,*,4]
  13. [0,*,4,id,5] (shift id and transit to state 5)
  14. [0,*,4,L]
  15. [0,*,4,L,8]
  16. [0,*,4,R] (Reduce L to R)
  17. [0,*,4,R,7]
  18. [0,L] (Reduce *R to L)
  19. [0,L,2] (Transit to state 2)
  20. [0,R]
  21. [0,R,3]
  22. [0,S]
  23. Accept
  24.  
  25. S
  26. |
  27. R
  28. |
  29. L
  30. /
  31. | R
  32. | |
  33. | L
  34. | |
  35. * id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement