Advertisement
Guest User

parser output

a guest
May 29th, 2020
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.95 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. | | | | |---->$open_curly_brace: {
  99. | | | | |---->$close_curly_brace: }
  100. | | |---->TMP nests:
  101. | | | |---->CST nest:
  102. | | | | |---->$open_curly_brace: {
  103. | | | | |---->TMP nestable:
  104. | | | | | |---->TMP nestable:
  105. | | | | | | |---->CST line:
  106. | | | | | | | |---->TMP lineable:
  107. | | | | | | | | |---->TMP lineable:
  108. | | | | | | | | | |---->$identifier: my_thing
  109. | | | | | | | | |---->TMP lineable:
  110. | | | | | | | | | |---->TMP lineable:
  111. | | | | | | | | | | |---->$assignment: =
  112. | | | | | | | | | |---->TMP lineable:
  113. | | | | | | | | | | |---->$identifier: your_thing
  114. | | | | | | | |---->$end_of_line: ;
  115. | | | | | |---->TMP nestable:
  116. | | | | | | |---->TMP nestable:
  117. | | | | | | | |---->CST nest:
  118. | | | | | | | | |---->$open_curly_brace: {
  119. | | | | | | | | |---->$close_curly_brace: }
  120. | | | | | | |---->TMP nestable:
  121. | | | | | | | |---->TMP nestable:
  122. | | | | | | | | |---->CST nest:
  123. | | | | | | | | | |---->$open_curly_brace: {
  124. | | | | | | | | | |---->TMP nestable:
  125. | | | | | | | | | | |---->CST line:
  126. | | | | | | | | | | | |---->TMP lineable:
  127. | | | | | | | | | | | | |---->TMP lineable:
  128. | | | | | | | | | | | | | |---->$identifier: my_thing
  129. | | | | | | | | | | | | |---->TMP lineable:
  130. | | | | | | | | | | | | | |---->TMP lineable:
  131. | | | | | | | | | | | | | | |---->$assignment: =
  132. | | | | | | | | | | | | | |---->TMP lineable:
  133. | | | | | | | | | | | | | | |---->$identifier: your_thing
  134. | | | | | | | | | | | |---->$end_of_line: ;
  135. | | | | | | | | | |---->$close_curly_brace: }
  136. | | | | | | | |---->TMP nestable:
  137. | | | | | | | | |---->TMP nestable:
  138. | | | | | | | | | |---->CST nest:
  139. | | | | | | | | | | |---->$open_curly_brace: {
  140. | | | | | | | | | | |---->TMP nestable:
  141. | | | | | | | | | | | |---->CST line:
  142. | | | | | | | | | | | | |---->TMP lineable:
  143. | | | | | | | | | | | | | |---->TMP lineable:
  144. | | | | | | | | | | | | | | |---->$identifier: my_method
  145. | | | | | | | | | | | | | |---->TMP lineable:
  146. | | | | | | | | | | | | | | |---->TMP lineable:
  147. | | | | | | | | | | | | | | | |---->$open_paren: (
  148. | | | | | | | | | | | | | | |---->TMP lineable:
  149. | | | | | | | | | | | | | | | |---->TMP lineable:
  150. | | | | | | | | | | | | | | | | |---->$identifier: bob
  151. | | | | | | | | | | | | | | | |---->TMP lineable:
  152. | | | | | | | | | | | | | | | | |---->$close_paren: )
  153. | | | | | | | | | | | | |---->CST nest:
  154. | | | | | | | | | | | | | |---->$open_curly_brace: {
  155. | | | | | | | | | | | | | |---->TMP nestable:
  156. | | | | | | | | | | | | | | |---->CST line:
  157. | | | | | | | | | | | | | | | |---->TMP lineable:
  158. | | | | | | | | | | | | | | | | |---->TMP lineable:
  159. | | | | | | | | | | | | | | | | | |---->$identifier: bob
  160. | | | | | | | | | | | | | | | | |---->TMP lineable:
  161. | | | | | | | | | | | | | | | | | |---->TMP lineable:
  162. | | | | | | | | | | | | | | | | | | |---->$assignment: =
  163. | | | | | | | | | | | | | | | | | |---->TMP lineable:
  164. | | | | | | | | | | | | | | | | | | |---->$identifier: boblin
  165. | | | | | | | | | | | | | | | |---->$end_of_line: ;
  166. | | | | | | | | | | | | | |---->$close_curly_brace: }
  167. | | | | | | | | | | | | |---->$end_of_line: ;
  168. | | | | | | | | | | |---->$close_curly_brace: }
  169. | | | | | | | | |---->TMP nestable:
  170. | | | | | | | | | |---->CST line:
  171. | | | | | | | | | | |---->TMP lineable:
  172. | | | | | | | | | | | |---->TMP lineable:
  173. | | | | | | | | | | | | |---->$identifier: my_thing
  174. | | | | | | | | | | | |---->TMP lineable:
  175. | | | | | | | | | | | | |---->TMP lineable:
  176. | | | | | | | | | | | | | |---->$assignment: =
  177. | | | | | | | | | | | | |---->TMP lineable:
  178. | | | | | | | | | | | | | |---->$identifier: your_thing
  179. | | | | | | | | | | |---->$end_of_line: ;
  180. | | | | |---->$close_curly_brace: }
  181.  
  182.  
  183. ====================Abstract syntax tree:====================
  184.  
  185. root:
  186. |---->CST nest:
  187. | |---->$open_curly_brace: {
  188. | |---->$close_curly_brace: }
  189. |---->CST nest:
  190. | |---->$open_curly_brace: {
  191. | |---->CST line:
  192. | | |---->$identifier: my_thing
  193. | | |---->$assignment: =
  194. | | |---->$identifier: your_thing
  195. | | |---->$end_of_line: ;
  196. | |---->CST nest:
  197. | | |---->$open_curly_brace: {
  198. | | |---->$close_curly_brace: }
  199. | |---->CST nest:
  200. | | |---->$open_curly_brace: {
  201. | | |---->CST line:
  202. | | | |---->$identifier: my_thing
  203. | | | |---->$assignment: =
  204. | | | |---->$identifier: your_thing
  205. | | | |---->$end_of_line: ;
  206. | | |---->$close_curly_brace: }
  207. | |---->CST nest:
  208. | | |---->$open_curly_brace: {
  209. | | |---->CST line:
  210. | | | |---->$identifier: my_method
  211. | | | |---->$open_paren: (
  212. | | | |---->$identifier: bob
  213. | | | |---->$close_paren: )
  214. | | | |---->CST nest:
  215. | | | | |---->$open_curly_brace: {
  216. | | | | |---->CST line:
  217. | | | | | |---->$identifier: bob
  218. | | | | | |---->$assignment: =
  219. | | | | | |---->$identifier: boblin
  220. | | | | | |---->$end_of_line: ;
  221. | | | | |---->$close_curly_brace: }
  222. | | | |---->$end_of_line: ;
  223. | | |---->$close_curly_brace: }
  224. | |---->CST line:
  225. | | |---->$identifier: my_thing
  226. | | |---->$assignment: =
  227. | | |---->$identifier: your_thing
  228. | | |---->$end_of_line: ;
  229. | |---->$close_curly_brace: }
  230.  
  231.  
  232. ====================Reconstructed Source:====================
  233.  
  234. { } { 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