Le-Nika

bison -v output

May 10th, 2014
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. Rules useless in parser due to conflicts
  2.  
  3. 6 typename: Identifier
  4.  
  5.  
  6. State 6 conflicts: 1 reduce/reduce
  7.  
  8.  
  9. Grammar
  10.  
  11. 0 $accept: generalExp $end
  12.  
  13. 1 generalExp: variable
  14. 2 | LRPAR generalExp RRPAR
  15. 3 | castExp
  16.  
  17. 4 castExp: LRPAR typename RRPAR generalExp
  18.  
  19. 5 variable: Identifier
  20.  
  21. 6 typename: Identifier
  22.  
  23.  
  24. Terminals, with rules where they appear
  25.  
  26. $end (0) 0
  27. error (256)
  28. Identifier (258) 5 6
  29. LRPAR (259) 2 4
  30. RRPAR (260) 2 4
  31.  
  32.  
  33. Nonterminals, with rules where they appear
  34.  
  35. $accept (6)
  36. on left: 0
  37. generalExp (7)
  38. on left: 1 2 3, on right: 0 2 4
  39. castExp (8)
  40. on left: 4, on right: 3
  41. variable (9)
  42. on left: 5, on right: 1
  43. typename (10)
  44. on left: 6, on right: 4
  45.  
  46.  
  47. State 0
  48.  
  49. 0 $accept: . generalExp $end
  50.  
  51. Identifier shift, and go to state 1
  52. LRPAR shift, and go to state 2
  53.  
  54. generalExp go to state 3
  55. castExp go to state 4
  56. variable go to state 5
  57.  
  58.  
  59. State 1
  60.  
  61. 5 variable: Identifier .
  62.  
  63. $default reduce using rule 5 (variable)
  64.  
  65.  
  66. State 2
  67.  
  68. 2 generalExp: LRPAR . generalExp RRPAR
  69. 4 castExp: LRPAR . typename RRPAR generalExp
  70.  
  71. Identifier shift, and go to state 6
  72. LRPAR shift, and go to state 2
  73.  
  74. generalExp go to state 7
  75. castExp go to state 4
  76. variable go to state 5
  77. typename go to state 8
  78.  
  79.  
  80. State 3
  81.  
  82. 0 $accept: generalExp . $end
  83.  
  84. $end shift, and go to state 9
  85.  
  86.  
  87. State 4
  88.  
  89. 3 generalExp: castExp .
  90.  
  91. $default reduce using rule 3 (generalExp)
  92.  
  93.  
  94. State 5
  95.  
  96. 1 generalExp: variable .
  97.  
  98. $default reduce using rule 1 (generalExp)
  99.  
  100.  
  101. State 6
  102.  
  103. 5 variable: Identifier .
  104. 6 typename: Identifier .
  105.  
  106. RRPAR reduce using rule 5 (variable)
  107. RRPAR [reduce using rule 6 (typename)]
  108. $default reduce using rule 5 (variable)
  109.  
  110.  
  111. State 7
  112.  
  113. 2 generalExp: LRPAR generalExp . RRPAR
  114.  
  115. RRPAR shift, and go to state 10
  116.  
  117.  
  118. State 8
  119.  
  120. 4 castExp: LRPAR typename . RRPAR generalExp
  121.  
  122. RRPAR shift, and go to state 11
  123.  
  124.  
  125. State 9
  126.  
  127. 0 $accept: generalExp $end .
  128.  
  129. $default accept
  130.  
  131.  
  132. State 10
  133.  
  134. 2 generalExp: LRPAR generalExp RRPAR .
  135.  
  136. $default reduce using rule 2 (generalExp)
  137.  
  138.  
  139. State 11
  140.  
  141. 4 castExp: LRPAR typename RRPAR . generalExp
  142.  
  143. Identifier shift, and go to state 1
  144. LRPAR shift, and go to state 2
  145.  
  146. generalExp go to state 12
  147. castExp go to state 4
  148. variable go to state 5
  149.  
  150.  
  151. State 12
  152.  
  153. 4 castExp: LRPAR typename RRPAR generalExp .
  154.  
  155. $default reduce using rule 4 (castExp)
Advertisement
Add Comment
Please, Sign In to add comment