Acse.output 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134
  1. Terminals which are not used
  2. COLON
  3. MOD_OP
  4. FOR
  5. NOT
  6. State 25 conflicts: 1 shift/reduce
  7. Grammar
  8. 0 $accept: program $end
  9. 1 program: var_declarations statements
  10. 2 var_declarations: var_declarations var_declaration
  11. 3 | /* empty */
  12. 4 var_declaration: TYPE declaration_list SEMI
  13. 5 declaration_list: declaration_list COMMA declaration
  14. 6 | declaration
  15. 7 declaration: IDENTIFIER ASSIGN NUMBER
  16. 8 | IDENTIFIER LSQUARE NUMBER RSQUARE
  17. 9 | IDENTIFIER
  18. 10 code_block: statement
  19. 11 | LBRACE statements RBRACE
  20. 12 statements: statements statement
  21. 13 | statement
  22. 14 statement: assign_statement SEMI
  23. 15 | control_statement
  24. 16 | read_write_statement SEMI
  25. 17 | SEMI
  26. 18 control_statement: if_statement
  27. 19 | do_while_statement SEMI
  28. 20 | while_statement
  29. 21 | return_statement SEMI
  30. 22 read_write_statement: read_statement
  31. 23 | write_statement
  32. 24 assign_statement: IDENTIFIER LSQUARE exp RSQUARE ASSIGN exp
  33. 25 | IDENTIFIER ASSIGN exp
  34. 26 if_statement: if_stmt
  35. 27 @1: /* empty */
  36. 28 if_statement: if_stmt ELSE @1 code_block
  37. 29 return_statement: RETURN
  38. 30 read_statement: READ LPAR IDENTIFIER RPAR
  39. 31 write_statement: WRITE LPAR exp RPAR
  40. 32 @2: /* empty */
  41. 33 @3: /* empty */
  42. 34 while_statement: WHILE @2 LPAR exp RPAR @3 code_block
  43. 35 @4: /* empty */
  44. 36 do_while_statement: DO @4 code_block WHILE LPAR exp RPAR
  45. 37 @5: /* empty */
  46. 38 @6: /* empty */
  47. 39 if_stmt: IF @5 LPAR exp RPAR @6 code_block
  48. 40 exp: NUMBER
  49. 41 | IDENTIFIER
  50. 42 | IDENTIFIER LSQUARE exp RSQUARE
  51. 43 | NOT_OP NUMBER
  52. 44 | NOT_OP IDENTIFIER
  53. 45 | exp AND_OP exp
  54. 46 | exp OR_OP exp
  55. 47 | exp PLUS exp
  56. 48 | exp MINUS exp
  57. 49 | exp MUL_OP exp
  58. 50 | exp DIV_OP exp
  59. 51 | exp LT exp
  60. 52 | exp GT exp
  61. 53 | exp EQ exp
  62. 54 | exp NOTEQ exp
  63. 55 | exp LTEQ exp
  64. 56 | exp GTEQ exp
  65. 57 | exp SHL_OP exp
  66. 58 | exp SHR_OP exp
  67. 59 | exp ANDAND exp
  68. 60 | exp OROR exp
  69. 61 | LPAR exp RPAR
  70. 62 | MINUS exp
  71. Terminals, with rules where they appear
  72. $end (0) 0
  73. error (256)
  74. LBRACE (258) 11
  75. RBRACE (259) 11
  76. LPAR (260) 30 31 34 36 39 61
  77. RPAR (261) 30 31 34 36 39 61
  78. LSQUARE (262) 8 24 42
  79. RSQUARE (263) 8 24 42
  80. SEMI (264) 4 14 16 17 19 21
  81. COLON (265)
  82. PLUS (266) 47
  83. MINUS (267) 48 62
  84. MUL_OP (268) 49
  85. DIV_OP (269) 50
  86. MOD_OP (270)
  87. AND_OP (271) 45
  88. OR_OP (272) 46
  89. NOT_OP (273) 43 44
  90. ASSIGN (274) 7 24 25
  91. LT (275) 51
  92. GT (276) 52
  93. SHL_OP (277) 57
  94. SHR_OP (278) 58
  95. EQ (279) 53
  96. NOTEQ (280) 54
  97. LTEQ (281) 55
  98. GTEQ (282) 56
  99. ANDAND (283) 59
  100. OROR (284) 60
  101. COMMA (285) 5
  102. ELSE (286) 28
  103. FOR (287)
  104. RETURN (288) 29
  105. READ (289) 30
  106. WRITE (290) 31
  107. DO (291) 36
  108. WHILE (292) 34 36
  109. IF (293) 39
  110. TYPE (294) 4
  111. IDENTIFIER (295) 7 8 9 24 25 30 41 42 44
  112. NUMBER (296) 7 8 40 43
  113. NOT (297)
  114. Nonterminals, with rules where they appear
  115. $accept (43)
  116. on left: 0
  117. program (44)
  118. on left: 1, on right: 0
  119. var_declarations (45)
  120. on left: 2 3, on right: 1 2
  121. var_declaration (46)
  122. on left: 4, on right: 2
  123. declaration_list (47)
  124. on left: 5 6, on right: 4 5
  125. declaration (48)
  126. on left: 7 8 9, on right: 5 6
  127. code_block (49)
  128. on left: 10 11, on right: 28 34 36 39
  129. statements (50)
  130. on left: 12 13, on right: 1 11 12
  131. statement (51)
  132. on left: 14 15 16 17, on right: 10 12 13
  133. control_statement (52)
  134. on left: 18 19 20 21, on right: 15
  135. read_write_statement (53)
  136. on left: 22 23, on right: 16
  137. assign_statement (54)
  138. on left: 24 25, on right: 14
  139. if_statement (55)
  140. on left: 26 28, on right: 18
  141. @1 (56)
  142. on left: 27, on right: 28
  143. return_statement (57)
  144. on left: 29, on right: 21
  145. read_statement (58)
  146. on left: 30, on right: 22
  147. write_statement (59)
  148. on left: 31, on right: 23
  149. while_statement (60)
  150. on left: 34, on right: 20
  151. @2 (61)
  152. on left: 32, on right: 34
  153. @3 (62)
  154. on left: 33, on right: 34
  155. do_while_statement (63)
  156. on left: 36, on right: 19
  157. @4 (64)
  158. on left: 35, on right: 36
  159. if_stmt (65)
  160. on left: 39, on right: 26 28
  161. @5 (66)
  162. on left: 37, on right: 39
  163. @6 (67)
  164. on left: 38, on right: 39
  165. exp (68)
  166. on left: 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
  167. 58 59 60 61 62, on right: 24 25 31 34 36 39 42 45 46 47 48 49 50
  168. 51 52 53 54 55 56 57 58 59 60 61 62
  169. state 0
  170. 0 $accept: . program $end
  171. $default reduce using rule 3 (var_declarations)
  172. program go to state 1
  173. var_declarations go to state 2
  174. state 1
  175. 0 $accept: program . $end
  176. $end shift, and go to state 3
  177. state 2
  178. 1 program: var_declarations . statements
  179. 2 var_declarations: var_declarations . var_declaration
  180. SEMI shift, and go to state 4
  181. RETURN shift, and go to state 5
  182. READ shift, and go to state 6
  183. WRITE shift, and go to state 7
  184. DO shift, and go to state 8
  185. WHILE shift, and go to state 9
  186. IF shift, and go to state 10
  187. TYPE shift, and go to state 11
  188. IDENTIFIER shift, and go to state 12
  189. var_declaration go to state 13
  190. statements go to state 14
  191. statement go to state 15
  192. control_statement go to state 16
  193. read_write_statement go to state 17
  194. assign_statement go to state 18
  195. if_statement go to state 19
  196. return_statement go to state 20
  197. read_statement go to state 21
  198. write_statement go to state 22
  199. while_statement go to state 23
  200. do_while_statement go to state 24
  201. if_stmt go to state 25
  202. state 3
  203. 0 $accept: program $end .
  204. $default accept
  205. state 4
  206. 17 statement: SEMI .
  207. $default reduce using rule 17 (statement)
  208. state 5
  209. 29 return_statement: RETURN .
  210. $default reduce using rule 29 (return_statement)
  211. state 6
  212. 30 read_statement: READ . LPAR IDENTIFIER RPAR
  213. LPAR shift, and go to state 26
  214. state 7
  215. 31 write_statement: WRITE . LPAR exp RPAR
  216. LPAR shift, and go to state 27
  217. state 8
  218. 36 do_while_statement: DO . @4 code_block WHILE LPAR exp RPAR
  219. $default reduce using rule 35 (@4)
  220. @4 go to state 28
  221. state 9
  222. 34 while_statement: WHILE . @2 LPAR exp RPAR @3 code_block
  223. $default reduce using rule 32 (@2)
  224. @2 go to state 29
  225. state 10
  226. 39 if_stmt: IF . @5 LPAR exp RPAR @6 code_block
  227. $default reduce using rule 37 (@5)
  228. @5 go to state 30
  229. state 11
  230. 4 var_declaration: TYPE . declaration_list SEMI
  231. IDENTIFIER shift, and go to state 31
  232. declaration_list go to state 32
  233. declaration go to state 33
  234. state 12
  235. 24 assign_statement: IDENTIFIER . LSQUARE exp RSQUARE ASSIGN exp
  236. 25 | IDENTIFIER . ASSIGN exp
  237. LSQUARE shift, and go to state 34
  238. ASSIGN shift, and go to state 35
  239. state 13
  240. 2 var_declarations: var_declarations var_declaration .
  241. $default reduce using rule 2 (var_declarations)
  242. state 14
  243. 1 program: var_declarations statements .
  244. 12 statements: statements . statement
  245. SEMI shift, and go to state 4
  246. RETURN shift, and go to state 5
  247. READ shift, and go to state 6
  248. WRITE shift, and go to state 7
  249. DO shift, and go to state 8
  250. WHILE shift, and go to state 9
  251. IF shift, and go to state 10
  252. IDENTIFIER shift, and go to state 12
  253. $default reduce using rule 1 (program)
  254. statement go to state 36
  255. control_statement go to state 16
  256. read_write_statement go to state 17
  257. assign_statement go to state 18
  258. if_statement go to state 19
  259. return_statement go to state 20
  260. read_statement go to state 21
  261. write_statement go to state 22
  262. while_statement go to state 23
  263. do_while_statement go to state 24
  264. if_stmt go to state 25
  265. state 15
  266. 13 statements: statement .
  267. $default reduce using rule 13 (statements)
  268. state 16
  269. 15 statement: control_statement .
  270. $default reduce using rule 15 (statement)
  271. state 17
  272. 16 statement: read_write_statement . SEMI
  273. SEMI shift, and go to state 37
  274. state 18
  275. 14 statement: assign_statement . SEMI
  276. SEMI shift, and go to state 38
  277. state 19
  278. 18 control_statement: if_statement .
  279. $default reduce using rule 18 (control_statement)
  280. state 20
  281. 21 control_statement: return_statement . SEMI
  282. SEMI shift, and go to state 39
  283. state 21
  284. 22 read_write_statement: read_statement .
  285. $default reduce using rule 22 (read_write_statement)
  286. state 22
  287. 23 read_write_statement: write_statement .
  288. $default reduce using rule 23 (read_write_statement)
  289. state 23
  290. 20 control_statement: while_statement .
  291. $default reduce using rule 20 (control_statement)
  292. state 24
  293. 19 control_statement: do_while_statement . SEMI
  294. SEMI shift, and go to state 40
  295. state 25
  296. 26 if_statement: if_stmt .
  297. 28 | if_stmt . ELSE @1 code_block
  298. ELSE shift, and go to state 41
  299. ELSE [reduce using rule 26 (if_statement)]
  300. $default reduce using rule 26 (if_statement)
  301. state 26
  302. 30 read_statement: READ LPAR . IDENTIFIER RPAR
  303. IDENTIFIER shift, and go to state 42
  304. state 27
  305. 31 write_statement: WRITE LPAR . exp RPAR
  306. LPAR shift, and go to state 43
  307. MINUS shift, and go to state 44
  308. NOT_OP shift, and go to state 45
  309. IDENTIFIER shift, and go to state 46
  310. NUMBER shift, and go to state 47
  311. exp go to state 48
  312. state 28
  313. 36 do_while_statement: DO @4 . code_block WHILE LPAR exp RPAR
  314. LBRACE shift, and go to state 49
  315. SEMI shift, and go to state 4
  316. RETURN shift, and go to state 5
  317. READ shift, and go to state 6
  318. WRITE shift, and go to state 7
  319. DO shift, and go to state 8
  320. WHILE shift, and go to state 9
  321. IF shift, and go to state 10
  322. IDENTIFIER shift, and go to state 12
  323. code_block go to state 50
  324. statement go to state 51
  325. control_statement go to state 16
  326. read_write_statement go to state 17
  327. assign_statement go to state 18
  328. if_statement go to state 19
  329. return_statement go to state 20
  330. read_statement go to state 21
  331. write_statement go to state 22
  332. while_statement go to state 23
  333. do_while_statement go to state 24
  334. if_stmt go to state 25
  335. state 29
  336. 34 while_statement: WHILE @2 . LPAR exp RPAR @3 code_block
  337. LPAR shift, and go to state 52
  338. state 30
  339. 39 if_stmt: IF @5 . LPAR exp RPAR @6 code_block
  340. LPAR shift, and go to state 53
  341. state 31
  342. 7 declaration: IDENTIFIER . ASSIGN NUMBER
  343. 8 | IDENTIFIER . LSQUARE NUMBER RSQUARE
  344. 9 | IDENTIFIER .
  345. LSQUARE shift, and go to state 54
  346. ASSIGN shift, and go to state 55
  347. $default reduce using rule 9 (declaration)
  348. state 32
  349. 4 var_declaration: TYPE declaration_list . SEMI
  350. 5 declaration_list: declaration_list . COMMA declaration
  351. SEMI shift, and go to state 56
  352. COMMA shift, and go to state 57
  353. state 33
  354. 6 declaration_list: declaration .
  355. $default reduce using rule 6 (declaration_list)
  356. state 34
  357. 24 assign_statement: IDENTIFIER LSQUARE . exp RSQUARE ASSIGN exp
  358. LPAR shift, and go to state 43
  359. MINUS shift, and go to state 44
  360. NOT_OP shift, and go to state 45
  361. IDENTIFIER shift, and go to state 46
  362. NUMBER shift, and go to state 47
  363. exp go to state 58
  364. state 35
  365. 25 assign_statement: IDENTIFIER ASSIGN . exp
  366. LPAR shift, and go to state 43
  367. MINUS shift, and go to state 44
  368. NOT_OP shift, and go to state 45
  369. IDENTIFIER shift, and go to state 46
  370. NUMBER shift, and go to state 47
  371. exp go to state 59
  372. state 36
  373. 12 statements: statements statement .
  374. $default reduce using rule 12 (statements)
  375. state 37
  376. 16 statement: read_write_statement SEMI .
  377. $default reduce using rule 16 (statement)
  378. state 38
  379. 14 statement: assign_statement SEMI .
  380. $default reduce using rule 14 (statement)
  381. state 39
  382. 21 control_statement: return_statement SEMI .
  383. $default reduce using rule 21 (control_statement)
  384. state 40
  385. 19 control_statement: do_while_statement SEMI .
  386. $default reduce using rule 19 (control_statement)
  387. state 41
  388. 28 if_statement: if_stmt ELSE . @1 code_block
  389. $default reduce using rule 27 (@1)
  390. @1 go to state 60
  391. state 42
  392. 30 read_statement: READ LPAR IDENTIFIER . RPAR
  393. RPAR shift, and go to state 61
  394. state 43
  395. 61 exp: LPAR . exp RPAR
  396. LPAR shift, and go to state 43
  397. MINUS shift, and go to state 44
  398. NOT_OP shift, and go to state 45
  399. IDENTIFIER shift, and go to state 46
  400. NUMBER shift, and go to state 47
  401. exp go to state 62
  402. state 44
  403. 62 exp: MINUS . exp
  404. LPAR shift, and go to state 43
  405. MINUS shift, and go to state 44
  406. NOT_OP shift, and go to state 45
  407. IDENTIFIER shift, and go to state 46
  408. NUMBER shift, and go to state 47
  409. exp go to state 63
  410. state 45
  411. 43 exp: NOT_OP . NUMBER
  412. 44 | NOT_OP . IDENTIFIER
  413. IDENTIFIER shift, and go to state 64
  414. NUMBER shift, and go to state 65
  415. state 46
  416. 41 exp: IDENTIFIER .
  417. 42 | IDENTIFIER . LSQUARE exp RSQUARE
  418. LSQUARE shift, and go to state 66
  419. $default reduce using rule 41 (exp)
  420. state 47
  421. 40 exp: NUMBER .
  422. $default reduce using rule 40 (exp)
  423. state 48
  424. 31 write_statement: WRITE LPAR exp . RPAR
  425. 45 exp: exp . AND_OP exp
  426. 46 | exp . OR_OP exp
  427. 47 | exp . PLUS exp
  428. 48 | exp . MINUS exp
  429. 49 | exp . MUL_OP exp
  430. 50 | exp . DIV_OP exp
  431. 51 | exp . LT exp
  432. 52 | exp . GT exp
  433. 53 | exp . EQ exp
  434. 54 | exp . NOTEQ exp
  435. 55 | exp . LTEQ exp
  436. 56 | exp . GTEQ exp
  437. 57 | exp . SHL_OP exp
  438. 58 | exp . SHR_OP exp
  439. 59 | exp . ANDAND exp
  440. 60 | exp . OROR exp
  441. RPAR shift, and go to state 67
  442. PLUS shift, and go to state 68
  443. MINUS shift, and go to state 69
  444. MUL_OP shift, and go to state 70
  445. DIV_OP shift, and go to state 71
  446. AND_OP shift, and go to state 72
  447. OR_OP shift, and go to state 73
  448. LT shift, and go to state 74
  449. GT shift, and go to state 75
  450. SHL_OP shift, and go to state 76
  451. SHR_OP shift, and go to state 77
  452. EQ shift, and go to state 78
  453. NOTEQ shift, and go to state 79
  454. LTEQ shift, and go to state 80
  455. GTEQ shift, and go to state 81
  456. ANDAND shift, and go to state 82
  457. OROR shift, and go to state 83
  458. state 49
  459. 11 code_block: LBRACE . statements RBRACE
  460. SEMI shift, and go to state 4
  461. RETURN shift, and go to state 5
  462. READ shift, and go to state 6
  463. WRITE shift, and go to state 7
  464. DO shift, and go to state 8
  465. WHILE shift, and go to state 9
  466. IF shift, and go to state 10
  467. IDENTIFIER shift, and go to state 12
  468. statements go to state 84
  469. statement go to state 15
  470. control_statement go to state 16
  471. read_write_statement go to state 17
  472. assign_statement go to state 18
  473. if_statement go to state 19
  474. return_statement go to state 20
  475. read_statement go to state 21
  476. write_statement go to state 22
  477. while_statement go to state 23
  478. do_while_statement go to state 24
  479. if_stmt go to state 25
  480. state 50
  481. 36 do_while_statement: DO @4 code_block . WHILE LPAR exp RPAR
  482. WHILE shift, and go to state 85
  483. state 51
  484. 10 code_block: statement .
  485. $default reduce using rule 10 (code_block)
  486. state 52
  487. 34 while_statement: WHILE @2 LPAR . exp RPAR @3 code_block
  488. LPAR shift, and go to state 43
  489. MINUS shift, and go to state 44
  490. NOT_OP shift, and go to state 45
  491. IDENTIFIER shift, and go to state 46
  492. NUMBER shift, and go to state 47
  493. exp go to state 86
  494. state 53
  495. 39 if_stmt: IF @5 LPAR . exp RPAR @6 code_block
  496. LPAR shift, and go to state 43
  497. MINUS shift, and go to state 44
  498. NOT_OP shift, and go to state 45
  499. IDENTIFIER shift, and go to state 46
  500. NUMBER shift, and go to state 47
  501. exp go to state 87
  502. state 54
  503. 8 declaration: IDENTIFIER LSQUARE . NUMBER RSQUARE
  504. NUMBER shift, and go to state 88
  505. state 55
  506. 7 declaration: IDENTIFIER ASSIGN . NUMBER
  507. NUMBER shift, and go to state 89
  508. state 56
  509. 4 var_declaration: TYPE declaration_list SEMI .
  510. $default reduce using rule 4 (var_declaration)
  511. state 57
  512. 5 declaration_list: declaration_list COMMA . declaration
  513. IDENTIFIER shift, and go to state 31
  514. declaration go to state 90
  515. state 58
  516. 24 assign_statement: IDENTIFIER LSQUARE exp . RSQUARE ASSIGN exp
  517. 45 exp: exp . AND_OP exp
  518. 46 | exp . OR_OP exp
  519. 47 | exp . PLUS exp
  520. 48 | exp . MINUS exp
  521. 49 | exp . MUL_OP exp
  522. 50 | exp . DIV_OP exp
  523. 51 | exp . LT exp
  524. 52 | exp . GT exp
  525. 53 | exp . EQ exp
  526. 54 | exp . NOTEQ exp
  527. 55 | exp . LTEQ exp
  528. 56 | exp . GTEQ exp
  529. 57 | exp . SHL_OP exp
  530. 58 | exp . SHR_OP exp
  531. 59 | exp . ANDAND exp
  532. 60 | exp . OROR exp
  533. RSQUARE shift, and go to state 91
  534. PLUS shift, and go to state 68
  535. MINUS shift, and go to state 69
  536. MUL_OP shift, and go to state 70
  537. DIV_OP shift, and go to state 71
  538. AND_OP shift, and go to state 72
  539. OR_OP shift, and go to state 73
  540. LT shift, and go to state 74
  541. GT shift, and go to state 75
  542. SHL_OP shift, and go to state 76
  543. SHR_OP shift, and go to state 77
  544. EQ shift, and go to state 78
  545. NOTEQ shift, and go to state 79
  546. LTEQ shift, and go to state 80
  547. GTEQ shift, and go to state 81
  548. ANDAND shift, and go to state 82
  549. OROR shift, and go to state 83
  550. state 59
  551. 25 assign_statement: IDENTIFIER ASSIGN exp .
  552. 45 exp: exp . AND_OP exp
  553. 46 | exp . OR_OP exp
  554. 47 | exp . PLUS exp
  555. 48 | exp . MINUS exp
  556. 49 | exp . MUL_OP exp
  557. 50 | exp . DIV_OP exp
  558. 51 | exp . LT exp
  559. 52 | exp . GT exp
  560. 53 | exp . EQ exp
  561. 54 | exp . NOTEQ exp
  562. 55 | exp . LTEQ exp
  563. 56 | exp . GTEQ exp
  564. 57 | exp . SHL_OP exp
  565. 58 | exp . SHR_OP exp
  566. 59 | exp . ANDAND exp
  567. 60 | exp . OROR exp
  568. PLUS shift, and go to state 68
  569. MINUS shift, and go to state 69
  570. MUL_OP shift, and go to state 70
  571. DIV_OP shift, and go to state 71
  572. AND_OP shift, and go to state 72
  573. OR_OP shift, and go to state 73
  574. LT shift, and go to state 74
  575. GT shift, and go to state 75
  576. SHL_OP shift, and go to state 76
  577. SHR_OP shift, and go to state 77
  578. EQ shift, and go to state 78
  579. NOTEQ shift, and go to state 79
  580. LTEQ shift, and go to state 80
  581. GTEQ shift, and go to state 81
  582. ANDAND shift, and go to state 82
  583. OROR shift, and go to state 83
  584. $default reduce using rule 25 (assign_statement)
  585. state 60
  586. 28 if_statement: if_stmt ELSE @1 . code_block
  587. LBRACE shift, and go to state 49
  588. SEMI shift, and go to state 4
  589. RETURN shift, and go to state 5
  590. READ shift, and go to state 6
  591. WRITE shift, and go to state 7
  592. DO shift, and go to state 8
  593. WHILE shift, and go to state 9
  594. IF shift, and go to state 10
  595. IDENTIFIER shift, and go to state 12
  596. code_block go to state 92
  597. statement go to state 51
  598. control_statement go to state 16
  599. read_write_statement go to state 17
  600. assign_statement go to state 18
  601. if_statement go to state 19
  602. return_statement go to state 20
  603. read_statement go to state 21
  604. write_statement go to state 22
  605. while_statement go to state 23
  606. do_while_statement go to state 24
  607. if_stmt go to state 25
  608. state 61
  609. 30 read_statement: READ LPAR IDENTIFIER RPAR .
  610. $default reduce using rule 30 (read_statement)
  611. state 62
  612. 45 exp: exp . AND_OP exp
  613. 46 | exp . OR_OP exp
  614. 47 | exp . PLUS exp
  615. 48 | exp . MINUS exp
  616. 49 | exp . MUL_OP exp
  617. 50 | exp . DIV_OP exp
  618. 51 | exp . LT exp
  619. 52 | exp . GT exp
  620. 53 | exp . EQ exp
  621. 54 | exp . NOTEQ exp
  622. 55 | exp . LTEQ exp
  623. 56 | exp . GTEQ exp
  624. 57 | exp . SHL_OP exp
  625. 58 | exp . SHR_OP exp
  626. 59 | exp . ANDAND exp
  627. 60 | exp . OROR exp
  628. 61 | LPAR exp . RPAR
  629. RPAR shift, and go to state 93
  630. PLUS shift, and go to state 68
  631. MINUS shift, and go to state 69
  632. MUL_OP shift, and go to state 70
  633. DIV_OP shift, and go to state 71
  634. AND_OP shift, and go to state 72
  635. OR_OP shift, and go to state 73
  636. LT shift, and go to state 74
  637. GT shift, and go to state 75
  638. SHL_OP shift, and go to state 76
  639. SHR_OP shift, and go to state 77
  640. EQ shift, and go to state 78
  641. NOTEQ shift, and go to state 79
  642. LTEQ shift, and go to state 80
  643. GTEQ shift, and go to state 81
  644. ANDAND shift, and go to state 82
  645. OROR shift, and go to state 83
  646. state 63
  647. 45 exp: exp . AND_OP exp
  648. 46 | exp . OR_OP exp
  649. 47 | exp . PLUS exp
  650. 48 | exp . MINUS exp
  651. 49 | exp . MUL_OP exp
  652. 50 | exp . DIV_OP exp
  653. 51 | exp . LT exp
  654. 52 | exp . GT exp
  655. 53 | exp . EQ exp
  656. 54 | exp . NOTEQ exp
  657. 55 | exp . LTEQ exp
  658. 56 | exp . GTEQ exp
  659. 57 | exp . SHL_OP exp
  660. 58 | exp . SHR_OP exp
  661. 59 | exp . ANDAND exp
  662. 60 | exp . OROR exp
  663. 62 | MINUS exp .
  664. MUL_OP shift, and go to state 70
  665. DIV_OP shift, and go to state 71
  666. $default reduce using rule 62 (exp)
  667. state 64
  668. 44 exp: NOT_OP IDENTIFIER .
  669. $default reduce using rule 44 (exp)
  670. state 65
  671. 43 exp: NOT_OP NUMBER .
  672. $default reduce using rule 43 (exp)
  673. state 66
  674. 42 exp: IDENTIFIER LSQUARE . exp RSQUARE
  675. LPAR shift, and go to state 43
  676. MINUS shift, and go to state 44
  677. NOT_OP shift, and go to state 45
  678. IDENTIFIER shift, and go to state 46
  679. NUMBER shift, and go to state 47
  680. exp go to state 94
  681. state 67
  682. 31 write_statement: WRITE LPAR exp RPAR .
  683. $default reduce using rule 31 (write_statement)
  684. state 68
  685. 47 exp: exp PLUS . exp
  686. LPAR shift, and go to state 43
  687. MINUS shift, and go to state 44
  688. NOT_OP shift, and go to state 45
  689. IDENTIFIER shift, and go to state 46
  690. NUMBER shift, and go to state 47
  691. exp go to state 95
  692. state 69
  693. 48 exp: exp MINUS . exp
  694. LPAR shift, and go to state 43
  695. MINUS shift, and go to state 44
  696. NOT_OP shift, and go to state 45
  697. IDENTIFIER shift, and go to state 46
  698. NUMBER shift, and go to state 47
  699. exp go to state 96
  700. state 70
  701. 49 exp: exp MUL_OP . exp
  702. LPAR shift, and go to state 43
  703. MINUS shift, and go to state 44
  704. NOT_OP shift, and go to state 45
  705. IDENTIFIER shift, and go to state 46
  706. NUMBER shift, and go to state 47
  707. exp go to state 97
  708. state 71
  709. 50 exp: exp DIV_OP . exp
  710. LPAR shift, and go to state 43
  711. MINUS shift, and go to state 44
  712. NOT_OP shift, and go to state 45
  713. IDENTIFIER shift, and go to state 46
  714. NUMBER shift, and go to state 47
  715. exp go to state 98
  716. state 72
  717. 45 exp: exp AND_OP . exp
  718. LPAR shift, and go to state 43
  719. MINUS shift, and go to state 44
  720. NOT_OP shift, and go to state 45
  721. IDENTIFIER shift, and go to state 46
  722. NUMBER shift, and go to state 47
  723. exp go to state 99
  724. state 73
  725. 46 exp: exp OR_OP . exp
  726. LPAR shift, and go to state 43
  727. MINUS shift, and go to state 44
  728. NOT_OP shift, and go to state 45
  729. IDENTIFIER shift, and go to state 46
  730. NUMBER shift, and go to state 47
  731. exp go to state 100
  732. state 74
  733. 51 exp: exp LT . exp
  734. LPAR shift, and go to state 43
  735. MINUS shift, and go to state 44
  736. NOT_OP shift, and go to state 45
  737. IDENTIFIER shift, and go to state 46
  738. NUMBER shift, and go to state 47
  739. exp go to state 101
  740. state 75
  741. 52 exp: exp GT . exp
  742. LPAR shift, and go to state 43
  743. MINUS shift, and go to state 44
  744. NOT_OP shift, and go to state 45
  745. IDENTIFIER shift, and go to state 46
  746. NUMBER shift, and go to state 47
  747. exp go to state 102
  748. state 76
  749. 57 exp: exp SHL_OP . exp
  750. LPAR shift, and go to state 43
  751. MINUS shift, and go to state 44
  752. NOT_OP shift, and go to state 45
  753. IDENTIFIER shift, and go to state 46
  754. NUMBER shift, and go to state 47
  755. exp go to state 103
  756. state 77
  757. 58 exp: exp SHR_OP . exp
  758. LPAR shift, and go to state 43
  759. MINUS shift, and go to state 44
  760. NOT_OP shift, and go to state 45
  761. IDENTIFIER shift, and go to state 46
  762. NUMBER shift, and go to state 47
  763. exp go to state 104
  764. state 78
  765. 53 exp: exp EQ . exp
  766. LPAR shift, and go to state 43
  767. MINUS shift, and go to state 44
  768. NOT_OP shift, and go to state 45
  769. IDENTIFIER shift, and go to state 46
  770. NUMBER shift, and go to state 47
  771. exp go to state 105
  772. state 79
  773. 54 exp: exp NOTEQ . exp
  774. LPAR shift, and go to state 43
  775. MINUS shift, and go to state 44
  776. NOT_OP shift, and go to state 45
  777. IDENTIFIER shift, and go to state 46
  778. NUMBER shift, and go to state 47
  779. exp go to state 106
  780. state 80
  781. 55 exp: exp LTEQ . exp
  782. LPAR shift, and go to state 43
  783. MINUS shift, and go to state 44
  784. NOT_OP shift, and go to state 45
  785. IDENTIFIER shift, and go to state 46
  786. NUMBER shift, and go to state 47
  787. exp go to state 107
  788. state 81
  789. 56 exp: exp GTEQ . exp
  790. LPAR shift, and go to state 43
  791. MINUS shift, and go to state 44
  792. NOT_OP shift, and go to state 45
  793. IDENTIFIER shift, and go to state 46
  794. NUMBER shift, and go to state 47
  795. exp go to state 108
  796. state 82
  797. 59 exp: exp ANDAND . exp
  798. LPAR shift, and go to state 43
  799. MINUS shift, and go to state 44
  800. NOT_OP shift, and go to state 45
  801. IDENTIFIER shift, and go to state 46
  802. NUMBER shift, and go to state 47
  803. exp go to state 109
  804. state 83
  805. 60 exp: exp OROR . exp
  806. LPAR shift, and go to state 43
  807. MINUS shift, and go to state 44
  808. NOT_OP shift, and go to state 45
  809. IDENTIFIER shift, and go to state 46
  810. NUMBER shift, and go to state 47
  811. exp go to state 110
  812. state 84
  813. 11 code_block: LBRACE statements . RBRACE
  814. 12 statements: statements . statement
  815. RBRACE shift, and go to state 111
  816. SEMI shift, and go to state 4
  817. RETURN shift, and go to state 5
  818. READ shift, and go to state 6
  819. WRITE shift, and go to state 7
  820. DO shift, and go to state 8
  821. WHILE shift, and go to state 9
  822. IF shift, and go to state 10
  823. IDENTIFIER shift, and go to state 12
  824. statement go to state 36
  825. control_statement go to state 16
  826. read_write_statement go to state 17
  827. assign_statement go to state 18
  828. if_statement go to state 19
  829. return_statement go to state 20
  830. read_statement go to state 21
  831. write_statement go to state 22
  832. while_statement go to state 23
  833. do_while_statement go to state 24
  834. if_stmt go to state 25
  835. state 85
  836. 36 do_while_statement: DO @4 code_block WHILE . LPAR exp RPAR
  837. LPAR shift, and go to state 112
  838. state 86
  839. 34 while_statement: WHILE @2 LPAR exp . RPAR @3 code_block
  840. 45 exp: exp . AND_OP exp
  841. 46 | exp . OR_OP exp
  842. 47 | exp . PLUS exp
  843. 48 | exp . MINUS exp
  844. 49 | exp . MUL_OP exp
  845. 50 | exp . DIV_OP exp
  846. 51 | exp . LT exp
  847. 52 | exp . GT exp
  848. 53 | exp . EQ exp
  849. 54 | exp . NOTEQ exp
  850. 55 | exp . LTEQ exp
  851. 56 | exp . GTEQ exp
  852. 57 | exp . SHL_OP exp
  853. 58 | exp . SHR_OP exp
  854. 59 | exp . ANDAND exp
  855. 60 | exp . OROR exp
  856. RPAR shift, and go to state 113
  857. PLUS shift, and go to state 68
  858. MINUS shift, and go to state 69
  859. MUL_OP shift, and go to state 70
  860. DIV_OP shift, and go to state 71
  861. AND_OP shift, and go to state 72
  862. OR_OP shift, and go to state 73
  863. LT shift, and go to state 74
  864. GT shift, and go to state 75
  865. SHL_OP shift, and go to state 76
  866. SHR_OP shift, and go to state 77
  867. EQ shift, and go to state 78
  868. NOTEQ shift, and go to state 79
  869. LTEQ shift, and go to state 80
  870. GTEQ shift, and go to state 81
  871. ANDAND shift, and go to state 82
  872. OROR shift, and go to state 83
  873. state 87
  874. 39 if_stmt: IF @5 LPAR exp . RPAR @6 code_block
  875. 45 exp: exp . AND_OP exp
  876. 46 | exp . OR_OP exp
  877. 47 | exp . PLUS exp
  878. 48 | exp . MINUS exp
  879. 49 | exp . MUL_OP exp
  880. 50 | exp . DIV_OP exp
  881. 51 | exp . LT exp
  882. 52 | exp . GT exp
  883. 53 | exp . EQ exp
  884. 54 | exp . NOTEQ exp
  885. 55 | exp . LTEQ exp
  886. 56 | exp . GTEQ exp
  887. 57 | exp . SHL_OP exp
  888. 58 | exp . SHR_OP exp
  889. 59 | exp . ANDAND exp
  890. 60 | exp . OROR exp
  891. RPAR shift, and go to state 114
  892. PLUS shift, and go to state 68
  893. MINUS shift, and go to state 69
  894. MUL_OP shift, and go to state 70
  895. DIV_OP shift, and go to state 71
  896. AND_OP shift, and go to state 72
  897. OR_OP shift, and go to state 73
  898. LT shift, and go to state 74
  899. GT shift, and go to state 75
  900. SHL_OP shift, and go to state 76
  901. SHR_OP shift, and go to state 77
  902. EQ shift, and go to state 78
  903. NOTEQ shift, and go to state 79
  904. LTEQ shift, and go to state 80
  905. GTEQ shift, and go to state 81
  906. ANDAND shift, and go to state 82
  907. OROR shift, and go to state 83
  908. state 88
  909. 8 declaration: IDENTIFIER LSQUARE NUMBER . RSQUARE
  910. RSQUARE shift, and go to state 115
  911. state 89
  912. 7 declaration: IDENTIFIER ASSIGN NUMBER .
  913. $default reduce using rule 7 (declaration)
  914. state 90
  915. 5 declaration_list: declaration_list COMMA declaration .
  916. $default reduce using rule 5 (declaration_list)
  917. state 91
  918. 24 assign_statement: IDENTIFIER LSQUARE exp RSQUARE . ASSIGN exp
  919. ASSIGN shift, and go to state 116
  920. state 92
  921. 28 if_statement: if_stmt ELSE @1 code_block .
  922. $default reduce using rule 28 (if_statement)
  923. state 93
  924. 61 exp: LPAR exp RPAR .
  925. $default reduce using rule 61 (exp)
  926. state 94
  927. 42 exp: IDENTIFIER LSQUARE exp . RSQUARE
  928. 45 | exp . AND_OP exp
  929. 46 | exp . OR_OP exp
  930. 47 | exp . PLUS exp
  931. 48 | exp . MINUS exp
  932. 49 | exp . MUL_OP exp
  933. 50 | exp . DIV_OP exp
  934. 51 | exp . LT exp
  935. 52 | exp . GT exp
  936. 53 | exp . EQ exp
  937. 54 | exp . NOTEQ exp
  938. 55 | exp . LTEQ exp
  939. 56 | exp . GTEQ exp
  940. 57 | exp . SHL_OP exp
  941. 58 | exp . SHR_OP exp
  942. 59 | exp . ANDAND exp
  943. 60 | exp . OROR exp
  944. RSQUARE shift, and go to state 117
  945. PLUS shift, and go to state 68
  946. MINUS shift, and go to state 69
  947. MUL_OP shift, and go to state 70
  948. DIV_OP shift, and go to state 71
  949. AND_OP shift, and go to state 72
  950. OR_OP shift, and go to state 73
  951. LT shift, and go to state 74
  952. GT shift, and go to state 75
  953. SHL_OP shift, and go to state 76
  954. SHR_OP shift, and go to state 77
  955. EQ shift, and go to state 78
  956. NOTEQ shift, and go to state 79
  957. LTEQ shift, and go to state 80
  958. GTEQ shift, and go to state 81
  959. ANDAND shift, and go to state 82
  960. OROR shift, and go to state 83
  961. state 95
  962. 45 exp: exp . AND_OP exp
  963. 46 | exp . OR_OP exp
  964. 47 | exp . PLUS exp
  965. 47 | exp PLUS exp .
  966. 48 | exp . MINUS exp
  967. 49 | exp . MUL_OP exp
  968. 50 | exp . DIV_OP exp
  969. 51 | exp . LT exp
  970. 52 | exp . GT exp
  971. 53 | exp . EQ exp
  972. 54 | exp . NOTEQ exp
  973. 55 | exp . LTEQ exp
  974. 56 | exp . GTEQ exp
  975. 57 | exp . SHL_OP exp
  976. 58 | exp . SHR_OP exp
  977. 59 | exp . ANDAND exp
  978. 60 | exp . OROR exp
  979. MUL_OP shift, and go to state 70
  980. DIV_OP shift, and go to state 71
  981. $default reduce using rule 47 (exp)
  982. state 96
  983. 45 exp: exp . AND_OP exp
  984. 46 | exp . OR_OP exp
  985. 47 | exp . PLUS exp
  986. 48 | exp . MINUS exp
  987. 48 | exp MINUS exp .
  988. 49 | exp . MUL_OP exp
  989. 50 | exp . DIV_OP exp
  990. 51 | exp . LT exp
  991. 52 | exp . GT exp
  992. 53 | exp . EQ exp
  993. 54 | exp . NOTEQ exp
  994. 55 | exp . LTEQ exp
  995. 56 | exp . GTEQ exp
  996. 57 | exp . SHL_OP exp
  997. 58 | exp . SHR_OP exp
  998. 59 | exp . ANDAND exp
  999. 60 | exp . OROR exp
  1000. MUL_OP shift, and go to state 70
  1001. DIV_OP shift, and go to state 71
  1002. $default reduce using rule 48 (exp)
  1003. state 97
  1004. 45 exp: exp . AND_OP exp
  1005. 46 | exp . OR_OP exp
  1006. 47 | exp . PLUS exp
  1007. 48 | exp . MINUS exp
  1008. 49 | exp . MUL_OP exp
  1009. 49 | exp MUL_OP exp .
  1010. 50 | exp . DIV_OP exp
  1011. 51 | exp . LT exp
  1012. 52 | exp . GT exp
  1013. 53 | exp . EQ exp
  1014. 54 | exp . NOTEQ exp
  1015. 55 | exp . LTEQ exp
  1016. 56 | exp . GTEQ exp
  1017. 57 | exp . SHL_OP exp
  1018. 58 | exp . SHR_OP exp
  1019. 59 | exp . ANDAND exp
  1020. 60 | exp . OROR exp
  1021. $default reduce using rule 49 (exp)
  1022. state 98
  1023. 45 exp: exp . AND_OP exp
  1024. 46 | exp . OR_OP exp
  1025. 47 | exp . PLUS exp
  1026. 48 | exp . MINUS exp
  1027. 49 | exp . MUL_OP exp
  1028. 50 | exp . DIV_OP exp
  1029. 50 | exp DIV_OP exp .
  1030. 51 | exp . LT exp
  1031. 52 | exp . GT exp
  1032. 53 | exp . EQ exp
  1033. 54 | exp . NOTEQ exp
  1034. 55 | exp . LTEQ exp
  1035. 56 | exp . GTEQ exp
  1036. 57 | exp . SHL_OP exp
  1037. 58 | exp . SHR_OP exp
  1038. 59 | exp . ANDAND exp
  1039. 60 | exp . OROR exp
  1040. $default reduce using rule 50 (exp)
  1041. state 99
  1042. 45 exp: exp . AND_OP exp
  1043. 45 | exp AND_OP exp .
  1044. 46 | exp . OR_OP exp
  1045. 47 | exp . PLUS exp
  1046. 48 | exp . MINUS exp
  1047. 49 | exp . MUL_OP exp
  1048. 50 | exp . DIV_OP exp
  1049. 51 | exp . LT exp
  1050. 52 | exp . GT exp
  1051. 53 | exp . EQ exp
  1052. 54 | exp . NOTEQ exp
  1053. 55 | exp . LTEQ exp
  1054. 56 | exp . GTEQ exp
  1055. 57 | exp . SHL_OP exp
  1056. 58 | exp . SHR_OP exp
  1057. 59 | exp . ANDAND exp
  1058. 60 | exp . OROR exp
  1059. PLUS shift, and go to state 68
  1060. MINUS shift, and go to state 69
  1061. MUL_OP shift, and go to state 70
  1062. DIV_OP shift, and go to state 71
  1063. LT shift, and go to state 74
  1064. GT shift, and go to state 75
  1065. SHL_OP shift, and go to state 76
  1066. SHR_OP shift, and go to state 77
  1067. EQ shift, and go to state 78
  1068. NOTEQ shift, and go to state 79
  1069. LTEQ shift, and go to state 80
  1070. GTEQ shift, and go to state 81
  1071. $default reduce using rule 45 (exp)
  1072. state 100
  1073. 45 exp: exp . AND_OP exp
  1074. 46 | exp . OR_OP exp
  1075. 46 | exp OR_OP exp .
  1076. 47 | exp . PLUS exp
  1077. 48 | exp . MINUS exp
  1078. 49 | exp . MUL_OP exp
  1079. 50 | exp . DIV_OP exp
  1080. 51 | exp . LT exp
  1081. 52 | exp . GT exp
  1082. 53 | exp . EQ exp
  1083. 54 | exp . NOTEQ exp
  1084. 55 | exp . LTEQ exp
  1085. 56 | exp . GTEQ exp
  1086. 57 | exp . SHL_OP exp
  1087. 58 | exp . SHR_OP exp
  1088. 59 | exp . ANDAND exp
  1089. 60 | exp . OROR exp
  1090. PLUS shift, and go to state 68
  1091. MINUS shift, and go to state 69
  1092. MUL_OP shift, and go to state 70
  1093. DIV_OP shift, and go to state 71
  1094. AND_OP shift, and go to state 72
  1095. LT shift, and go to state 74
  1096. GT shift, and go to state 75
  1097. SHL_OP shift, and go to state 76
  1098. SHR_OP shift, and go to state 77
  1099. EQ shift, and go to state 78
  1100. NOTEQ shift, and go to state 79
  1101. LTEQ shift, and go to state 80
  1102. GTEQ shift, and go to state 81
  1103. $default reduce using rule 46 (exp)
  1104. state 101
  1105. 45 exp: exp . AND_OP exp
  1106. 46 | exp . OR_OP exp
  1107. 47 | exp . PLUS exp
  1108. 48 | exp . MINUS exp
  1109. 49 | exp . MUL_OP exp
  1110. 50 | exp . DIV_OP exp
  1111. 51 | exp . LT exp
  1112. 51 | exp LT exp .
  1113. 52 | exp . GT exp
  1114. 53 | exp . EQ exp
  1115. 54 | exp . NOTEQ exp
  1116. 55 | exp . LTEQ exp
  1117. 56 | exp . GTEQ exp
  1118. 57 | exp . SHL_OP exp
  1119. 58 | exp . SHR_OP exp
  1120. 59 | exp . ANDAND exp
  1121. 60 | exp . OROR exp
  1122. PLUS shift, and go to state 68
  1123. MINUS shift, and go to state 69
  1124. MUL_OP shift, and go to state 70
  1125. DIV_OP shift, and go to state 71
  1126. SHL_OP shift, and go to state 76
  1127. SHR_OP shift, and go to state 77
  1128. $default reduce using rule 51 (exp)
  1129. state 102
  1130. 45 exp: exp . AND_OP exp
  1131. 46 | exp . OR_OP exp
  1132. 47 | exp . PLUS exp
  1133. 48 | exp . MINUS exp
  1134. 49 | exp . MUL_OP exp
  1135. 50 | exp . DIV_OP exp
  1136. 51 | exp . LT exp
  1137. 52 | exp . GT exp
  1138. 52 | exp GT exp .
  1139. 53 | exp . EQ exp
  1140. 54 | exp . NOTEQ exp
  1141. 55 | exp . LTEQ exp
  1142. 56 | exp . GTEQ exp
  1143. 57 | exp . SHL_OP exp
  1144. 58 | exp . SHR_OP exp
  1145. 59 | exp . ANDAND exp
  1146. 60 | exp . OROR exp
  1147. PLUS shift, and go to state 68
  1148. MINUS shift, and go to state 69
  1149. MUL_OP shift, and go to state 70
  1150. DIV_OP shift, and go to state 71
  1151. SHL_OP shift, and go to state 76
  1152. SHR_OP shift, and go to state 77
  1153. $default reduce using rule 52 (exp)
  1154. state 103
  1155. 45 exp: exp . AND_OP exp
  1156. 46 | exp . OR_OP exp
  1157. 47 | exp . PLUS exp
  1158. 48 | exp . MINUS exp
  1159. 49 | exp . MUL_OP exp
  1160. 50 | exp . DIV_OP exp
  1161. 51 | exp . LT exp
  1162. 52 | exp . GT exp
  1163. 53 | exp . EQ exp
  1164. 54 | exp . NOTEQ exp
  1165. 55 | exp . LTEQ exp
  1166. 56 | exp . GTEQ exp
  1167. 57 | exp . SHL_OP exp
  1168. 57 | exp SHL_OP exp .
  1169. 58 | exp . SHR_OP exp
  1170. 59 | exp . ANDAND exp
  1171. 60 | exp . OROR exp
  1172. PLUS shift, and go to state 68
  1173. MINUS shift, and go to state 69
  1174. MUL_OP shift, and go to state 70
  1175. DIV_OP shift, and go to state 71
  1176. $default reduce using rule 57 (exp)
  1177. state 104
  1178. 45 exp: exp . AND_OP exp
  1179. 46 | exp . OR_OP exp
  1180. 47 | exp . PLUS exp
  1181. 48 | exp . MINUS exp
  1182. 49 | exp . MUL_OP exp
  1183. 50 | exp . DIV_OP exp
  1184. 51 | exp . LT exp
  1185. 52 | exp . GT exp
  1186. 53 | exp . EQ exp
  1187. 54 | exp . NOTEQ exp
  1188. 55 | exp . LTEQ exp
  1189. 56 | exp . GTEQ exp
  1190. 57 | exp . SHL_OP exp
  1191. 58 | exp . SHR_OP exp
  1192. 58 | exp SHR_OP exp .
  1193. 59 | exp . ANDAND exp
  1194. 60 | exp . OROR exp
  1195. PLUS shift, and go to state 68
  1196. MINUS shift, and go to state 69
  1197. MUL_OP shift, and go to state 70
  1198. DIV_OP shift, and go to state 71
  1199. $default reduce using rule 58 (exp)
  1200. state 105
  1201. 45 exp: exp . AND_OP exp
  1202. 46 | exp . OR_OP exp
  1203. 47 | exp . PLUS exp
  1204. 48 | exp . MINUS exp
  1205. 49 | exp . MUL_OP exp
  1206. 50 | exp . DIV_OP exp
  1207. 51 | exp . LT exp
  1208. 52 | exp . GT exp
  1209. 53 | exp . EQ exp
  1210. 53 | exp EQ exp .
  1211. 54 | exp . NOTEQ exp
  1212. 55 | exp . LTEQ exp
  1213. 56 | exp . GTEQ exp
  1214. 57 | exp . SHL_OP exp
  1215. 58 | exp . SHR_OP exp
  1216. 59 | exp . ANDAND exp
  1217. 60 | exp . OROR exp
  1218. PLUS shift, and go to state 68
  1219. MINUS shift, and go to state 69
  1220. MUL_OP shift, and go to state 70
  1221. DIV_OP shift, and go to state 71
  1222. LT shift, and go to state 74
  1223. GT shift, and go to state 75
  1224. SHL_OP shift, and go to state 76
  1225. SHR_OP shift, and go to state 77
  1226. LTEQ shift, and go to state 80
  1227. GTEQ shift, and go to state 81
  1228. $default reduce using rule 53 (exp)
  1229. state 106
  1230. 45 exp: exp . AND_OP exp
  1231. 46 | exp . OR_OP exp
  1232. 47 | exp . PLUS exp
  1233. 48 | exp . MINUS exp
  1234. 49 | exp . MUL_OP exp
  1235. 50 | exp . DIV_OP exp
  1236. 51 | exp . LT exp
  1237. 52 | exp . GT exp
  1238. 53 | exp . EQ exp
  1239. 54 | exp . NOTEQ exp
  1240. 54 | exp NOTEQ exp .
  1241. 55 | exp . LTEQ exp
  1242. 56 | exp . GTEQ exp
  1243. 57 | exp . SHL_OP exp
  1244. 58 | exp . SHR_OP exp
  1245. 59 | exp . ANDAND exp
  1246. 60 | exp . OROR exp
  1247. PLUS shift, and go to state 68
  1248. MINUS shift, and go to state 69
  1249. MUL_OP shift, and go to state 70
  1250. DIV_OP shift, and go to state 71
  1251. LT shift, and go to state 74
  1252. GT shift, and go to state 75
  1253. SHL_OP shift, and go to state 76
  1254. SHR_OP shift, and go to state 77
  1255. LTEQ shift, and go to state 80
  1256. GTEQ shift, and go to state 81
  1257. $default reduce using rule 54 (exp)
  1258. state 107
  1259. 45 exp: exp . AND_OP exp
  1260. 46 | exp . OR_OP exp
  1261. 47 | exp . PLUS exp
  1262. 48 | exp . MINUS exp
  1263. 49 | exp . MUL_OP exp
  1264. 50 | exp . DIV_OP exp
  1265. 51 | exp . LT exp
  1266. 52 | exp . GT exp
  1267. 53 | exp . EQ exp
  1268. 54 | exp . NOTEQ exp
  1269. 55 | exp . LTEQ exp
  1270. 55 | exp LTEQ exp .
  1271. 56 | exp . GTEQ exp
  1272. 57 | exp . SHL_OP exp
  1273. 58 | exp . SHR_OP exp
  1274. 59 | exp . ANDAND exp
  1275. 60 | exp . OROR exp
  1276. PLUS shift, and go to state 68
  1277. MINUS shift, and go to state 69
  1278. MUL_OP shift, and go to state 70
  1279. DIV_OP shift, and go to state 71
  1280. SHL_OP shift, and go to state 76
  1281. SHR_OP shift, and go to state 77
  1282. $default reduce using rule 55 (exp)
  1283. state 108
  1284. 45 exp: exp . AND_OP exp
  1285. 46 | exp . OR_OP exp
  1286. 47 | exp . PLUS exp
  1287. 48 | exp . MINUS exp
  1288. 49 | exp . MUL_OP exp
  1289. 50 | exp . DIV_OP exp
  1290. 51 | exp . LT exp
  1291. 52 | exp . GT exp
  1292. 53 | exp . EQ exp
  1293. 54 | exp . NOTEQ exp
  1294. 55 | exp . LTEQ exp
  1295. 56 | exp . GTEQ exp
  1296. 56 | exp GTEQ exp .
  1297. 57 | exp . SHL_OP exp
  1298. 58 | exp . SHR_OP exp
  1299. 59 | exp . ANDAND exp
  1300. 60 | exp . OROR exp
  1301. PLUS shift, and go to state 68
  1302. MINUS shift, and go to state 69
  1303. MUL_OP shift, and go to state 70
  1304. DIV_OP shift, and go to state 71
  1305. SHL_OP shift, and go to state 76
  1306. SHR_OP shift, and go to state 77
  1307. $default reduce using rule 56 (exp)
  1308. state 109
  1309. 45 exp: exp . AND_OP exp
  1310. 46 | exp . OR_OP exp
  1311. 47 | exp . PLUS exp
  1312. 48 | exp . MINUS exp
  1313. 49 | exp . MUL_OP exp
  1314. 50 | exp . DIV_OP exp
  1315. 51 | exp . LT exp
  1316. 52 | exp . GT exp
  1317. 53 | exp . EQ exp
  1318. 54 | exp . NOTEQ exp
  1319. 55 | exp . LTEQ exp
  1320. 56 | exp . GTEQ exp
  1321. 57 | exp . SHL_OP exp
  1322. 58 | exp . SHR_OP exp
  1323. 59 | exp . ANDAND exp
  1324. 59 | exp ANDAND exp .
  1325. 60 | exp . OROR exp
  1326. PLUS shift, and go to state 68
  1327. MINUS shift, and go to state 69
  1328. MUL_OP shift, and go to state 70
  1329. DIV_OP shift, and go to state 71
  1330. AND_OP shift, and go to state 72
  1331. OR_OP shift, and go to state 73
  1332. LT shift, and go to state 74
  1333. GT shift, and go to state 75
  1334. SHL_OP shift, and go to state 76
  1335. SHR_OP shift, and go to state 77
  1336. EQ shift, and go to state 78
  1337. NOTEQ shift, and go to state 79
  1338. LTEQ shift, and go to state 80
  1339. GTEQ shift, and go to state 81
  1340. $default reduce using rule 59 (exp)
  1341. state 110
  1342. 45 exp: exp . AND_OP exp
  1343. 46 | exp . OR_OP exp
  1344. 47 | exp . PLUS exp
  1345. 48 | exp . MINUS exp
  1346. 49 | exp . MUL_OP exp
  1347. 50 | exp . DIV_OP exp
  1348. 51 | exp . LT exp
  1349. 52 | exp . GT exp
  1350. 53 | exp . EQ exp
  1351. 54 | exp . NOTEQ exp
  1352. 55 | exp . LTEQ exp
  1353. 56 | exp . GTEQ exp
  1354. 57 | exp . SHL_OP exp
  1355. 58 | exp . SHR_OP exp
  1356. 59 | exp . ANDAND exp
  1357. 60 | exp . OROR exp
  1358. 60 | exp OROR exp .
  1359. PLUS shift, and go to state 68
  1360. MINUS shift, and go to state 69
  1361. MUL_OP shift, and go to state 70
  1362. DIV_OP shift, and go to state 71
  1363. AND_OP shift, and go to state 72
  1364. OR_OP shift, and go to state 73
  1365. LT shift, and go to state 74
  1366. GT shift, and go to state 75
  1367. SHL_OP shift, and go to state 76
  1368. SHR_OP shift, and go to state 77
  1369. EQ shift, and go to state 78
  1370. NOTEQ shift, and go to state 79
  1371. LTEQ shift, and go to state 80
  1372. GTEQ shift, and go to state 81
  1373. ANDAND shift, and go to state 82
  1374. $default reduce using rule 60 (exp)
  1375. state 111
  1376. 11 code_block: LBRACE statements RBRACE .
  1377. $default reduce using rule 11 (code_block)
  1378. state 112
  1379. 36 do_while_statement: DO @4 code_block WHILE LPAR . exp RPAR
  1380. LPAR shift, and go to state 43
  1381. MINUS shift, and go to state 44
  1382. NOT_OP shift, and go to state 45
  1383. IDENTIFIER shift, and go to state 46
  1384. NUMBER shift, and go to state 47
  1385. exp go to state 118
  1386. state 113
  1387. 34 while_statement: WHILE @2 LPAR exp RPAR . @3 code_block
  1388. $default reduce using rule 33 (@3)
  1389. @3 go to state 119
  1390. state 114
  1391. 39 if_stmt: IF @5 LPAR exp RPAR . @6 code_block
  1392. $default reduce using rule 38 (@6)
  1393. @6 go to state 120
  1394. state 115
  1395. 8 declaration: IDENTIFIER LSQUARE NUMBER RSQUARE .
  1396. $default reduce using rule 8 (declaration)
  1397. state 116
  1398. 24 assign_statement: IDENTIFIER LSQUARE exp RSQUARE ASSIGN . exp
  1399. LPAR shift, and go to state 43
  1400. MINUS shift, and go to state 44
  1401. NOT_OP shift, and go to state 45
  1402. IDENTIFIER shift, and go to state 46
  1403. NUMBER shift, and go to state 47
  1404. exp go to state 121
  1405. state 117
  1406. 42 exp: IDENTIFIER LSQUARE exp RSQUARE .
  1407. $default reduce using rule 42 (exp)
  1408. state 118
  1409. 36 do_while_statement: DO @4 code_block WHILE LPAR exp . RPAR
  1410. 45 exp: exp . AND_OP exp
  1411. 46 | exp . OR_OP exp
  1412. 47 | exp . PLUS exp
  1413. 48 | exp . MINUS exp
  1414. 49 | exp . MUL_OP exp
  1415. 50 | exp . DIV_OP exp
  1416. 51 | exp . LT exp
  1417. 52 | exp . GT exp
  1418. 53 | exp . EQ exp
  1419. 54 | exp . NOTEQ exp
  1420. 55 | exp . LTEQ exp
  1421. 56 | exp . GTEQ exp
  1422. 57 | exp . SHL_OP exp
  1423. 58 | exp . SHR_OP exp
  1424. 59 | exp . ANDAND exp
  1425. 60 | exp . OROR exp
  1426. RPAR shift, and go to state 122
  1427. PLUS shift, and go to state 68
  1428. MINUS shift, and go to state 69
  1429. MUL_OP shift, and go to state 70
  1430. DIV_OP shift, and go to state 71
  1431. AND_OP shift, and go to state 72
  1432. OR_OP shift, and go to state 73
  1433. LT shift, and go to state 74
  1434. GT shift, and go to state 75
  1435. SHL_OP shift, and go to state 76
  1436. SHR_OP shift, and go to state 77
  1437. EQ shift, and go to state 78
  1438. NOTEQ shift, and go to state 79
  1439. LTEQ shift, and go to state 80
  1440. GTEQ shift, and go to state 81
  1441. ANDAND shift, and go to state 82
  1442. OROR shift, and go to state 83
  1443. state 119
  1444. 34 while_statement: WHILE @2 LPAR exp RPAR @3 . code_block
  1445. LBRACE shift, and go to state 49
  1446. SEMI shift, and go to state 4
  1447. RETURN shift, and go to state 5
  1448. READ shift, and go to state 6
  1449. WRITE shift, and go to state 7
  1450. DO shift, and go to state 8
  1451. WHILE shift, and go to state 9
  1452. IF shift, and go to state 10
  1453. IDENTIFIER shift, and go to state 12
  1454. code_block go to state 123
  1455. statement go to state 51
  1456. control_statement go to state 16
  1457. read_write_statement go to state 17
  1458. assign_statement go to state 18
  1459. if_statement go to state 19
  1460. return_statement go to state 20
  1461. read_statement go to state 21
  1462. write_statement go to state 22
  1463. while_statement go to state 23
  1464. do_while_statement go to state 24
  1465. if_stmt go to state 25
  1466. state 120
  1467. 39 if_stmt: IF @5 LPAR exp RPAR @6 . code_block
  1468. LBRACE shift, and go to state 49
  1469. SEMI shift, and go to state 4
  1470. RETURN shift, and go to state 5
  1471. READ shift, and go to state 6
  1472. WRITE shift, and go to state 7
  1473. DO shift, and go to state 8
  1474. WHILE shift, and go to state 9
  1475. IF shift, and go to state 10
  1476. IDENTIFIER shift, and go to state 12
  1477. code_block go to state 124
  1478. statement go to state 51
  1479. control_statement go to state 16
  1480. read_write_statement go to state 17
  1481. assign_statement go to state 18
  1482. if_statement go to state 19
  1483. return_statement go to state 20
  1484. read_statement go to state 21
  1485. write_statement go to state 22
  1486. while_statement go to state 23
  1487. do_while_statement go to state 24
  1488. if_stmt go to state 25
  1489. state 121
  1490. 24 assign_statement: IDENTIFIER LSQUARE exp RSQUARE ASSIGN exp .
  1491. 45 exp: exp . AND_OP exp
  1492. 46 | exp . OR_OP exp
  1493. 47 | exp . PLUS exp
  1494. 48 | exp . MINUS exp
  1495. 49 | exp . MUL_OP exp
  1496. 50 | exp . DIV_OP exp
  1497. 51 | exp . LT exp
  1498. 52 | exp . GT exp
  1499. 53 | exp . EQ exp
  1500. 54 | exp . NOTEQ exp
  1501. 55 | exp . LTEQ exp
  1502. 56 | exp . GTEQ exp
  1503. 57 | exp . SHL_OP exp
  1504. 58 | exp . SHR_OP exp
  1505. 59 | exp . ANDAND exp
  1506. 60 | exp . OROR exp
  1507. PLUS shift, and go to state 68
  1508. MINUS shift, and go to state 69
  1509. MUL_OP shift, and go to state 70
  1510. DIV_OP shift, and go to state 71
  1511. AND_OP shift, and go to state 72
  1512. OR_OP shift, and go to state 73
  1513. LT shift, and go to state 74
  1514. GT shift, and go to state 75
  1515. SHL_OP shift, and go to state 76
  1516. SHR_OP shift, and go to state 77
  1517. EQ shift, and go to state 78
  1518. NOTEQ shift, and go to state 79
  1519. LTEQ shift, and go to state 80
  1520. GTEQ shift, and go to state 81
  1521. ANDAND shift, and go to state 82
  1522. OROR shift, and go to state 83
  1523. $default reduce using rule 24 (assign_statement)
  1524. state 122
  1525. 36 do_while_statement: DO @4 code_block WHILE LPAR exp RPAR .
  1526. $default reduce using rule 36 (do_while_statement)
  1527. state 123
  1528. 34 while_statement: WHILE @2 LPAR exp RPAR @3 code_block .
  1529. $default reduce using rule 34 (while_statement)
  1530. state 124
  1531. 39 if_stmt: IF @5 LPAR exp RPAR @6 code_block .
  1532. $default reduce using rule 39 (if_stmt)