Parser.js 110 KB

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