2
0

Compiler-Core.js 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011
  1. smalltalk.addPackage('Compiler-Core');
  2. smalltalk.addClass('Compiler', smalltalk.Object, ['currentClass', 'source', 'unknownVariables', 'codeGeneratorClass'], 'Compiler-Core');
  3. smalltalk.Compiler.comment="I provide the public interface for compiling Amber source code into JavaScript.\x0a\x0aThe code generator used to produce JavaScript can be plugged with `#codeGeneratorClass`. \x0aThe default code generator is an instance of `InlinedCodeGenerator`"
  4. smalltalk.addMethod(
  5. "_codeGeneratorClass",
  6. smalltalk.method({
  7. selector: "codeGeneratorClass",
  8. category: 'accessing',
  9. fn: function (){
  10. var self=this;
  11. return smalltalk.withContext(function($ctx1) { var $2,$1;
  12. $2=self["@codeGeneratorClass"];
  13. if(($receiver = $2) == nil || $receiver == undefined){
  14. $1=(smalltalk.InliningCodeGenerator || InliningCodeGenerator);
  15. } else {
  16. $1=$2;
  17. };
  18. return $1;
  19. }, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass",{}, smalltalk.Compiler)})},
  20. args: [],
  21. source: "codeGeneratorClass\x0a\x09^codeGeneratorClass ifNil: [InliningCodeGenerator]",
  22. messageSends: ["ifNil:"],
  23. referencedClasses: ["InliningCodeGenerator"]
  24. }),
  25. smalltalk.Compiler);
  26. smalltalk.addMethod(
  27. "_codeGeneratorClass_",
  28. smalltalk.method({
  29. selector: "codeGeneratorClass:",
  30. category: 'accessing',
  31. fn: function (aClass){
  32. var self=this;
  33. return smalltalk.withContext(function($ctx1) { self["@codeGeneratorClass"]=aClass;
  34. return self}, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass:",{aClass:aClass}, smalltalk.Compiler)})},
  35. args: ["aClass"],
  36. source: "codeGeneratorClass: aClass\x0a\x09codeGeneratorClass := aClass",
  37. messageSends: [],
  38. referencedClasses: []
  39. }),
  40. smalltalk.Compiler);
  41. smalltalk.addMethod(
  42. "_compile_",
  43. smalltalk.method({
  44. selector: "compile:",
  45. category: 'compiling',
  46. fn: function (aString){
  47. var self=this;
  48. return smalltalk.withContext(function($ctx1) { var $1;
  49. $1=_st(self)._compileNode_(_st(self)._parse_(aString));
  50. return $1;
  51. }, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString}, smalltalk.Compiler)})},
  52. args: ["aString"],
  53. source: "compile: aString\x0a\x09^self compileNode: (self parse: aString)",
  54. messageSends: ["compileNode:", "parse:"],
  55. referencedClasses: []
  56. }),
  57. smalltalk.Compiler);
  58. smalltalk.addMethod(
  59. "_compile_forClass_",
  60. smalltalk.method({
  61. selector: "compile:forClass:",
  62. category: 'compiling',
  63. fn: function (aString,aClass){
  64. var self=this;
  65. return smalltalk.withContext(function($ctx1) { var $1;
  66. _st(self)._currentClass_(aClass);
  67. _st(self)._source_(aString);
  68. $1=_st(self)._compile_(aString);
  69. return $1;
  70. }, function($ctx1) {$ctx1.fill(self,"compile:forClass:",{aString:aString,aClass:aClass}, smalltalk.Compiler)})},
  71. args: ["aString", "aClass"],
  72. source: "compile: aString forClass: aClass\x0a\x09self currentClass: aClass.\x0a\x09self source: aString.\x0a\x09^self compile: aString",
  73. messageSends: ["currentClass:", "source:", "compile:"],
  74. referencedClasses: []
  75. }),
  76. smalltalk.Compiler);
  77. smalltalk.addMethod(
  78. "_compileExpression_",
  79. smalltalk.method({
  80. selector: "compileExpression:",
  81. category: 'compiling',
  82. fn: function (aString){
  83. var self=this;
  84. return smalltalk.withContext(function($ctx1) { var $1;
  85. _st(self)._currentClass_((smalltalk.DoIt || DoIt));
  86. _st(self)._source_(_st(_st("doIt ^[").__comma(aString)).__comma("] value"));
  87. $1=_st(self)._compileNode_(_st(self)._parse_(_st(self)._source()));
  88. return $1;
  89. }, function($ctx1) {$ctx1.fill(self,"compileExpression:",{aString:aString}, smalltalk.Compiler)})},
  90. args: ["aString"],
  91. source: "compileExpression: aString\x0a\x09self currentClass: DoIt.\x0a\x09self source: 'doIt ^[', aString, '] value'.\x0a\x09^self compileNode: (self parse: self source)",
  92. messageSends: ["currentClass:", "source:", ",", "compileNode:", "parse:", "source"],
  93. referencedClasses: ["DoIt"]
  94. }),
  95. smalltalk.Compiler);
  96. smalltalk.addMethod(
  97. "_compileExpression_on_",
  98. smalltalk.method({
  99. selector: "compileExpression:on:",
  100. category: 'compiling',
  101. fn: function (aString,anObject){
  102. var self=this;
  103. return smalltalk.withContext(function($ctx1) { var $1;
  104. _st(self)._currentClass_(_st(anObject)._class());
  105. _st(self)._source_(_st(_st("xxxDoIt ^[").__comma(aString)).__comma("] value"));
  106. $1=_st(self)._compileNode_(_st(self)._parse_(_st(self)._source()));
  107. return $1;
  108. }, function($ctx1) {$ctx1.fill(self,"compileExpression:on:",{aString:aString,anObject:anObject}, smalltalk.Compiler)})},
  109. args: ["aString", "anObject"],
  110. source: "compileExpression: aString on: anObject\x0a\x09self currentClass: anObject class.\x0a\x09self source: 'xxxDoIt ^[', aString, '] value'.\x0a\x09^self compileNode: (self parse: self source)",
  111. messageSends: ["currentClass:", "class", "source:", ",", "compileNode:", "parse:", "source"],
  112. referencedClasses: []
  113. }),
  114. smalltalk.Compiler);
  115. smalltalk.addMethod(
  116. "_compileNode_",
  117. smalltalk.method({
  118. selector: "compileNode:",
  119. category: 'compiling',
  120. fn: function (aNode){
  121. var self=this;
  122. var generator,result;
  123. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  124. generator=_st(_st(self)._codeGeneratorClass())._new();
  125. $1=generator;
  126. _st($1)._source_(_st(self)._source());
  127. $2=_st($1)._currentClass_(_st(self)._currentClass());
  128. result=_st(generator)._compileNode_(aNode);
  129. _st(self)._unknownVariables_([]);
  130. $3=result;
  131. return $3;
  132. }, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,generator:generator,result:result}, smalltalk.Compiler)})},
  133. args: ["aNode"],
  134. source: "compileNode: aNode\x0a\x09| generator result |\x0a\x09generator := self codeGeneratorClass new.\x0a\x09generator\x0a\x09\x09source: self source;\x0a\x09\x09currentClass: self currentClass.\x0a\x09result := generator compileNode: aNode.\x0a\x09self unknownVariables: #().\x0a\x09^result",
  135. messageSends: ["new", "codeGeneratorClass", "source:", "source", "currentClass:", "currentClass", "compileNode:", "unknownVariables:"],
  136. referencedClasses: []
  137. }),
  138. smalltalk.Compiler);
  139. smalltalk.addMethod(
  140. "_currentClass",
  141. smalltalk.method({
  142. selector: "currentClass",
  143. category: 'accessing',
  144. fn: function (){
  145. var self=this;
  146. return smalltalk.withContext(function($ctx1) { var $1;
  147. $1=self["@currentClass"];
  148. return $1;
  149. }, function($ctx1) {$ctx1.fill(self,"currentClass",{}, smalltalk.Compiler)})},
  150. args: [],
  151. source: "currentClass\x0a\x09^currentClass",
  152. messageSends: [],
  153. referencedClasses: []
  154. }),
  155. smalltalk.Compiler);
  156. smalltalk.addMethod(
  157. "_currentClass_",
  158. smalltalk.method({
  159. selector: "currentClass:",
  160. category: 'accessing',
  161. fn: function (aClass){
  162. var self=this;
  163. return smalltalk.withContext(function($ctx1) { self["@currentClass"]=aClass;
  164. return self}, function($ctx1) {$ctx1.fill(self,"currentClass:",{aClass:aClass}, smalltalk.Compiler)})},
  165. args: ["aClass"],
  166. source: "currentClass: aClass\x0a\x09currentClass := aClass",
  167. messageSends: [],
  168. referencedClasses: []
  169. }),
  170. smalltalk.Compiler);
  171. smalltalk.addMethod(
  172. "_eval_",
  173. smalltalk.method({
  174. selector: "eval:",
  175. category: 'compiling',
  176. fn: function (aString){
  177. var self=this;
  178. return smalltalk.withContext(function($ctx1) { return eval(aString);
  179. return self}, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString}, smalltalk.Compiler)})},
  180. args: ["aString"],
  181. source: "eval: aString\x0a\x09<return eval(aString)>",
  182. messageSends: [],
  183. referencedClasses: []
  184. }),
  185. smalltalk.Compiler);
  186. smalltalk.addMethod(
  187. "_evaluateExpression_",
  188. smalltalk.method({
  189. selector: "evaluateExpression:",
  190. category: 'compiling',
  191. fn: function (aString){
  192. var self=this;
  193. return smalltalk.withContext(function($ctx1) { var $1;
  194. $1=_st(self)._evaluateExpression_on_(aString,_st((smalltalk.DoIt || DoIt))._new());
  195. return $1;
  196. }, function($ctx1) {$ctx1.fill(self,"evaluateExpression:",{aString:aString}, smalltalk.Compiler)})},
  197. args: ["aString"],
  198. source: "evaluateExpression: aString\x0a\x09\x22Unlike #eval: evaluate a Smalltalk expression and answer the returned object\x22\x0a\x09^ self evaluateExpression: aString on: DoIt new",
  199. messageSends: ["evaluateExpression:on:", "new"],
  200. referencedClasses: ["DoIt"]
  201. }),
  202. smalltalk.Compiler);
  203. smalltalk.addMethod(
  204. "_evaluateExpression_on_",
  205. smalltalk.method({
  206. selector: "evaluateExpression:on:",
  207. category: 'compiling',
  208. fn: function (aString,anObject){
  209. var self=this;
  210. var result,method;
  211. return smalltalk.withContext(function($ctx1) { var $1;
  212. method=_st(self)._eval_(_st(self)._compileExpression_on_(aString,anObject));
  213. _st(method)._category_("xxxDoIt");
  214. _st(_st(anObject)._class())._addCompiledMethod_(method);
  215. result=_st(anObject)._xxxDoIt();
  216. _st(_st(anObject)._class())._removeCompiledMethod_(method);
  217. $1=result;
  218. return $1;
  219. }, function($ctx1) {$ctx1.fill(self,"evaluateExpression:on:",{aString:aString,anObject:anObject,result:result,method:method}, smalltalk.Compiler)})},
  220. args: ["aString", "anObject"],
  221. source: "evaluateExpression: aString on: anObject\x0a\x09\x22Unlike #eval: evaluate a Smalltalk expression with anObject as the receiver and answer the returned object\x22\x0a\x09| result method |\x0a method := self eval: (self compileExpression: aString on: anObject).\x0a method category: 'xxxDoIt'.\x0a\x09anObject class addCompiledMethod: method.\x0a\x09result := anObject xxxDoIt.\x0a\x09anObject class removeCompiledMethod: method.\x0a\x09^result",
  222. messageSends: ["eval:", "compileExpression:on:", "category:", "addCompiledMethod:", "class", "xxxDoIt", "removeCompiledMethod:"],
  223. referencedClasses: []
  224. }),
  225. smalltalk.Compiler);
  226. smalltalk.addMethod(
  227. "_install_forClass_category_",
  228. smalltalk.method({
  229. selector: "install:forClass:category:",
  230. category: 'compiling',
  231. fn: function (aString,aBehavior,anotherString){
  232. var self=this;
  233. return smalltalk.withContext(function($ctx1) { var $1;
  234. $1=_st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._installMethod_forClass_category_(_st(self)._eval_(_st(self)._compile_forClass_(aString,aBehavior)),aBehavior,anotherString);
  235. return $1;
  236. }, function($ctx1) {$ctx1.fill(self,"install:forClass:category:",{aString:aString,aBehavior:aBehavior,anotherString:anotherString}, smalltalk.Compiler)})},
  237. args: ["aString", "aBehavior", "anotherString"],
  238. source: "install: aString forClass: aBehavior category: anotherString\x0a \x09^ ClassBuilder new\x0a \x09installMethod: (self eval: (self compile: aString forClass: aBehavior))\x0a forClass: aBehavior\x0a category: anotherString",
  239. messageSends: ["installMethod:forClass:category:", "eval:", "compile:forClass:", "new"],
  240. referencedClasses: ["ClassBuilder"]
  241. }),
  242. smalltalk.Compiler);
  243. smalltalk.addMethod(
  244. "_parse_",
  245. smalltalk.method({
  246. selector: "parse:",
  247. category: 'compiling',
  248. fn: function (aString){
  249. var self=this;
  250. return smalltalk.withContext(function($ctx1) { var $1;
  251. $1=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._parse_(aString);
  252. return $1;
  253. }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString}, smalltalk.Compiler)})},
  254. args: ["aString"],
  255. source: "parse: aString\x0a ^Smalltalk current parse: aString",
  256. messageSends: ["parse:", "current"],
  257. referencedClasses: ["Smalltalk"]
  258. }),
  259. smalltalk.Compiler);
  260. smalltalk.addMethod(
  261. "_parseExpression_",
  262. smalltalk.method({
  263. selector: "parseExpression:",
  264. category: 'compiling',
  265. fn: function (aString){
  266. var self=this;
  267. return smalltalk.withContext(function($ctx1) { var $1;
  268. $1=_st(self)._parse_(_st(_st("doIt ^[").__comma(aString)).__comma("] value"));
  269. return $1;
  270. }, function($ctx1) {$ctx1.fill(self,"parseExpression:",{aString:aString}, smalltalk.Compiler)})},
  271. args: ["aString"],
  272. source: "parseExpression: aString\x0a ^self parse: 'doIt ^[', aString, '] value'",
  273. messageSends: ["parse:", ","],
  274. referencedClasses: []
  275. }),
  276. smalltalk.Compiler);
  277. smalltalk.addMethod(
  278. "_recompile_",
  279. smalltalk.method({
  280. selector: "recompile:",
  281. category: 'compiling',
  282. fn: function (aClass){
  283. var self=this;
  284. return smalltalk.withContext(function($ctx1) { var $1;
  285. _st(_st(aClass)._methodDictionary())._do_((function(each){
  286. return smalltalk.withContext(function($ctx2) { _st(console)._log_(_st(_st(_st(aClass)._name()).__comma(" >> ")).__comma(_st(each)._selector()));
  287. return _st(self)._install_forClass_category_(_st(each)._source(),aClass,_st(each)._category());
  288. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  289. $1=_st(aClass)._isMetaclass();
  290. if(! smalltalk.assert($1)){
  291. _st(self)._recompile_(_st(aClass)._class());
  292. };
  293. return self}, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass}, smalltalk.Compiler)})},
  294. args: ["aClass"],
  295. source: "recompile: aClass\x0a\x09aClass methodDictionary do: [:each |\x0a\x09\x09console log: aClass name, ' >> ', each selector.\x0a\x09\x09self install: each source forClass: aClass category: each category].\x0a\x09\x22self setupClass: aClass.\x22\x0a\x09aClass isMetaclass ifFalse: [self recompile: aClass class]",
  296. messageSends: ["do:", "log:", ",", "selector", "name", "install:forClass:category:", "source", "category", "methodDictionary", "ifFalse:", "recompile:", "class", "isMetaclass"],
  297. referencedClasses: []
  298. }),
  299. smalltalk.Compiler);
  300. smalltalk.addMethod(
  301. "_recompileAll",
  302. smalltalk.method({
  303. selector: "recompileAll",
  304. category: 'compiling',
  305. fn: function (){
  306. var self=this;
  307. return smalltalk.withContext(function($ctx1) { var $1,$2;
  308. _st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes())._do_((function(each){
  309. return smalltalk.withContext(function($ctx2) { $1=(smalltalk.Transcript || Transcript);
  310. _st($1)._show_(each);
  311. $2=_st($1)._cr();
  312. $2;
  313. return _st((function(){
  314. return smalltalk.withContext(function($ctx3) { return _st(self)._recompile_(each);
  315. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((100));
  316. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  317. return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{}, smalltalk.Compiler)})},
  318. args: [],
  319. source: "recompileAll\x0a\x09Smalltalk current classes do: [:each |\x0a\x09\x09Transcript show: each; cr.\x0a\x09\x09[self recompile: each] valueWithTimeout: 100]",
  320. messageSends: ["do:", "show:", "cr", "valueWithTimeout:", "recompile:", "classes", "current"],
  321. referencedClasses: ["Transcript", "Smalltalk"]
  322. }),
  323. smalltalk.Compiler);
  324. smalltalk.addMethod(
  325. "_source",
  326. smalltalk.method({
  327. selector: "source",
  328. category: 'accessing',
  329. fn: function (){
  330. var self=this;
  331. return smalltalk.withContext(function($ctx1) { var $2,$1;
  332. $2=self["@source"];
  333. if(($receiver = $2) == nil || $receiver == undefined){
  334. $1="";
  335. } else {
  336. $1=$2;
  337. };
  338. return $1;
  339. }, function($ctx1) {$ctx1.fill(self,"source",{}, smalltalk.Compiler)})},
  340. args: [],
  341. source: "source\x0a\x09^source ifNil: ['']",
  342. messageSends: ["ifNil:"],
  343. referencedClasses: []
  344. }),
  345. smalltalk.Compiler);
  346. smalltalk.addMethod(
  347. "_source_",
  348. smalltalk.method({
  349. selector: "source:",
  350. category: 'accessing',
  351. fn: function (aString){
  352. var self=this;
  353. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  354. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString}, smalltalk.Compiler)})},
  355. args: ["aString"],
  356. source: "source: aString\x0a\x09source := aString",
  357. messageSends: [],
  358. referencedClasses: []
  359. }),
  360. smalltalk.Compiler);
  361. smalltalk.addMethod(
  362. "_unknownVariables",
  363. smalltalk.method({
  364. selector: "unknownVariables",
  365. category: 'accessing',
  366. fn: function (){
  367. var self=this;
  368. return smalltalk.withContext(function($ctx1) { var $1;
  369. $1=self["@unknownVariables"];
  370. return $1;
  371. }, function($ctx1) {$ctx1.fill(self,"unknownVariables",{}, smalltalk.Compiler)})},
  372. args: [],
  373. source: "unknownVariables\x0a\x09^unknownVariables",
  374. messageSends: [],
  375. referencedClasses: []
  376. }),
  377. smalltalk.Compiler);
  378. smalltalk.addMethod(
  379. "_unknownVariables_",
  380. smalltalk.method({
  381. selector: "unknownVariables:",
  382. category: 'accessing',
  383. fn: function (aCollection){
  384. var self=this;
  385. return smalltalk.withContext(function($ctx1) { self["@unknownVariables"]=aCollection;
  386. return self}, function($ctx1) {$ctx1.fill(self,"unknownVariables:",{aCollection:aCollection}, smalltalk.Compiler)})},
  387. args: ["aCollection"],
  388. source: "unknownVariables: aCollection\x0a\x09unknownVariables := aCollection",
  389. messageSends: [],
  390. referencedClasses: []
  391. }),
  392. smalltalk.Compiler);
  393. smalltalk.addMethod(
  394. "_recompile_",
  395. smalltalk.method({
  396. selector: "recompile:",
  397. category: 'compiling',
  398. fn: function (aClass){
  399. var self=this;
  400. return smalltalk.withContext(function($ctx1) { _st(_st(self)._new())._recompile_(aClass);
  401. return self}, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass}, smalltalk.Compiler.klass)})},
  402. args: ["aClass"],
  403. source: "recompile: aClass\x0a\x09self new recompile: aClass",
  404. messageSends: ["recompile:", "new"],
  405. referencedClasses: []
  406. }),
  407. smalltalk.Compiler.klass);
  408. smalltalk.addMethod(
  409. "_recompileAll",
  410. smalltalk.method({
  411. selector: "recompileAll",
  412. category: 'compiling',
  413. fn: function (){
  414. var self=this;
  415. return smalltalk.withContext(function($ctx1) { _st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes())._do_((function(each){
  416. return smalltalk.withContext(function($ctx2) { return _st(self)._recompile_(each);
  417. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  418. return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{}, smalltalk.Compiler.klass)})},
  419. args: [],
  420. source: "recompileAll\x0a\x09Smalltalk current classes do: [:each |\x0a\x09\x09self recompile: each]",
  421. messageSends: ["do:", "recompile:", "classes", "current"],
  422. referencedClasses: ["Smalltalk"]
  423. }),
  424. smalltalk.Compiler.klass);
  425. smalltalk.addClass('DoIt', smalltalk.Object, [], 'Compiler-Core');
  426. smalltalk.DoIt.comment="`DoIt` is the class used to compile and evaluate expressions. See `Compiler >> evaluateExpression:`."
  427. smalltalk.addClass('NodeVisitor', smalltalk.Object, [], 'Compiler-Core');
  428. smalltalk.NodeVisitor.comment="I am the abstract super class of all AST node visitors."
  429. smalltalk.addMethod(
  430. "_visit_",
  431. smalltalk.method({
  432. selector: "visit:",
  433. category: 'visiting',
  434. fn: function (aNode){
  435. var self=this;
  436. return smalltalk.withContext(function($ctx1) { var $1;
  437. $1=_st(aNode)._accept_(self);
  438. return $1;
  439. }, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  440. args: ["aNode"],
  441. source: "visit: aNode\x0a\x09^ aNode accept: self",
  442. messageSends: ["accept:"],
  443. referencedClasses: []
  444. }),
  445. smalltalk.NodeVisitor);
  446. smalltalk.addMethod(
  447. "_visitAll_",
  448. smalltalk.method({
  449. selector: "visitAll:",
  450. category: 'visiting',
  451. fn: function (aCollection){
  452. var self=this;
  453. return smalltalk.withContext(function($ctx1) { var $1;
  454. $1=_st(aCollection)._collect_((function(each){
  455. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  456. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  457. return $1;
  458. }, function($ctx1) {$ctx1.fill(self,"visitAll:",{aCollection:aCollection}, smalltalk.NodeVisitor)})},
  459. args: ["aCollection"],
  460. source: "visitAll: aCollection\x0a\x09^ aCollection collect: [ :each | self visit: each ]",
  461. messageSends: ["collect:", "visit:"],
  462. referencedClasses: []
  463. }),
  464. smalltalk.NodeVisitor);
  465. smalltalk.addMethod(
  466. "_visitAssignmentNode_",
  467. smalltalk.method({
  468. selector: "visitAssignmentNode:",
  469. category: 'visiting',
  470. fn: function (aNode){
  471. var self=this;
  472. return smalltalk.withContext(function($ctx1) { var $1;
  473. $1=_st(self)._visitNode_(aNode);
  474. return $1;
  475. }, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  476. args: ["aNode"],
  477. source: "visitAssignmentNode: aNode\x0a\x09^ self visitNode: aNode",
  478. messageSends: ["visitNode:"],
  479. referencedClasses: []
  480. }),
  481. smalltalk.NodeVisitor);
  482. smalltalk.addMethod(
  483. "_visitBlockNode_",
  484. smalltalk.method({
  485. selector: "visitBlockNode:",
  486. category: 'visiting',
  487. fn: function (aNode){
  488. var self=this;
  489. return smalltalk.withContext(function($ctx1) { var $1;
  490. $1=_st(self)._visitNode_(aNode);
  491. return $1;
  492. }, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  493. args: ["aNode"],
  494. source: "visitBlockNode: aNode\x0a\x09^ self visitNode: aNode",
  495. messageSends: ["visitNode:"],
  496. referencedClasses: []
  497. }),
  498. smalltalk.NodeVisitor);
  499. smalltalk.addMethod(
  500. "_visitBlockSequenceNode_",
  501. smalltalk.method({
  502. selector: "visitBlockSequenceNode:",
  503. category: 'visiting',
  504. fn: function (aNode){
  505. var self=this;
  506. return smalltalk.withContext(function($ctx1) { var $1;
  507. $1=_st(self)._visitSequenceNode_(aNode);
  508. return $1;
  509. }, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  510. args: ["aNode"],
  511. source: "visitBlockSequenceNode: aNode\x0a\x09^ self visitSequenceNode: aNode",
  512. messageSends: ["visitSequenceNode:"],
  513. referencedClasses: []
  514. }),
  515. smalltalk.NodeVisitor);
  516. smalltalk.addMethod(
  517. "_visitCascadeNode_",
  518. smalltalk.method({
  519. selector: "visitCascadeNode:",
  520. category: 'visiting',
  521. fn: function (aNode){
  522. var self=this;
  523. return smalltalk.withContext(function($ctx1) { var $1;
  524. $1=_st(self)._visitNode_(aNode);
  525. return $1;
  526. }, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  527. args: ["aNode"],
  528. source: "visitCascadeNode: aNode\x0a\x09^ self visitNode: aNode",
  529. messageSends: ["visitNode:"],
  530. referencedClasses: []
  531. }),
  532. smalltalk.NodeVisitor);
  533. smalltalk.addMethod(
  534. "_visitClassReferenceNode_",
  535. smalltalk.method({
  536. selector: "visitClassReferenceNode:",
  537. category: 'visiting',
  538. fn: function (aNode){
  539. var self=this;
  540. return smalltalk.withContext(function($ctx1) { var $1;
  541. $1=_st(self)._visitVariableNode_(aNode);
  542. return $1;
  543. }, function($ctx1) {$ctx1.fill(self,"visitClassReferenceNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  544. args: ["aNode"],
  545. source: "visitClassReferenceNode: aNode\x0a\x09^ self visitVariableNode: aNode",
  546. messageSends: ["visitVariableNode:"],
  547. referencedClasses: []
  548. }),
  549. smalltalk.NodeVisitor);
  550. smalltalk.addMethod(
  551. "_visitDynamicArrayNode_",
  552. smalltalk.method({
  553. selector: "visitDynamicArrayNode:",
  554. category: 'visiting',
  555. fn: function (aNode){
  556. var self=this;
  557. return smalltalk.withContext(function($ctx1) { var $1;
  558. $1=_st(self)._visitNode_(aNode);
  559. return $1;
  560. }, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  561. args: ["aNode"],
  562. source: "visitDynamicArrayNode: aNode\x0a\x09^ self visitNode: aNode",
  563. messageSends: ["visitNode:"],
  564. referencedClasses: []
  565. }),
  566. smalltalk.NodeVisitor);
  567. smalltalk.addMethod(
  568. "_visitDynamicDictionaryNode_",
  569. smalltalk.method({
  570. selector: "visitDynamicDictionaryNode:",
  571. category: 'visiting',
  572. fn: function (aNode){
  573. var self=this;
  574. return smalltalk.withContext(function($ctx1) { var $1;
  575. $1=_st(self)._visitNode_(aNode);
  576. return $1;
  577. }, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  578. args: ["aNode"],
  579. source: "visitDynamicDictionaryNode: aNode\x0a\x09^ self visitNode: aNode",
  580. messageSends: ["visitNode:"],
  581. referencedClasses: []
  582. }),
  583. smalltalk.NodeVisitor);
  584. smalltalk.addMethod(
  585. "_visitJSStatementNode_",
  586. smalltalk.method({
  587. selector: "visitJSStatementNode:",
  588. category: 'visiting',
  589. fn: function (aNode){
  590. var self=this;
  591. return smalltalk.withContext(function($ctx1) { var $1;
  592. $1=_st(self)._visitNode_(aNode);
  593. return $1;
  594. }, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  595. args: ["aNode"],
  596. source: "visitJSStatementNode: aNode\x0a\x09^ self visitNode: aNode",
  597. messageSends: ["visitNode:"],
  598. referencedClasses: []
  599. }),
  600. smalltalk.NodeVisitor);
  601. smalltalk.addMethod(
  602. "_visitMethodNode_",
  603. smalltalk.method({
  604. selector: "visitMethodNode:",
  605. category: 'visiting',
  606. fn: function (aNode){
  607. var self=this;
  608. return smalltalk.withContext(function($ctx1) { var $1;
  609. $1=_st(self)._visitNode_(aNode);
  610. return $1;
  611. }, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  612. args: ["aNode"],
  613. source: "visitMethodNode: aNode\x0a\x09^ self visitNode: aNode",
  614. messageSends: ["visitNode:"],
  615. referencedClasses: []
  616. }),
  617. smalltalk.NodeVisitor);
  618. smalltalk.addMethod(
  619. "_visitNode_",
  620. smalltalk.method({
  621. selector: "visitNode:",
  622. category: 'visiting',
  623. fn: function (aNode){
  624. var self=this;
  625. return smalltalk.withContext(function($ctx1) { var $1;
  626. $1=_st(self)._visitAll_(_st(aNode)._nodes());
  627. return $1;
  628. }, function($ctx1) {$ctx1.fill(self,"visitNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  629. args: ["aNode"],
  630. source: "visitNode: aNode\x0a\x09^ self visitAll: aNode nodes",
  631. messageSends: ["visitAll:", "nodes"],
  632. referencedClasses: []
  633. }),
  634. smalltalk.NodeVisitor);
  635. smalltalk.addMethod(
  636. "_visitReturnNode_",
  637. smalltalk.method({
  638. selector: "visitReturnNode:",
  639. category: 'visiting',
  640. fn: function (aNode){
  641. var self=this;
  642. return smalltalk.withContext(function($ctx1) { var $1;
  643. $1=_st(self)._visitNode_(aNode);
  644. return $1;
  645. }, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  646. args: ["aNode"],
  647. source: "visitReturnNode: aNode\x0a\x09^ self visitNode: aNode",
  648. messageSends: ["visitNode:"],
  649. referencedClasses: []
  650. }),
  651. smalltalk.NodeVisitor);
  652. smalltalk.addMethod(
  653. "_visitSendNode_",
  654. smalltalk.method({
  655. selector: "visitSendNode:",
  656. category: 'visiting',
  657. fn: function (aNode){
  658. var self=this;
  659. return smalltalk.withContext(function($ctx1) { var $1;
  660. $1=_st(self)._visitNode_(aNode);
  661. return $1;
  662. }, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  663. args: ["aNode"],
  664. source: "visitSendNode: aNode\x0a\x09^ self visitNode: aNode",
  665. messageSends: ["visitNode:"],
  666. referencedClasses: []
  667. }),
  668. smalltalk.NodeVisitor);
  669. smalltalk.addMethod(
  670. "_visitSequenceNode_",
  671. smalltalk.method({
  672. selector: "visitSequenceNode:",
  673. category: 'visiting',
  674. fn: function (aNode){
  675. var self=this;
  676. return smalltalk.withContext(function($ctx1) { var $1;
  677. $1=_st(self)._visitNode_(aNode);
  678. return $1;
  679. }, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  680. args: ["aNode"],
  681. source: "visitSequenceNode: aNode\x0a\x09^ self visitNode: aNode",
  682. messageSends: ["visitNode:"],
  683. referencedClasses: []
  684. }),
  685. smalltalk.NodeVisitor);
  686. smalltalk.addMethod(
  687. "_visitValueNode_",
  688. smalltalk.method({
  689. selector: "visitValueNode:",
  690. category: 'visiting',
  691. fn: function (aNode){
  692. var self=this;
  693. return smalltalk.withContext(function($ctx1) { var $1;
  694. $1=_st(self)._visitNode_(aNode);
  695. return $1;
  696. }, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  697. args: ["aNode"],
  698. source: "visitValueNode: aNode\x0a\x09^ self visitNode: aNode",
  699. messageSends: ["visitNode:"],
  700. referencedClasses: []
  701. }),
  702. smalltalk.NodeVisitor);
  703. smalltalk.addMethod(
  704. "_visitVariableNode_",
  705. smalltalk.method({
  706. selector: "visitVariableNode:",
  707. category: 'visiting',
  708. fn: function (aNode){
  709. var self=this;
  710. return smalltalk.withContext(function($ctx1) { var $1;
  711. $1=_st(self)._visitNode_(aNode);
  712. return $1;
  713. }, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode}, smalltalk.NodeVisitor)})},
  714. args: ["aNode"],
  715. source: "visitVariableNode: aNode\x0a\x09^ self visitNode: aNode",
  716. messageSends: ["visitNode:"],
  717. referencedClasses: []
  718. }),
  719. smalltalk.NodeVisitor);
  720. smalltalk.addClass('AbstractCodeGenerator', smalltalk.NodeVisitor, ['currentClass', 'source'], 'Compiler-Core');
  721. smalltalk.AbstractCodeGenerator.comment="I am the abstract super class of all code generators and provide their common API."
  722. smalltalk.addMethod(
  723. "_classNameFor_",
  724. smalltalk.method({
  725. selector: "classNameFor:",
  726. category: 'accessing',
  727. fn: function (aClass){
  728. var self=this;
  729. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  730. $2=_st(aClass)._isMetaclass();
  731. if(smalltalk.assert($2)){
  732. $1=_st(_st(_st(aClass)._instanceClass())._name()).__comma(".klass");
  733. } else {
  734. $3=_st(aClass)._isNil();
  735. if(smalltalk.assert($3)){
  736. $1="nil";
  737. } else {
  738. $1=_st(aClass)._name();
  739. };
  740. };
  741. return $1;
  742. }, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass}, smalltalk.AbstractCodeGenerator)})},
  743. args: ["aClass"],
  744. source: "classNameFor: aClass\x0a\x09^aClass isMetaclass\x0a\x09 ifTrue: [aClass instanceClass name, '.klass']\x0a\x09 ifFalse: [\x0a\x09\x09aClass isNil\x0a\x09\x09 ifTrue: ['nil']\x0a\x09\x09 ifFalse: [aClass name]]",
  745. messageSends: ["ifTrue:ifFalse:", ",", "name", "instanceClass", "isNil", "isMetaclass"],
  746. referencedClasses: []
  747. }),
  748. smalltalk.AbstractCodeGenerator);
  749. smalltalk.addMethod(
  750. "_compileNode_",
  751. smalltalk.method({
  752. selector: "compileNode:",
  753. category: 'compiling',
  754. fn: function (aNode){
  755. var self=this;
  756. return smalltalk.withContext(function($ctx1) { _st(self)._subclassResponsibility();
  757. return self}, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode}, smalltalk.AbstractCodeGenerator)})},
  758. args: ["aNode"],
  759. source: "compileNode: aNode\x0a\x09self subclassResponsibility",
  760. messageSends: ["subclassResponsibility"],
  761. referencedClasses: []
  762. }),
  763. smalltalk.AbstractCodeGenerator);
  764. smalltalk.addMethod(
  765. "_currentClass",
  766. smalltalk.method({
  767. selector: "currentClass",
  768. category: 'accessing',
  769. fn: function (){
  770. var self=this;
  771. return smalltalk.withContext(function($ctx1) { var $1;
  772. $1=self["@currentClass"];
  773. return $1;
  774. }, function($ctx1) {$ctx1.fill(self,"currentClass",{}, smalltalk.AbstractCodeGenerator)})},
  775. args: [],
  776. source: "currentClass\x0a\x09^currentClass",
  777. messageSends: [],
  778. referencedClasses: []
  779. }),
  780. smalltalk.AbstractCodeGenerator);
  781. smalltalk.addMethod(
  782. "_currentClass_",
  783. smalltalk.method({
  784. selector: "currentClass:",
  785. category: 'accessing',
  786. fn: function (aClass){
  787. var self=this;
  788. return smalltalk.withContext(function($ctx1) { self["@currentClass"]=aClass;
  789. return self}, function($ctx1) {$ctx1.fill(self,"currentClass:",{aClass:aClass}, smalltalk.AbstractCodeGenerator)})},
  790. args: ["aClass"],
  791. source: "currentClass: aClass\x0a\x09currentClass := aClass",
  792. messageSends: [],
  793. referencedClasses: []
  794. }),
  795. smalltalk.AbstractCodeGenerator);
  796. smalltalk.addMethod(
  797. "_pseudoVariables",
  798. smalltalk.method({
  799. selector: "pseudoVariables",
  800. category: 'accessing',
  801. fn: function (){
  802. var self=this;
  803. return smalltalk.withContext(function($ctx1) { return ["self", "super", "true", "false", "nil", "thisContext"];
  804. }, function($ctx1) {$ctx1.fill(self,"pseudoVariables",{}, smalltalk.AbstractCodeGenerator)})},
  805. args: [],
  806. source: "pseudoVariables\x0a\x09^#('self' 'super' 'true' 'false' 'nil' 'thisContext')",
  807. messageSends: [],
  808. referencedClasses: []
  809. }),
  810. smalltalk.AbstractCodeGenerator);
  811. smalltalk.addMethod(
  812. "_safeVariableNameFor_",
  813. smalltalk.method({
  814. selector: "safeVariableNameFor:",
  815. category: 'accessing',
  816. fn: function (aString){
  817. var self=this;
  818. return smalltalk.withContext(function($ctx1) { var $2,$1;
  819. $2=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._reservedWords())._includes_(aString);
  820. if(smalltalk.assert($2)){
  821. $1=_st(aString).__comma("_");
  822. } else {
  823. $1=aString;
  824. };
  825. return $1;
  826. }, function($ctx1) {$ctx1.fill(self,"safeVariableNameFor:",{aString:aString}, smalltalk.AbstractCodeGenerator)})},
  827. args: ["aString"],
  828. source: "safeVariableNameFor: aString\x0a\x09^(Smalltalk current reservedWords includes: aString)\x0a\x09\x09ifTrue: [aString, '_']\x0a\x09\x09ifFalse: [aString]",
  829. messageSends: ["ifTrue:ifFalse:", ",", "includes:", "reservedWords", "current"],
  830. referencedClasses: ["Smalltalk"]
  831. }),
  832. smalltalk.AbstractCodeGenerator);
  833. smalltalk.addMethod(
  834. "_source",
  835. smalltalk.method({
  836. selector: "source",
  837. category: 'accessing',
  838. fn: function (){
  839. var self=this;
  840. return smalltalk.withContext(function($ctx1) { var $2,$1;
  841. $2=self["@source"];
  842. if(($receiver = $2) == nil || $receiver == undefined){
  843. $1="";
  844. } else {
  845. $1=$2;
  846. };
  847. return $1;
  848. }, function($ctx1) {$ctx1.fill(self,"source",{}, smalltalk.AbstractCodeGenerator)})},
  849. args: [],
  850. source: "source\x0a\x09^source ifNil: ['']",
  851. messageSends: ["ifNil:"],
  852. referencedClasses: []
  853. }),
  854. smalltalk.AbstractCodeGenerator);
  855. smalltalk.addMethod(
  856. "_source_",
  857. smalltalk.method({
  858. selector: "source:",
  859. category: 'accessing',
  860. fn: function (aString){
  861. var self=this;
  862. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  863. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString}, smalltalk.AbstractCodeGenerator)})},
  864. args: ["aString"],
  865. source: "source: aString\x0a\x09source := aString",
  866. messageSends: [],
  867. referencedClasses: []
  868. }),
  869. smalltalk.AbstractCodeGenerator);
  870. smalltalk.addClass('CodeGenerator', smalltalk.AbstractCodeGenerator, [], 'Compiler-Core');
  871. smalltalk.CodeGenerator.comment="I am a basic code generator. I generate a valid JavaScript output, but no not perform any inlining.\x0aSee `InliningCodeGenerator` for an optimized JavaScript code generation."
  872. smalltalk.addMethod(
  873. "_compileNode_",
  874. smalltalk.method({
  875. selector: "compileNode:",
  876. category: 'compiling',
  877. fn: function (aNode){
  878. var self=this;
  879. var ir,stream;
  880. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  881. _st(_st(self)._semanticAnalyzer())._visit_(aNode);
  882. ir=_st(_st(self)._translator())._visit_(aNode);
  883. $2=_st(self)._irTranslator();
  884. _st($2)._visit_(ir);
  885. $3=_st($2)._contents();
  886. $1=$3;
  887. return $1;
  888. }, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,ir:ir,stream:stream}, smalltalk.CodeGenerator)})},
  889. args: ["aNode"],
  890. source: "compileNode: aNode\x0a\x09| ir stream |\x0a\x09self semanticAnalyzer visit: aNode.\x0a\x09ir := self translator visit: aNode.\x0a\x09^ self irTranslator\x0a\x09\x09visit: ir;\x0a\x09\x09contents",
  891. messageSends: ["visit:", "semanticAnalyzer", "translator", "irTranslator", "contents"],
  892. referencedClasses: []
  893. }),
  894. smalltalk.CodeGenerator);
  895. smalltalk.addMethod(
  896. "_irTranslator",
  897. smalltalk.method({
  898. selector: "irTranslator",
  899. category: 'compiling',
  900. fn: function (){
  901. var self=this;
  902. return smalltalk.withContext(function($ctx1) { var $1;
  903. $1=_st((smalltalk.IRJSTranslator || IRJSTranslator))._new();
  904. return $1;
  905. }, function($ctx1) {$ctx1.fill(self,"irTranslator",{}, smalltalk.CodeGenerator)})},
  906. args: [],
  907. source: "irTranslator\x0a\x09^ IRJSTranslator new",
  908. messageSends: ["new"],
  909. referencedClasses: ["IRJSTranslator"]
  910. }),
  911. smalltalk.CodeGenerator);
  912. smalltalk.addMethod(
  913. "_semanticAnalyzer",
  914. smalltalk.method({
  915. selector: "semanticAnalyzer",
  916. category: 'compiling',
  917. fn: function (){
  918. var self=this;
  919. return smalltalk.withContext(function($ctx1) { var $1;
  920. $1=_st((smalltalk.SemanticAnalyzer || SemanticAnalyzer))._on_(_st(self)._currentClass());
  921. return $1;
  922. }, function($ctx1) {$ctx1.fill(self,"semanticAnalyzer",{}, smalltalk.CodeGenerator)})},
  923. args: [],
  924. source: "semanticAnalyzer\x0a\x09^ SemanticAnalyzer on: self currentClass",
  925. messageSends: ["on:", "currentClass"],
  926. referencedClasses: ["SemanticAnalyzer"]
  927. }),
  928. smalltalk.CodeGenerator);
  929. smalltalk.addMethod(
  930. "_translator",
  931. smalltalk.method({
  932. selector: "translator",
  933. category: 'compiling',
  934. fn: function (){
  935. var self=this;
  936. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  937. $2=_st((smalltalk.IRASTTranslator || IRASTTranslator))._new();
  938. _st($2)._source_(_st(self)._source());
  939. _st($2)._theClass_(_st(self)._currentClass());
  940. $3=_st($2)._yourself();
  941. $1=$3;
  942. return $1;
  943. }, function($ctx1) {$ctx1.fill(self,"translator",{}, smalltalk.CodeGenerator)})},
  944. args: [],
  945. source: "translator\x0a\x09^ IRASTTranslator new\x0a\x09\x09source: self source;\x0a\x09\x09theClass: self currentClass;\x0a\x09\x09yourself",
  946. messageSends: ["source:", "source", "new", "theClass:", "currentClass", "yourself"],
  947. referencedClasses: ["IRASTTranslator"]
  948. }),
  949. smalltalk.CodeGenerator);