1
0

Parser.js 108 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655
  1. smalltalk.addClass('PPParser', smalltalk.Object, ['memo'], 'Parser');
  2. smalltalk.addMethod(
  3. '_initialize',
  4. smalltalk.method({
  5. selector: 'initialize',
  6. category: 'initialization',
  7. fn: function (){
  8. var self=this;
  9. self['@memo']=smalltalk.send(smalltalk.Dictionary, "_new", []);
  10. return self;},
  11. source: unescape('initialize%0A%09memo%20%3A%3D%20Dictionary%20new'),
  12. messageSends: ["new"],
  13. referencedClasses: [smalltalk.Dictionary]
  14. }),
  15. smalltalk.PPParser);
  16. smalltalk.addMethod(
  17. '_memo',
  18. smalltalk.method({
  19. selector: 'memo',
  20. category: 'accessing',
  21. fn: function (){
  22. var self=this;
  23. return self['@memo'];
  24. return self;},
  25. source: unescape('memo%0A%09%5Ememo'),
  26. messageSends: [],
  27. referencedClasses: []
  28. }),
  29. smalltalk.PPParser);
  30. smalltalk.addMethod(
  31. '_flatten',
  32. smalltalk.method({
  33. selector: 'flatten',
  34. category: 'operations',
  35. fn: function (){
  36. var self=this;
  37. return smalltalk.send(smalltalk.PPFlattenParser, "_on_", [self]);
  38. return self;},
  39. source: unescape('flatten%0A%09%5EPPFlattenParser%20on%3A%20self'),
  40. messageSends: ["on:"],
  41. referencedClasses: [smalltalk.nil]
  42. }),
  43. smalltalk.PPParser);
  44. smalltalk.addMethod(
  45. '_withSource',
  46. smalltalk.method({
  47. selector: 'withSource',
  48. category: 'operations',
  49. fn: function (){
  50. var self=this;
  51. return smalltalk.send(smalltalk.PPSourceParser, "_on_", [self]);
  52. return self;},
  53. source: unescape('withSource%0A%09%5EPPSourceParser%20on%3A%20self'),
  54. messageSends: ["on:"],
  55. referencedClasses: [smalltalk.nil]
  56. }),
  57. smalltalk.PPParser);
  58. smalltalk.addMethod(
  59. '__eq_eq_gt',
  60. smalltalk.method({
  61. selector: '==>',
  62. category: 'operations',
  63. fn: function (aBlock){
  64. var self=this;
  65. return smalltalk.send(smalltalk.PPActionParser, "_on_block_", [self, aBlock]);
  66. return self;},
  67. source: unescape('%3D%3D%3E%20aBlock%0A%09%5EPPActionParser%20on%3A%20self%20block%3A%20aBlock'),
  68. messageSends: ["on:block:"],
  69. referencedClasses: [smalltalk.nil]
  70. }),
  71. smalltalk.PPParser);
  72. smalltalk.addMethod(
  73. '__comma',
  74. smalltalk.method({
  75. selector: ',',
  76. category: 'operations',
  77. fn: function (aParser){
  78. var self=this;
  79. return smalltalk.send(smalltalk.PPSequenceParser, "_with_with_", [self, aParser]);
  80. return self;},
  81. source: unescape('%2C%20aParser%0A%09%5EPPSequenceParser%20with%3A%20self%20with%3A%20aParser'),
  82. messageSends: ["with:with:"],
  83. referencedClasses: [smalltalk.nil]
  84. }),
  85. smalltalk.PPParser);
  86. smalltalk.addMethod(
  87. '__slash',
  88. smalltalk.method({
  89. selector: '/',
  90. category: 'operations',
  91. fn: function (aParser){
  92. var self=this;
  93. return smalltalk.send(smalltalk.PPChoiceParser, "_with_with_", [self, aParser]);
  94. return self;},
  95. source: unescape('/%20aParser%0A%09%5EPPChoiceParser%20with%3A%20self%20with%3A%20aParser'),
  96. messageSends: ["with:with:"],
  97. referencedClasses: [smalltalk.nil]
  98. }),
  99. smalltalk.PPParser);
  100. smalltalk.addMethod(
  101. '_plus',
  102. smalltalk.method({
  103. selector: 'plus',
  104. category: 'operations',
  105. fn: function (){
  106. var self=this;
  107. return smalltalk.send(smalltalk.PPRepeatingParser, "_on_min_", [self, (1)]);
  108. return self;},
  109. source: unescape('plus%0A%09%5EPPRepeatingParser%20on%3A%20self%20min%3A%201'),
  110. messageSends: ["on:min:"],
  111. referencedClasses: [smalltalk.nil]
  112. }),
  113. smalltalk.PPParser);
  114. smalltalk.addMethod(
  115. '_star',
  116. smalltalk.method({
  117. selector: 'star',
  118. category: 'operations',
  119. fn: function (){
  120. var self=this;
  121. return smalltalk.send(smalltalk.PPRepeatingParser, "_on_min_", [self, (0)]);
  122. return self;},
  123. source: unescape('star%0A%09%5EPPRepeatingParser%20on%3A%20self%20min%3A%200'),
  124. messageSends: ["on:min:"],
  125. referencedClasses: [smalltalk.nil]
  126. }),
  127. smalltalk.PPParser);
  128. smalltalk.addMethod(
  129. '_not',
  130. smalltalk.method({
  131. selector: 'not',
  132. category: 'operations',
  133. fn: function (){
  134. var self=this;
  135. return smalltalk.send(smalltalk.PPNotParser, "_on_", [self]);
  136. return self;},
  137. source: unescape('not%0A%09%5EPPNotParser%20on%3A%20self'),
  138. messageSends: ["on:"],
  139. referencedClasses: [smalltalk.nil]
  140. }),
  141. smalltalk.PPParser);
  142. smalltalk.addMethod(
  143. '_optional',
  144. smalltalk.method({
  145. selector: 'optional',
  146. category: 'operations',
  147. fn: function (){
  148. var self=this;
  149. return smalltalk.send(self, "__slash", [smalltalk.send(smalltalk.PPEpsilonParser, "_new", [])]);
  150. return self;},
  151. source: unescape('optional%0A%09%5Eself%20/%20PPEpsilonParser%20new'),
  152. messageSends: [unescape("/"), "new"],
  153. referencedClasses: [smalltalk.nil]
  154. }),
  155. smalltalk.PPParser);
  156. smalltalk.addMethod(
  157. '_memoizedParse_',
  158. smalltalk.method({
  159. selector: 'memoizedParse:',
  160. category: 'operations',
  161. fn: function (aStream){
  162. var self=this;
  163. var start=nil;
  164. var end=nil;
  165. var node=nil;
  166. start=smalltalk.send(aStream, "_position", []);
  167. return smalltalk.send(smalltalk.send(self, "_memo", []), "_at_ifPresent_ifAbsent_", [start, (function(value){smalltalk.send(aStream, "_position_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_memo", []), "_at_", [start]), "_second", [])]);return smalltalk.send(value, "_first", []);}), (function(){node=smalltalk.send(self, "_parse_", [aStream]);end=smalltalk.send(aStream, "_position", []);smalltalk.send(smalltalk.send(self, "_memo", []), "_at_put_", [start, smalltalk.send(smalltalk.Array, "_with_with_", [node, end])]);return node;})]);
  168. return self;},
  169. source: unescape('memoizedParse%3A%20aStream%0A%09%7C%20start%20end%20node%20%7C%0A%09start%20%3A%3D%20aStream%20position.%0A%09%5Eself%20memo%20at%3A%20start%20%0A%09%20%20%20%20ifPresent%3A%20%5B%3Avalue%20%7C%0A%09%09aStream%20position%3A%20%28self%20memo%20at%3A%20start%29%20second.%0A%09%09value%20first%5D%0A%09%20%20%20%20ifAbsent%3A%20%5B%0A%09%09node%20%3A%3D%20self%20parse%3A%20aStream.%0A%09%09end%20%3A%3D%20aStream%20position.%0A%09%09self%20memo%20at%3A%20start%20put%3A%20%28Array%20with%3A%20node%20with%3A%20end%29.%0A%09%09node%5D'),
  170. messageSends: ["position", "at:ifPresent:ifAbsent:", "memo", "position:", "second", "at:", "first", "parse:", "at:put:", "with:with:"],
  171. referencedClasses: [smalltalk.Array]
  172. }),
  173. smalltalk.PPParser);
  174. smalltalk.addMethod(
  175. '_parse_',
  176. smalltalk.method({
  177. selector: 'parse:',
  178. category: 'parsing',
  179. fn: function (aStream){
  180. var self=this;
  181. smalltalk.send(self, "_subclassResponsibility", []);
  182. return self;},
  183. source: unescape('parse%3A%20aStream%0A%09self%20subclassResponsibility'),
  184. messageSends: ["subclassResponsibility"],
  185. referencedClasses: []
  186. }),
  187. smalltalk.PPParser);
  188. smalltalk.addMethod(
  189. '_parseAll_',
  190. smalltalk.method({
  191. selector: 'parseAll:',
  192. category: 'parsing',
  193. fn: function (aStream){
  194. var self=this;
  195. var result=nil;
  196. result=smalltalk.send(smalltalk.send(smalltalk.PPSequenceParser, "_with_with_", [self, smalltalk.send(smalltalk.PPEOFParser, "_new", [])]), "_memoizedParse_", [aStream]);
  197. return smalltalk.send(smalltalk.send(result, "_isParseFailure", []), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(self, "_error_", [smalltalk.send(result, "_messageFor_", [smalltalk.send(aStream, "_contents", [])])]);}), (function(){return smalltalk.send(result, "_first", []);})]);
  198. return self;},
  199. source: unescape('parseAll%3A%20aStream%0A%09%7C%20result%20%7C%0A%09result%20%3A%3D%20%28PPSequenceParser%20with%3A%20self%20with%3A%20PPEOFParser%20new%29%20memoizedParse%3A%20aStream.%0A%09%5Eresult%20isParseFailure%20%0A%09%20%20%20%20ifTrue%3A%20%5Bself%20error%3A%20%28result%20messageFor%3A%20aStream%20contents%29%5D%0A%09%20%20%20%20ifFalse%3A%20%5Bresult%20first%5D'),
  200. messageSends: ["memoizedParse:", "with:with:", "new", "ifTrue:ifFalse:", "isParseFailure", "error:", "messageFor:", "contents", "first"],
  201. referencedClasses: [smalltalk.nil,smalltalk.nil]
  202. }),
  203. smalltalk.PPParser);
  204. smalltalk.addClass('PPEOFParser', smalltalk.PPParser, [], 'Parser');
  205. smalltalk.addMethod(
  206. '_parse_',
  207. smalltalk.method({
  208. selector: 'parse:',
  209. category: 'parsing',
  210. fn: function (aStream){
  211. var self=this;
  212. return smalltalk.send(smalltalk.send(aStream, "_atEnd", []), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.PPFailure, "_new", []), "_reason_at_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aStream, "_contents", []), "__comma", [smalltalk.send(smalltalk.String, "_lf", [])]), "__comma", [unescape("---------------")]), "__comma", [smalltalk.send(smalltalk.String, "_lf", [])]), "__comma", ["EOF expected"]), smalltalk.send(aStream, "_position", [])]);}), (function(){return nil;})]);
  213. return self;},
  214. source: unescape('parse%3A%20aStream%0A%09%5EaStream%20atEnd%20%0A%09%20%20%20%20ifFalse%3A%20%5B%0A%09%09PPFailure%20new%20reason%3A%20aStream%20contents%2C%20String%20lf%2C%20%27---------------%27%2C%20String%20lf%2C%20%27EOF%20expected%27%20at%3A%20aStream%20position%5D%0A%09%20%20%20%20ifTrue%3A%20%5Bnil%5D'),
  215. messageSends: ["ifFalse:ifTrue:", "atEnd", "reason:at:", "new", unescape("%2C"), "contents", "lf", "position"],
  216. referencedClasses: [smalltalk.nil,smalltalk.String]
  217. }),
  218. smalltalk.PPEOFParser);
  219. smalltalk.addClass('PPAnyParser', smalltalk.PPParser, [], 'Parser');
  220. smalltalk.addMethod(
  221. '_parse_',
  222. smalltalk.method({
  223. selector: 'parse:',
  224. category: 'parsing',
  225. fn: function (aStream){
  226. var self=this;
  227. return smalltalk.send(smalltalk.send(aStream, "_atEnd", []), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.PPFailure, "_new", []), "_reason_at_", ["did not expect EOF", smalltalk.send(aStream, "_position", [])]);}), (function(){return smalltalk.send(aStream, "_next", []);})]);
  228. return self;},
  229. source: unescape('parse%3A%20aStream%0A%09%5EaStream%20atEnd%0A%09%20%20%20%20ifTrue%3A%20%5BPPFailure%20new%0A%09%09%09%20reason%3A%20%27did%20not%20expect%20EOF%27%20at%3A%20aStream%20position%5D%0A%09%20%20%20%20ifFalse%3A%20%5BaStream%20next%5D'),
  230. messageSends: ["ifTrue:ifFalse:", "atEnd", "reason:at:", "new", "position", "next"],
  231. referencedClasses: [smalltalk.nil]
  232. }),
  233. smalltalk.PPAnyParser);
  234. smalltalk.addClass('PPEpsilonParser', smalltalk.PPParser, [], 'Parser');
  235. smalltalk.addMethod(
  236. '_parse_',
  237. smalltalk.method({
  238. selector: 'parse:',
  239. category: 'parsing',
  240. fn: function (aStream){
  241. var self=this;
  242. return nil;
  243. return self;},
  244. source: unescape('parse%3A%20aStream%0A%09%5Enil'),
  245. messageSends: [],
  246. referencedClasses: []
  247. }),
  248. smalltalk.PPEpsilonParser);
  249. smalltalk.addClass('PPStringParser', smalltalk.PPParser, ['string'], 'Parser');
  250. smalltalk.addMethod(
  251. '_string',
  252. smalltalk.method({
  253. selector: 'string',
  254. category: 'accessing',
  255. fn: function (){
  256. var self=this;
  257. return self['@string'];
  258. return self;},
  259. source: unescape('string%0A%09%5Estring'),
  260. messageSends: [],
  261. referencedClasses: []
  262. }),
  263. smalltalk.PPStringParser);
  264. smalltalk.addMethod(
  265. '_string_',
  266. smalltalk.method({
  267. selector: 'string:',
  268. category: 'accessing',
  269. fn: function (aString){
  270. var self=this;
  271. self['@string']=aString;
  272. return self;},
  273. source: unescape('string%3A%20aString%0A%09string%20%3A%3D%20aString'),
  274. messageSends: [],
  275. referencedClasses: []
  276. }),
  277. smalltalk.PPStringParser);
  278. smalltalk.addMethod(
  279. '_parse_',
  280. smalltalk.method({
  281. selector: 'parse:',
  282. category: 'parsing',
  283. fn: function (aStream){
  284. var self=this;
  285. var position=nil;
  286. var result=nil;
  287. position=smalltalk.send(aStream, "_position", []);
  288. result=smalltalk.send(aStream, "_next_", [smalltalk.send(smalltalk.send(self, "_string", []), "_size", [])]);
  289. return smalltalk.send(smalltalk.send(result, "__eq", [smalltalk.send(self, "_string", [])]), "_ifTrue_ifFalse_", [(function(){return result;}), (function(){smalltalk.send(aStream, "_position_", [position]);return (function($rec){smalltalk.send($rec, "_reason_", [smalltalk.send(smalltalk.send(smalltalk.send("Expected ", "__comma", [smalltalk.send(self, "_string", [])]), "__comma", [" but got "]), "__comma", [smalltalk.send(smalltalk.send(result, "_at_", [position]), "_printString", [])])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.PPFailure, "_new", []));})]);
  290. return self;},
  291. source: unescape('parse%3A%20aStream%0A%09%7C%20position%20result%20%7C%0A%09position%20%3A%3D%20aStream%20position.%0A%09result%20%3A%3D%20aStream%20next%3A%20self%20string%20size.%0A%09%5Eresult%20%3D%20self%20string%0A%09%20%20%20%20ifTrue%3A%20%5Bresult%5D%0A%09%20%20%20%20ifFalse%3A%20%5B%0A%09%09aStream%20position%3A%20position.%0A%09%09PPFailure%20new%20reason%3A%20%27Expected%20%27%2C%20self%20string%2C%20%27%20but%20got%20%27%2C%20%28result%20at%3A%20position%29%20printString%3B%20yourself%5D'),
  292. messageSends: ["position", "next:", "size", "string", "ifTrue:ifFalse:", unescape("%3D"), "position:", "reason:", unescape("%2C"), "printString", "at:", "yourself", "new"],
  293. referencedClasses: [smalltalk.nil]
  294. }),
  295. smalltalk.PPStringParser);
  296. smalltalk.addClass('PPCharacterParser', smalltalk.PPParser, ['regexp'], 'Parser');
  297. smalltalk.addMethod(
  298. '_string_',
  299. smalltalk.method({
  300. selector: 'string:',
  301. category: 'accessing',
  302. fn: function (aString){
  303. var self=this;
  304. self['@regexp']=smalltalk.send(smalltalk.RegularExpression, "_fromString_", [smalltalk.send(smalltalk.send(unescape("%5B"), "__comma", [aString]), "__comma", [unescape("%5D")])]);
  305. return self;},
  306. source: unescape('string%3A%20aString%0A%09regexp%20%3A%3D%20RegularExpression%20fromString%3A%20%27%5B%27%2C%20aString%2C%20%27%5D%27'),
  307. messageSends: ["fromString:", unescape("%2C")],
  308. referencedClasses: [smalltalk.RegularExpression]
  309. }),
  310. smalltalk.PPCharacterParser);
  311. smalltalk.addMethod(
  312. '_parse_',
  313. smalltalk.method({
  314. selector: 'parse:',
  315. category: 'parsing',
  316. fn: function (aStream){
  317. var self=this;
  318. return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aStream, "_peek", []), "_notNil", []), "_and_", [(function(){return smalltalk.send(self, "_match_", [smalltalk.send(aStream, "_peek", [])]);})]), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aStream, "_next", []);}), (function(){return smalltalk.send(smalltalk.send(smalltalk.PPFailure, "_new", []), "_reason_at_", ["Could not match", smalltalk.send(aStream, "_position", [])]);})]);
  319. return self;},
  320. source: unescape('parse%3A%20aStream%0A%09%5E%28aStream%20peek%20notNil%20and%3A%20%5Bself%20match%3A%20aStream%20peek%5D%29%0A%09%20%20%20%20ifTrue%3A%20%5BaStream%20next%5D%0A%09%20%20%20%20ifFalse%3A%20%5BPPFailure%20new%20reason%3A%20%27Could%20not%20match%27%20at%3A%20aStream%20position%5D'),
  321. messageSends: ["ifTrue:ifFalse:", "and:", "notNil", "peek", "match:", "next", "reason:at:", "new", "position"],
  322. referencedClasses: [smalltalk.nil]
  323. }),
  324. smalltalk.PPCharacterParser);
  325. smalltalk.addMethod(
  326. '_match_',
  327. smalltalk.method({
  328. selector: 'match:',
  329. category: 'private',
  330. fn: function (aString){
  331. var self=this;
  332. return smalltalk.send(aString, "_match_", [self['@regexp']]);
  333. return self;},
  334. source: unescape('match%3A%20aString%0A%09%5EaString%20match%3A%20regexp'),
  335. messageSends: ["match:"],
  336. referencedClasses: []
  337. }),
  338. smalltalk.PPCharacterParser);
  339. smalltalk.addClass('PPListParser', smalltalk.PPParser, ['parsers'], 'Parser');
  340. smalltalk.addMethod(
  341. '_parsers',
  342. smalltalk.method({
  343. selector: 'parsers',
  344. category: 'accessing',
  345. fn: function (){
  346. var self=this;
  347. return smalltalk.send(self['@parsers'], "_ifNil_", [(function(){return [];})]);
  348. return self;},
  349. source: unescape('parsers%0A%09%5Eparsers%20ifNil%3A%20%5B%23%28%29%5D'),
  350. messageSends: ["ifNil:"],
  351. referencedClasses: []
  352. }),
  353. smalltalk.PPListParser);
  354. smalltalk.addMethod(
  355. '_parsers_',
  356. smalltalk.method({
  357. selector: 'parsers:',
  358. category: 'accessing',
  359. fn: function (aCollection){
  360. var self=this;
  361. self['@parsers']=aCollection;
  362. return self;},
  363. source: unescape('parsers%3A%20aCollection%0A%09parsers%20%3A%3D%20aCollection'),
  364. messageSends: [],
  365. referencedClasses: []
  366. }),
  367. smalltalk.PPListParser);
  368. smalltalk.addMethod(
  369. '_copyWith_',
  370. smalltalk.method({
  371. selector: 'copyWith:',
  372. category: 'copying',
  373. fn: function (aParser){
  374. var self=this;
  375. return smalltalk.send(smalltalk.send(self, "_class", []), "_withAll_", [smalltalk.send(smalltalk.send(self, "_parsers", []), "_copyWith_", [aParser])]);
  376. return self;},
  377. source: unescape('copyWith%3A%20aParser%0A%09%5Eself%20class%20withAll%3A%20%28self%20parsers%20copyWith%3A%20aParser%29'),
  378. messageSends: ["withAll:", "class", "copyWith:", "parsers"],
  379. referencedClasses: []
  380. }),
  381. smalltalk.PPListParser);
  382. smalltalk.addMethod(
  383. '_withAll_',
  384. smalltalk.method({
  385. selector: 'withAll:',
  386. category: 'instance creation',
  387. fn: function (aCollection){
  388. var self=this;
  389. return (function($rec){smalltalk.send($rec, "_parsers_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  390. return self;},
  391. source: unescape('withAll%3A%20aCollection%0A%09%20%20%20%20%5Eself%20new%0A%09%09parsers%3A%20aCollection%3B%0A%09%09yourself'),
  392. messageSends: ["parsers:", "yourself", "new"],
  393. referencedClasses: []
  394. }),
  395. smalltalk.PPListParser.klass);
  396. smalltalk.addMethod(
  397. '_with_with_',
  398. smalltalk.method({
  399. selector: 'with:with:',
  400. category: 'instance creation',
  401. fn: function (aParser, anotherParser){
  402. var self=this;
  403. return smalltalk.send(self, "_withAll_", [smalltalk.send(smalltalk.Array, "_with_with_", [aParser, anotherParser])]);
  404. return self;},
  405. source: unescape('with%3A%20aParser%20with%3A%20anotherParser%0A%09%20%20%20%20%5Eself%20withAll%3A%20%28Array%20with%3A%20aParser%20with%3A%20anotherParser%29'),
  406. messageSends: ["withAll:", "with:with:"],
  407. referencedClasses: [smalltalk.Array]
  408. }),
  409. smalltalk.PPListParser.klass);
  410. smalltalk.addClass('PPSequenceParser', smalltalk.PPListParser, [], 'Parser');
  411. smalltalk.addMethod(
  412. '__comma',
  413. smalltalk.method({
  414. selector: ',',
  415. category: 'copying',
  416. fn: function (aRule){
  417. var self=this;
  418. return smalltalk.send(self, "_copyWith_", [aRule]);
  419. return self;},
  420. source: unescape('%2C%20aRule%0A%09%5Eself%20copyWith%3A%20aRule'),
  421. messageSends: ["copyWith:"],
  422. referencedClasses: []
  423. }),
  424. smalltalk.PPSequenceParser);
  425. smalltalk.addMethod(
  426. '_parse_',
  427. smalltalk.method({
  428. selector: 'parse:',
  429. category: 'parsing',
  430. fn: function (aStream){
  431. var self=this;
  432. var start=nil;
  433. var elements=nil;
  434. var element=nil;
  435. start=smalltalk.send(aStream, "_position", []);
  436. elements=[];
  437. smalltalk.send(smalltalk.send(self, "_parsers", []), "_detect_ifNone_", [(function(each){element=smalltalk.send(each, "_memoizedParse_", [aStream]);smalltalk.send(elements, "_add_", [element]);return smalltalk.send(element, "_isParseFailure", []);}), (function(){return nil;})]);
  438. return smalltalk.send(smalltalk.send(element, "_isParseFailure", []), "_ifFalse_ifTrue_", [(function(){return elements;}), (function(){smalltalk.send(aStream, "_position_", [start]);return element;})]);
  439. return self;},
  440. source: unescape('parse%3A%20aStream%0A%09%7C%20start%20elements%20element%20%7C%0A%09start%20%3A%3D%20aStream%20position.%0A%09elements%20%3A%3D%20%23%28%29.%0A%09self%20parsers%20%0A%09%20%20%20%20detect%3A%20%5B%3Aeach%20%7C%0A%09%09element%20%3A%3D%20each%20memoizedParse%3A%20aStream.%0A%09%09elements%20add%3A%20element.%0A%09%09element%20isParseFailure%5D%20%0A%09%20%20%20%20ifNone%3A%20%5B%5D.%0A%09%5Eelement%20isParseFailure%0A%09%20%20%20%20ifFalse%3A%20%5Belements%5D%0A%09%20%20%20%20ifTrue%3A%20%5BaStream%20position%3A%20start.%20element%5D'),
  441. messageSends: ["position", "detect:ifNone:", "parsers", "memoizedParse:", "add:", "isParseFailure", "ifFalse:ifTrue:", "position:"],
  442. referencedClasses: []
  443. }),
  444. smalltalk.PPSequenceParser);
  445. smalltalk.addClass('PPChoiceParser', smalltalk.PPListParser, [], 'Parser');
  446. smalltalk.addMethod(
  447. '__slash',
  448. smalltalk.method({
  449. selector: '/',
  450. category: 'copying',
  451. fn: function (aRule){
  452. var self=this;
  453. return smalltalk.send(self, "_copyWith_", [aRule]);
  454. return self;},
  455. source: unescape('/%20aRule%0A%09%5Eself%20copyWith%3A%20aRule'),
  456. messageSends: ["copyWith:"],
  457. referencedClasses: []
  458. }),
  459. smalltalk.PPChoiceParser);
  460. smalltalk.addMethod(
  461. '_parse_',
  462. smalltalk.method({
  463. selector: 'parse:',
  464. category: 'parsing',
  465. fn: function (aStream){
  466. var self=this;
  467. var result=nil;
  468. smalltalk.send(smalltalk.send(self, "_parsers", []), "_detect_ifNone_", [(function(each){result=smalltalk.send(each, "_memoizedParse_", [aStream]);return smalltalk.send(smalltalk.send(result, "_isParseFailure", []), "_not", []);}), (function(){return nil;})]);
  469. return result;
  470. return self;},
  471. source: unescape('parse%3A%20aStream%0A%09%7C%20result%20%7C%0A%09self%20parsers%0A%20%20%20%20%09%20%20%20%20detect%3A%20%5B%3Aeach%20%7C%0A%09%09result%20%3A%3D%20each%20memoizedParse%3A%20aStream.%0A%09%09result%20isParseFailure%20not%5D%0A%09%20%20%20%20ifNone%3A%20%5B%5D.%0A%09%5Eresult'),
  472. messageSends: ["detect:ifNone:", "parsers", "memoizedParse:", "not", "isParseFailure"],
  473. referencedClasses: []
  474. }),
  475. smalltalk.PPChoiceParser);
  476. smalltalk.addClass('PPDelegateParser', smalltalk.PPParser, ['parser'], 'Parser');
  477. smalltalk.addMethod(
  478. '_parser',
  479. smalltalk.method({
  480. selector: 'parser',
  481. category: 'accessing',
  482. fn: function (){
  483. var self=this;
  484. return self['@parser'];
  485. return self;},
  486. source: unescape('parser%0A%09%5Eparser'),
  487. messageSends: [],
  488. referencedClasses: []
  489. }),
  490. smalltalk.PPDelegateParser);
  491. smalltalk.addMethod(
  492. '_parser_',
  493. smalltalk.method({
  494. selector: 'parser:',
  495. category: 'accessing',
  496. fn: function (aParser){
  497. var self=this;
  498. self['@parser']=aParser;
  499. return self;},
  500. source: unescape('parser%3A%20aParser%0A%09parser%20%3A%3D%20aParser'),
  501. messageSends: [],
  502. referencedClasses: []
  503. }),
  504. smalltalk.PPDelegateParser);
  505. smalltalk.addMethod(
  506. '_parse_',
  507. smalltalk.method({
  508. selector: 'parse:',
  509. category: 'parsing',
  510. fn: function (aStream){
  511. var self=this;
  512. return smalltalk.send(smalltalk.send(self, "_parser", []), "_memoizedParse_", [aStream]);
  513. return self;},
  514. source: unescape('parse%3A%20aStream%0A%09%5Eself%20parser%20memoizedParse%3A%20aStream'),
  515. messageSends: ["memoizedParse:", "parser"],
  516. referencedClasses: []
  517. }),
  518. smalltalk.PPDelegateParser);
  519. smalltalk.addMethod(
  520. '_on_',
  521. smalltalk.method({
  522. selector: 'on:',
  523. category: 'instance creation',
  524. fn: function (aParser){
  525. var self=this;
  526. return (function($rec){smalltalk.send($rec, "_parser_", [aParser]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  527. return self;},
  528. source: unescape('on%3A%20aParser%0A%09%20%20%20%20%5Eself%20new%0A%09%09parser%3A%20aParser%3B%0A%09%09yourself'),
  529. messageSends: ["parser:", "yourself", "new"],
  530. referencedClasses: []
  531. }),
  532. smalltalk.PPDelegateParser.klass);
  533. smalltalk.addClass('PPAndParser', smalltalk.PPDelegateParser, [], 'Parser');
  534. smalltalk.addMethod(
  535. '_parse_',
  536. smalltalk.method({
  537. selector: 'parse:',
  538. category: 'parsing',
  539. fn: function (aStream){
  540. var self=this;
  541. return smalltalk.send(self, "_basicParse_", [aStream]);
  542. return self;},
  543. source: unescape('parse%3A%20aStream%0A%09%5Eself%20basicParse%3A%20aStream'),
  544. messageSends: ["basicParse:"],
  545. referencedClasses: []
  546. }),
  547. smalltalk.PPAndParser);
  548. smalltalk.addMethod(
  549. '_basicParse_',
  550. smalltalk.method({
  551. selector: 'basicParse:',
  552. category: 'parsing',
  553. fn: function (aStream){
  554. var self=this;
  555. var element=nil;
  556. var position=nil;
  557. position=smalltalk.send(aStream, "_position", []);
  558. element=smalltalk.send(smalltalk.send(self, "_parser", []), "_memoizedParse_", [aStream]);
  559. smalltalk.send(aStream, "_position_", [position]);
  560. return element;
  561. return self;},
  562. source: unescape('basicParse%3A%20aStream%0A%09%7C%20element%20position%20%7C%0A%09position%20%3A%3D%20aStream%20position.%0A%09element%20%3A%3D%20self%20parser%20memoizedParse%3A%20aStream.%0A%09aStream%20position%3A%20position.%0A%09%5Eelement'),
  563. messageSends: ["position", "memoizedParse:", "parser", "position:"],
  564. referencedClasses: []
  565. }),
  566. smalltalk.PPAndParser);
  567. smalltalk.addClass('PPNotParser', smalltalk.PPAndParser, [], 'Parser');
  568. smalltalk.addMethod(
  569. '_parse_',
  570. smalltalk.method({
  571. selector: 'parse:',
  572. category: 'parsing',
  573. fn: function (aStream){
  574. var self=this;
  575. var element=nil;
  576. element=smalltalk.send(self, "_basicParse_", [aStream]);
  577. return smalltalk.send(smalltalk.send(element, "_isParseFailure", []), "_ifTrue_ifFalse_", [(function(){return nil;}), (function(){return smalltalk.send(smalltalk.PPFailure, "_reason_at_", [element, smalltalk.send(aStream, "_position", [])]);})]);
  578. return self;},
  579. source: unescape('parse%3A%20aStream%0A%09%7C%20element%20%7C%0A%09element%20%3A%3D%20self%20basicParse%3A%20aStream.%0A%09%5Eelement%20isParseFailure%20%0A%09%20%20%20%20ifTrue%3A%20%5Bnil%5D%0A%09%20%20%20%20ifFalse%3A%20%5BPPFailure%20reason%3A%20element%20at%3A%20aStream%20position%5D'),
  580. messageSends: ["basicParse:", "ifTrue:ifFalse:", "isParseFailure", "reason:at:", "position"],
  581. referencedClasses: [smalltalk.nil]
  582. }),
  583. smalltalk.PPNotParser);
  584. smalltalk.addClass('PPActionParser', smalltalk.PPDelegateParser, ['block'], 'Parser');
  585. smalltalk.addMethod(
  586. '_block',
  587. smalltalk.method({
  588. selector: 'block',
  589. category: 'accessing',
  590. fn: function (){
  591. var self=this;
  592. return self['@block'];
  593. return self;},
  594. source: unescape('block%0A%09%5Eblock'),
  595. messageSends: [],
  596. referencedClasses: []
  597. }),
  598. smalltalk.PPActionParser);
  599. smalltalk.addMethod(
  600. '_block_',
  601. smalltalk.method({
  602. selector: 'block:',
  603. category: 'accessing',
  604. fn: function (aBlock){
  605. var self=this;
  606. self['@block']=aBlock;
  607. return self;},
  608. source: unescape('block%3A%20aBlock%0A%09block%20%3A%3D%20aBlock'),
  609. messageSends: [],
  610. referencedClasses: []
  611. }),
  612. smalltalk.PPActionParser);
  613. smalltalk.addMethod(
  614. '_parse_',
  615. smalltalk.method({
  616. selector: 'parse:',
  617. category: 'parsing',
  618. fn: function (aStream){
  619. var self=this;
  620. var element=nil;
  621. element=smalltalk.send(smalltalk.send(self, "_parser", []), "_memoizedParse_", [aStream]);
  622. return smalltalk.send(smalltalk.send(element, "_isParseFailure", []), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(smalltalk.send(self, "_block", []), "_value_", [element]);}), (function(){return element;})]);
  623. return self;},
  624. source: unescape('parse%3A%20aStream%0A%09%7C%20element%20%7C%0A%09element%20%3A%3D%20self%20parser%20memoizedParse%3A%20aStream.%0A%09%5Eelement%20isParseFailure%0A%09%20%20%20%20ifFalse%3A%20%5Bself%20block%20value%3A%20element%5D%0A%09%20%20%20%20ifTrue%3A%20%5Belement%5D'),
  625. messageSends: ["memoizedParse:", "parser", "ifFalse:ifTrue:", "isParseFailure", "value:", "block"],
  626. referencedClasses: []
  627. }),
  628. smalltalk.PPActionParser);
  629. smalltalk.addMethod(
  630. '_on_block_',
  631. smalltalk.method({
  632. selector: 'on:block:',
  633. category: 'instance creation',
  634. fn: function (aParser, aBlock){
  635. var self=this;
  636. return (function($rec){smalltalk.send($rec, "_parser_", [aParser]);smalltalk.send($rec, "_block_", [aBlock]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  637. return self;},
  638. source: unescape('on%3A%20aParser%20block%3A%20aBlock%0A%09%20%20%20%20%5Eself%20new%0A%09%09parser%3A%20aParser%3B%0A%09%09block%3A%20aBlock%3B%0A%09%09yourself'),
  639. messageSends: ["parser:", "block:", "yourself", "new"],
  640. referencedClasses: []
  641. }),
  642. smalltalk.PPActionParser.klass);
  643. smalltalk.addClass('PPFlattenParser', smalltalk.PPDelegateParser, [], 'Parser');
  644. smalltalk.addMethod(
  645. '_parse_',
  646. smalltalk.method({
  647. selector: 'parse:',
  648. category: 'parsing',
  649. fn: function (aStream){
  650. var self=this;
  651. var start=nil;
  652. var element=nil;
  653. var stop=nil;
  654. start=smalltalk.send(aStream, "_position", []);
  655. element=smalltalk.send(smalltalk.send(self, "_parser", []), "_memoizedParse_", [aStream]);
  656. return smalltalk.send(smalltalk.send(element, "_isParseFailure", []), "_ifTrue_ifFalse_", [(function(){return element;}), (function(){return smalltalk.send(smalltalk.send(aStream, "_collection", []), "_copyFrom_to_", [smalltalk.send(start, "__plus", [(1)]), smalltalk.send(aStream, "_position", [])]);})]);
  657. return self;},
  658. source: unescape('parse%3A%20aStream%0A%09%7C%20start%20element%20stop%20%7C%0A%09start%20%3A%3D%20aStream%20position.%0A%09element%20%3A%3D%20self%20parser%20memoizedParse%3A%20aStream.%0A%09%5Eelement%20isParseFailure%0A%09%20%20%20%20ifTrue%3A%20%5Belement%5D%0A%09%20%20%20%20ifFalse%3A%20%5BaStream%20collection%20%0A%09%09copyFrom%3A%20start%20+%201%20%0A%09%09to%3A%20aStream%20position%5D'),
  659. messageSends: ["position", "memoizedParse:", "parser", "ifTrue:ifFalse:", "isParseFailure", "copyFrom:to:", "collection", unescape("+")],
  660. referencedClasses: []
  661. }),
  662. smalltalk.PPFlattenParser);
  663. smalltalk.addClass('PPSourceParser', smalltalk.PPDelegateParser, [], 'Parser');
  664. smalltalk.addMethod(
  665. '_parse_',
  666. smalltalk.method({
  667. selector: 'parse:',
  668. category: 'parsing',
  669. fn: function (aStream){
  670. var self=this;
  671. var start=nil;
  672. var element=nil;
  673. var stop=nil;
  674. var result=nil;
  675. start=smalltalk.send(aStream, "_position", []);
  676. element=smalltalk.send(smalltalk.send(self, "_parser", []), "_memoizedParse_", [aStream]);
  677. return smalltalk.send(smalltalk.send(element, "_isParseFailure", []), "_ifTrue_ifFalse_", [(function(){return element;}), (function(){result=smalltalk.send(smalltalk.send(aStream, "_collection", []), "_copyFrom_to_", [smalltalk.send(start, "__plus", [(1)]), smalltalk.send(aStream, "_position", [])]);return smalltalk.send(smalltalk.Array, "_with_with_", [element, result]);})]);
  678. return self;},
  679. source: unescape('parse%3A%20aStream%0A%09%7C%20start%20element%20stop%20result%20%7C%0A%09start%20%3A%3D%20aStream%20position.%0A%09element%20%3A%3D%20self%20parser%20memoizedParse%3A%20aStream.%0A%09%5Eelement%20isParseFailure%0A%09%09ifTrue%3A%20%5Belement%5D%0A%09%09ifFalse%3A%20%5Bresult%20%3A%3D%20aStream%20collection%20copyFrom%3A%20start%20+%201%20to%3A%20aStream%20position.%0A%09%09%09Array%20with%3A%20element%20with%3A%20result%5D.'),
  680. messageSends: ["position", "memoizedParse:", "parser", "ifTrue:ifFalse:", "isParseFailure", "copyFrom:to:", "collection", unescape("+"), "with:with:"],
  681. referencedClasses: [smalltalk.Array]
  682. }),
  683. smalltalk.PPSourceParser);
  684. smalltalk.addClass('PPRepeatingParser', smalltalk.PPDelegateParser, ['min'], 'Parser');
  685. smalltalk.addMethod(
  686. '_min',
  687. smalltalk.method({
  688. selector: 'min',
  689. category: 'accessing',
  690. fn: function (){
  691. var self=this;
  692. return self['@min'];
  693. return self;},
  694. source: unescape('min%0A%09%5Emin'),
  695. messageSends: [],
  696. referencedClasses: []
  697. }),
  698. smalltalk.PPRepeatingParser);
  699. smalltalk.addMethod(
  700. '_min_',
  701. smalltalk.method({
  702. selector: 'min:',
  703. category: 'accessing',
  704. fn: function (aNumber){
  705. var self=this;
  706. self['@min']=aNumber;
  707. return self;},
  708. source: unescape('min%3A%20aNumber%0A%09min%20%3A%3D%20aNumber'),
  709. messageSends: [],
  710. referencedClasses: []
  711. }),
  712. smalltalk.PPRepeatingParser);
  713. smalltalk.addMethod(
  714. '_parse_',
  715. smalltalk.method({
  716. selector: 'parse:',
  717. category: 'parsing',
  718. fn: function (aStream){
  719. var self=this;
  720. var start=nil;
  721. var element=nil;
  722. var elements=nil;
  723. var failure=nil;
  724. start=smalltalk.send(aStream, "_position", []);
  725. elements=smalltalk.send(smalltalk.Array, "_new", []);
  726. smalltalk.send((function(){return smalltalk.send(smalltalk.send(smalltalk.send(elements, "_size", []), "__lt", [smalltalk.send(self, "_min", [])]), "_and_", [(function(){return smalltalk.send(failure, "_isNil", []);})]);}), "_whileTrue_", [(function(){element=smalltalk.send(smalltalk.send(self, "_parser", []), "_memoizedParse_", [aStream]);return smalltalk.send(smalltalk.send(element, "_isParseFailure", []), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(elements, "_addLast_", [element]);}), (function(){smalltalk.send(aStream, "_position_", [start]);return failure=element;})]);})]);
  727. return smalltalk.send(failure, "_ifNil_ifNotNil_", [(function(){smalltalk.send((function(){return smalltalk.send(failure, "_isNil", []);}), "_whileTrue_", [(function(){element=smalltalk.send(smalltalk.send(self, "_parser", []), "_memoizedParse_", [aStream]);return smalltalk.send(smalltalk.send(element, "_isParseFailure", []), "_ifTrue_ifFalse_", [(function(){return failure=element;}), (function(){return smalltalk.send(elements, "_addLast_", [element]);})]);})]);return elements;}), (function(){return failure;})]);
  728. return self;},
  729. source: unescape('parse%3A%20aStream%0A%09%7C%20start%20element%20elements%20failure%20%7C%0A%09start%20%3A%3D%20aStream%20position.%0A%09elements%20%3A%3D%20Array%20new.%0A%09%5B%28elements%20size%20%3C%20self%20min%29%20and%3A%20%5Bfailure%20isNil%5D%5D%20whileTrue%3A%20%5B%0A%09%20%20%20%20element%20%3A%3D%20self%20parser%20memoizedParse%3A%20aStream.%0A%09%20%20%20%20element%20isParseFailure%0A%09%09%09ifFalse%3A%20%5Belements%20addLast%3A%20element%5D%0A%09%09%09ifTrue%3A%20%5BaStream%20position%3A%20start.%0A%09%09%09%09%20failure%20%3A%3D%20element%5D%5D.%0A%09%5Efailure%20ifNil%3A%20%5B%0A%09%20%20%20%20%5Bfailure%20isNil%5D%20whileTrue%3A%20%5B%0A%09%09%09element%20%3A%3D%20self%20parser%20memoizedParse%3A%20aStream.%0A%09%20%09%09element%20isParseFailure%0A%09%09%09%09ifTrue%3A%20%5Bfailure%20%3A%3D%20element%5D%0A%09%09%09%09ifFalse%3A%20%5Belements%20addLast%3A%20element%5D%5D.%0A%09%09%09%09elements%5D%0A%09%09ifNotNil%3A%20%5Bfailure%5D.'),
  730. messageSends: ["position", "new", "whileTrue:", "and:", unescape("%3C"), "size", "min", "isNil", "memoizedParse:", "parser", "ifFalse:ifTrue:", "isParseFailure", "addLast:", "position:", "ifNil:ifNotNil:", "ifTrue:ifFalse:"],
  731. referencedClasses: [smalltalk.Array]
  732. }),
  733. smalltalk.PPRepeatingParser);
  734. smalltalk.addMethod(
  735. '_on_min_',
  736. smalltalk.method({
  737. selector: 'on:min:',
  738. category: 'instance creation',
  739. fn: function (aParser, aNumber){
  740. var self=this;
  741. return (function($rec){smalltalk.send($rec, "_parser_", [aParser]);smalltalk.send($rec, "_min_", [aNumber]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  742. return self;},
  743. source: unescape('on%3A%20aParser%20min%3A%20aNumber%0A%09%20%20%20%20%5Eself%20new%0A%09%09parser%3A%20aParser%3B%0A%09%09min%3A%20aNumber%3B%0A%09%09yourself'),
  744. messageSends: ["parser:", "min:", "yourself", "new"],
  745. referencedClasses: []
  746. }),
  747. smalltalk.PPRepeatingParser.klass);
  748. smalltalk.addClass('PPFailure', smalltalk.Object, ['position', 'reason'], 'Parser');
  749. smalltalk.addMethod(
  750. '_position',
  751. smalltalk.method({
  752. selector: 'position',
  753. category: 'accessing',
  754. fn: function (){
  755. var self=this;
  756. return smalltalk.send(self['@position'], "_ifNil_", [(function(){return (0);})]);
  757. return self;},
  758. source: unescape('position%0A%09%5Eposition%20ifNil%3A%20%5B0%5D'),
  759. messageSends: ["ifNil:"],
  760. referencedClasses: []
  761. }),
  762. smalltalk.PPFailure);
  763. smalltalk.addMethod(
  764. '_position_',
  765. smalltalk.method({
  766. selector: 'position:',
  767. category: 'accessing',
  768. fn: function (aNumber){
  769. var self=this;
  770. self['@position']=aNumber;
  771. return self;},
  772. source: unescape('position%3A%20aNumber%0A%09position%20%3A%3D%20aNumber'),
  773. messageSends: [],
  774. referencedClasses: []
  775. }),
  776. smalltalk.PPFailure);
  777. smalltalk.addMethod(
  778. '_reason',
  779. smalltalk.method({
  780. selector: 'reason',
  781. category: 'accessing',
  782. fn: function (){
  783. var self=this;
  784. return smalltalk.send(self['@reason'], "_ifNil_", [(function(){return "";})]);
  785. return self;},
  786. source: unescape('reason%0A%09%5Ereason%20ifNil%3A%20%5B%27%27%5D'),
  787. messageSends: ["ifNil:"],
  788. referencedClasses: []
  789. }),
  790. smalltalk.PPFailure);
  791. smalltalk.addMethod(
  792. '_reason_',
  793. smalltalk.method({
  794. selector: 'reason:',
  795. category: 'accessing',
  796. fn: function (aString){
  797. var self=this;
  798. self['@reason']=aString;
  799. return self;},
  800. source: unescape('reason%3A%20aString%0A%09reason%20%3A%3D%20aString'),
  801. messageSends: [],
  802. referencedClasses: []
  803. }),
  804. smalltalk.PPFailure);
  805. smalltalk.addMethod(
  806. '_reason_at_',
  807. smalltalk.method({
  808. selector: 'reason:at:',
  809. category: 'accessing',
  810. fn: function (aString, anInteger){
  811. var self=this;
  812. (function($rec){smalltalk.send($rec, "_reason_", [aString]);return smalltalk.send($rec, "_position_", [anInteger]);})(self);
  813. return self;},
  814. source: unescape('reason%3A%20aString%20at%3A%20anInteger%0A%09self%20%0A%09%20%20%20%20reason%3A%20aString%3B%20%0A%09%20%20%20%20position%3A%20anInteger'),
  815. messageSends: ["reason:", "position:"],
  816. referencedClasses: []
  817. }),
  818. smalltalk.PPFailure);
  819. smalltalk.addMethod(
  820. '_isParseFailure',
  821. smalltalk.method({
  822. selector: 'isParseFailure',
  823. category: 'testing',
  824. fn: function (){
  825. var self=this;
  826. return true;
  827. return self;},
  828. source: unescape('isParseFailure%0A%09%5Etrue'),
  829. messageSends: [],
  830. referencedClasses: []
  831. }),
  832. smalltalk.PPFailure);
  833. smalltalk.addMethod(
  834. '_accept_',
  835. smalltalk.method({
  836. selector: 'accept:',
  837. category: 'accessing',
  838. fn: function (aVisitor){
  839. var self=this;
  840. smalltalk.send(aVisitor, "_visitFailure_", [self]);
  841. return self;},
  842. source: unescape('accept%3A%20aVisitor%0A%09aVisitor%20visitFailure%3A%20self'),
  843. messageSends: ["visitFailure:"],
  844. referencedClasses: []
  845. }),
  846. smalltalk.PPFailure);
  847. smalltalk.addMethod(
  848. '_asString',
  849. smalltalk.method({
  850. selector: 'asString',
  851. category: 'testing',
  852. fn: function (){
  853. var self=this;
  854. return smalltalk.send(smalltalk.send(self['@reason'], "__comma", [" at "]), "__comma", [smalltalk.send(self['@position'], "_asString", [])]);
  855. return self;},
  856. source: unescape('asString%0A%09%5Ereason%2C%20%27%20at%20%27%2C%20position%20asString'),
  857. messageSends: [unescape("%2C"), "asString"],
  858. referencedClasses: []
  859. }),
  860. smalltalk.PPFailure);
  861. smalltalk.addMethod(
  862. '_reason_at_',
  863. smalltalk.method({
  864. selector: 'reason:at:',
  865. category: 'instance creation',
  866. fn: function (aString, anInteger){
  867. var self=this;
  868. return (function($rec){smalltalk.send($rec, "_reason_at_", [aString, anInteger]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  869. return self;},
  870. source: unescape('reason%3A%20aString%20at%3A%20anInteger%0A%09%20%20%20%20%5Eself%20new%0A%09%09reason%3A%20aString%20at%3A%20anInteger%3B%0A%09%09yourself'),
  871. messageSends: ["reason:at:", "yourself", "new"],
  872. referencedClasses: []
  873. }),
  874. smalltalk.PPFailure.klass);
  875. smalltalk.addClass('SmalltalkParser', smalltalk.Object, [], 'Parser');
  876. smalltalk.addMethod(
  877. '_parse_',
  878. smalltalk.method({
  879. selector: 'parse:',
  880. category: 'parsing',
  881. fn: function (aStream){
  882. var self=this;
  883. return smalltalk.send(smalltalk.send(self, "_parser", []), "_parse_", [aStream]);
  884. return self;},
  885. source: unescape('parse%3A%20aStream%0A%09%5Eself%20parser%20parse%3A%20aStream'),
  886. messageSends: ["parse:", "parser"],
  887. referencedClasses: []
  888. }),
  889. smalltalk.SmalltalkParser);
  890. smalltalk.addMethod(
  891. '_parser',
  892. smalltalk.method({
  893. selector: 'parser',
  894. category: 'grammar',
  895. fn: function (){
  896. var self=this;
  897. var method=nil;
  898. var expression=nil;
  899. var separator=nil;
  900. var comment=nil;
  901. var ws=nil;
  902. var identifier=nil;
  903. var keyword=nil;
  904. var className=nil;
  905. var string=nil;
  906. var symbol=nil;
  907. var number=nil;
  908. var literalArray=nil;
  909. var variable=nil;
  910. var reference=nil;
  911. var classReference=nil;
  912. var literal=nil;
  913. var ret=nil;
  914. var methodParser=nil;
  915. var expressionParser=nil;
  916. var keyword=nil;
  917. var unarySelector=nil;
  918. var binarySelector=nil;
  919. var keywordPattern=nil;
  920. var unaryPattern=nil;
  921. var binaryPattern=nil;
  922. var assignment=nil;
  923. var temps=nil;
  924. var blockParamList=nil;
  925. var block=nil;
  926. var expression=nil;
  927. var expressions=nil;
  928. var subexpression=nil;
  929. var statements=nil;
  930. var sequence=nil;
  931. var operand=nil;
  932. var unaryMessage=nil;
  933. var unarySend=nil;
  934. var unaryTail=nil;
  935. var binaryMessage=nil;
  936. var binarySend=nil;
  937. var binaryTail=nil;
  938. var keywordMessage=nil;
  939. var keywordSend=nil;
  940. var keywordPair=nil;
  941. var cascade=nil;
  942. var message=nil;
  943. var jsStatement=nil;
  944. separator=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.String, "_cr", []), "__comma", [smalltalk.send(smalltalk.String, "_space", [])]), "__comma", [smalltalk.send(smalltalk.String, "_lf", [])]), "__comma", [smalltalk.send(smalltalk.String, "_tab", [])]), "_asChoiceParser", []);
  945. comment=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%22"), "_asCharacterParser", []), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%22"), "_asParser", []), "_not", []), "__comma", [smalltalk.send(smalltalk.PPAnyParser, "_new", [])]), "_star", [])]), "__comma", [smalltalk.send(unescape("%22"), "_asCharacterParser", [])]), "_flatten", []);
  946. ws=smalltalk.send(smalltalk.send(separator, "__slash", [comment]), "_star", []);
  947. identifier=smalltalk.send(smalltalk.send(smalltalk.send(unescape("a-z"), "_asCharacterParser", []), "__comma", [smalltalk.send(smalltalk.send(unescape("a-zA-Z0-9"), "_asCharacterParser", []), "_star", [])]), "_flatten", []);
  948. keyword=smalltalk.send(smalltalk.send(identifier, "__comma", [smalltalk.send(":", "_asParser", [])]), "_flatten", []);
  949. className=smalltalk.send(smalltalk.send(smalltalk.send(unescape("A-Z"), "_asCharacterParser", []), "__comma", [smalltalk.send(smalltalk.send(unescape("a-zA-Z0-9"), "_asCharacterParser", []), "_star", [])]), "_flatten", []);
  950. string=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%27"), "_asParser", []), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%27%27"), "_asParser", []), "__slash", [smalltalk.send(smalltalk.send(smalltalk.send(unescape("%27"), "_asParser", []), "_not", []), "__comma", [smalltalk.send(smalltalk.PPAnyParser, "_new", [])])]), "_star", []), "_flatten", [])]), "__comma", [smalltalk.send(unescape("%27"), "_asParser", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(smalltalk.ValueNode, "_new", []), "_value_", [smalltalk.send(smalltalk.send(node, "_at_", [(2)]), "_replace_with_", [unescape("%27%27"), unescape("%27")])]);})]);
  951. symbol=smalltalk.send(smalltalk.send(smalltalk.send(unescape("%23"), "_asParser", []), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(unescape("a-zA-Z0-9"), "_asCharacterParser", []), "_plus", []), "_flatten", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(smalltalk.ValueNode, "_new", []), "_value_", [smalltalk.send(node, "_second", [])]);})]);
  952. number=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("0-9"), "_asCharacterParser", []), "_plus", []), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(".", "_asParser", []), "__comma", [smalltalk.send(smalltalk.send(unescape("0-9"), "_asCharacterParser", []), "_plus", [])]), "_optional", [])]), "_flatten", []), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(smalltalk.ValueNode, "_new", []), "_value_", [smalltalk.send(node, "_asNumber", [])]);})]);
  953. literal=smalltalk.send(smalltalk.PPDelegateParser, "_new", []);
  954. literalArray=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%23%28"), "_asParser", []), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(ws, "__comma", [literal]), "__comma", [ws]), "_star", [])]), "__comma", [smalltalk.send(unescape("%29"), "_asParser", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(smalltalk.ValueNode, "_new", []), "_value_", [smalltalk.send(smalltalk.Array, "_withAll_", [smalltalk.send(smalltalk.send(node, "_second", []), "_collect_", [(function(each){return smalltalk.send(smalltalk.send(each, "_second", []), "_value", []);})])])]);})]);
  955. variable=smalltalk.send(identifier, "__eq_eq_gt", [(function(token){return smalltalk.send(smalltalk.send(smalltalk.VariableNode, "_new", []), "_value_", [token]);})]);
  956. classReference=smalltalk.send(className, "__eq_eq_gt", [(function(token){return smalltalk.send(smalltalk.send(smalltalk.ClassReferenceNode, "_new", []), "_value_", [token]);})]);
  957. reference=smalltalk.send(variable, "__slash", [classReference]);
  958. binarySelector=smalltalk.send(smalltalk.send(smalltalk.send(unescape("+*/%3D%3E%3C%2C@%25%7E-"), "_asCharacterParser", []), "_plus", []), "_flatten", []);
  959. unarySelector=identifier;
  960. keywordPattern=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(ws, "__comma", [keyword]), "__comma", [ws]), "__comma", [identifier]), "_plus", []), "__eq_eq_gt", [(function(nodes){return smalltalk.send(smalltalk.Array, "_with_with_", [smalltalk.send(smalltalk.send(nodes, "_collect_", [(function(each){return smalltalk.send(each, "_at_", [(2)]);})]), "_join_", [""]), smalltalk.send(nodes, "_collect_", [(function(each){return smalltalk.send(each, "_at_", [(4)]);})])]);})]);
  961. binaryPattern=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(ws, "__comma", [binarySelector]), "__comma", [ws]), "__comma", [identifier]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.Array, "_with_with_", [smalltalk.send(node, "_second", []), smalltalk.send(smalltalk.Array, "_with_", [smalltalk.send(node, "_fourth", [])])]);})]);
  962. unaryPattern=smalltalk.send(smalltalk.send(ws, "__comma", [unarySelector]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.Array, "_with_with_", [smalltalk.send(node, "_second", []), smalltalk.send(smalltalk.Array, "_new", [])]);})]);
  963. expression=smalltalk.send(smalltalk.PPDelegateParser, "_new", []);
  964. expressions=smalltalk.send(smalltalk.send(expression, "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(ws, "__comma", [smalltalk.send(".", "_asParser", [])]), "__comma", [ws]), "__comma", [expression]), "__eq_eq_gt", [(function(node){return smalltalk.send(node, "_fourth", []);})]), "_star", [])]), "__eq_eq_gt", [(function(node){var result=nil;
  965. result=smalltalk.send(smalltalk.Array, "_with_", [smalltalk.send(node, "_first", [])]);smalltalk.send(smalltalk.send(node, "_second", []), "_do_", [(function(each){return smalltalk.send(result, "_add_", [each]);})]);return result;})]);
  966. assignment=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(reference, "__comma", [ws]), "__comma", [smalltalk.send(unescape("%3A%3D"), "_asParser", [])]), "__comma", [ws]), "__comma", [expression]), "__eq_eq_gt", [(function(node){return (function($rec){smalltalk.send($rec, "_left_", [smalltalk.send(node, "_first", [])]);return smalltalk.send($rec, "_right_", [smalltalk.send(node, "_at_", [(5)])]);})(smalltalk.send(smalltalk.AssignmentNode, "_new", []));})]);
  967. ret=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%5E"), "_asParser", []), "__comma", [ws]), "__comma", [expression]), "__comma", [ws]), "__comma", [smalltalk.send(smalltalk.send(".", "_asParser", []), "_optional", [])]), "__eq_eq_gt", [(function(node){return (function($rec){smalltalk.send($rec, "_addNode_", [smalltalk.send(node, "_third", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.ReturnNode, "_new", []));})]);
  968. temps=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%7C"), "_asParser", []), "__comma", [smalltalk.send(smalltalk.send(ws, "__comma", [identifier]), "_star", [])]), "__comma", [ws]), "__comma", [smalltalk.send(unescape("%7C"), "_asParser", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(node, "_second", []), "_collect_", [(function(each){return smalltalk.send(each, "_second", []);})]);})]);
  969. blockParamList=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(":", "_asParser", []), "__comma", [identifier]), "__comma", [ws]), "_plus", []), "__comma", [smalltalk.send(unescape("%7C"), "_asParser", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(node, "_first", []), "_collect_", [(function(each){return smalltalk.send(each, "_second", []);})]);})]);
  970. subexpression=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%28"), "_asParser", []), "__comma", [ws]), "__comma", [expression]), "__comma", [ws]), "__comma", [smalltalk.send(unescape("%29"), "_asParser", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(node, "_third", []);})]);
  971. statements=smalltalk.send(smalltalk.send(smalltalk.send(ret, "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.Array, "_with_", [node]);})]), "__slash", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(expressions, "__comma", [ws]), "__comma", [smalltalk.send(".", "_asParser", [])]), "__comma", [ws]), "__comma", [ret]), "__eq_eq_gt", [(function(node){return (function($rec){smalltalk.send($rec, "_add_", [smalltalk.send(node, "_at_", [(5)])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(node, "_first", []));})])]), "__slash", [smalltalk.send(smalltalk.send(expressions, "__comma", [smalltalk.send(smalltalk.send(".", "_asParser", []), "_optional", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(node, "_first", []);})])]);
  972. sequence=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(temps, "_optional", []), "__comma", [ws]), "__comma", [smalltalk.send(statements, "_optional", [])]), "__comma", [ws]), "__eq_eq_gt", [(function(node){return (function($rec){smalltalk.send($rec, "_temps_", [smalltalk.send(node, "_first", [])]);smalltalk.send($rec, "_nodes_", [smalltalk.send(node, "_third", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.SequenceNode, "_new", []));})]);
  973. block=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%5B"), "_asParser", []), "__comma", [ws]), "__comma", [smalltalk.send(blockParamList, "_optional", [])]), "__comma", [ws]), "__comma", [smalltalk.send(sequence, "_optional", [])]), "__comma", [ws]), "__comma", [smalltalk.send(unescape("%5D"), "_asParser", [])]), "__eq_eq_gt", [(function(node){return (function($rec){smalltalk.send($rec, "_parameters_", [smalltalk.send(node, "_third", [])]);return smalltalk.send($rec, "_addNode_", [smalltalk.send(smalltalk.send(node, "_at_", [(5)]), "_asBlockSequenceNode", [])]);})(smalltalk.send(smalltalk.BlockNode, "_new", []));})]);
  974. operand=smalltalk.send(smalltalk.send(literal, "__slash", [reference]), "__slash", [subexpression]);
  975. smalltalk.send(literal, "_parser_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(number, "__slash", [string]), "__slash", [literalArray]), "__slash", [symbol]), "__slash", [block])]);
  976. unaryMessage=smalltalk.send(smalltalk.send(smalltalk.send(ws, "__comma", [unarySelector]), "__comma", [smalltalk.send(smalltalk.send(":", "_asParser", []), "_not", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(smalltalk.SendNode, "_new", []), "_selector_", [smalltalk.send(node, "_second", [])]);})]);
  977. unaryTail=smalltalk.send(smalltalk.PPDelegateParser, "_new", []);
  978. smalltalk.send(unaryTail, "_parser_", [smalltalk.send(smalltalk.send(unaryMessage, "__comma", [smalltalk.send(unaryTail, "_optional", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(node, "_second", []), "_ifNil_ifNotNil_", [(function(){return smalltalk.send(node, "_first", []);}), (function(){return smalltalk.send(smalltalk.send(node, "_second", []), "_valueForReceiver_", [smalltalk.send(node, "_first", [])]);})]);})])]);
  979. unarySend=smalltalk.send(smalltalk.send(operand, "__comma", [smalltalk.send(unaryTail, "_optional", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(node, "_second", []), "_ifNil_ifNotNil_", [(function(){return smalltalk.send(node, "_first", []);}), (function(){return smalltalk.send(smalltalk.send(node, "_second", []), "_valueForReceiver_", [smalltalk.send(node, "_first", [])]);})]);})]);
  980. binaryMessage=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(ws, "__comma", [binarySelector]), "__comma", [ws]), "__comma", [smalltalk.send(unarySend, "__slash", [operand])]), "__eq_eq_gt", [(function(node){return (function($rec){smalltalk.send($rec, "_selector_", [smalltalk.send(node, "_second", [])]);return smalltalk.send($rec, "_arguments_", [smalltalk.send(smalltalk.Array, "_with_", [smalltalk.send(node, "_fourth", [])])]);})(smalltalk.send(smalltalk.SendNode, "_new", []));})]);
  981. binaryTail=smalltalk.send(smalltalk.PPDelegateParser, "_new", []);
  982. smalltalk.send(binaryTail, "_parser_", [smalltalk.send(smalltalk.send(binaryMessage, "__comma", [smalltalk.send(binaryTail, "_optional", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(node, "_second", []), "_ifNil_ifNotNil_", [(function(){return smalltalk.send(node, "_first", []);}), (function(){return smalltalk.send(smalltalk.send(node, "_second", []), "_valueForReceiver_", [smalltalk.send(node, "_first", [])]);})]);})])]);
  983. binarySend=smalltalk.send(smalltalk.send(unarySend, "__comma", [smalltalk.send(binaryTail, "_optional", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(node, "_second", []), "_ifNil_ifNotNil_", [(function(){return smalltalk.send(node, "_first", []);}), (function(){return smalltalk.send(smalltalk.send(node, "_second", []), "_valueForReceiver_", [smalltalk.send(node, "_first", [])]);})]);})]);
  984. keywordPair=smalltalk.send(smalltalk.send(keyword, "__comma", [ws]), "__comma", [binarySend]);
  985. keywordMessage=smalltalk.send(smalltalk.send(smalltalk.send(ws, "__comma", [keywordPair]), "_plus", []), "__eq_eq_gt", [(function(nodes){return (function($rec){smalltalk.send($rec, "_selector_", [smalltalk.send(smalltalk.send(nodes, "_collect_", [(function(each){return smalltalk.send(smalltalk.send(each, "_second", []), "_first", []);})]), "_join_", [""])]);return smalltalk.send($rec, "_arguments_", [smalltalk.send(nodes, "_collect_", [(function(each){return smalltalk.send(smalltalk.send(each, "_second", []), "_third", []);})])]);})(smalltalk.send(smalltalk.SendNode, "_new", []));})]);
  986. keywordSend=smalltalk.send(smalltalk.send(binarySend, "__comma", [keywordMessage]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(node, "_second", []), "_valueForReceiver_", [smalltalk.send(node, "_first", [])]);})]);
  987. message=smalltalk.send(smalltalk.send(binaryMessage, "__slash", [unaryMessage]), "__slash", [keywordMessage]);
  988. cascade=smalltalk.send(smalltalk.send(smalltalk.send(keywordSend, "__slash", [binarySend]), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(ws, "__comma", [smalltalk.send(unescape("%3B"), "_asParser", [])]), "__comma", [message]), "_plus", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(node, "_first", []), "_cascadeNodeWithMessages_", [smalltalk.send(smalltalk.send(node, "_second", []), "_collect_", [(function(each){return smalltalk.send(each, "_third", []);})])]);})]);
  989. jsStatement=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%3C"), "_asParser", []), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%3E%3E"), "_asParser", []), "__slash", [smalltalk.send(smalltalk.send(smalltalk.send(unescape("%3E"), "_asParser", []), "_not", []), "__comma", [smalltalk.send(smalltalk.PPAnyParser, "_new", [])])]), "_star", []), "_flatten", [])]), "__comma", [smalltalk.send(unescape("%3E"), "_asParser", [])]), "__eq_eq_gt", [(function(node){return (function($rec){smalltalk.send($rec, "_source_", [smalltalk.send(node, "_second", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.JSStatementNode, "_new", []));})]);
  990. smalltalk.send(expression, "_parser_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(assignment, "__slash", [cascade]), "__slash", [keywordSend]), "__slash", [binarySend]), "__slash", [jsStatement])]);
  991. method=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(ws, "__comma", [smalltalk.send(smalltalk.send(keywordPattern, "__slash", [binaryPattern]), "__slash", [unaryPattern])]), "__comma", [ws]), "__comma", [smalltalk.send(sequence, "_optional", [])]), "__comma", [ws]), "_withSource", []), "__eq_eq_gt", [(function(node){return (function($rec){smalltalk.send($rec, "_selector_", [smalltalk.send(smalltalk.send(smalltalk.send(node, "_first", []), "_second", []), "_first", [])]);smalltalk.send($rec, "_arguments_", [smalltalk.send(smalltalk.send(smalltalk.send(node, "_first", []), "_second", []), "_second", [])]);smalltalk.send($rec, "_addNode_", [smalltalk.send(smalltalk.send(node, "_first", []), "_fourth", [])]);smalltalk.send($rec, "_source_", [smalltalk.send(node, "_second", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(smalltalk.MethodNode, "_new", []));})]);
  992. return smalltalk.send(smalltalk.send(method, "__comma", [smalltalk.send(smalltalk.PPEOFParser, "_new", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(node, "_first", []);})]);
  993. return self;},
  994. source: unescape('parser%0A%09%7C%20method%20expression%20separator%20comment%20ws%20identifier%20keyword%20className%20string%20symbol%20number%20literalArray%20variable%20reference%20classReference%20literal%20ret%20methodParser%20expressionParser%20keyword%20unarySelector%20binarySelector%20keywordPattern%20unaryPattern%20binaryPattern%20assignment%20temps%20blockParamList%20block%20expression%20expressions%20subexpression%20statements%20sequence%20operand%20unaryMessage%20unarySend%20unaryTail%20binaryMessage%20binarySend%20binaryTail%20keywordMessage%20keywordSend%20keywordPair%20cascade%20message%20jsStatement%20%7C%0A%09%0A%09separator%20%3A%3D%20%28String%20cr%2C%20String%20space%2C%20String%20lf%2C%20String%20tab%29%20asChoiceParser.%0A%09comment%20%3A%3D%20%28%27%22%27%20asCharacterParser%2C%20%28%27%22%27%20asParser%20not%2C%20PPAnyParser%20new%29%20star%2C%20%27%22%27%20asCharacterParser%29%20flatten.%0A%0A%09ws%20%3A%3D%20%28separator%20/%20comment%29%20star.%0A%09%0A%09identifier%20%3A%3D%20%28%27a-z%27%20asCharacterParser%2C%20%27a-zA-Z0-9%27%20asCharacterParser%20star%29%20flatten.%0A%0A%09keyword%20%3A%3D%20%28identifier%2C%20%27%3A%27%20asParser%29%20flatten.%0A%0A%09className%20%3A%3D%20%28%27A-Z%27%20asCharacterParser%2C%20%27a-zA-Z0-9%27%20asCharacterParser%20star%29%20flatten.%0A%0A%09string%20%3A%3D%20%27%27%27%27%20asParser%2C%20%28%27%27%27%27%27%27%20asParser%20/%20%28%27%27%27%27%20asParser%20not%2C%20PPAnyParser%20new%29%29%20star%20flatten%2C%20%27%27%27%27%20asParser%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20ValueNode%20new%20value%3A%20%28%28node%20at%3A%202%29%20replace%3A%20%27%27%27%27%27%27%20with%3A%20%27%27%27%27%29%5D.%0A%0A%09symbol%20%3A%3D%20%27%23%27%20asParser%2C%20%27a-zA-Z0-9%27%20asCharacterParser%20plus%20flatten%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20ValueNode%20new%20value%3A%20node%20second%5D.%0A%0A%09number%20%3A%3D%20%28%270-9%27%20asCharacterParser%20plus%2C%20%28%27.%27%20asParser%2C%20%270-9%27%20asCharacterParser%20plus%29%20optional%29%20flatten%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20ValueNode%20new%20value%3A%20node%20asNumber%5D.%0A%0A%09literal%20%3A%3D%20PPDelegateParser%20new.%0A%0A%09literalArray%20%3A%3D%20%27%23%28%27%20asParser%2C%20%28ws%2C%20literal%2C%20ws%29%20star%2C%20%27%29%27%20asParser%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20ValueNode%20new%20value%3A%20%28Array%20withAll%3A%20%28node%20second%20collect%3A%20%5B%3Aeach%20%7C%20each%20second%20value%5D%29%29%5D.%0A%0A%09variable%20%3A%3D%20identifier%20%3D%3D%3E%20%5B%3Atoken%20%7C%20VariableNode%20new%20value%3A%20token%5D.%0A%0A%09classReference%20%3A%3D%20className%20%3D%3D%3E%20%5B%3Atoken%20%7C%20ClassReferenceNode%20new%20value%3A%20token%5D.%0A%0A%09reference%20%3A%3D%20variable%20/%20classReference.%0A%0A%09binarySelector%20%3A%3D%20%27+*/%3D%3E%3C%2C@%25%7E-%27%20asCharacterParser%20plus%20flatten.%0A%0A%09unarySelector%20%3A%3D%20identifier.%0A%0A%09keywordPattern%20%3A%3D%20%28ws%2C%20keyword%2C%20ws%2C%20identifier%29%20plus%0A%09%09%3D%3D%3E%20%5B%3Anodes%20%7C%20Array%0A%09%09%09%09%20%20with%3A%20%28%28nodes%20collect%3A%20%5B%3Aeach%20%7C%20each%20at%3A%202%5D%29%20join%3A%20%27%27%29%0A%09%09%09%09%20%20with%3A%20%28nodes%20collect%3A%20%5B%3Aeach%20%7C%20each%20at%3A%204%5D%29%5D.%0A%0A%09binaryPattern%20%3A%3D%20ws%2C%20binarySelector%2C%20ws%2C%20identifier%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20Array%20with%3A%20node%20second%20with%3A%20%28Array%20with%3A%20node%20fourth%29%5D.%0A%0A%09unaryPattern%20%3A%3D%20ws%2C%20unarySelector%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20Array%20with%3A%20node%20second%20with%3A%20Array%20new%5D.%0A%09%0A%09expression%20%3A%3D%20PPDelegateParser%20new.%0A%0A%09expressions%20%3A%3D%20expression%2C%20%28%28ws%2C%20%27.%27%20asParser%2C%20ws%2C%20expression%29%20%3D%3D%3E%20%5B%3Anode%20%7C%20node%20fourth%5D%29%20star%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%7C%20result%20%7C%0A%09%09%20%20%20%20result%20%3A%3D%20Array%20with%3A%20node%20first.%0A%09%09%20%20%20%20node%20second%20do%3A%20%5B%3Aeach%20%7C%20result%20add%3A%20each%5D.%0A%09%09%20%20%20%20result%5D.%0A%0A%09assignment%20%3A%3D%20reference%2C%20ws%2C%20%27%3A%3D%27%20asParser%2C%20ws%2C%20expression%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20AssignmentNode%20new%20left%3A%20node%20first%3B%20right%3A%20%28node%20at%3A%205%29%5D.%0A%0A%09ret%20%3A%3D%20%27%5E%27%20asParser%2C%20ws%2C%20expression%2C%20ws%2C%20%27.%27%20asParser%20optional%0A%09%20%20%20%20%3D%3D%3E%20%5B%3Anode%20%7C%20ReturnNode%20new%0A%09%09%09%20%20%20%20%20addNode%3A%20node%20third%3B%0A%09%09%09%20%20%20%20%20yourself%5D.%0A%0A%09temps%20%3A%3D%20%27%7C%27%20asParser%2C%20%28ws%2C%20identifier%29%20star%2C%20ws%2C%20%27%7C%27%20asParser%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20node%20second%20collect%3A%20%5B%3Aeach%20%7C%20each%20second%5D%5D.%0A%0A%09blockParamList%20%3A%3D%20%28%27%3A%27%20asParser%2C%20identifier%2C%20ws%29%20plus%2C%20%27%7C%27%20asParser%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20node%20first%20collect%3A%20%5B%3Aeach%20%7C%20each%20second%5D%5D.%0A%0A%09subexpression%20%3A%3D%20%27%28%27%20asParser%2C%20ws%2C%20expression%2C%20ws%2C%20%27%29%27%20asParser%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20node%20third%5D.%0A%0A%09statements%20%3A%3D%20%28ret%20%3D%3D%3E%20%5B%3Anode%20%7C%20Array%20with%3A%20node%5D%29%20/%20%28expressions%2C%20ws%2C%20%27.%27%20asParser%2C%20ws%2C%20ret%20%3D%3D%3E%20%5B%3Anode%20%7C%20node%20first%20add%3A%20%28node%20at%3A%205%29%3B%20yourself%5D%29%20/%20%28expressions%20%2C%20%27.%27%20asParser%20optional%20%3D%3D%3E%20%5B%3Anode%20%7C%20node%20first%5D%29.%0A%0A%09sequence%20%3A%3D%20temps%20optional%2C%20ws%2C%20statements%20optional%2C%20ws%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20SequenceNode%20new%0A%09%09%09%09%20temps%3A%20node%20first%3B%0A%09%09%09%09%20nodes%3A%20node%20third%3B%0A%09%09%09%09%20yourself%5D.%0A%0A%09block%20%3A%3D%20%27%5B%27%20asParser%2C%20ws%2C%20blockParamList%20optional%2C%20ws%2C%20sequence%20optional%2C%20ws%2C%20%27%5D%27%20asParser%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%0A%09%09%20%20%20%20BlockNode%20new%0A%09%09%09parameters%3A%20node%20third%3B%0A%09%09%09addNode%3A%20%28node%20at%3A%205%29%20asBlockSequenceNode%5D.%0A%0A%09operand%20%3A%3D%20literal%20/%20reference%20/%20subexpression.%0A%0A%09literal%20parser%3A%20number%20/%20string%20/%20literalArray%20/%20symbol%20/%20block.%0A%0A%09unaryMessage%20%3A%3D%20ws%2C%20unarySelector%2C%20%27%3A%27%20asParser%20not%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20SendNode%20new%20selector%3A%20node%20second%5D.%0A%0A%09unaryTail%20%3A%3D%20PPDelegateParser%20new.%0A%09unaryTail%20parser%3A%20%28unaryMessage%2C%20unaryTail%20optional%0A%09%09%09%20%20%20%20%20%20%20%3D%3D%3E%20%5B%3Anode%20%7C%0A%09%09%09%09%20%20%20node%20second%0A%09%09%09%09%09%20%20%20ifNil%3A%20%5Bnode%20first%5D%0A%09%09%09%09%09%20%20%20ifNotNil%3A%20%5Bnode%20second%20valueForReceiver%3A%20node%20first%5D%5D%29.%0A%0A%09unarySend%20%3A%3D%20operand%2C%20unaryTail%20optional%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%0A%09%09%20%20%20%20node%20second%20%0A%09%09%09ifNil%3A%20%5Bnode%20first%5D%0A%09%09%09ifNotNil%3A%20%5Bnode%20second%20valueForReceiver%3A%20node%20first%5D%5D.%0A%0A%09binaryMessage%20%3A%3D%20ws%2C%20binarySelector%2C%20ws%2C%20%28unarySend%20/%20operand%29%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%0A%09%09%20%20%20%20SendNode%20new%0A%09%09%09selector%3A%20node%20second%3B%0A%09%09%09arguments%3A%20%28Array%20with%3A%20node%20fourth%29%5D.%0A%0A%09binaryTail%20%3A%3D%20PPDelegateParser%20new.%0A%09binaryTail%20parser%3A%20%28binaryMessage%2C%20binaryTail%20optional%0A%09%09%09%09%20%20%20%20%3D%3D%3E%20%5B%3Anode%20%7C%0A%09%09%09%09%09node%20second%20%0A%09%09%09%09%09%20%20%20%20ifNil%3A%20%5Bnode%20first%5D%0A%09%09%09%09%09%20%20%20%20ifNotNil%3A%20%5B%20node%20second%20valueForReceiver%3A%20node%20first%5D%5D%29.%0A%0A%09binarySend%20%3A%3D%20unarySend%2C%20binaryTail%20optional%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%0A%09%09%20%20%20%20node%20second%0A%09%09%09ifNil%3A%20%5Bnode%20first%5D%0A%09%09%09ifNotNil%3A%20%5Bnode%20second%20valueForReceiver%3A%20node%20first%5D%5D.%0A%0A%09keywordPair%20%3A%3D%20keyword%2C%20ws%2C%20binarySend.%0A%0A%09keywordMessage%20%3A%3D%20%28ws%2C%20keywordPair%29%20plus%0A%09%09%3D%3D%3E%20%5B%3Anodes%20%7C%0A%09%09%20%20%20%20SendNode%20new%0A%09%09%09selector%3A%20%28%28nodes%20collect%3A%20%5B%3Aeach%20%7C%20each%20second%20first%5D%29%20join%3A%20%27%27%29%3B%0A%09%09%09arguments%3A%20%28nodes%20collect%3A%20%5B%3Aeach%20%7C%20each%20second%20third%5D%29%5D.%0A%0A%09keywordSend%20%3A%3D%20binarySend%2C%20keywordMessage%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%0A%09%09%20%20%20%20node%20second%20valueForReceiver%3A%20node%20first%5D.%0A%0A%09message%20%3A%3D%20binaryMessage%20/%20unaryMessage%20/%20keywordMessage.%0A%0A%09cascade%20%3A%3D%20%28keywordSend%20/%20binarySend%29%2C%20%28ws%2C%20%27%3B%27%20asParser%2C%20message%29%20plus%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%0A%09%09%20%20%20%20node%20first%20cascadeNodeWithMessages%3A%20%0A%09%09%09%28node%20second%20collect%3A%20%5B%3Aeach%20%7C%20each%20third%5D%29%5D.%0A%0A%09jsStatement%20%3A%3D%20%27%3C%27%20asParser%2C%20%28%27%3E%3E%27%20asParser%20/%20%28%27%3E%27%20asParser%20not%2C%20PPAnyParser%20new%29%29%20star%20flatten%2C%20%27%3E%27%20asParser%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20JSStatementNode%20new%0A%09%09%09source%3A%20node%20second%3B%0A%09%09%09yourself%5D.%0A%0A%09expression%20parser%3A%20assignment%20/%20cascade%20/%20keywordSend%20/%20binarySend%20/%20jsStatement.%0A%0A%09method%20%3A%3D%20%28ws%2C%20%28keywordPattern%20/%20binaryPattern%20/%20unaryPattern%29%2C%20ws%2C%20sequence%20optional%2C%20ws%29%20withSource%0A%09%20%20%20%20%3D%3D%3E%20%5B%3Anode%20%7C%0A%09%09MethodNode%20new%0A%09%09%20%20%20%20selector%3A%20node%20first%20second%20first%3B%0A%09%09%20%20%20%20arguments%3A%20node%20first%20second%20second%3B%0A%09%09%20%20%20%20addNode%3A%20node%20first%20fourth%3B%0A%09%09%20%20%20%20source%3A%20node%20second%3B%0A%09%09%20%20%20%20yourself%5D.%0A%09%0A%09%5Emethod%2C%20PPEOFParser%20new%20%3D%3D%3E%20%5B%3Anode%20%7C%20node%20first%5D'),
  995. messageSends: ["asChoiceParser", unescape("%2C"), "cr", "space", "lf", "tab", "flatten", "asCharacterParser", "star", "not", "asParser", "new", unescape("/"), unescape("%3D%3D%3E"), "value:", "replace:with:", "at:", "plus", "second", "optional", "asNumber", "withAll:", "collect:", "value", "with:with:", "join:", "with:", "fourth", "first", "do:", "add:", "left:", "right:", "addNode:", "third", "yourself", "temps:", "nodes:", "parameters:", "asBlockSequenceNode", "parser:", "selector:", "ifNil:ifNotNil:", "valueForReceiver:", "arguments:", "cascadeNodeWithMessages:", "source:", "withSource"],
  996. referencedClasses: [smalltalk.String,smalltalk.PPAnyParser,smalltalk.nil,smalltalk.PPDelegateParser,smalltalk.Array,smalltalk.nil,smalltalk.nil,smalltalk.nil,smalltalk.nil,smalltalk.nil,smalltalk.nil,smalltalk.nil,smalltalk.nil,smalltalk.nil,smalltalk.PPEOFParser]
  997. }),
  998. smalltalk.SmalltalkParser);
  999. smalltalk.addMethod(
  1000. '_parse_',
  1001. smalltalk.method({
  1002. selector: 'parse:',
  1003. category: 'instance creation',
  1004. fn: function (aStream){
  1005. var self=this;
  1006. return smalltalk.send(smalltalk.send(self, "_new", []), "_parse_", [aStream]);
  1007. return self;},
  1008. source: unescape('parse%3A%20aStream%0A%09%20%20%20%20%5Eself%20new%0A%09%09parse%3A%20aStream'),
  1009. messageSends: ["parse:", "new"],
  1010. referencedClasses: []
  1011. }),
  1012. smalltalk.SmalltalkParser.klass);
  1013. smalltalk.addClass('Chunk', smalltalk.Object, ['contents'], 'Parser');
  1014. smalltalk.addMethod(
  1015. '_contents',
  1016. smalltalk.method({
  1017. selector: 'contents',
  1018. category: 'accessing',
  1019. fn: function (){
  1020. var self=this;
  1021. return smalltalk.send(self['@contents'], "_ifNil_", [(function(){return "";})]);
  1022. return self;},
  1023. source: unescape('contents%0A%09%5Econtents%20ifNil%3A%20%5B%27%27%5D'),
  1024. messageSends: ["ifNil:"],
  1025. referencedClasses: []
  1026. }),
  1027. smalltalk.Chunk);
  1028. smalltalk.addMethod(
  1029. '_contents_',
  1030. smalltalk.method({
  1031. selector: 'contents:',
  1032. category: 'accessing',
  1033. fn: function (aString){
  1034. var self=this;
  1035. self['@contents']=aString;
  1036. return self;},
  1037. source: unescape('contents%3A%20aString%0A%09contents%20%3A%3D%20aString'),
  1038. messageSends: [],
  1039. referencedClasses: []
  1040. }),
  1041. smalltalk.Chunk);
  1042. smalltalk.addMethod(
  1043. '_isEmptyChunk',
  1044. smalltalk.method({
  1045. selector: 'isEmptyChunk',
  1046. category: 'testing',
  1047. fn: function (){
  1048. var self=this;
  1049. return false;
  1050. return self;},
  1051. source: unescape('isEmptyChunk%0A%09%5Efalse'),
  1052. messageSends: [],
  1053. referencedClasses: []
  1054. }),
  1055. smalltalk.Chunk);
  1056. smalltalk.addMethod(
  1057. '_isInstructionChunk',
  1058. smalltalk.method({
  1059. selector: 'isInstructionChunk',
  1060. category: 'testing',
  1061. fn: function (){
  1062. var self=this;
  1063. return false;
  1064. return self;},
  1065. source: unescape('isInstructionChunk%0A%09%5Efalse'),
  1066. messageSends: [],
  1067. referencedClasses: []
  1068. }),
  1069. smalltalk.Chunk);
  1070. smalltalk.addClass('InstructionChunk', smalltalk.Chunk, [], 'Parser');
  1071. smalltalk.addMethod(
  1072. '_isInstructionChunk',
  1073. smalltalk.method({
  1074. selector: 'isInstructionChunk',
  1075. category: 'testing',
  1076. fn: function (){
  1077. var self=this;
  1078. return true;
  1079. return self;},
  1080. source: unescape('isInstructionChunk%0A%09%5Etrue'),
  1081. messageSends: [],
  1082. referencedClasses: []
  1083. }),
  1084. smalltalk.InstructionChunk);
  1085. smalltalk.addClass('EmptyChunk', smalltalk.Chunk, [], 'Parser');
  1086. smalltalk.addMethod(
  1087. '_isEmptyChunk',
  1088. smalltalk.method({
  1089. selector: 'isEmptyChunk',
  1090. category: 'testing',
  1091. fn: function (){
  1092. var self=this;
  1093. return true;
  1094. return self;},
  1095. source: unescape('isEmptyChunk%0A%09%5Etrue'),
  1096. messageSends: [],
  1097. referencedClasses: []
  1098. }),
  1099. smalltalk.EmptyChunk);
  1100. smalltalk.addClass('ChunkParser', smalltalk.Object, ['parser', 'separator', 'eof', 'ws', 'chunk', 'emptyChunk', 'instructionChunk'], 'Parser');
  1101. smalltalk.addMethod(
  1102. '_parser',
  1103. smalltalk.method({
  1104. selector: 'parser',
  1105. category: 'accessing',
  1106. fn: function (){
  1107. var self=this;
  1108. return smalltalk.send(self['@parser'], "_ifNil_", [(function(){return self['@parser']=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_instructionChunk", []), "__slash", [smalltalk.send(self, "_emptyChunk", [])]), "__slash", [smalltalk.send(self, "_chunk", [])]), "__slash", [smalltalk.send(self, "_eof", [])]);})]);
  1109. return self;},
  1110. source: unescape('parser%0A%09%5Eparser%20ifNil%3A%20%5B%0A%09%20%20%20%20parser%20%3A%3D%20self%20instructionChunk%20/%20self%20emptyChunk%20/%20self%20chunk%20/%20self%20eof%5D'),
  1111. messageSends: ["ifNil:", unescape("/"), "instructionChunk", "emptyChunk", "chunk", "eof"],
  1112. referencedClasses: []
  1113. }),
  1114. smalltalk.ChunkParser);
  1115. smalltalk.addMethod(
  1116. '_eof',
  1117. smalltalk.method({
  1118. selector: 'eof',
  1119. category: 'accessing',
  1120. fn: function (){
  1121. var self=this;
  1122. return smalltalk.send(self['@eof'], "_ifNil_", [(function(){return self['@eof']=smalltalk.send(smalltalk.send(smalltalk.send(self, "_ws", []), "__comma", [smalltalk.send(smalltalk.PPEOFParser, "_new", [])]), "__eq_eq_gt", [(function(node){return nil;})]);})]);
  1123. return self;},
  1124. source: unescape('eof%0A%09%5Eeof%20ifNil%3A%20%5Beof%20%3A%3D%20self%20ws%2C%20PPEOFParser%20new%20%3D%3D%3E%20%5B%3Anode%20%7C%20nil%5D%5D'),
  1125. messageSends: ["ifNil:", unescape("%3D%3D%3E"), unescape("%2C"), "ws", "new"],
  1126. referencedClasses: [smalltalk.PPEOFParser]
  1127. }),
  1128. smalltalk.ChunkParser);
  1129. smalltalk.addMethod(
  1130. '_separator',
  1131. smalltalk.method({
  1132. selector: 'separator',
  1133. category: 'accessing',
  1134. fn: function (){
  1135. var self=this;
  1136. return smalltalk.send(self['@separator'], "_ifNil_", [(function(){return self['@separator']=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.String, "_cr", []), "__comma", [smalltalk.send(smalltalk.String, "_space", [])]), "__comma", [smalltalk.send(smalltalk.String, "_lf", [])]), "__comma", [smalltalk.send(smalltalk.String, "_tab", [])]), "_asChoiceParser", []);})]);
  1137. return self;},
  1138. source: unescape('separator%0A%09%5Eseparator%20ifNil%3A%20%5Bseparator%20%3A%3D%20%28String%20cr%2C%20String%20space%2C%20String%20lf%2C%20String%20tab%29%20asChoiceParser%5D'),
  1139. messageSends: ["ifNil:", "asChoiceParser", unescape("%2C"), "cr", "space", "lf", "tab"],
  1140. referencedClasses: [smalltalk.String]
  1141. }),
  1142. smalltalk.ChunkParser);
  1143. smalltalk.addMethod(
  1144. '_ws',
  1145. smalltalk.method({
  1146. selector: 'ws',
  1147. category: 'accessing',
  1148. fn: function (){
  1149. var self=this;
  1150. return smalltalk.send(self['@ws'], "_ifNil_", [(function(){return self['@ws']=smalltalk.send(smalltalk.send(self, "_separator", []), "_star", []);})]);
  1151. return self;},
  1152. source: unescape('ws%0A%09%5Ews%20ifNil%3A%20%5Bws%20%3A%3D%20self%20separator%20star%5D'),
  1153. messageSends: ["ifNil:", "star", "separator"],
  1154. referencedClasses: []
  1155. }),
  1156. smalltalk.ChunkParser);
  1157. smalltalk.addMethod(
  1158. '_chunk',
  1159. smalltalk.method({
  1160. selector: 'chunk',
  1161. category: 'accessing',
  1162. fn: function (){
  1163. var self=this;
  1164. return smalltalk.send(self['@chunk'], "_ifNil_", [(function(){return self['@chunk']=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_ws", []), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(unescape("%21%21"), "_asParser", []), "__slash", [smalltalk.send(smalltalk.send(smalltalk.send(unescape("%21"), "_asParser", []), "_not", []), "__comma", [smalltalk.send(smalltalk.PPAnyParser, "_new", [])])]), "_plus", []), "_flatten", [])]), "__comma", [smalltalk.send(unescape("%21"), "_asParser", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(smalltalk.Chunk, "_new", []), "_contents_", [smalltalk.send(smalltalk.send(smalltalk.send(node, "_second", []), "_replace_with_", [unescape("%21%21"), unescape("%21")]), "_trimBoth", [])]);})]);})]);
  1165. return self;},
  1166. source: unescape('chunk%0A%09%5Echunk%20ifNil%3A%20%5Bchunk%20%3A%3D%20self%20ws%2C%20%28%27%21%21%27%20asParser%20/%20%28%27%21%27%20asParser%20not%2C%20PPAnyParser%20new%29%29%20plus%20flatten%2C%20%27%21%27%20asParser%0A%09%09%3D%3D%3E%20%5B%3Anode%20%7C%20Chunk%20new%20contents%3A%20%28node%20second%20replace%3A%20%27%21%21%27%20with%3A%20%27%21%27%29%20trimBoth%5D%5D'),
  1167. messageSends: ["ifNil:", unescape("%3D%3D%3E"), unescape("%2C"), "ws", "flatten", "plus", unescape("/"), "asParser", "not", "new", "contents:", "trimBoth", "replace:with:", "second"],
  1168. referencedClasses: [smalltalk.PPAnyParser,smalltalk.Chunk]
  1169. }),
  1170. smalltalk.ChunkParser);
  1171. smalltalk.addMethod(
  1172. '_emptyChunk',
  1173. smalltalk.method({
  1174. selector: 'emptyChunk',
  1175. category: 'accessing',
  1176. fn: function (){
  1177. var self=this;
  1178. return smalltalk.send(self['@emptyChunk'], "_ifNil_", [(function(){return self['@emptyChunk']=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_separator", []), "_plus", []), "__comma", [smalltalk.send(unescape("%21"), "_asParser", [])]), "__comma", [smalltalk.send(self, "_ws", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.EmptyChunk, "_new", []);})]);})]);
  1179. return self;},
  1180. source: unescape('emptyChunk%0A%09%5EemptyChunk%20ifNil%3A%20%5BemptyChunk%20%3A%3D%20self%20separator%20plus%2C%20%27%21%27%20asParser%2C%20self%20ws%20%3D%3D%3E%20%5B%3Anode%20%7C%20EmptyChunk%20new%5D%5D'),
  1181. messageSends: ["ifNil:", unescape("%3D%3D%3E"), unescape("%2C"), "plus", "separator", "asParser", "ws", "new"],
  1182. referencedClasses: [smalltalk.EmptyChunk]
  1183. }),
  1184. smalltalk.ChunkParser);
  1185. smalltalk.addMethod(
  1186. '_instructionChunk',
  1187. smalltalk.method({
  1188. selector: 'instructionChunk',
  1189. category: '',
  1190. fn: function (){
  1191. var self=this;
  1192. return smalltalk.send(self['@instructionChunk'], "_ifNil_", [(function(){return self['@instructionChunk']=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_ws", []), "__comma", [smalltalk.send(unescape("%21"), "_asParser", [])]), "__comma", [smalltalk.send(self, "_chunk", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(smalltalk.send(smalltalk.InstructionChunk, "_new", []), "_contents_", [smalltalk.send(smalltalk.send(node, "_last", []), "_contents", [])]);})]);})]);
  1193. return self;},
  1194. source: unescape('instructionChunk%0A%09%5EinstructionChunk%20ifNil%3A%20%5B%0A%09%20%20%20%20instructionChunk%20%3A%3D%20self%20ws%2C%20%27%21%27%20asParser%2C%20self%20chunk%0A%09%20%20%20%20%3D%3D%3E%20%5B%3Anode%20%7C%20InstructionChunk%20new%20contents%3A%20node%20last%20contents%5D%5D'),
  1195. messageSends: ["ifNil:", unescape("%3D%3D%3E"), unescape("%2C"), "ws", "asParser", "chunk", "contents:", "new", "contents", "last"],
  1196. referencedClasses: [smalltalk.InstructionChunk]
  1197. }),
  1198. smalltalk.ChunkParser);
  1199. smalltalk.addClass('Importer', smalltalk.Object, ['chunkParser'], 'Parser');
  1200. smalltalk.addMethod(
  1201. '_chunkParser',
  1202. smalltalk.method({
  1203. selector: 'chunkParser',
  1204. category: 'accessing',
  1205. fn: function (){
  1206. var self=this;
  1207. return smalltalk.send(self['@chunkParser'], "_ifNil_", [(function(){return self['@chunkParser']=smalltalk.send(smalltalk.send(smalltalk.ChunkParser, "_new", []), "_parser", []);})]);
  1208. return self;},
  1209. source: unescape('chunkParser%0A%09%5EchunkParser%20ifNil%3A%20%5BchunkParser%20%3A%3D%20ChunkParser%20new%20parser%5D'),
  1210. messageSends: ["ifNil:", "parser", "new"],
  1211. referencedClasses: [smalltalk.ChunkParser]
  1212. }),
  1213. smalltalk.Importer);
  1214. smalltalk.addMethod(
  1215. '_import_',
  1216. smalltalk.method({
  1217. selector: 'import:',
  1218. category: 'fileIn',
  1219. fn: function (aStream){
  1220. var self=this;
  1221. smalltalk.send(smalltalk.send(aStream, "_atEnd", []), "_ifFalse_", [(function(){var nextChunk=nil;
  1222. nextChunk=smalltalk.send(smalltalk.send(self, "_chunkParser", []), "_parse_", [aStream]);return smalltalk.send(nextChunk, "_ifNotNil_", [(function(){smalltalk.send(smalltalk.send(nextChunk, "_isInstructionChunk", []), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Compiler, "_new", []), "_loadExpression_", [smalltalk.send(nextChunk, "_contents", [])]), "_scanFrom_", [aStream]);}), (function(){return smalltalk.send(smalltalk.send(smalltalk.Compiler, "_new", []), "_loadExpression_", [smalltalk.send(nextChunk, "_contents", [])]);})]);return smalltalk.send(self, "_import_", [aStream]);})]);})]);
  1223. return self;},
  1224. source: unescape('import%3A%20aStream%0A%09aStream%20atEnd%20ifFalse%3A%20%5B%0A%09%20%20%20%20%7C%20nextChunk%20%7C%0A%09%20%20%20%20nextChunk%20%3A%3D%20self%20chunkParser%20parse%3A%20aStream.%0A%09%20%20%20%20nextChunk%20ifNotNil%3A%20%5B%0A%09%09nextChunk%20isInstructionChunk%20%0A%09%09%20%20%20%20ifTrue%3A%20%5B%28Compiler%20new%20loadExpression%3A%20nextChunk%20contents%29%0A%09%09%09%09%09%20scanFrom%3A%20aStream%5D%0A%09%09%20%20%20%20ifFalse%3A%20%5BCompiler%20new%20loadExpression%3A%20nextChunk%20contents%5D.%0A%09%09self%20import%3A%20aStream%5D%5D'),
  1225. messageSends: ["ifFalse:", "atEnd", "parse:", "chunkParser", "ifNotNil:", "ifTrue:ifFalse:", "isInstructionChunk", "scanFrom:", "loadExpression:", "new", "contents", "import:"],
  1226. referencedClasses: [smalltalk.nil]
  1227. }),
  1228. smalltalk.Importer);
  1229. smalltalk.addClass('Exporter', smalltalk.Object, [], 'Parser');
  1230. smalltalk.addMethod(
  1231. '_exportCategory_',
  1232. smalltalk.method({
  1233. selector: 'exportCategory:',
  1234. category: 'fileOut',
  1235. fn: function (aString){
  1236. var self=this;
  1237. var stream=nil;
  1238. stream=smalltalk.send("", "_writeStream", []);
  1239. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Smalltalk, "_current", []), "_classes", []), "_select_", [(function(each){return smalltalk.send(smalltalk.send(each, "_category", []), "__eq", [aString]);})]), "_do_", [(function(each){return smalltalk.send(stream, "_nextPutAll_", [smalltalk.send(self, "_export_", [each])]);})]);
  1240. smalltalk.send(self, "_exportCategoryExtensions_on_", [aString, stream]);
  1241. return smalltalk.send(stream, "_contents", []);
  1242. return self;},
  1243. source: unescape('exportCategory%3A%20aString%0A%09%7C%20stream%20%7C%0A%09stream%20%3A%3D%20%27%27%20writeStream.%0A%09%28Smalltalk%20current%20classes%20%0A%09%20%20%20%20select%3A%20%5B%3Aeach%20%7C%20each%20category%20%3D%20aString%5D%29%0A%09%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20stream%20nextPutAll%3A%20%28self%20export%3A%20each%29%5D.%0A%09self%20exportCategoryExtensions%3A%20aString%20on%3A%20stream.%0A%09%5Estream%20contents'),
  1244. messageSends: ["writeStream", "do:", "select:", "classes", "current", unescape("%3D"), "category", "nextPutAll:", "export:", "exportCategoryExtensions:on:", "contents"],
  1245. referencedClasses: [smalltalk.Smalltalk]
  1246. }),
  1247. smalltalk.Exporter);
  1248. smalltalk.addMethod(
  1249. '_export_',
  1250. smalltalk.method({
  1251. selector: 'export:',
  1252. category: 'fileOut',
  1253. fn: function (aClass){
  1254. var self=this;
  1255. var stream=nil;
  1256. stream=smalltalk.send("", "_writeStream", []);
  1257. smalltalk.send(self, "_exportDefinitionOf_on_", [aClass, stream]);
  1258. smalltalk.send(self, "_exportMethodsOf_on_", [aClass, stream]);
  1259. smalltalk.send(self, "_exportMetaDefinitionOf_on_", [aClass, stream]);
  1260. smalltalk.send(self, "_exportMethodsOf_on_", [smalltalk.send(aClass, "_class", []), stream]);
  1261. return smalltalk.send(stream, "_contents", []);
  1262. return self;},
  1263. source: unescape('export%3A%20aClass%0A%09%7C%20stream%20%7C%0A%09stream%20%3A%3D%20%27%27%20writeStream.%0A%09self%20exportDefinitionOf%3A%20aClass%20on%3A%20stream.%0A%09self%20exportMethodsOf%3A%20aClass%20on%3A%20stream.%0A%09self%20exportMetaDefinitionOf%3A%20aClass%20on%3A%20stream.%0A%09self%20exportMethodsOf%3A%20aClass%20class%20on%3A%20stream.%0A%09%5Estream%20contents'),
  1264. messageSends: ["writeStream", "exportDefinitionOf:on:", "exportMethodsOf:on:", "exportMetaDefinitionOf:on:", "class", "contents"],
  1265. referencedClasses: []
  1266. }),
  1267. smalltalk.Exporter);
  1268. smalltalk.addMethod(
  1269. '_exportDefinitionOf_on_',
  1270. smalltalk.method({
  1271. selector: 'exportDefinitionOf:on:',
  1272. category: 'private',
  1273. fn: function (aClass, aStream){
  1274. var self=this;
  1275. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("smalltalk.addClass%28")]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])]), "__comma", [unescape("%27%2C%20")])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_superclass", [])])])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%2C%20%5B")]);})(aStream);
  1276. smalltalk.send(smalltalk.send(aClass, "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [each]), "__comma", [unescape("%27")])]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [unescape("%2C%20")]);})]);
  1277. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("%5D%2C%20%27")]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(aClass, "_category", []), "__comma", [unescape("%27")])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%29%3B")]);})(aStream);
  1278. smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_comment", []), "_notEmpty", []), "_ifTrue_", [(function(){return (function($rec){smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["smalltalk."]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_classNameFor_", [aClass])]);smalltalk.send($rec, "_nextPutAll_", [unescape(".comment%3D")]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("unescape%28%27"), "__comma", [smalltalk.send(smalltalk.send(aClass, "_comment", []), "_escaped", [])]), "__comma", [unescape("%27%29")])]);})(aStream);})]);
  1279. smalltalk.send(aStream, "_lf", []);
  1280. return self;},
  1281. source: unescape('exportDefinitionOf%3A%20aClass%20on%3A%20aStream%0A%09aStream%20%0A%09%20%20%20%20nextPutAll%3A%20%27smalltalk.addClass%28%27%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%27%27%27%2C%20%28self%20classNameFor%3A%20aClass%29%2C%20%27%27%27%2C%20%27%3B%0A%09%20%20%20%20nextPutAll%3A%20%27smalltalk.%27%2C%20%28self%20classNameFor%3A%20aClass%20superclass%29%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%2C%20%5B%27.%0A%09aClass%20instanceVariableNames%20%0A%09%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20aStream%20nextPutAll%3A%20%27%27%27%27%2C%20each%2C%20%27%27%27%27%5D%0A%09%20%20%20%20separatedBy%3A%20%5BaStream%20nextPutAll%3A%20%27%2C%20%27%5D.%0A%09aStream%09%0A%09%20%20%20%20nextPutAll%3A%20%27%5D%2C%20%27%27%27%3B%0A%09%20%20%20%20nextPutAll%3A%20aClass%20category%2C%20%27%27%27%27%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%29%3B%27.%0A%09aClass%20comment%20notEmpty%20ifTrue%3A%20%5B%0A%09%20%20%20%20aStream%20%0A%09%20%20%20%20%09lf%3B%0A%09%09nextPutAll%3A%20%27smalltalk.%27%3B%0A%09%09nextPutAll%3A%20%28self%20classNameFor%3A%20aClass%29%3B%0A%09%09nextPutAll%3A%20%27.comment%3D%27%3B%0A%09%09nextPutAll%3A%20%27unescape%28%27%27%27%2C%20aClass%20comment%20escaped%2C%20%27%27%27%29%27%5D.%0A%09aStream%20lf'),
  1282. messageSends: ["nextPutAll:", unescape("%2C"), "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "notEmpty", "comment", "lf", "escaped"],
  1283. referencedClasses: []
  1284. }),
  1285. smalltalk.Exporter);
  1286. smalltalk.addMethod(
  1287. '_exportMetaDefinitionOf_on_',
  1288. smalltalk.method({
  1289. selector: 'exportMetaDefinitionOf:on:',
  1290. category: 'private',
  1291. fn: function (aClass, aStream){
  1292. var self=this;
  1293. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_isEmpty", []), "_ifFalse_", [(function(){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_class", [])])])]);return smalltalk.send($rec, "_nextPutAll_", [unescape(".iVarNames%20%3D%20%5B")]);})(aStream);smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [each]), "__comma", [unescape("%27")])]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [unescape("%2C")]);})]);return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(unescape("%5D%3B"), "__comma", [smalltalk.send(smalltalk.String, "_lf", [])])]);})]);
  1294. return self;},
  1295. source: unescape('exportMetaDefinitionOf%3A%20aClass%20on%3A%20aStream%0A%09aClass%20class%20instanceVariableNames%20isEmpty%20ifFalse%3A%20%5B%0A%09%20%20%20%20aStream%20%0A%09%09nextPutAll%3A%20%27smalltalk.%27%2C%20%28self%20classNameFor%3A%20aClass%20class%29%3B%0A%09%09nextPutAll%3A%20%27.iVarNames%20%3D%20%5B%27.%0A%09%20%20%20%20aClass%20class%20instanceVariableNames%0A%09%09do%3A%20%5B%3Aeach%20%7C%20aStream%20nextPutAll%3A%20%27%27%27%27%2C%20each%2C%20%27%27%27%27%5D%0A%09%09separatedBy%3A%20%5BaStream%20nextPutAll%3A%20%27%2C%27%5D.%0A%09%20%20%20%20aStream%20nextPutAll%3A%20%27%5D%3B%27%2C%20String%20lf%5D'),
  1296. messageSends: ["ifFalse:", "isEmpty", "instanceVariableNames", "class", "nextPutAll:", unescape("%2C"), "classNameFor:", "do:separatedBy:", "lf"],
  1297. referencedClasses: [smalltalk.String]
  1298. }),
  1299. smalltalk.Exporter);
  1300. smalltalk.addMethod(
  1301. '_exportMethodsOf_on_',
  1302. smalltalk.method({
  1303. selector: 'exportMethodsOf:on:',
  1304. category: 'private',
  1305. fn: function (aClass, aStream){
  1306. var self=this;
  1307. smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_values", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(smalltalk.send(each, "_category", []), "_match_", [unescape("%5E%5C*")]), "_ifFalse_", [(function(){return smalltalk.send(self, "_exportMethod_of_on_", [each, aClass, aStream]);})]);})]);
  1308. smalltalk.send(aStream, "_lf", []);
  1309. return self;},
  1310. source: unescape('exportMethodsOf%3A%20aClass%20on%3A%20aStream%0A%09aClass%20methodDictionary%20values%20do%3A%20%5B%3Aeach%20%7C%0A%09%09%28each%20category%20match%3A%20%27%5E%5C*%27%29%20ifFalse%3A%20%5B%0A%09%09%09self%20exportMethod%3A%20each%20of%3A%20aClass%20on%3A%20aStream%5D%5D.%0A%09aStream%20lf'),
  1311. messageSends: ["do:", "values", "methodDictionary", "ifFalse:", "match:", "category", "exportMethod:of:on:", "lf"],
  1312. referencedClasses: []
  1313. }),
  1314. smalltalk.Exporter);
  1315. smalltalk.addMethod(
  1316. '_classNameFor_',
  1317. smalltalk.method({
  1318. selector: 'classNameFor:',
  1319. category: 'private',
  1320. fn: function (aClass){
  1321. var self=this;
  1322. return smalltalk.send(smalltalk.send(aClass, "_isMetaclass", []), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [".klass"]);}), (function(){return smalltalk.send(smalltalk.send(aClass, "_isNil", []), "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]);})]);
  1323. return self;},
  1324. source: unescape('classNameFor%3A%20aClass%0A%09%5EaClass%20isMetaclass%0A%09%20%20%20%20ifTrue%3A%20%5BaClass%20instanceClass%20name%2C%20%27.klass%27%5D%0A%09%20%20%20%20ifFalse%3A%20%5B%0A%09%09aClass%20isNil%0A%09%09%20%20%20%20ifTrue%3A%20%5B%27nil%27%5D%0A%09%09%20%20%20%20ifFalse%3A%20%5BaClass%20name%5D%5D'),
  1325. messageSends: ["ifTrue:ifFalse:", "isMetaclass", unescape("%2C"), "name", "instanceClass", "isNil"],
  1326. referencedClasses: []
  1327. }),
  1328. smalltalk.Exporter);
  1329. smalltalk.addMethod(
  1330. '_exportMethod_of_on_',
  1331. smalltalk.method({
  1332. selector: 'exportMethod:of:on:',
  1333. category: 'private',
  1334. fn: function (aMethod, aClass, aStream){
  1335. var self=this;
  1336. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("smalltalk.addMethod%28")]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [smalltalk.send(smalltalk.send(aMethod, "_selector", []), "_asSelector", [])]), "__comma", [unescape("%27%2C")])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [unescape("smalltalk.method%28%7B")]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("selector%3A%20%27"), "__comma", [smalltalk.send(aMethod, "_selector", [])]), "__comma", [unescape("%27%2C")])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("category%3A%20%27"), "__comma", [smalltalk.send(aMethod, "_category", [])]), "__comma", [unescape("%27%2C")])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("fn: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_fn", []), "_compiledSource", [])]), "__comma", [unescape("%2C")])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("source%3A%20unescape%28%27"), "__comma", [smalltalk.send(smalltalk.send(aMethod, "_source", []), "_escaped", [])]), "__comma", [unescape("%27%29%2C")])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("messageSends: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_messageSends", []), "_asJavascript", [])]), "__comma", [unescape("%2C")])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", [unescape("referencedClasses%3A%20%5B")]);})(aStream);
  1337. smalltalk.send(smalltalk.send(aMethod, "_referencedClasses", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [each])])]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [unescape("%2C")]);})]);
  1338. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("%5D")]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [unescape("%7D%29%2C")]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])])]);smalltalk.send($rec, "_nextPutAll_", [unescape("%29%3B")]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_lf", []);})(aStream);
  1339. return self;},
  1340. source: unescape('exportMethod%3A%20aMethod%20of%3A%20aClass%20on%3A%20aStream%0A%09aStream%20%0A%09%09nextPutAll%3A%20%27smalltalk.addMethod%28%27%3Blf%3B%0A%09%09nextPutAll%3A%20%27%27%27%27%2C%20aMethod%20selector%20asSelector%2C%20%27%27%27%2C%27%3Blf%3B%0A%09%09nextPutAll%3A%20%27smalltalk.method%28%7B%27%3Blf%3B%0A%09%09nextPutAll%3A%20%27selector%3A%20%27%27%27%2C%20aMethod%20selector%2C%20%27%27%27%2C%27%3Blf%3B%0A%09%09nextPutAll%3A%20%27category%3A%20%27%27%27%2C%20aMethod%20category%2C%20%27%27%27%2C%27%3Blf%3B%0A%09%09nextPutAll%3A%20%27fn%3A%20%27%2C%20aMethod%20fn%20compiledSource%2C%20%27%2C%27%3Blf%3B%0A%09%09nextPutAll%3A%20%27source%3A%20unescape%28%27%27%27%2C%20aMethod%20source%20escaped%2C%20%27%27%27%29%2C%27%3Blf%3B%0A%09%09nextPutAll%3A%20%27messageSends%3A%20%27%2C%20aMethod%20messageSends%20asJavascript%2C%20%27%2C%27%3Blf%3B%0A%09%09nextPutAll%3A%20%27referencedClasses%3A%20%5B%27.%0A%09%20%20%20%20%09%09aMethod%20referencedClasses%20%0A%09%09%09%09do%3A%20%5B%3Aeach%20%7C%20aStream%20nextPutAll%3A%20%27smalltalk.%27%2C%20%28self%20classNameFor%3A%20each%29%5D%0A%09%09%09%09separatedBy%3A%20%5BaStream%20nextPutAll%3A%20%27%2C%27%5D.%0A%09aStream%0A%09%09nextPutAll%3A%20%27%5D%27%3Blf%3B%0A%09%09nextPutAll%3A%20%27%7D%29%2C%27%3Blf%3B%0A%09%09nextPutAll%3A%20%27smalltalk.%27%2C%20%28self%20classNameFor%3A%20aClass%29%3B%0A%09%09nextPutAll%3A%20%27%29%3B%27%3Blf%3Blf'),
  1341. messageSends: ["nextPutAll:", "lf", unescape("%2C"), "asSelector", "selector", "category", "compiledSource", "fn", "escaped", "source", "asJavascript", "messageSends", "do:separatedBy:", "referencedClasses", "classNameFor:"],
  1342. referencedClasses: []
  1343. }),
  1344. smalltalk.Exporter);
  1345. smalltalk.addMethod(
  1346. '_exportCategoryExtensions_on_',
  1347. smalltalk.method({
  1348. selector: 'exportCategoryExtensions:on:',
  1349. category: 'private',
  1350. fn: function (aString, aStream){
  1351. var self=this;
  1352. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Smalltalk, "_current", []), "_classes", []), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Smalltalk, "_current", []), "_classes", []), "_collect_", [(function(each){return smalltalk.send(each, "_class", []);})])]), "_do_", [(function(each){return smalltalk.send(smalltalk.send(smalltalk.send(each, "_methodDictionary", []), "_values", []), "_do_", [(function(method){return smalltalk.send(smalltalk.send(smalltalk.send(method, "_category", []), "__eq", [smalltalk.send(unescape("*"), "__comma", [aString])]), "_ifTrue_", [(function(){return smalltalk.send(self, "_exportMethod_of_on_", [method, each, aStream]);})]);})]);})]);
  1353. return self;},
  1354. source: unescape('exportCategoryExtensions%3A%20aString%20on%3A%20aStream%0A%09Smalltalk%20current%20classes%2C%20%28Smalltalk%20current%20classes%20collect%3A%20%5B%3Aeach%20%7C%20each%20class%5D%29%20do%3A%20%5B%3Aeach%20%7C%0A%09%09each%20methodDictionary%20values%20do%3A%20%5B%3Amethod%20%7C%0A%09%09%09method%20category%20%3D%20%28%27*%27%2C%20aString%29%20ifTrue%3A%20%5B%0A%09%09%09%09self%20exportMethod%3A%20method%20of%3A%20each%20on%3A%20aStream%5D%5D%5D'),
  1355. messageSends: ["do:", unescape("%2C"), "classes", "current", "collect:", "class", "values", "methodDictionary", "ifTrue:", unescape("%3D"), "category", "exportMethod:of:on:"],
  1356. referencedClasses: [smalltalk.Smalltalk]
  1357. }),
  1358. smalltalk.Exporter);
  1359. smalltalk.addClass('ChunkExporter', smalltalk.Exporter, [], 'Parser');
  1360. smalltalk.addMethod(
  1361. '_exportDefinitionOf_on_',
  1362. smalltalk.method({
  1363. selector: 'exportDefinitionOf:on:',
  1364. category: 'not yet classified',
  1365. fn: function (aClass, aStream){
  1366. var self=this;
  1367. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_superclass", [])])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(unescape("%20subclass%3A%20%23"), "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", [unescape("%09instanceVariableNames%3A%20%27")]);})(aStream);
  1368. smalltalk.send(smalltalk.send(aClass, "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [each]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [" "]);})]);
  1369. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("%27")]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%09category%3A%20%27"), "__comma", [smalltalk.send(aClass, "_category", [])]), "__comma", [unescape("%27%21")])]);return smalltalk.send($rec, "_lf", []);})(aStream);
  1370. smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_comment", []), "_notEmpty", []), "_ifTrue_", [(function(){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%21"), "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])]), "__comma", [unescape("%20commentStamp%21")])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(self, "_chunkEscape_", [smalltalk.send(aClass, "_comment", [])]), "__comma", [unescape("%21")])]);return smalltalk.send($rec, "_lf", []);})(aStream);})]);
  1371. smalltalk.send(aStream, "_lf", []);
  1372. return self;},
  1373. source: unescape('exportDefinitionOf%3A%20aClass%20on%3A%20aStream%0A%09%22Chunk%20format.%22%0A%0A%09aStream%20%0A%09%20%20%20%20nextPutAll%3A%20%28self%20classNameFor%3A%20aClass%20superclass%29%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%20subclass%3A%20%23%27%2C%20%28self%20classNameFor%3A%20aClass%29%3B%20lf%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%09instanceVariableNames%3A%20%27%27%27.%0A%09aClass%20instanceVariableNames%20%0A%09%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20aStream%20nextPutAll%3A%20each%5D%0A%09%20%20%20%20separatedBy%3A%20%5BaStream%20nextPutAll%3A%20%27%20%27%5D.%0A%09aStream%09%0A%09%20%20%20%20nextPutAll%3A%20%27%27%27%27%3B%20lf%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%09category%3A%20%27%27%27%2C%20aClass%20category%2C%20%27%27%27%21%27%3B%20lf.%0A%20%09aClass%20comment%20notEmpty%20ifTrue%3A%20%5B%0A%09%20%20%20%20aStream%20%0A%09%09nextPutAll%3A%20%27%21%27%2C%20%28self%20classNameFor%3A%20aClass%29%2C%20%27%20commentStamp%21%27%3Blf%3B%0A%09%09nextPutAll%3A%20%28self%20chunkEscape%3A%20aClass%20comment%29%2C%20%27%21%27%3Blf%5D.%0A%09aStream%20lf'),
  1374. messageSends: ["nextPutAll:", "classNameFor:", "superclass", unescape("%2C"), "lf", "do:separatedBy:", "instanceVariableNames", "category", "ifTrue:", "notEmpty", "comment", "chunkEscape:"],
  1375. referencedClasses: []
  1376. }),
  1377. smalltalk.ChunkExporter);
  1378. smalltalk.addMethod(
  1379. '_exportMethod_of_on_',
  1380. smalltalk.method({
  1381. selector: 'exportMethod:of:on:',
  1382. category: 'not yet classified',
  1383. fn: function (aMethod, aClass, aStream){
  1384. var self=this;
  1385. (function($rec){smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_chunkEscape_", [smalltalk.send(aMethod, "_source", [])])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", [unescape("%21")]);})(aStream);
  1386. return self;},
  1387. source: unescape('exportMethod%3A%20aMethod%20of%3A%20aClass%20on%3A%20aStream%0A%09aStream%20%0A%09%09lf%3B%20lf%3B%20nextPutAll%3A%20%28self%20chunkEscape%3A%20aMethod%20source%29%3B%20lf%3B%0A%09%09nextPutAll%3A%20%27%21%27'),
  1388. messageSends: ["lf", "nextPutAll:", "chunkEscape:", "source"],
  1389. referencedClasses: []
  1390. }),
  1391. smalltalk.ChunkExporter);
  1392. smalltalk.addMethod(
  1393. '_exportMethodsOf_on_',
  1394. smalltalk.method({
  1395. selector: 'exportMethodsOf:on:',
  1396. category: 'not yet classified',
  1397. fn: function (aClass, aStream){
  1398. var self=this;
  1399. smalltalk.send(aClass, "_protocolsDo_", [(function(category, methods){return smalltalk.send(smalltalk.send(category, "_match_", [unescape("%5E%5C*")]), "_ifFalse_", [(function(){return smalltalk.send(self, "_exportMethods_category_of_on_", [methods, category, aClass, aStream]);})]);})]);
  1400. return self;},
  1401. source: unescape('exportMethodsOf%3A%20aClass%20on%3A%20aStream%0A%0A%20%20%20aClass%20protocolsDo%3A%20%5B%3Acategory%20%3Amethods%20%7C%0A%09%28category%20match%3A%20%27%5E%5C*%27%29%20ifFalse%3A%20%5B%20%0A%09%09self%0A%09%09%09exportMethods%3A%20methods%0A%09%09%09category%3A%20category%0A%09%09%09of%3A%20aClass%0A%09%09%09on%3A%20aStream%5D%5D'),
  1402. messageSends: ["protocolsDo:", "ifFalse:", "match:", "exportMethods:category:of:on:"],
  1403. referencedClasses: []
  1404. }),
  1405. smalltalk.ChunkExporter);
  1406. smalltalk.addMethod(
  1407. '_exportMetaDefinitionOf_on_',
  1408. smalltalk.method({
  1409. selector: 'exportMetaDefinitionOf:on:',
  1410. category: 'not yet classified',
  1411. fn: function (aClass, aStream){
  1412. var self=this;
  1413. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_isEmpty", []), "_ifFalse_", [(function(){(function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_class", [])])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%20instanceVariableNames%3A%20%27")]);})(aStream);smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_class", []), "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [each]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [" "]);})]);return (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("%27%21")]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_lf", []);})(aStream);})]);
  1414. return self;},
  1415. source: unescape('exportMetaDefinitionOf%3A%20aClass%20on%3A%20aStream%0A%0A%09aClass%20class%20instanceVariableNames%20isEmpty%20ifFalse%3A%20%5B%0A%09%09aStream%20%0A%09%09%20%20%20%20nextPutAll%3A%20%28self%20classNameFor%3A%20aClass%20class%29%3B%0A%09%09%20%20%20%20nextPutAll%3A%20%27%20instanceVariableNames%3A%20%27%27%27.%0A%09%09aClass%20class%20instanceVariableNames%20%0A%09%09%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20aStream%20nextPutAll%3A%20each%5D%0A%09%09%20%20%20%20separatedBy%3A%20%5BaStream%20nextPutAll%3A%20%27%20%27%5D.%0A%09%09aStream%09%0A%09%09%20%20%20%20nextPutAll%3A%20%27%27%27%21%27%3B%20lf%3B%20lf%5D'),
  1416. messageSends: ["ifFalse:", "isEmpty", "instanceVariableNames", "class", "nextPutAll:", "classNameFor:", "do:separatedBy:", "lf"],
  1417. referencedClasses: []
  1418. }),
  1419. smalltalk.ChunkExporter);
  1420. smalltalk.addMethod(
  1421. '_classNameFor_',
  1422. smalltalk.method({
  1423. selector: 'classNameFor:',
  1424. category: 'not yet classified',
  1425. fn: function (aClass){
  1426. var self=this;
  1427. return smalltalk.send(smalltalk.send(aClass, "_isMetaclass", []), "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(aClass, "_instanceClass", []), "_name", []), "__comma", [" class"]);}), (function(){return smalltalk.send(smalltalk.send(aClass, "_isNil", []), "_ifTrue_ifFalse_", [(function(){return "nil";}), (function(){return smalltalk.send(aClass, "_name", []);})]);})]);
  1428. return self;},
  1429. source: unescape('classNameFor%3A%20aClass%0A%09%5EaClass%20isMetaclass%0A%09%20%20%20%20ifTrue%3A%20%5BaClass%20instanceClass%20name%2C%20%27%20class%27%5D%0A%09%20%20%20%20ifFalse%3A%20%5B%0A%09%09aClass%20isNil%0A%09%09%20%20%20%20ifTrue%3A%20%5B%27nil%27%5D%0A%09%09%20%20%20%20ifFalse%3A%20%5BaClass%20name%5D%5D'),
  1430. messageSends: ["ifTrue:ifFalse:", "isMetaclass", unescape("%2C"), "name", "instanceClass", "isNil"],
  1431. referencedClasses: []
  1432. }),
  1433. smalltalk.ChunkExporter);
  1434. smalltalk.addMethod(
  1435. '_chunkEscape_',
  1436. smalltalk.method({
  1437. selector: 'chunkEscape:',
  1438. category: 'not yet classified',
  1439. fn: function (aString){
  1440. var self=this;
  1441. return smalltalk.send(smalltalk.send(aString, "_replace_with_", [unescape("%21"), unescape("%21%21")]), "_trimBoth", []);
  1442. return self;},
  1443. source: unescape('chunkEscape%3A%20aString%0A%09%22Replace%20all%20occurrences%20of%20%21%20with%20%21%21%20and%20trim%20at%20both%20ends.%22%0A%0A%09%5E%28aString%20replace%3A%20%27%21%27%20with%3A%20%27%21%21%27%29%20trimBoth'),
  1444. messageSends: ["trimBoth", "replace:with:"],
  1445. referencedClasses: []
  1446. }),
  1447. smalltalk.ChunkExporter);
  1448. smalltalk.addMethod(
  1449. '_exportCategoryExtensions_on_',
  1450. smalltalk.method({
  1451. selector: 'exportCategoryExtensions:on:',
  1452. category: 'not yet classified',
  1453. fn: function (aString, aStream){
  1454. var self=this;
  1455. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Smalltalk, "_current", []), "_classes", []), "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.Smalltalk, "_current", []), "_classes", []), "_collect_", [(function(each){return smalltalk.send(each, "_class", []);})])]), "_do_", [(function(each){return smalltalk.send(each, "_protocolsDo_", [(function(category, methods){return smalltalk.send(smalltalk.send(category, "__eq", [smalltalk.send(unescape("*"), "__comma", [aString])]), "_ifTrue_", [(function(){return smalltalk.send(self, "_exportMethods_category_of_on_", [methods, category, each, aStream]);})]);})]);})]);
  1456. return self;},
  1457. source: unescape('exportCategoryExtensions%3A%20aString%20on%3A%20aStream%0A%09%22We%20need%20to%20override%20this%20one%20too%20since%20we%20need%20to%20group%0A%09all%20methods%20in%20a%20given%20protocol%20under%20a%20leading%20methodsFor%3A%20chunk%0A%09for%20that%20class.%22%0A%0A%09Smalltalk%20current%20classes%2C%20%28Smalltalk%20current%20classes%20collect%3A%20%5B%3Aeach%20%7C%20each%20class%5D%29%20do%3A%20%5B%3Aeach%20%7C%0A%09%09each%20protocolsDo%3A%20%5B%3Acategory%20%3Amethods%20%7C%0A%09%09%09category%20%3D%20%28%27*%27%2C%20aString%29%20ifTrue%3A%20%5B%0A%09%09%09%09self%20exportMethods%3A%20methods%20category%3A%20category%20of%3A%20each%20on%3A%20aStream%5D%5D%5D'),
  1458. messageSends: ["do:", unescape("%2C"), "classes", "current", "collect:", "class", "protocolsDo:", "ifTrue:", unescape("%3D"), "exportMethods:category:of:on:"],
  1459. referencedClasses: [smalltalk.Smalltalk]
  1460. }),
  1461. smalltalk.ChunkExporter);
  1462. smalltalk.addMethod(
  1463. '_exportMethods_category_of_on_',
  1464. smalltalk.method({
  1465. selector: 'exportMethods:category:of:on:',
  1466. category: 'not yet classified',
  1467. fn: function (methods, category, aClass, aStream){
  1468. var self=this;
  1469. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(unescape("%21"), "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])])]);return smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%20methodsFor%3A%20%27"), "__comma", [category]), "__comma", [unescape("%27%21")])]);})(aStream);
  1470. smalltalk.send(methods, "_do_", [(function(each){return smalltalk.send(self, "_exportMethod_of_on_", [each, aClass, aStream]);})]);
  1471. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("%20%21")]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_lf", []);})(aStream);
  1472. return self;},
  1473. source: unescape('exportMethods%3A%20methods%20category%3A%20category%20of%3A%20aClass%20on%3A%20aStream%0A%0A%09aStream%0A%09%09nextPutAll%3A%20%27%21%27%2C%20%28self%20classNameFor%3A%20aClass%29%3B%0A%09%09nextPutAll%3A%20%27%20methodsFor%3A%20%27%27%27%2C%20category%2C%20%27%27%27%21%27.%0A%20%20%20%20%09methods%20do%3A%20%5B%3Aeach%20%7C%0A%09%09self%20exportMethod%3A%20each%20of%3A%20aClass%20on%3A%20aStream%5D.%0A%09aStream%20nextPutAll%3A%20%27%20%21%27%3B%20lf%3B%20lf'),
  1474. messageSends: ["nextPutAll:", unescape("%2C"), "classNameFor:", "do:", "exportMethod:of:on:", "lf"],
  1475. referencedClasses: []
  1476. }),
  1477. smalltalk.ChunkExporter);
  1478. smalltalk.addClass('StrippedExporter', smalltalk.Exporter, [], 'Parser');
  1479. smalltalk.addMethod(
  1480. '_exportDefinitionOf_on_',
  1481. smalltalk.method({
  1482. selector: 'exportDefinitionOf:on:',
  1483. category: 'private',
  1484. fn: function (aClass, aStream){
  1485. var self=this;
  1486. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("smalltalk.addClass%28")]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])]), "__comma", [unescape("%27%2C%20")])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [smalltalk.send(aClass, "_superclass", [])])])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%2C%20%5B")]);})(aStream);
  1487. smalltalk.send(smalltalk.send(aClass, "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [each]), "__comma", [unescape("%27")])]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [unescape("%2C%20")]);})]);
  1488. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("%5D%2C%20%27")]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(aClass, "_category", []), "__comma", [unescape("%27")])]);return smalltalk.send($rec, "_nextPutAll_", [unescape("%29%3B")]);})(aStream);
  1489. smalltalk.send(aStream, "_lf", []);
  1490. return self;},
  1491. source: unescape('exportDefinitionOf%3A%20aClass%20on%3A%20aStream%0A%09aStream%20%0A%09%20%20%20%20nextPutAll%3A%20%27smalltalk.addClass%28%27%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%27%27%27%2C%20%28self%20classNameFor%3A%20aClass%29%2C%20%27%27%27%2C%20%27%3B%0A%09%20%20%20%20nextPutAll%3A%20%27smalltalk.%27%2C%20%28self%20classNameFor%3A%20aClass%20superclass%29%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%2C%20%5B%27.%0A%09aClass%20instanceVariableNames%20%0A%09%20%20%20%20do%3A%20%5B%3Aeach%20%7C%20aStream%20nextPutAll%3A%20%27%27%27%27%2C%20each%2C%20%27%27%27%27%5D%0A%09%20%20%20%20separatedBy%3A%20%5BaStream%20nextPutAll%3A%20%27%2C%20%27%5D.%0A%09aStream%09%0A%09%20%20%20%20nextPutAll%3A%20%27%5D%2C%20%27%27%27%3B%0A%09%20%20%20%20nextPutAll%3A%20aClass%20category%2C%20%27%27%27%27%3B%0A%09%20%20%20%20nextPutAll%3A%20%27%29%3B%27.%0A%09aStream%20lf'),
  1492. messageSends: ["nextPutAll:", unescape("%2C"), "classNameFor:", "superclass", "do:separatedBy:", "instanceVariableNames", "category", "lf"],
  1493. referencedClasses: []
  1494. }),
  1495. smalltalk.StrippedExporter);
  1496. smalltalk.addMethod(
  1497. '_exportMethod_of_on_',
  1498. smalltalk.method({
  1499. selector: 'exportMethod:of:on:',
  1500. category: 'private',
  1501. fn: function (aMethod, aClass, aStream){
  1502. var self=this;
  1503. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("smalltalk.addMethod%28")]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("%27"), "__comma", [smalltalk.send(smalltalk.send(aMethod, "_selector", []), "_asSelector", [])]), "__comma", [unescape("%27%2C")])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [unescape("smalltalk.method%28%7B")]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(unescape("selector%3A%20%27"), "__comma", [smalltalk.send(aMethod, "_selector", [])]), "__comma", [unescape("%27%2C")])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("fn: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_fn", []), "_compiledSource", [])]), "__comma", [unescape("%2C")])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [unescape("%5D")]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [unescape("%7D%29%2C")]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send("smalltalk.", "__comma", [smalltalk.send(self, "_classNameFor_", [aClass])])]);smalltalk.send($rec, "_nextPutAll_", [unescape("%29%3B")]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_lf", []);})(aStream);
  1504. return self;},
  1505. source: unescape('exportMethod%3A%20aMethod%20of%3A%20aClass%20on%3A%20aStream%0A%09aStream%20%0A%09%09nextPutAll%3A%20%27smalltalk.addMethod%28%27%3Blf%3B%0A%09%09nextPutAll%3A%20%27%27%27%27%2C%20aMethod%20selector%20asSelector%2C%20%27%27%27%2C%27%3Blf%3B%0A%09%09nextPutAll%3A%20%27smalltalk.method%28%7B%27%3Blf%3B%0A%09%09nextPutAll%3A%20%27selector%3A%20%27%27%27%2C%20aMethod%20selector%2C%20%27%27%27%2C%27%3Blf%3B%0A%09%09nextPutAll%3A%20%27fn%3A%20%27%2C%20aMethod%20fn%20compiledSource%2C%20%27%2C%27%3Blf%3B%0A%09%09nextPutAll%3A%20%27%5D%27%3Blf%3B%0A%09%09nextPutAll%3A%20%27%7D%29%2C%27%3Blf%3B%0A%09%09nextPutAll%3A%20%27smalltalk.%27%2C%20%28self%20classNameFor%3A%20aClass%29%3B%0A%09%09nextPutAll%3A%20%27%29%3B%27%3Blf%3Blf'),
  1506. messageSends: ["nextPutAll:", "lf", unescape("%2C"), "asSelector", "selector", "compiledSource", "fn", "classNameFor:"],
  1507. referencedClasses: []
  1508. }),
  1509. smalltalk.StrippedExporter);