assembler.output 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  1. State 11 conflicts: 1 shift/reduce
  2. State 36 conflicts: 1 shift/reduce
  3. State 45 conflicts: 1 shift/reduce
  4. Grammar
  5. 0 $accept: asm $end
  6. 1 asm: asm data_segm instruction_segm
  7. 2 | data_segm instruction_segm
  8. 3 | instruction_segm
  9. 4 instruction_segm: instruction_segm instruction
  10. 5 | instruction
  11. 6 instruction: instr comment
  12. 7 | label_decl instr comment
  13. 8 | instr
  14. 9 | label_decl instr
  15. 10 instr: OPCODE3 register REG register
  16. 11 | OPCODE2 REG REG immediate
  17. 12 | OPCODEI REG address
  18. 13 | CCODE address
  19. 14 | HALT
  20. 15 | NOP
  21. 16 data_segm: data_segm data_def
  22. 17 | data_def comment
  23. 18 | data_def
  24. 19 data_def: label_decl data_value
  25. 20 | data_value
  26. 21 label_decl: ETI COLON
  27. 22 data_value: _WORD IMM
  28. 23 | _SPACE IMM
  29. 24 register: REG
  30. 25 | LPAR REG RPAR
  31. 26 immediate: BEGIN_IMMEDIATE IMM
  32. 27 | BEGIN_IMMEDIATE MINUS IMM
  33. 28 address: ETI
  34. 29 | IMM
  35. 30 comment: BEGIN_COMMENT COMMENT END_COMMENT
  36. Terminals, with rules where they appear
  37. $end (0) 0
  38. error (256)
  39. OPCODE3 (258) 10
  40. OPCODE2 (259) 11
  41. OPCODEI (260) 12
  42. CCODE (261) 13
  43. HALT (262) 14
  44. NOP (263) 15
  45. _WORD (264) 22
  46. _SPACE (265) 23
  47. REG (266) 10 11 12 24 25
  48. LPAR (267) 25
  49. RPAR (268) 25
  50. COLON (269) 21
  51. MINUS (270) 27
  52. BEGIN_IMMEDIATE (271) 26 27
  53. BEGIN_COMMENT (272) 30
  54. END_COMMENT (273) 30
  55. COMMENT (274) 30
  56. ETI (275) 21 28
  57. IMM (276) 22 23 26 27 29
  58. Nonterminals, with rules where they appear
  59. $accept (22)
  60. on left: 0
  61. asm (23)
  62. on left: 1 2 3, on right: 0 1
  63. instruction_segm (24)
  64. on left: 4 5, on right: 1 2 3 4
  65. instruction (25)
  66. on left: 6 7 8 9, on right: 4 5
  67. instr (26)
  68. on left: 10 11 12 13 14 15, on right: 6 7 8 9
  69. data_segm (27)
  70. on left: 16 17 18, on right: 1 2 16
  71. data_def (28)
  72. on left: 19 20, on right: 16 17 18
  73. label_decl (29)
  74. on left: 21, on right: 7 9 19
  75. data_value (30)
  76. on left: 22 23, on right: 19 20
  77. register (31)
  78. on left: 24 25, on right: 10
  79. immediate (32)
  80. on left: 26 27, on right: 11
  81. address (33)
  82. on left: 28 29, on right: 12 13
  83. comment (34)
  84. on left: 30, on right: 6 7 17
  85. state 0
  86. 0 $accept: . asm $end
  87. OPCODE3 shift, and go to state 1
  88. OPCODE2 shift, and go to state 2
  89. OPCODEI shift, and go to state 3
  90. CCODE shift, and go to state 4
  91. HALT shift, and go to state 5
  92. NOP shift, and go to state 6
  93. _WORD shift, and go to state 7
  94. _SPACE shift, and go to state 8
  95. ETI shift, and go to state 9
  96. asm go to state 10
  97. instruction_segm go to state 11
  98. instruction go to state 12
  99. instr go to state 13
  100. data_segm go to state 14
  101. data_def go to state 15
  102. label_decl go to state 16
  103. data_value go to state 17
  104. state 1
  105. 10 instr: OPCODE3 . register REG register
  106. REG shift, and go to state 18
  107. LPAR shift, and go to state 19
  108. register go to state 20
  109. state 2
  110. 11 instr: OPCODE2 . REG REG immediate
  111. REG shift, and go to state 21
  112. state 3
  113. 12 instr: OPCODEI . REG address
  114. REG shift, and go to state 22
  115. state 4
  116. 13 instr: CCODE . address
  117. ETI shift, and go to state 23
  118. IMM shift, and go to state 24
  119. address go to state 25
  120. state 5
  121. 14 instr: HALT .
  122. $default reduce using rule 14 (instr)
  123. state 6
  124. 15 instr: NOP .
  125. $default reduce using rule 15 (instr)
  126. state 7
  127. 22 data_value: _WORD . IMM
  128. IMM shift, and go to state 26
  129. state 8
  130. 23 data_value: _SPACE . IMM
  131. IMM shift, and go to state 27
  132. state 9
  133. 21 label_decl: ETI . COLON
  134. COLON shift, and go to state 28
  135. state 10
  136. 0 $accept: asm . $end
  137. 1 asm: asm . data_segm instruction_segm
  138. $end shift, and go to state 29
  139. _WORD shift, and go to state 7
  140. _SPACE shift, and go to state 8
  141. ETI shift, and go to state 9
  142. data_segm go to state 30
  143. data_def go to state 15
  144. label_decl go to state 31
  145. data_value go to state 17
  146. state 11
  147. 3 asm: instruction_segm .
  148. 4 instruction_segm: instruction_segm . instruction
  149. OPCODE3 shift, and go to state 1
  150. OPCODE2 shift, and go to state 2
  151. OPCODEI shift, and go to state 3
  152. CCODE shift, and go to state 4
  153. HALT shift, and go to state 5
  154. NOP shift, and go to state 6
  155. ETI shift, and go to state 9
  156. ETI [reduce using rule 3 (asm)]
  157. $default reduce using rule 3 (asm)
  158. instruction go to state 32
  159. instr go to state 13
  160. label_decl go to state 33
  161. state 12
  162. 5 instruction_segm: instruction .
  163. $default reduce using rule 5 (instruction_segm)
  164. state 13
  165. 6 instruction: instr . comment
  166. 8 | instr .
  167. BEGIN_COMMENT shift, and go to state 34
  168. $default reduce using rule 8 (instruction)
  169. comment go to state 35
  170. state 14
  171. 2 asm: data_segm . instruction_segm
  172. 16 data_segm: data_segm . data_def
  173. OPCODE3 shift, and go to state 1
  174. OPCODE2 shift, and go to state 2
  175. OPCODEI shift, and go to state 3
  176. CCODE shift, and go to state 4
  177. HALT shift, and go to state 5
  178. NOP shift, and go to state 6
  179. _WORD shift, and go to state 7
  180. _SPACE shift, and go to state 8
  181. ETI shift, and go to state 9
  182. instruction_segm go to state 36
  183. instruction go to state 12
  184. instr go to state 13
  185. data_def go to state 37
  186. label_decl go to state 16
  187. data_value go to state 17
  188. state 15
  189. 17 data_segm: data_def . comment
  190. 18 | data_def .
  191. BEGIN_COMMENT shift, and go to state 34
  192. $default reduce using rule 18 (data_segm)
  193. comment go to state 38
  194. state 16
  195. 7 instruction: label_decl . instr comment
  196. 9 | label_decl . instr
  197. 19 data_def: label_decl . data_value
  198. OPCODE3 shift, and go to state 1
  199. OPCODE2 shift, and go to state 2
  200. OPCODEI shift, and go to state 3
  201. CCODE shift, and go to state 4
  202. HALT shift, and go to state 5
  203. NOP shift, and go to state 6
  204. _WORD shift, and go to state 7
  205. _SPACE shift, and go to state 8
  206. instr go to state 39
  207. data_value go to state 40
  208. state 17
  209. 20 data_def: data_value .
  210. $default reduce using rule 20 (data_def)
  211. state 18
  212. 24 register: REG .
  213. $default reduce using rule 24 (register)
  214. state 19
  215. 25 register: LPAR . REG RPAR
  216. REG shift, and go to state 41
  217. state 20
  218. 10 instr: OPCODE3 register . REG register
  219. REG shift, and go to state 42
  220. state 21
  221. 11 instr: OPCODE2 REG . REG immediate
  222. REG shift, and go to state 43
  223. state 22
  224. 12 instr: OPCODEI REG . address
  225. ETI shift, and go to state 23
  226. IMM shift, and go to state 24
  227. address go to state 44
  228. state 23
  229. 28 address: ETI .
  230. $default reduce using rule 28 (address)
  231. state 24
  232. 29 address: IMM .
  233. $default reduce using rule 29 (address)
  234. state 25
  235. 13 instr: CCODE address .
  236. $default reduce using rule 13 (instr)
  237. state 26
  238. 22 data_value: _WORD IMM .
  239. $default reduce using rule 22 (data_value)
  240. state 27
  241. 23 data_value: _SPACE IMM .
  242. $default reduce using rule 23 (data_value)
  243. state 28
  244. 21 label_decl: ETI COLON .
  245. $default reduce using rule 21 (label_decl)
  246. state 29
  247. 0 $accept: asm $end .
  248. $default accept
  249. state 30
  250. 1 asm: asm data_segm . instruction_segm
  251. 16 data_segm: data_segm . data_def
  252. OPCODE3 shift, and go to state 1
  253. OPCODE2 shift, and go to state 2
  254. OPCODEI shift, and go to state 3
  255. CCODE shift, and go to state 4
  256. HALT shift, and go to state 5
  257. NOP shift, and go to state 6
  258. _WORD shift, and go to state 7
  259. _SPACE shift, and go to state 8
  260. ETI shift, and go to state 9
  261. instruction_segm go to state 45
  262. instruction go to state 12
  263. instr go to state 13
  264. data_def go to state 37
  265. label_decl go to state 16
  266. data_value go to state 17
  267. state 31
  268. 19 data_def: label_decl . data_value
  269. _WORD shift, and go to state 7
  270. _SPACE shift, and go to state 8
  271. data_value go to state 40
  272. state 32
  273. 4 instruction_segm: instruction_segm instruction .
  274. $default reduce using rule 4 (instruction_segm)
  275. state 33
  276. 7 instruction: label_decl . instr comment
  277. 9 | label_decl . instr
  278. OPCODE3 shift, and go to state 1
  279. OPCODE2 shift, and go to state 2
  280. OPCODEI shift, and go to state 3
  281. CCODE shift, and go to state 4
  282. HALT shift, and go to state 5
  283. NOP shift, and go to state 6
  284. instr go to state 39
  285. state 34
  286. 30 comment: BEGIN_COMMENT . COMMENT END_COMMENT
  287. COMMENT shift, and go to state 46
  288. state 35
  289. 6 instruction: instr comment .
  290. $default reduce using rule 6 (instruction)
  291. state 36
  292. 2 asm: data_segm instruction_segm .
  293. 4 instruction_segm: instruction_segm . instruction
  294. OPCODE3 shift, and go to state 1
  295. OPCODE2 shift, and go to state 2
  296. OPCODEI shift, and go to state 3
  297. CCODE shift, and go to state 4
  298. HALT shift, and go to state 5
  299. NOP shift, and go to state 6
  300. ETI shift, and go to state 9
  301. ETI [reduce using rule 2 (asm)]
  302. $default reduce using rule 2 (asm)
  303. instruction go to state 32
  304. instr go to state 13
  305. label_decl go to state 33
  306. state 37
  307. 16 data_segm: data_segm data_def .
  308. $default reduce using rule 16 (data_segm)
  309. state 38
  310. 17 data_segm: data_def comment .
  311. $default reduce using rule 17 (data_segm)
  312. state 39
  313. 7 instruction: label_decl instr . comment
  314. 9 | label_decl instr .
  315. BEGIN_COMMENT shift, and go to state 34
  316. $default reduce using rule 9 (instruction)
  317. comment go to state 47
  318. state 40
  319. 19 data_def: label_decl data_value .
  320. $default reduce using rule 19 (data_def)
  321. state 41
  322. 25 register: LPAR REG . RPAR
  323. RPAR shift, and go to state 48
  324. state 42
  325. 10 instr: OPCODE3 register REG . register
  326. REG shift, and go to state 18
  327. LPAR shift, and go to state 19
  328. register go to state 49
  329. state 43
  330. 11 instr: OPCODE2 REG REG . immediate
  331. BEGIN_IMMEDIATE shift, and go to state 50
  332. immediate go to state 51
  333. state 44
  334. 12 instr: OPCODEI REG address .
  335. $default reduce using rule 12 (instr)
  336. state 45
  337. 1 asm: asm data_segm instruction_segm .
  338. 4 instruction_segm: instruction_segm . instruction
  339. OPCODE3 shift, and go to state 1
  340. OPCODE2 shift, and go to state 2
  341. OPCODEI shift, and go to state 3
  342. CCODE shift, and go to state 4
  343. HALT shift, and go to state 5
  344. NOP shift, and go to state 6
  345. ETI shift, and go to state 9
  346. ETI [reduce using rule 1 (asm)]
  347. $default reduce using rule 1 (asm)
  348. instruction go to state 32
  349. instr go to state 13
  350. label_decl go to state 33
  351. state 46
  352. 30 comment: BEGIN_COMMENT COMMENT . END_COMMENT
  353. END_COMMENT shift, and go to state 52
  354. state 47
  355. 7 instruction: label_decl instr comment .
  356. $default reduce using rule 7 (instruction)
  357. state 48
  358. 25 register: LPAR REG RPAR .
  359. $default reduce using rule 25 (register)
  360. state 49
  361. 10 instr: OPCODE3 register REG register .
  362. $default reduce using rule 10 (instr)
  363. state 50
  364. 26 immediate: BEGIN_IMMEDIATE . IMM
  365. 27 | BEGIN_IMMEDIATE . MINUS IMM
  366. MINUS shift, and go to state 53
  367. IMM shift, and go to state 54
  368. state 51
  369. 11 instr: OPCODE2 REG REG immediate .
  370. $default reduce using rule 11 (instr)
  371. state 52
  372. 30 comment: BEGIN_COMMENT COMMENT END_COMMENT .
  373. $default reduce using rule 30 (comment)
  374. state 53
  375. 27 immediate: BEGIN_IMMEDIATE MINUS . IMM
  376. IMM shift, and go to state 55
  377. state 54
  378. 26 immediate: BEGIN_IMMEDIATE IMM .
  379. $default reduce using rule 26 (immediate)
  380. state 55
  381. 27 immediate: BEGIN_IMMEDIATE MINUS IMM .
  382. $default reduce using rule 27 (immediate)