Advertisement
Guest User

Untitled

a guest
Mar 30th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.62 KB | None | 0 0
  1. %baseclass-preinclude <iostream>
  2. %lsp-needed
  3.  
  4.  
  5.  
  6. %token NUMBER;
  7.  
  8. %token KETTOSPONT;
  9. %token COMMENT;
  10. %token DOT;
  11. %token COMMA;
  12.  
  13. %left LESS;
  14. %left MORE;
  15. %left EQUAL;
  16. %left OR;
  17. %left AND;
  18. %left DIVIDE;
  19. %left MOD;
  20.  
  21. %token NOT;
  22. %token KEYWORD;
  23. %token I_TYPE;
  24. %token B_TYPE;
  25. %token B_TYPE;
  26. %token VARIABLE;
  27.  
  28. %token DATA;
  29. %token TYPE;
  30. %token PROGRAM;
  31. %token ADD;
  32.  
  33. %token MOVE;
  34. %token READ;
  35. %token WRITE;
  36.  
  37. %token TO;
  38.  
  39.  
  40. %token WHILE;
  41. %token ENDWHILE;
  42.  
  43. %token IF;
  44. %token ENDIF;
  45.  
  46. %token TRUE;
  47. %token FALSE;
  48. %token MORE;
  49.  
  50. %token SUBTRACT;
  51. %token MULTIPLY;
  52. %token FROM;
  53. %token BY;
  54.  
  55.  
  56. %%
  57.  
  58. start:
  59. INT MAIN NYITOZAROJEL CSUKOZAROJEL NYITOKAPOCS deklaraciok utasitasok ZAROKAPOCS
  60. {
  61. std::cout<<"S-> INT MAIN NYITOZAROJEL CSUKOZAROJEL NYITOKAPOCS deklaraciok utasitasok ZAROKAPOCS"<<std::endl;
  62. }
  63. ;
  64.  
  65. deklaraciok:
  66. // epszilon
  67. {
  68. std::cout<<"deklaraciok->epszilon"<<std::endl;
  69. }
  70. |
  71. deklaracio deklaraciok
  72. {
  73. std::cout<<"deklaraciok->deklaracio deklaraciok"<<std::endl;
  74. }
  75. ;
  76.  
  77. deklaracio:
  78. UNSIGNED AZONOSITO PONTOSVESSZO
  79. {
  80. std::cout<<"deklaracio -> UNSIGNED AZONOSITO PONTOSVESSZO"<<std::endl;
  81. }
  82. |
  83. BOOL AZONOSITO PONTOSVESSZO
  84. {
  85. std::cout<<"deklaracio -> BOOL AZONOSITO PONTOSVESSZO "<<std::endl;
  86. }
  87. ;
  88.  
  89. utasitasok:
  90. utasitas
  91. {
  92. std::cout<<"utasitasok->utasitas "<<std::endl;
  93. }
  94. |
  95. utasitas utasitasok
  96. {
  97. std::cout<<"utasitasok->utasitas utasitasok"<<std::endl;
  98. }
  99. ;
  100.  
  101. utasitas:
  102. CIN BEOLVASAS kifejezes PONTOSVESSZO
  103. {
  104. std::cout<<"utasitas ->CIN BEOLVASAS kifejezes PONTOSVESSZO"<<std::endl;
  105. }
  106. |
  107. AZONOSITO ERTEKADAS kifejezes PONTOSVESSZO
  108. {
  109. std::cout<<"utasitas ->AZONOSITO ERTEKADAS kifejezes PONTOSVESSZO"<<std::endl;
  110. }
  111. |
  112. COUT KIIRAS kifejezes PONTOSVESSZO
  113. {
  114. std::cout<<"utasitas ->COUT KIIRAS kifejezes PONTOSVESSZO"<<std::endl;
  115. }
  116. |
  117. elagazas
  118. {
  119. std::cout<<"utasitas ->elagazas"<<std::endl;
  120. }
  121. |
  122. ciklus
  123. {
  124. std::cout<<"utasitas ->ciklus"<<std::endl;
  125. }
  126.  
  127. ;
  128.  
  129. ciklus:
  130. while_cikl
  131. {
  132. std::cout<<"ciklus->while_cikl"<<std::endl;
  133. }
  134. ;
  135.  
  136. while_cikl:
  137. WHILE NYITOZAROJEL kifejezes CSUKOZAROJEL NYITOKAPOCS utasitasok ZAROKAPOCS
  138. {
  139. std::cout<<"while_cikl->WHILE NYITOZAROJEL kifejezes CSUKOZAROJEL NYITOKAPOCS utasitasok ZAROKAPOCS"<<std::endl;
  140. }
  141. ;
  142.  
  143. elagazas:
  144. IF NYITOZAROJEL kifejezes CSUKOZAROJEL NYITOKAPOCS utasitasok ZAROKAPOCS
  145. {
  146. std::cout<<"elagazas->IF NYITOZAROJEL kifejezes CSUKOZAROJEL NYITOKAPOCS utasitasok ZAROKAPOCS"<<std::endl;
  147. }
  148. |
  149. IF NYITOZAROJEL kifejezes CSUKOZAROJEL NYITOKAPOCS utasitasok ZAROKAPOCS ELSE NYITOKAPOCS utasitasok ZAROKAPOCS
  150. {
  151. std::cout<<"elagazas->IF NYITOZAROJEL kifejezes CSUKOZAROJEL NYITOKAPOCS utasitasok ZAROKAPOCS ELSE NYITOKAPOCS utasitasok ZAROKAPOCS"<<std::endl;
  152. }
  153. ;
  154.  
  155. kifejezes:
  156. SZAM
  157. {
  158. std::cout<<"kifejezes->SZAM"<<std::endl;
  159. }
  160. |
  161. TRUE
  162. {
  163. std::cout<<"kifejezes->TRUE"<<std::endl;
  164. }
  165. |
  166. FALSE
  167. {
  168. std::cout<<"kifejezes->FALSE"<<std::endl;
  169. }
  170. |
  171. AZONOSITO
  172. {
  173. std::cout<<"kifejezes->AZONOSITO"<<std::endl;
  174. }
  175. |
  176. kifejezes PLUS kifejezes
  177. {
  178. std::cout<<"kifejezes->kifejezes PLUS kifejezes"<<std::endl;
  179. }
  180. |
  181. kifejezes MINUS kifejezes
  182. {
  183. std::cout<<"kifejezes->kifejezes MINUS kifejezes"<<std::endl;
  184. }
  185. |
  186. kifejezes SZORZAS kifejezes
  187. {
  188. std::cout<<"kifejezes->kifejezes SZORZAS kifejezes"<<std::endl;
  189. }
  190. |
  191. kifejezes OSZTAS kifejezes
  192. {
  193. std::cout<<"kifejezes->kifejezes OSZTAS kifejezes"<<std::endl;
  194. }
  195. |
  196. kifejezes MARADEKKEPZES kifejezes
  197. {
  198. std::cout<<"kifejezes->kifejezes MARADEKKEPZES kifejezes"<<std::endl;
  199. }
  200. |
  201. kifejezes EGYENLOSEG kifejezes
  202. {
  203. std::cout<<"kifejezes->kifejezes EGYENLOSEG kifejezes"<<std::endl;
  204. }
  205. |
  206. kifejezes KISEBB kifejezes
  207. {
  208. std::cout<<"kifejezes->kifejezes KISEBB kifejezes"<<std::endl;
  209. }
  210. |
  211. kifejezes NAGYOBB kifejezes
  212. {
  213. std::cout<<"kifejezes->kifejezes NAGYOBB kifejezes"<<std::endl;
  214. }
  215. |
  216. kifejezes KONJUNKCIO kifejezes
  217. {
  218. std::cout<<"kifejezes->kifejezes KONJUNKCIO kifejezes"<<std::endl;
  219. }
  220. |
  221. kifejezes DISZJUNKCIO kifejezes
  222. {
  223. std::cout<<"kifejezes->kifejezes DISZJUNKCIO kifejezes"<<std::endl;
  224. }
  225. |
  226. NEGACIO kifejezes
  227. {
  228. std::cout<<"kifejezes->NEGACIO kifejezes"<<std::endl;
  229. }
  230. |
  231. kifejezes NAGYOBBEGYENLO kifejezes
  232. {
  233. std::cout<<"kifejezes->kifejezes NAGYOBBEGYENLO kifejezes"<<std::endl;
  234. }
  235. |
  236. kifejezes KISEBBEGYENLO kifejezes
  237. {
  238. std::cout<<"kifejezes->kifejezes KISEBBEGYENLO kifejezes"<<std::endl;
  239. }
  240. |
  241. NYITOZAROJEL kifejezes CSUKOZAROJEL
  242. {
  243. std::cout<<"kifejezes->NYITOZAROJEL kifejezes CSUKO"<<std::endl;
  244. }
  245. |
  246. NYITOKAPOCS kifejezes ZAROKAPOCS
  247. {
  248. std::cout<<"kifejezes->NYITOKAPOCS kifejezes ZAROKAPOCS"<<std::endl;
  249. }
  250. ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement