Advertisement
Guest User

Untitled

a guest
May 29th, 2020
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.56 KB | None | 0 0
  1. ====================Source:====================
  2.  
  3. {}
  4.  
  5. {
  6.  
  7. my_thing = your_thing;
  8.  
  9. {}
  10.  
  11. {
  12. my_thing = your_thing;
  13. }
  14.  
  15. {
  16.  
  17. my_method(bob)
  18. {
  19. bob = boblin;
  20. };
  21. }
  22.  
  23. my_thing = your_thing;
  24.  
  25. }
  26.  
  27.  
  28. ====================Source no comments:====================
  29.  
  30. {}
  31.  
  32. {
  33.  
  34. my_thing = your_thing;
  35.  
  36. {}
  37.  
  38. {
  39. my_thing = your_thing;
  40. }
  41.  
  42. {
  43.  
  44. my_method(bob)
  45. {
  46. bob = boblin;
  47. };
  48. }
  49.  
  50. my_thing = your_thing;
  51.  
  52. }
  53.  
  54. ====================Tokens:====================
  55.  
  56. Line: Token: Token Rule:
  57. 00001 { $open_curly_brace
  58. 00001 } $close_curly_brace
  59. 00003 { $open_curly_brace
  60. 00005 my_thing $identifier
  61. 00005 = $assignment
  62. 00005 your_thing $identifier
  63. 00005 ; $end_of_line
  64. 00007 { $open_curly_brace
  65. 00007 } $close_curly_brace
  66. 00009 { $open_curly_brace
  67. 00010 my_thing $identifier
  68. 00010 = $assignment
  69. 00010 your_thing $identifier
  70. 00010 ; $end_of_line
  71. 00011 } $close_curly_brace
  72. 00013 { $open_curly_brace
  73. 00015 my_method $identifier
  74. 00015 ( $open_paren
  75. 00015 bob $identifier
  76. 00015 ) $close_paren
  77. 00016 { $open_curly_brace
  78. 00017 bob $identifier
  79. 00017 = $assignment
  80. 00017 boblin $identifier
  81. 00017 ; $end_of_line
  82. 00018 } $close_curly_brace
  83. 00018 ; $end_of_line
  84. 00019 } $close_curly_brace
  85. 00021 my_thing $identifier
  86. 00021 = $assignment
  87. 00021 your_thing $identifier
  88. 00021 ; $end_of_line
  89. 00023 } $close_curly_brace
  90.  
  91. ====================Concrete syntax tree:====================
  92.  
  93. root:
  94. |---->TMP root:
  95. | |---->TMP nests:
  96. | | |---->TMP nests:
  97. | | | |---->CST nest:
  98. | | | | |---->TMP boblin:
  99. | | | | | |---->TMP joblin:
  100. | | | | | | |---->CST nest:
  101. | | | | | | | |---->$open_curly_brace: {
  102. | | | | | | | |---->$close_curly_brace: }
  103. | | |---->TMP nests:
  104. | | | |---->CST nest:
  105. | | | | |---->TMP boblin:
  106. | | | | | |---->TMP joblin:
  107. | | | | | | |---->CST nest:
  108. | | | | | | | |---->$open_curly_brace: {
  109. | | | | | | | |---->TMP nestable:
  110. | | | | | | | | |---->TMP nestable:
  111. | | | | | | | | | |---->CST line:
  112. | | | | | | | | | | |---->TMP lineable:
  113. | | | | | | | | | | | |---->TMP lineable:
  114. | | | | | | | | | | | | |---->$identifier: my_thing
  115. | | | | | | | | | | | |---->TMP lineable:
  116. | | | | | | | | | | | | |---->TMP lineable:
  117. | | | | | | | | | | | | | |---->$assignment: =
  118. | | | | | | | | | | | | |---->TMP lineable:
  119. | | | | | | | | | | | | | |---->$identifier: your_thing
  120. | | | | | | | | | | |---->$end_of_line: ;
  121. | | | | | | | | |---->TMP nestable:
  122. | | | | | | | | | |---->TMP nestable:
  123. | | | | | | | | | | |---->CST nest:
  124. | | | | | | | | | | | |---->TMP boblin:
  125. | | | | | | | | | | | | |---->TMP joblin:
  126. | | | | | | | | | | | | | |---->CST nest:
  127. | | | | | | | | | | | | | | |---->$open_curly_brace: {
  128. | | | | | | | | | | | | | | |---->$close_curly_brace: }
  129. | | | | | | | | | |---->TMP nestable:
  130. | | | | | | | | | | |---->TMP nestable:
  131. | | | | | | | | | | | |---->CST nest:
  132. | | | | | | | | | | | | |---->TMP boblin:
  133. | | | | | | | | | | | | | |---->TMP joblin:
  134. | | | | | | | | | | | | | | |---->CST nest:
  135. | | | | | | | | | | | | | | | |---->$open_curly_brace: {
  136. | | | | | | | | | | | | | | | |---->TMP nestable:
  137. | | | | | | | | | | | | | | | | |---->CST line:
  138. | | | | | | | | | | | | | | | | | |---->TMP lineable:
  139. | | | | | | | | | | | | | | | | | | |---->TMP lineable:
  140. | | | | | | | | | | | | | | | | | | | |---->$identifier: my_thing
  141. | | | | | | | | | | | | | | | | | | |---->TMP lineable:
  142. | | | | | | | | | | | | | | | | | | | |---->TMP lineable:
  143. | | | | | | | | | | | | | | | | | | | | |---->$assignment: =
  144. | | | | | | | | | | | | | | | | | | | |---->TMP lineable:
  145. | | | | | | | | | | | | | | | | | | | | |---->$identifier: your_thing
  146. | | | | | | | | | | | | | | | | | |---->$end_of_line: ;
  147. | | | | | | | | | | | | | | | |---->$close_curly_brace: }
  148. | | | | | | | | | | |---->TMP nestable:
  149. | | | | | | | | | | | |---->TMP nestable:
  150. | | | | | | | | | | | | |---->CST nest:
  151. | | | | | | | | | | | | | |---->TMP boblin:
  152. | | | | | | | | | | | | | | |---->TMP joblin:
  153. | | | | | | | | | | | | | | | |---->CST nest:
  154. | | | | | | | | | | | | | | | | |---->$open_curly_brace: {
  155. | | | | | | | | | | | | | | | | |---->TMP nestable:
  156. | | | | | | | | | | | | | | | | | |---->CST line:
  157. | | | | | | | | | | | | | | | | | | |---->TMP lineable:
  158. | | | | | | | | | | | | | | | | | | | |---->TMP lineable:
  159. | | | | | | | | | | | | | | | | | | | | |---->$identifier: my_method
  160. | | | | | | | | | | | | | | | | | | | |---->TMP lineable:
  161. | | | | | | | | | | | | | | | | | | | | |---->TMP lineable:
  162. | | | | | | | | | | | | | | | | | | | | | |---->$open_paren: (
  163. | | | | | | | | | | | | | | | | | | | | |---->TMP lineable:
  164. | | | | | | | | | | | | | | | | | | | | | |---->TMP lineable:
  165. | | | | | | | | | | | | | | | | | | | | | | |---->$identifier: bob
  166. | | | | | | | | | | | | | | | | | | | | | |---->TMP lineable:
  167. | | | | | | | | | | | | | | | | | | | | | | |---->$close_paren: )
  168. | | | | | | | | | | | | | | | | | | |---->CST nest:
  169. | | | | | | | | | | | | | | | | | | | |---->TMP boblin:
  170. | | | | | | | | | | | | | | | | | | | | |---->TMP joblin:
  171. | | | | | | | | | | | | | | | | | | | | | |---->CST nest:
  172. | | | | | | | | | | | | | | | | | | | | | | |---->$open_curly_brace: {
  173. | | | | | | | | | | | | | | | | | | | | | | |---->TMP nestable:
  174. | | | | | | | | | | | | | | | | | | | | | | | |---->CST line:
  175. | | | | | | | | | | | | | | | | | | | | | | | | |---->TMP lineable:
  176. | | | | | | | | | | | | | | | | | | | | | | | | | |---->TMP lineable:
  177. | | | | | | | | | | | | | | | | | | | | | | | | | | |---->$identifier: bob
  178. | | | | | | | | | | | | | | | | | | | | | | | | | |---->TMP lineable:
  179. | | | | | | | | | | | | | | | | | | | | | | | | | | |---->TMP lineable:
  180. | | | | | | | | | | | | | | | | | | | | | | | | | | | |---->$assignment: =
  181. | | | | | | | | | | | | | | | | | | | | | | | | | | |---->TMP lineable:
  182. | | | | | | | | | | | | | | | | | | | | | | | | | | | |---->$identifier: boblin
  183. | | | | | | | | | | | | | | | | | | | | | | | | |---->$end_of_line: ;
  184. | | | | | | | | | | | | | | | | | | | | | | |---->$close_curly_brace: }
  185. | | | | | | | | | | | | | | | | | | |---->$end_of_line: ;
  186. | | | | | | | | | | | | | | | | |---->$close_curly_brace: }
  187. | | | | | | | | | | | |---->TMP nestable:
  188. | | | | | | | | | | | | |---->CST line:
  189. | | | | | | | | | | | | | |---->TMP lineable:
  190. | | | | | | | | | | | | | | |---->TMP lineable:
  191. | | | | | | | | | | | | | | | |---->$identifier: my_thing
  192. | | | | | | | | | | | | | | |---->TMP lineable:
  193. | | | | | | | | | | | | | | | |---->TMP lineable:
  194. | | | | | | | | | | | | | | | | |---->$assignment: =
  195. | | | | | | | | | | | | | | | |---->TMP lineable:
  196. | | | | | | | | | | | | | | | | |---->$identifier: your_thing
  197. | | | | | | | | | | | | | |---->$end_of_line: ;
  198. | | | | | | | |---->$close_curly_brace: }
  199.  
  200.  
  201. ====================Abstract syntax tree:====================
  202.  
  203. root:
  204. |---->CST nest:
  205. | |---->CST nest:
  206. | | |---->$open_curly_brace: {
  207. | | |---->$close_curly_brace: }
  208. |---->CST nest:
  209. | |---->CST nest:
  210. | | |---->$open_curly_brace: {
  211. | | |---->CST line:
  212. | | | |---->$identifier: my_thing
  213. | | | |---->$assignment: =
  214. | | | |---->$identifier: your_thing
  215. | | | |---->$end_of_line: ;
  216. | | |---->CST nest:
  217. | | | |---->CST nest:
  218. | | | | |---->$open_curly_brace: {
  219. | | | | |---->$close_curly_brace: }
  220. | | |---->CST nest:
  221. | | | |---->CST nest:
  222. | | | | |---->$open_curly_brace: {
  223. | | | | |---->CST line:
  224. | | | | | |---->$identifier: my_thing
  225. | | | | | |---->$assignment: =
  226. | | | | | |---->$identifier: your_thing
  227. | | | | | |---->$end_of_line: ;
  228. | | | | |---->$close_curly_brace: }
  229. | | |---->CST nest:
  230. | | | |---->CST nest:
  231. | | | | |---->$open_curly_brace: {
  232. | | | | |---->CST line:
  233. | | | | | |---->$identifier: my_method
  234. | | | | | |---->$open_paren: (
  235. | | | | | |---->$identifier: bob
  236. | | | | | |---->$close_paren: )
  237. | | | | | |---->CST nest:
  238. | | | | | | |---->CST nest:
  239. | | | | | | | |---->$open_curly_brace: {
  240. | | | | | | | |---->CST line:
  241. | | | | | | | | |---->$identifier: bob
  242. | | | | | | | | |---->$assignment: =
  243. | | | | | | | | |---->$identifier: boblin
  244. | | | | | | | | |---->$end_of_line: ;
  245. | | | | | | | |---->$close_curly_brace: }
  246. | | | | | |---->$end_of_line: ;
  247. | | | | |---->$close_curly_brace: }
  248. | | |---->CST line:
  249. | | | |---->$identifier: my_thing
  250. | | | |---->$assignment: =
  251. | | | |---->$identifier: your_thing
  252. | | | |---->$end_of_line: ;
  253. | | |---->$close_curly_brace: }
  254.  
  255.  
  256. ====================Reconstructed Source:====================
  257.  
  258. { } { my_thing = your_thing ; { } { my_thing = your_thing ; } { my_method ( bob ) { bob = boblin ; } ; } my_thing = your_thing ; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement