Parser.deploy.js 63 KB

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