1
0

Parser.deploy.js 64 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373
  1. smalltalk.addClass('PPParser', smalltalk.Object, ['memo'], 'Parser');
  2. smalltalk.addMethod(
  3. '_initialize',
  4. smalltalk.method({
  5. selector: 'initialize',
  6. fn: function (){
  7. var self=this;
  8. self['@memo']=smalltalk.send(smalltalk.Dictionary, "_new", []);
  9. return self;}
  10. ]
  11. }),
  12. smalltalk.PPParser);
  13. smalltalk.addMethod(
  14. '_memo',
  15. smalltalk.method({
  16. selector: 'memo',
  17. fn: function (){
  18. var self=this;
  19. return self['@memo'];
  20. return self;}
  21. ]
  22. }),
  23. smalltalk.PPParser);
  24. smalltalk.addMethod(
  25. '_flatten',
  26. smalltalk.method({
  27. selector: 'flatten',
  28. fn: function (){
  29. var self=this;
  30. return smalltalk.send(smalltalk.PPFlattenParser, "_on_", [self]);
  31. return self;}
  32. ]
  33. }),
  34. smalltalk.PPParser);
  35. smalltalk.addMethod(
  36. '_withSource',
  37. smalltalk.method({
  38. selector: 'withSource',
  39. fn: function (){
  40. var self=this;
  41. return smalltalk.send(smalltalk.PPSourceParser, "_on_", [self]);
  42. return self;}
  43. ]
  44. }),
  45. smalltalk.PPParser);
  46. smalltalk.addMethod(
  47. '__eq_eq_gt',
  48. smalltalk.method({
  49. selector: '==>',
  50. fn: function (aBlock){
  51. var self=this;
  52. return smalltalk.send(smalltalk.PPActionParser, "_on_block_", [self, aBlock]);
  53. return self;}
  54. ]
  55. }),
  56. smalltalk.PPParser);
  57. smalltalk.addMethod(
  58. '__comma',
  59. smalltalk.method({
  60. selector: ',',
  61. fn: function (aParser){
  62. var self=this;
  63. return smalltalk.send(smalltalk.PPSequenceParser, "_with_with_", [self, aParser]);
  64. return self;}
  65. ]
  66. }),
  67. smalltalk.PPParser);
  68. smalltalk.addMethod(
  69. '__slash',
  70. smalltalk.method({
  71. selector: '/',
  72. fn: function (aParser){
  73. var self=this;
  74. return smalltalk.send(smalltalk.PPChoiceParser, "_with_with_", [self, aParser]);
  75. return self;}
  76. ]
  77. }),
  78. smalltalk.PPParser);
  79. smalltalk.addMethod(
  80. '_plus',
  81. smalltalk.method({
  82. selector: 'plus',
  83. fn: function (){
  84. var self=this;
  85. return smalltalk.send(smalltalk.PPRepeatingParser, "_on_min_", [self, (1)]);
  86. return self;}
  87. ]
  88. }),
  89. smalltalk.PPParser);
  90. smalltalk.addMethod(
  91. '_star',
  92. smalltalk.method({
  93. selector: 'star',
  94. fn: function (){
  95. var self=this;
  96. return smalltalk.send(smalltalk.PPRepeatingParser, "_on_min_", [self, (0)]);
  97. return self;}
  98. ]
  99. }),
  100. smalltalk.PPParser);
  101. smalltalk.addMethod(
  102. '_not',
  103. smalltalk.method({
  104. selector: 'not',
  105. fn: function (){
  106. var self=this;
  107. return smalltalk.send(smalltalk.PPNotParser, "_on_", [self]);
  108. return self;}
  109. ]
  110. }),
  111. smalltalk.PPParser);
  112. smalltalk.addMethod(
  113. '_optional',
  114. smalltalk.method({
  115. selector: 'optional',
  116. fn: function (){
  117. var self=this;
  118. return smalltalk.send(self, "__slash", [smalltalk.send(smalltalk.PPEpsilonParser, "_new", [])]);
  119. return self;}
  120. ]
  121. }),
  122. smalltalk.PPParser);
  123. smalltalk.addMethod(
  124. '_memoizedParse_',
  125. smalltalk.method({
  126. selector: 'memoizedParse:',
  127. fn: function (aStream){
  128. var self=this;
  129. var start=nil;
  130. var end=nil;
  131. var node=nil;
  132. start=smalltalk.send(aStream, "_position", []);
  133. 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;})]);
  134. return self;}
  135. ]
  136. }),
  137. smalltalk.PPParser);
  138. smalltalk.addMethod(
  139. '_parse_',
  140. smalltalk.method({
  141. selector: 'parse:',
  142. fn: function (aStream){
  143. var self=this;
  144. smalltalk.send(self, "_subclassResponsibility", []);
  145. return self;}
  146. ]
  147. }),
  148. smalltalk.PPParser);
  149. smalltalk.addMethod(
  150. '_parseAll_',
  151. smalltalk.method({
  152. selector: 'parseAll:',
  153. fn: function (aStream){
  154. var self=this;
  155. var result=nil;
  156. result=smalltalk.send(smalltalk.send(smalltalk.PPSequenceParser, "_with_with_", [self, smalltalk.send(smalltalk.PPEOFParser, "_new", [])]), "_memoizedParse_", [aStream]);
  157. 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", []);})]);
  158. return self;}
  159. ]
  160. }),
  161. smalltalk.PPParser);
  162. smalltalk.addClass('PPEOFParser', smalltalk.PPParser, [], 'Parser');
  163. smalltalk.addMethod(
  164. '_parse_',
  165. smalltalk.method({
  166. selector: 'parse:',
  167. fn: function (aStream){
  168. var self=this;
  169. 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;})]);
  170. return self;}
  171. ]
  172. }),
  173. smalltalk.PPEOFParser);
  174. smalltalk.addClass('PPAnyParser', smalltalk.PPParser, [], 'Parser');
  175. smalltalk.addMethod(
  176. '_parse_',
  177. smalltalk.method({
  178. selector: 'parse:',
  179. fn: function (aStream){
  180. var self=this;
  181. 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", []);})]);
  182. return self;}
  183. ]
  184. }),
  185. smalltalk.PPAnyParser);
  186. smalltalk.addClass('PPEpsilonParser', smalltalk.PPParser, [], 'Parser');
  187. smalltalk.addMethod(
  188. '_parse_',
  189. smalltalk.method({
  190. selector: 'parse:',
  191. fn: function (aStream){
  192. var self=this;
  193. return nil;
  194. return self;}
  195. ]
  196. }),
  197. smalltalk.PPEpsilonParser);
  198. smalltalk.addClass('PPStringParser', smalltalk.PPParser, ['string'], 'Parser');
  199. smalltalk.addMethod(
  200. '_string',
  201. smalltalk.method({
  202. selector: 'string',
  203. fn: function (){
  204. var self=this;
  205. return self['@string'];
  206. return self;}
  207. ]
  208. }),
  209. smalltalk.PPStringParser);
  210. smalltalk.addMethod(
  211. '_string_',
  212. smalltalk.method({
  213. selector: 'string:',
  214. fn: function (aString){
  215. var self=this;
  216. self['@string']=aString;
  217. return self;}
  218. ]
  219. }),
  220. smalltalk.PPStringParser);
  221. smalltalk.addMethod(
  222. '_parse_',
  223. smalltalk.method({
  224. selector: 'parse:',
  225. fn: function (aStream){
  226. var self=this;
  227. var position=nil;
  228. var result=nil;
  229. position=smalltalk.send(aStream, "_position", []);
  230. result=smalltalk.send(aStream, "_next_", [smalltalk.send(smalltalk.send(self, "_string", []), "_size", [])]);
  231. 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", []));})]);
  232. return self;}
  233. ]
  234. }),
  235. smalltalk.PPStringParser);
  236. smalltalk.addClass('PPCharacterParser', smalltalk.PPParser, ['regexp'], 'Parser');
  237. smalltalk.addMethod(
  238. '_string_',
  239. smalltalk.method({
  240. selector: 'string:',
  241. fn: function (aString){
  242. var self=this;
  243. self['@regexp']=smalltalk.send(smalltalk.RegularExpression, "_fromString_", [smalltalk.send(smalltalk.send(unescape("%5B"), "__comma", [aString]), "__comma", [unescape("%5D")])]);
  244. return self;}
  245. ]
  246. }),
  247. smalltalk.PPCharacterParser);
  248. smalltalk.addMethod(
  249. '_parse_',
  250. smalltalk.method({
  251. selector: 'parse:',
  252. fn: function (aStream){
  253. var self=this;
  254. 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", [])]);})]);
  255. return self;}
  256. ]
  257. }),
  258. smalltalk.PPCharacterParser);
  259. smalltalk.addMethod(
  260. '_match_',
  261. smalltalk.method({
  262. selector: 'match:',
  263. fn: function (aString){
  264. var self=this;
  265. return smalltalk.send(aString, "_match_", [self['@regexp']]);
  266. return self;}
  267. ]
  268. }),
  269. smalltalk.PPCharacterParser);
  270. smalltalk.addClass('PPListParser', smalltalk.PPParser, ['parsers'], 'Parser');
  271. smalltalk.addMethod(
  272. '_parsers',
  273. smalltalk.method({
  274. selector: 'parsers',
  275. fn: function (){
  276. var self=this;
  277. return smalltalk.send(self['@parsers'], "_ifNil_", [(function(){return [];})]);
  278. return self;}
  279. ]
  280. }),
  281. smalltalk.PPListParser);
  282. smalltalk.addMethod(
  283. '_parsers_',
  284. smalltalk.method({
  285. selector: 'parsers:',
  286. fn: function (aCollection){
  287. var self=this;
  288. self['@parsers']=aCollection;
  289. return self;}
  290. ]
  291. }),
  292. smalltalk.PPListParser);
  293. smalltalk.addMethod(
  294. '_copyWith_',
  295. smalltalk.method({
  296. selector: 'copyWith:',
  297. fn: function (aParser){
  298. var self=this;
  299. return smalltalk.send(smalltalk.send(self, "_class", []), "_withAll_", [smalltalk.send(smalltalk.send(self, "_parsers", []), "_copyWith_", [aParser])]);
  300. return self;}
  301. ]
  302. }),
  303. smalltalk.PPListParser);
  304. smalltalk.addMethod(
  305. '_withAll_',
  306. smalltalk.method({
  307. selector: 'withAll:',
  308. fn: function (aCollection){
  309. var self=this;
  310. return (function($rec){smalltalk.send($rec, "_parsers_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  311. return self;}
  312. ]
  313. }),
  314. smalltalk.PPListParser.klass);
  315. smalltalk.addMethod(
  316. '_with_with_',
  317. smalltalk.method({
  318. selector: 'with:with:',
  319. fn: function (aParser, anotherParser){
  320. var self=this;
  321. return smalltalk.send(self, "_withAll_", [smalltalk.send(smalltalk.Array, "_with_with_", [aParser, anotherParser])]);
  322. return self;}
  323. ]
  324. }),
  325. smalltalk.PPListParser.klass);
  326. smalltalk.addClass('PPSequenceParser', smalltalk.PPListParser, [], 'Parser');
  327. smalltalk.addMethod(
  328. '__comma',
  329. smalltalk.method({
  330. selector: ',',
  331. fn: function (aRule){
  332. var self=this;
  333. return smalltalk.send(self, "_copyWith_", [aRule]);
  334. return self;}
  335. ]
  336. }),
  337. smalltalk.PPSequenceParser);
  338. smalltalk.addMethod(
  339. '_parse_',
  340. smalltalk.method({
  341. selector: 'parse:',
  342. fn: function (aStream){
  343. var self=this;
  344. var start=nil;
  345. var elements=nil;
  346. var element=nil;
  347. start=smalltalk.send(aStream, "_position", []);
  348. elements=[];
  349. 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;})]);
  350. return smalltalk.send(smalltalk.send(element, "_isParseFailure", []), "_ifFalse_ifTrue_", [(function(){return elements;}), (function(){smalltalk.send(aStream, "_position_", [start]);return element;})]);
  351. return self;}
  352. ]
  353. }),
  354. smalltalk.PPSequenceParser);
  355. smalltalk.addClass('PPChoiceParser', smalltalk.PPListParser, [], 'Parser');
  356. smalltalk.addMethod(
  357. '__slash',
  358. smalltalk.method({
  359. selector: '/',
  360. fn: function (aRule){
  361. var self=this;
  362. return smalltalk.send(self, "_copyWith_", [aRule]);
  363. return self;}
  364. ]
  365. }),
  366. smalltalk.PPChoiceParser);
  367. smalltalk.addMethod(
  368. '_parse_',
  369. smalltalk.method({
  370. selector: 'parse:',
  371. fn: function (aStream){
  372. var self=this;
  373. var result=nil;
  374. 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;})]);
  375. return result;
  376. return self;}
  377. ]
  378. }),
  379. smalltalk.PPChoiceParser);
  380. smalltalk.addClass('PPDelegateParser', smalltalk.PPParser, ['parser'], 'Parser');
  381. smalltalk.addMethod(
  382. '_parser',
  383. smalltalk.method({
  384. selector: 'parser',
  385. fn: function (){
  386. var self=this;
  387. return self['@parser'];
  388. return self;}
  389. ]
  390. }),
  391. smalltalk.PPDelegateParser);
  392. smalltalk.addMethod(
  393. '_parser_',
  394. smalltalk.method({
  395. selector: 'parser:',
  396. fn: function (aParser){
  397. var self=this;
  398. self['@parser']=aParser;
  399. return self;}
  400. ]
  401. }),
  402. smalltalk.PPDelegateParser);
  403. smalltalk.addMethod(
  404. '_parse_',
  405. smalltalk.method({
  406. selector: 'parse:',
  407. fn: function (aStream){
  408. var self=this;
  409. return smalltalk.send(smalltalk.send(self, "_parser", []), "_memoizedParse_", [aStream]);
  410. return self;}
  411. ]
  412. }),
  413. smalltalk.PPDelegateParser);
  414. smalltalk.addMethod(
  415. '_on_',
  416. smalltalk.method({
  417. selector: 'on:',
  418. fn: function (aParser){
  419. var self=this;
  420. return (function($rec){smalltalk.send($rec, "_parser_", [aParser]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  421. return self;}
  422. ]
  423. }),
  424. smalltalk.PPDelegateParser.klass);
  425. smalltalk.addClass('PPAndParser', smalltalk.PPDelegateParser, [], 'Parser');
  426. smalltalk.addMethod(
  427. '_parse_',
  428. smalltalk.method({
  429. selector: 'parse:',
  430. fn: function (aStream){
  431. var self=this;
  432. return smalltalk.send(self, "_basicParse_", [aStream]);
  433. return self;}
  434. ]
  435. }),
  436. smalltalk.PPAndParser);
  437. smalltalk.addMethod(
  438. '_basicParse_',
  439. smalltalk.method({
  440. selector: 'basicParse:',
  441. fn: function (aStream){
  442. var self=this;
  443. var element=nil;
  444. var position=nil;
  445. position=smalltalk.send(aStream, "_position", []);
  446. element=smalltalk.send(smalltalk.send(self, "_parser", []), "_memoizedParse_", [aStream]);
  447. smalltalk.send(aStream, "_position_", [position]);
  448. return element;
  449. return self;}
  450. ]
  451. }),
  452. smalltalk.PPAndParser);
  453. smalltalk.addClass('PPNotParser', smalltalk.PPAndParser, [], 'Parser');
  454. smalltalk.addMethod(
  455. '_parse_',
  456. smalltalk.method({
  457. selector: 'parse:',
  458. fn: function (aStream){
  459. var self=this;
  460. var element=nil;
  461. element=smalltalk.send(self, "_basicParse_", [aStream]);
  462. 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", [])]);})]);
  463. return self;}
  464. ]
  465. }),
  466. smalltalk.PPNotParser);
  467. smalltalk.addClass('PPActionParser', smalltalk.PPDelegateParser, ['block'], 'Parser');
  468. smalltalk.addMethod(
  469. '_block',
  470. smalltalk.method({
  471. selector: 'block',
  472. fn: function (){
  473. var self=this;
  474. return self['@block'];
  475. return self;}
  476. ]
  477. }),
  478. smalltalk.PPActionParser);
  479. smalltalk.addMethod(
  480. '_block_',
  481. smalltalk.method({
  482. selector: 'block:',
  483. fn: function (aBlock){
  484. var self=this;
  485. self['@block']=aBlock;
  486. return self;}
  487. ]
  488. }),
  489. smalltalk.PPActionParser);
  490. smalltalk.addMethod(
  491. '_parse_',
  492. smalltalk.method({
  493. selector: 'parse:',
  494. fn: function (aStream){
  495. var self=this;
  496. var element=nil;
  497. element=smalltalk.send(smalltalk.send(self, "_parser", []), "_memoizedParse_", [aStream]);
  498. return smalltalk.send(smalltalk.send(element, "_isParseFailure", []), "_ifFalse_ifTrue_", [(function(){return smalltalk.send(smalltalk.send(self, "_block", []), "_value_", [element]);}), (function(){return element;})]);
  499. return self;}
  500. ]
  501. }),
  502. smalltalk.PPActionParser);
  503. smalltalk.addMethod(
  504. '_on_block_',
  505. smalltalk.method({
  506. selector: 'on:block:',
  507. fn: function (aParser, aBlock){
  508. var self=this;
  509. return (function($rec){smalltalk.send($rec, "_parser_", [aParser]);smalltalk.send($rec, "_block_", [aBlock]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  510. return self;}
  511. ]
  512. }),
  513. smalltalk.PPActionParser.klass);
  514. smalltalk.addClass('PPFlattenParser', smalltalk.PPDelegateParser, [], 'Parser');
  515. smalltalk.addMethod(
  516. '_parse_',
  517. smalltalk.method({
  518. selector: 'parse:',
  519. fn: function (aStream){
  520. var self=this;
  521. var start=nil;
  522. var element=nil;
  523. var stop=nil;
  524. start=smalltalk.send(aStream, "_position", []);
  525. element=smalltalk.send(smalltalk.send(self, "_parser", []), "_memoizedParse_", [aStream]);
  526. 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", [])]);})]);
  527. return self;}
  528. ]
  529. }),
  530. smalltalk.PPFlattenParser);
  531. smalltalk.addClass('PPSourceParser', smalltalk.PPDelegateParser, [], 'Parser');
  532. smalltalk.addMethod(
  533. '_parse_',
  534. smalltalk.method({
  535. selector: 'parse:',
  536. fn: function (aStream){
  537. var self=this;
  538. var start=nil;
  539. var element=nil;
  540. var stop=nil;
  541. var result=nil;
  542. start=smalltalk.send(aStream, "_position", []);
  543. element=smalltalk.send(smalltalk.send(self, "_parser", []), "_memoizedParse_", [aStream]);
  544. 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]);})]);
  545. return self;}
  546. ]
  547. }),
  548. smalltalk.PPSourceParser);
  549. smalltalk.addClass('PPRepeatingParser', smalltalk.PPDelegateParser, ['min'], 'Parser');
  550. smalltalk.addMethod(
  551. '_min',
  552. smalltalk.method({
  553. selector: 'min',
  554. fn: function (){
  555. var self=this;
  556. return self['@min'];
  557. return self;}
  558. ]
  559. }),
  560. smalltalk.PPRepeatingParser);
  561. smalltalk.addMethod(
  562. '_min_',
  563. smalltalk.method({
  564. selector: 'min:',
  565. fn: function (aNumber){
  566. var self=this;
  567. self['@min']=aNumber;
  568. return self;}
  569. ]
  570. }),
  571. smalltalk.PPRepeatingParser);
  572. smalltalk.addMethod(
  573. '_parse_',
  574. smalltalk.method({
  575. selector: 'parse:',
  576. fn: function (aStream){
  577. var self=this;
  578. var start=nil;
  579. var element=nil;
  580. var elements=nil;
  581. var failure=nil;
  582. start=smalltalk.send(aStream, "_position", []);
  583. elements=smalltalk.send(smalltalk.Array, "_new", []);
  584. 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;})]);})]);
  585. 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;})]);
  586. return self;}
  587. ]
  588. }),
  589. smalltalk.PPRepeatingParser);
  590. smalltalk.addMethod(
  591. '_on_min_',
  592. smalltalk.method({
  593. selector: 'on:min:',
  594. fn: function (aParser, aNumber){
  595. var self=this;
  596. return (function($rec){smalltalk.send($rec, "_parser_", [aParser]);smalltalk.send($rec, "_min_", [aNumber]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  597. return self;}
  598. ]
  599. }),
  600. smalltalk.PPRepeatingParser.klass);
  601. smalltalk.addClass('PPFailure', smalltalk.Object, ['position', 'reason'], 'Parser');
  602. smalltalk.addMethod(
  603. '_position',
  604. smalltalk.method({
  605. selector: 'position',
  606. fn: function (){
  607. var self=this;
  608. return smalltalk.send(self['@position'], "_ifNil_", [(function(){return (0);})]);
  609. return self;}
  610. ]
  611. }),
  612. smalltalk.PPFailure);
  613. smalltalk.addMethod(
  614. '_position_',
  615. smalltalk.method({
  616. selector: 'position:',
  617. fn: function (aNumber){
  618. var self=this;
  619. self['@position']=aNumber;
  620. return self;}
  621. ]
  622. }),
  623. smalltalk.PPFailure);
  624. smalltalk.addMethod(
  625. '_reason',
  626. smalltalk.method({
  627. selector: 'reason',
  628. fn: function (){
  629. var self=this;
  630. return smalltalk.send(self['@reason'], "_ifNil_", [(function(){return "";})]);
  631. return self;}
  632. ]
  633. }),
  634. smalltalk.PPFailure);
  635. smalltalk.addMethod(
  636. '_reason_',
  637. smalltalk.method({
  638. selector: 'reason:',
  639. fn: function (aString){
  640. var self=this;
  641. self['@reason']=aString;
  642. return self;}
  643. ]
  644. }),
  645. smalltalk.PPFailure);
  646. smalltalk.addMethod(
  647. '_reason_at_',
  648. smalltalk.method({
  649. selector: 'reason:at:',
  650. fn: function (aString, anInteger){
  651. var self=this;
  652. (function($rec){smalltalk.send($rec, "_reason_", [aString]);return smalltalk.send($rec, "_position_", [anInteger]);})(self);
  653. return self;}
  654. ]
  655. }),
  656. smalltalk.PPFailure);
  657. smalltalk.addMethod(
  658. '_isParseFailure',
  659. smalltalk.method({
  660. selector: 'isParseFailure',
  661. fn: function (){
  662. var self=this;
  663. return true;
  664. return self;}
  665. ]
  666. }),
  667. smalltalk.PPFailure);
  668. smalltalk.addMethod(
  669. '_accept_',
  670. smalltalk.method({
  671. selector: 'accept:',
  672. fn: function (aVisitor){
  673. var self=this;
  674. smalltalk.send(aVisitor, "_visitFailure_", [self]);
  675. return self;}
  676. ]
  677. }),
  678. smalltalk.PPFailure);
  679. smalltalk.addMethod(
  680. '_asString',
  681. smalltalk.method({
  682. selector: 'asString',
  683. fn: function (){
  684. var self=this;
  685. return smalltalk.send(smalltalk.send(self['@reason'], "__comma", [" at "]), "__comma", [smalltalk.send(self['@position'], "_asString", [])]);
  686. return self;}
  687. ]
  688. }),
  689. smalltalk.PPFailure);
  690. smalltalk.addMethod(
  691. '_reason_at_',
  692. smalltalk.method({
  693. selector: 'reason:at:',
  694. fn: function (aString, anInteger){
  695. var self=this;
  696. return (function($rec){smalltalk.send($rec, "_reason_at_", [aString, anInteger]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
  697. return self;}
  698. ]
  699. }),
  700. smalltalk.PPFailure.klass);
  701. smalltalk.addClass('SmalltalkParser', smalltalk.Object, [], 'Parser');
  702. smalltalk.addMethod(
  703. '_parse_',
  704. smalltalk.method({
  705. selector: 'parse:',
  706. fn: function (aStream){
  707. var self=this;
  708. return smalltalk.send(smalltalk.send(self, "_parser", []), "_parse_", [aStream]);
  709. return self;}
  710. ]
  711. }),
  712. smalltalk.SmalltalkParser);
  713. smalltalk.addMethod(
  714. '_parser',
  715. smalltalk.method({
  716. selector: 'parser',
  717. fn: function (){
  718. var self=this;
  719. var method=nil;
  720. var expression=nil;
  721. var separator=nil;
  722. var comment=nil;
  723. var ws=nil;
  724. var identifier=nil;
  725. var keyword=nil;
  726. var className=nil;
  727. var string=nil;
  728. var symbol=nil;
  729. var number=nil;
  730. var literalArray=nil;
  731. var variable=nil;
  732. var reference=nil;
  733. var classReference=nil;
  734. var literal=nil;
  735. var ret=nil;
  736. var methodParser=nil;
  737. var expressionParser=nil;
  738. var keyword=nil;
  739. var unarySelector=nil;
  740. var binarySelector=nil;
  741. var keywordPattern=nil;
  742. var unaryPattern=nil;
  743. var binaryPattern=nil;
  744. var assignment=nil;
  745. var temps=nil;
  746. var blockParamList=nil;
  747. var block=nil;
  748. var expression=nil;
  749. var expressions=nil;
  750. var subexpression=nil;
  751. var statements=nil;
  752. var sequence=nil;
  753. var operand=nil;
  754. var unaryMessage=nil;
  755. var unarySend=nil;
  756. var unaryTail=nil;
  757. var binaryMessage=nil;
  758. var binarySend=nil;
  759. var binaryTail=nil;
  760. var keywordMessage=nil;
  761. var keywordSend=nil;
  762. var keywordPair=nil;
  763. var cascade=nil;
  764. var message=nil;
  765. var jsStatement=nil;
  766. 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", []);
  767. 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", []);
  768. ws=smalltalk.send(smalltalk.send(separator, "__slash", [comment]), "_star", []);
  769. identifier=smalltalk.send(smalltalk.send(smalltalk.send(unescape("a-z"), "_asCharacterParser", []), "__comma", [smalltalk.send(smalltalk.send(unescape("a-zA-Z0-9"), "_asCharacterParser", []), "_star", [])]), "_flatten", []);
  770. keyword=smalltalk.send(smalltalk.send(identifier, "__comma", [smalltalk.send(":", "_asParser", [])]), "_flatten", []);
  771. className=smalltalk.send(smalltalk.send(smalltalk.send(unescape("A-Z"), "_asCharacterParser", []), "__comma", [smalltalk.send(smalltalk.send(unescape("a-zA-Z0-9"), "_asCharacterParser", []), "_star", [])]), "_flatten", []);
  772. 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")])]);})]);
  773. 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", [])]);})]);
  774. 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", [])]);})]);
  775. literal=smalltalk.send(smalltalk.PPDelegateParser, "_new", []);
  776. 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", []);})])])]);})]);
  777. variable=smalltalk.send(identifier, "__eq_eq_gt", [(function(token){return smalltalk.send(smalltalk.send(smalltalk.VariableNode, "_new", []), "_value_", [token]);})]);
  778. classReference=smalltalk.send(className, "__eq_eq_gt", [(function(token){return smalltalk.send(smalltalk.send(smalltalk.ClassReferenceNode, "_new", []), "_value_", [token]);})]);
  779. reference=smalltalk.send(variable, "__slash", [classReference]);
  780. binarySelector=smalltalk.send(smalltalk.send(smalltalk.send(unescape("+*/%3D%3E%3C%2C@%25%7E-"), "_asCharacterParser", []), "_plus", []), "_flatten", []);
  781. unarySelector=identifier;
  782. 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)]);})])]);})]);
  783. 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", [])])]);})]);
  784. 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", [])]);})]);
  785. expression=smalltalk.send(smalltalk.PPDelegateParser, "_new", []);
  786. 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;
  787. 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;})]);
  788. 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", []));})]);
  789. 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", []));})]);
  790. 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", []);})]);})]);
  791. 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", []);})]);})]);
  792. 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", []);})]);
  793. 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", []);})])]);
  794. 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", []));})]);
  795. 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", []));})]);
  796. operand=smalltalk.send(smalltalk.send(literal, "__slash", [reference]), "__slash", [subexpression]);
  797. smalltalk.send(literal, "_parser_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(number, "__slash", [string]), "__slash", [literalArray]), "__slash", [symbol]), "__slash", [block])]);
  798. 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", [])]);})]);
  799. unaryTail=smalltalk.send(smalltalk.PPDelegateParser, "_new", []);
  800. 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", [])]);})]);})])]);
  801. 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", [])]);})]);})]);
  802. 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", []));})]);
  803. binaryTail=smalltalk.send(smalltalk.PPDelegateParser, "_new", []);
  804. 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", [])]);})]);})])]);
  805. 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", [])]);})]);})]);
  806. keywordPair=smalltalk.send(smalltalk.send(keyword, "__comma", [ws]), "__comma", [binarySend]);
  807. 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", []));})]);
  808. 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", [])]);})]);
  809. message=smalltalk.send(smalltalk.send(binaryMessage, "__slash", [unaryMessage]), "__slash", [keywordMessage]);
  810. 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", []);})])]);})]);
  811. 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", []));})]);
  812. smalltalk.send(expression, "_parser_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(assignment, "__slash", [cascade]), "__slash", [keywordSend]), "__slash", [binarySend]), "__slash", [jsStatement])]);
  813. 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", []));})]);
  814. return smalltalk.send(smalltalk.send(method, "__comma", [smalltalk.send(smalltalk.PPEOFParser, "_new", [])]), "__eq_eq_gt", [(function(node){return smalltalk.send(node, "_first", []);})]);
  815. return self;}
  816. ]
  817. }),
  818. smalltalk.SmalltalkParser);
  819. smalltalk.addMethod(
  820. '_parse_',
  821. smalltalk.method({
  822. selector: 'parse:',
  823. fn: function (aStream){
  824. var self=this;
  825. return smalltalk.send(smalltalk.send(self, "_new", []), "_parse_", [aStream]);
  826. return self;}
  827. ]
  828. }),
  829. smalltalk.SmalltalkParser.klass);
  830. smalltalk.addClass('Chunk', smalltalk.Object, ['contents'], 'Parser');
  831. smalltalk.addMethod(
  832. '_contents',
  833. smalltalk.method({
  834. selector: 'contents',
  835. fn: function (){
  836. var self=this;
  837. return smalltalk.send(self['@contents'], "_ifNil_", [(function(){return "";})]);
  838. return self;}
  839. ]
  840. }),
  841. smalltalk.Chunk);
  842. smalltalk.addMethod(
  843. '_contents_',
  844. smalltalk.method({
  845. selector: 'contents:',
  846. fn: function (aString){
  847. var self=this;
  848. self['@contents']=aString;
  849. return self;}
  850. ]
  851. }),
  852. smalltalk.Chunk);
  853. smalltalk.addMethod(
  854. '_isEmptyChunk',
  855. smalltalk.method({
  856. selector: 'isEmptyChunk',
  857. fn: function (){
  858. var self=this;
  859. return false;
  860. return self;}
  861. ]
  862. }),
  863. smalltalk.Chunk);
  864. smalltalk.addMethod(
  865. '_isInstructionChunk',
  866. smalltalk.method({
  867. selector: 'isInstructionChunk',
  868. fn: function (){
  869. var self=this;
  870. return false;
  871. return self;}
  872. ]
  873. }),
  874. smalltalk.Chunk);
  875. smalltalk.addClass('InstructionChunk', smalltalk.Chunk, [], 'Parser');
  876. smalltalk.addMethod(
  877. '_isInstructionChunk',
  878. smalltalk.method({
  879. selector: 'isInstructionChunk',
  880. fn: function (){
  881. var self=this;
  882. return true;
  883. return self;}
  884. ]
  885. }),
  886. smalltalk.InstructionChunk);
  887. smalltalk.addClass('EmptyChunk', smalltalk.Chunk, [], 'Parser');
  888. smalltalk.addMethod(
  889. '_isEmptyChunk',
  890. smalltalk.method({
  891. selector: 'isEmptyChunk',
  892. fn: function (){
  893. var self=this;
  894. return true;
  895. return self;}
  896. ]
  897. }),
  898. smalltalk.EmptyChunk);
  899. smalltalk.addClass('ChunkParser', smalltalk.Object, ['parser', 'separator', 'eof', 'ws', 'chunk', 'emptyChunk', 'instructionChunk'], 'Parser');
  900. smalltalk.addMethod(
  901. '_parser',
  902. smalltalk.method({
  903. selector: 'parser',
  904. fn: function (){
  905. var self=this;
  906. 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", [])]);})]);
  907. return self;}
  908. ]
  909. }),
  910. smalltalk.ChunkParser);
  911. smalltalk.addMethod(
  912. '_eof',
  913. smalltalk.method({
  914. selector: 'eof',
  915. fn: function (){
  916. var self=this;
  917. 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;})]);})]);
  918. return self;}
  919. ]
  920. }),
  921. smalltalk.ChunkParser);
  922. smalltalk.addMethod(
  923. '_separator',
  924. smalltalk.method({
  925. selector: 'separator',
  926. fn: function (){
  927. var self=this;
  928. 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", []);})]);
  929. return self;}
  930. ]
  931. }),
  932. smalltalk.ChunkParser);
  933. smalltalk.addMethod(
  934. '_ws',
  935. smalltalk.method({
  936. selector: 'ws',
  937. fn: function (){
  938. var self=this;
  939. return smalltalk.send(self['@ws'], "_ifNil_", [(function(){return self['@ws']=smalltalk.send(smalltalk.send(self, "_separator", []), "_star", []);})]);
  940. return self;}
  941. ]
  942. }),
  943. smalltalk.ChunkParser);
  944. smalltalk.addMethod(
  945. '_chunk',
  946. smalltalk.method({
  947. selector: 'chunk',
  948. fn: function (){
  949. var self=this;
  950. 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", [])]);})]);})]);
  951. return self;}
  952. ]
  953. }),
  954. smalltalk.ChunkParser);
  955. smalltalk.addMethod(
  956. '_emptyChunk',
  957. smalltalk.method({
  958. selector: 'emptyChunk',
  959. fn: function (){
  960. var self=this;
  961. 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", []);})]);})]);
  962. return self;}
  963. ]
  964. }),
  965. smalltalk.ChunkParser);
  966. smalltalk.addMethod(
  967. '_instructionChunk',
  968. smalltalk.method({
  969. selector: 'instructionChunk',
  970. fn: function (){
  971. var self=this;
  972. 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", [])]);})]);})]);
  973. return self;}
  974. ]
  975. }),
  976. smalltalk.ChunkParser);
  977. smalltalk.addClass('Importer', smalltalk.Object, ['chunkParser'], 'Parser');
  978. smalltalk.addMethod(
  979. '_chunkParser',
  980. smalltalk.method({
  981. selector: 'chunkParser',
  982. fn: function (){
  983. var self=this;
  984. return smalltalk.send(self['@chunkParser'], "_ifNil_", [(function(){return self['@chunkParser']=smalltalk.send(smalltalk.send(smalltalk.ChunkParser, "_new", []), "_parser", []);})]);
  985. return self;}
  986. ]
  987. }),
  988. smalltalk.Importer);
  989. smalltalk.addMethod(
  990. '_import_',
  991. smalltalk.method({
  992. selector: 'import:',
  993. fn: function (aStream){
  994. var self=this;
  995. smalltalk.send(smalltalk.send(aStream, "_atEnd", []), "_ifFalse_", [(function(){var nextChunk=nil;
  996. 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]);})]);})]);
  997. return self;}
  998. ]
  999. }),
  1000. smalltalk.Importer);
  1001. smalltalk.addClass('Exporter', smalltalk.Object, [], 'Parser');
  1002. smalltalk.addMethod(
  1003. '_exportCategory_',
  1004. smalltalk.method({
  1005. selector: 'exportCategory:',
  1006. fn: function (aString){
  1007. var self=this;
  1008. var stream=nil;
  1009. stream=smalltalk.send("", "_writeStream", []);
  1010. 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])]);})]);
  1011. smalltalk.send(self, "_exportCategoryExtensions_on_", [aString, stream]);
  1012. return smalltalk.send(stream, "_contents", []);
  1013. return self;}
  1014. ]
  1015. }),
  1016. smalltalk.Exporter);
  1017. smalltalk.addMethod(
  1018. '_export_',
  1019. smalltalk.method({
  1020. selector: 'export:',
  1021. fn: function (aClass){
  1022. var self=this;
  1023. var stream=nil;
  1024. stream=smalltalk.send("", "_writeStream", []);
  1025. smalltalk.send(self, "_exportDefinitionOf_on_", [aClass, stream]);
  1026. smalltalk.send(self, "_exportMethodsOf_on_", [aClass, stream]);
  1027. smalltalk.send(self, "_exportMetaDefinitionOf_on_", [aClass, stream]);
  1028. smalltalk.send(self, "_exportMethodsOf_on_", [smalltalk.send(aClass, "_class", []), stream]);
  1029. return smalltalk.send(stream, "_contents", []);
  1030. return self;}
  1031. ]
  1032. }),
  1033. smalltalk.Exporter);
  1034. smalltalk.addMethod(
  1035. '_exportDefinitionOf_on_',
  1036. smalltalk.method({
  1037. selector: 'exportDefinitionOf:on:',
  1038. fn: function (aClass, aStream){
  1039. var self=this;
  1040. (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);
  1041. 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")]);})]);
  1042. (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);
  1043. 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);})]);
  1044. smalltalk.send(aStream, "_lf", []);
  1045. return self;}
  1046. ]
  1047. }),
  1048. smalltalk.Exporter);
  1049. smalltalk.addMethod(
  1050. '_exportMetaDefinitionOf_on_',
  1051. smalltalk.method({
  1052. selector: 'exportMetaDefinitionOf:on:',
  1053. fn: function (aClass, aStream){
  1054. var self=this;
  1055. 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", [])])]);})]);
  1056. return self;}
  1057. ]
  1058. }),
  1059. smalltalk.Exporter);
  1060. smalltalk.addMethod(
  1061. '_exportMethodsOf_on_',
  1062. smalltalk.method({
  1063. selector: 'exportMethodsOf:on:',
  1064. fn: function (aClass, aStream){
  1065. var self=this;
  1066. 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]);})]);})]);
  1067. smalltalk.send(aStream, "_lf", []);
  1068. return self;}
  1069. ]
  1070. }),
  1071. smalltalk.Exporter);
  1072. smalltalk.addMethod(
  1073. '_classNameFor_',
  1074. smalltalk.method({
  1075. selector: 'classNameFor:',
  1076. fn: function (aClass){
  1077. var self=this;
  1078. 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", []);})]);})]);
  1079. return self;}
  1080. ]
  1081. }),
  1082. smalltalk.Exporter);
  1083. smalltalk.addMethod(
  1084. '_exportMethod_of_on_',
  1085. smalltalk.method({
  1086. selector: 'exportMethod:of:on:',
  1087. fn: function (aMethod, aClass, aStream){
  1088. var self=this;
  1089. (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);
  1090. 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")]);})]);
  1091. (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);
  1092. return self;}
  1093. ]
  1094. }),
  1095. smalltalk.Exporter);
  1096. smalltalk.addMethod(
  1097. '_exportCategoryExtensions_on_',
  1098. smalltalk.method({
  1099. selector: 'exportCategoryExtensions:on:',
  1100. fn: function (aString, aStream){
  1101. var self=this;
  1102. 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]);})]);})]);})]);
  1103. return self;}
  1104. ]
  1105. }),
  1106. smalltalk.Exporter);
  1107. smalltalk.addClass('ChunkExporter', smalltalk.Exporter, [], 'Parser');
  1108. smalltalk.addMethod(
  1109. '_exportDefinitionOf_on_',
  1110. smalltalk.method({
  1111. selector: 'exportDefinitionOf:on:',
  1112. fn: function (aClass, aStream){
  1113. var self=this;
  1114. (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);
  1115. smalltalk.send(smalltalk.send(aClass, "_instanceVariableNames", []), "_do_separatedBy_", [(function(each){return smalltalk.send(aStream, "_nextPutAll_", [each]);}), (function(){return smalltalk.send(aStream, "_nextPutAll_", [" "]);})]);
  1116. (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);
  1117. 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);})]);
  1118. smalltalk.send(aStream, "_lf", []);
  1119. return self;}
  1120. ]
  1121. }),
  1122. smalltalk.ChunkExporter);
  1123. smalltalk.addMethod(
  1124. '_exportMethod_of_on_',
  1125. smalltalk.method({
  1126. selector: 'exportMethod:of:on:',
  1127. fn: function (aMethod, aClass, aStream){
  1128. var self=this;
  1129. (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);
  1130. return self;}
  1131. ]
  1132. }),
  1133. smalltalk.ChunkExporter);
  1134. smalltalk.addMethod(
  1135. '_exportMethodsOf_on_',
  1136. smalltalk.method({
  1137. selector: 'exportMethodsOf:on:',
  1138. fn: function (aClass, aStream){
  1139. var self=this;
  1140. 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]);})]);})]);
  1141. return self;}
  1142. ]
  1143. }),
  1144. smalltalk.ChunkExporter);
  1145. smalltalk.addMethod(
  1146. '_exportMetaDefinitionOf_on_',
  1147. smalltalk.method({
  1148. selector: 'exportMetaDefinitionOf:on:',
  1149. fn: function (aClass, aStream){
  1150. var self=this;
  1151. 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);})]);
  1152. return self;}
  1153. ]
  1154. }),
  1155. smalltalk.ChunkExporter);
  1156. smalltalk.addMethod(
  1157. '_classNameFor_',
  1158. smalltalk.method({
  1159. selector: 'classNameFor:',
  1160. fn: function (aClass){
  1161. var self=this;
  1162. 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", []);})]);})]);
  1163. return self;}
  1164. ]
  1165. }),
  1166. smalltalk.ChunkExporter);
  1167. smalltalk.addMethod(
  1168. '_chunkEscape_',
  1169. smalltalk.method({
  1170. selector: 'chunkEscape:',
  1171. fn: function (aString){
  1172. var self=this;
  1173. return smalltalk.send(smalltalk.send(aString, "_replace_with_", [unescape("%21"), unescape("%21%21")]), "_trimBoth", []);
  1174. return self;}
  1175. ]
  1176. }),
  1177. smalltalk.ChunkExporter);
  1178. smalltalk.addMethod(
  1179. '_exportCategoryExtensions_on_',
  1180. smalltalk.method({
  1181. selector: 'exportCategoryExtensions:on:',
  1182. fn: function (aString, aStream){
  1183. var self=this;
  1184. 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]);})]);})]);})]);
  1185. return self;}
  1186. ]
  1187. }),
  1188. smalltalk.ChunkExporter);
  1189. smalltalk.addMethod(
  1190. '_exportMethods_category_of_on_',
  1191. smalltalk.method({
  1192. selector: 'exportMethods:category:of:on:',
  1193. fn: function (methods, category, aClass, aStream){
  1194. var self=this;
  1195. (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);
  1196. smalltalk.send(methods, "_do_", [(function(each){return smalltalk.send(self, "_exportMethod_of_on_", [each, aClass, aStream]);})]);
  1197. (function($rec){smalltalk.send($rec, "_nextPutAll_", [unescape("%20%21")]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_lf", []);})(aStream);
  1198. return self;}
  1199. ]
  1200. }),
  1201. smalltalk.ChunkExporter);
  1202. smalltalk.addClass('StrippedExporter', smalltalk.Exporter, [], 'Parser');
  1203. smalltalk.addMethod(
  1204. '_exportDefinitionOf_on_',
  1205. smalltalk.method({
  1206. selector: 'exportDefinitionOf:on:',
  1207. fn: function (aClass, aStream){
  1208. var self=this;
  1209. (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);
  1210. 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")]);})]);
  1211. (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);
  1212. smalltalk.send(aStream, "_lf", []);
  1213. return self;}
  1214. ]
  1215. }),
  1216. smalltalk.StrippedExporter);
  1217. smalltalk.addMethod(
  1218. '_exportMethod_of_on_',
  1219. smalltalk.method({
  1220. selector: 'exportMethod:of:on:',
  1221. fn: function (aMethod, aClass, aStream){
  1222. var self=this;
  1223. (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("fn: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_fn", []), "_compiledSource", [])])]);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);
  1224. return self;}
  1225. ]
  1226. }),
  1227. smalltalk.StrippedExporter);