Compiler-Core.deploy.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  1. smalltalk.addPackage('Compiler-Core');
  2. smalltalk.addClass('AbstractCodeGenerator', smalltalk.Object, ['currentClass', 'source'], 'Compiler-Core');
  3. smalltalk.addMethod(
  4. "_classNameFor_",
  5. smalltalk.method({
  6. selector: "classNameFor:",
  7. fn: function (aClass){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  10. $2=_st(aClass)._isMetaclass();
  11. if(smalltalk.assert($2)){
  12. $1=_st(_st(_st(aClass)._instanceClass())._name()).__comma(".klass");
  13. } else {
  14. $3=_st(aClass)._isNil();
  15. if(smalltalk.assert($3)){
  16. $1="nil";
  17. } else {
  18. $1=_st(aClass)._name();
  19. };
  20. };
  21. return $1;
  22. }, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass},smalltalk.AbstractCodeGenerator)})},
  23. messageSends: ["ifTrue:ifFalse:", ",", "name", "instanceClass", "isNil", "isMetaclass"]}),
  24. smalltalk.AbstractCodeGenerator);
  25. smalltalk.addMethod(
  26. "_compileNode_",
  27. smalltalk.method({
  28. selector: "compileNode:",
  29. fn: function (aNode){
  30. var self=this;
  31. return smalltalk.withContext(function($ctx1) { _st(self)._subclassResponsibility();
  32. return self}, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode},smalltalk.AbstractCodeGenerator)})},
  33. messageSends: ["subclassResponsibility"]}),
  34. smalltalk.AbstractCodeGenerator);
  35. smalltalk.addMethod(
  36. "_currentClass",
  37. smalltalk.method({
  38. selector: "currentClass",
  39. fn: function (){
  40. var self=this;
  41. return smalltalk.withContext(function($ctx1) { var $1;
  42. $1=self["@currentClass"];
  43. return $1;
  44. }, function($ctx1) {$ctx1.fill(self,"currentClass",{},smalltalk.AbstractCodeGenerator)})},
  45. messageSends: []}),
  46. smalltalk.AbstractCodeGenerator);
  47. smalltalk.addMethod(
  48. "_currentClass_",
  49. smalltalk.method({
  50. selector: "currentClass:",
  51. fn: function (aClass){
  52. var self=this;
  53. return smalltalk.withContext(function($ctx1) { self["@currentClass"]=aClass;
  54. return self}, function($ctx1) {$ctx1.fill(self,"currentClass:",{aClass:aClass},smalltalk.AbstractCodeGenerator)})},
  55. messageSends: []}),
  56. smalltalk.AbstractCodeGenerator);
  57. smalltalk.addMethod(
  58. "_pseudoVariables",
  59. smalltalk.method({
  60. selector: "pseudoVariables",
  61. fn: function (){
  62. var self=this;
  63. return smalltalk.withContext(function($ctx1) { return ["self", "super", "true", "false", "nil", "thisContext"];
  64. }, function($ctx1) {$ctx1.fill(self,"pseudoVariables",{},smalltalk.AbstractCodeGenerator)})},
  65. messageSends: []}),
  66. smalltalk.AbstractCodeGenerator);
  67. smalltalk.addMethod(
  68. "_safeVariableNameFor_",
  69. smalltalk.method({
  70. selector: "safeVariableNameFor:",
  71. fn: function (aString){
  72. var self=this;
  73. return smalltalk.withContext(function($ctx1) { var $2,$1;
  74. $2=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._reservedWords())._includes_(aString);
  75. if(smalltalk.assert($2)){
  76. $1=_st(aString).__comma("_");
  77. } else {
  78. $1=aString;
  79. };
  80. return $1;
  81. }, function($ctx1) {$ctx1.fill(self,"safeVariableNameFor:",{aString:aString},smalltalk.AbstractCodeGenerator)})},
  82. messageSends: ["ifTrue:ifFalse:", ",", "includes:", "reservedWords", "current"]}),
  83. smalltalk.AbstractCodeGenerator);
  84. smalltalk.addMethod(
  85. "_source",
  86. smalltalk.method({
  87. selector: "source",
  88. fn: function (){
  89. var self=this;
  90. return smalltalk.withContext(function($ctx1) { var $2,$1;
  91. $2=self["@source"];
  92. if(($receiver = $2) == nil || $receiver == undefined){
  93. $1="";
  94. } else {
  95. $1=$2;
  96. };
  97. return $1;
  98. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.AbstractCodeGenerator)})},
  99. messageSends: ["ifNil:"]}),
  100. smalltalk.AbstractCodeGenerator);
  101. smalltalk.addMethod(
  102. "_source_",
  103. smalltalk.method({
  104. selector: "source:",
  105. fn: function (aString){
  106. var self=this;
  107. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  108. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.AbstractCodeGenerator)})},
  109. messageSends: []}),
  110. smalltalk.AbstractCodeGenerator);
  111. smalltalk.addClass('CodeGenerator', smalltalk.AbstractCodeGenerator, [], 'Compiler-Core');
  112. smalltalk.addMethod(
  113. "_compileNode_",
  114. smalltalk.method({
  115. selector: "compileNode:",
  116. fn: function (aNode){
  117. var self=this;
  118. var ir,stream;
  119. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  120. _st(_st(self)._semanticAnalyzer())._visit_(aNode);
  121. ir=_st(_st(self)._translator())._visit_(aNode);
  122. $2=_st(self)._irTranslator();
  123. _st($2)._visit_(ir);
  124. $3=_st($2)._contents();
  125. $1=$3;
  126. return $1;
  127. }, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,ir:ir,stream:stream},smalltalk.CodeGenerator)})},
  128. messageSends: ["visit:", "semanticAnalyzer", "translator", "irTranslator", "contents"]}),
  129. smalltalk.CodeGenerator);
  130. smalltalk.addMethod(
  131. "_irTranslator",
  132. smalltalk.method({
  133. selector: "irTranslator",
  134. fn: function (){
  135. var self=this;
  136. return smalltalk.withContext(function($ctx1) { var $1;
  137. $1=_st((smalltalk.IRJSTranslator || IRJSTranslator))._new();
  138. return $1;
  139. }, function($ctx1) {$ctx1.fill(self,"irTranslator",{},smalltalk.CodeGenerator)})},
  140. messageSends: ["new"]}),
  141. smalltalk.CodeGenerator);
  142. smalltalk.addMethod(
  143. "_semanticAnalyzer",
  144. smalltalk.method({
  145. selector: "semanticAnalyzer",
  146. fn: function (){
  147. var self=this;
  148. return smalltalk.withContext(function($ctx1) { var $1;
  149. $1=_st((smalltalk.SemanticAnalyzer || SemanticAnalyzer))._on_(_st(self)._currentClass());
  150. return $1;
  151. }, function($ctx1) {$ctx1.fill(self,"semanticAnalyzer",{},smalltalk.CodeGenerator)})},
  152. messageSends: ["on:", "currentClass"]}),
  153. smalltalk.CodeGenerator);
  154. smalltalk.addMethod(
  155. "_translator",
  156. smalltalk.method({
  157. selector: "translator",
  158. fn: function (){
  159. var self=this;
  160. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  161. $2=_st((smalltalk.IRASTTranslator || IRASTTranslator))._new();
  162. _st($2)._source_(_st(self)._source());
  163. _st($2)._theClass_(_st(self)._currentClass());
  164. $3=_st($2)._yourself();
  165. $1=$3;
  166. return $1;
  167. }, function($ctx1) {$ctx1.fill(self,"translator",{},smalltalk.CodeGenerator)})},
  168. messageSends: ["source:", "source", "new", "theClass:", "currentClass", "yourself"]}),
  169. smalltalk.CodeGenerator);
  170. smalltalk.addClass('Compiler', smalltalk.Object, ['currentClass', 'source', 'unknownVariables', 'codeGeneratorClass'], 'Compiler-Core');
  171. smalltalk.addMethod(
  172. "_codeGeneratorClass",
  173. smalltalk.method({
  174. selector: "codeGeneratorClass",
  175. fn: function (){
  176. var self=this;
  177. return smalltalk.withContext(function($ctx1) { var $2,$1;
  178. $2=self["@codeGeneratorClass"];
  179. if(($receiver = $2) == nil || $receiver == undefined){
  180. $1=(smalltalk.InliningCodeGenerator || InliningCodeGenerator);
  181. } else {
  182. $1=$2;
  183. };
  184. return $1;
  185. }, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass",{},smalltalk.Compiler)})},
  186. messageSends: ["ifNil:"]}),
  187. smalltalk.Compiler);
  188. smalltalk.addMethod(
  189. "_codeGeneratorClass_",
  190. smalltalk.method({
  191. selector: "codeGeneratorClass:",
  192. fn: function (aClass){
  193. var self=this;
  194. return smalltalk.withContext(function($ctx1) { self["@codeGeneratorClass"]=aClass;
  195. return self}, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass:",{aClass:aClass},smalltalk.Compiler)})},
  196. messageSends: []}),
  197. smalltalk.Compiler);
  198. smalltalk.addMethod(
  199. "_compile_",
  200. smalltalk.method({
  201. selector: "compile:",
  202. fn: function (aString){
  203. var self=this;
  204. return smalltalk.withContext(function($ctx1) { var $1;
  205. $1=_st(self)._compileNode_(_st(self)._parse_(aString));
  206. return $1;
  207. }, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString},smalltalk.Compiler)})},
  208. messageSends: ["compileNode:", "parse:"]}),
  209. smalltalk.Compiler);
  210. smalltalk.addMethod(
  211. "_compile_forClass_",
  212. smalltalk.method({
  213. selector: "compile:forClass:",
  214. fn: function (aString,aClass){
  215. var self=this;
  216. return smalltalk.withContext(function($ctx1) { var $1;
  217. _st(self)._currentClass_(aClass);
  218. _st(self)._source_(aString);
  219. $1=_st(self)._compile_(aString);
  220. return $1;
  221. }, function($ctx1) {$ctx1.fill(self,"compile:forClass:",{aString:aString,aClass:aClass},smalltalk.Compiler)})},
  222. messageSends: ["currentClass:", "source:", "compile:"]}),
  223. smalltalk.Compiler);
  224. smalltalk.addMethod(
  225. "_compileExpression_",
  226. smalltalk.method({
  227. selector: "compileExpression:",
  228. fn: function (aString){
  229. var self=this;
  230. return smalltalk.withContext(function($ctx1) { var $1;
  231. _st(self)._currentClass_((smalltalk.DoIt || DoIt));
  232. _st(self)._source_(_st(_st("doIt ^[").__comma(aString)).__comma("] value"));
  233. $1=_st(self)._compileNode_(_st(self)._parse_(_st(self)._source()));
  234. return $1;
  235. }, function($ctx1) {$ctx1.fill(self,"compileExpression:",{aString:aString},smalltalk.Compiler)})},
  236. messageSends: ["currentClass:", "source:", ",", "compileNode:", "parse:", "source"]}),
  237. smalltalk.Compiler);
  238. smalltalk.addMethod(
  239. "_compileExpression_on_",
  240. smalltalk.method({
  241. selector: "compileExpression:on:",
  242. fn: function (aString,anObject){
  243. var self=this;
  244. return smalltalk.withContext(function($ctx1) { var $1;
  245. _st(self)._currentClass_(_st(anObject)._class());
  246. _st(self)._source_(_st(_st("xxxDoIt ^[").__comma(aString)).__comma("] value"));
  247. $1=_st(self)._compileNode_(_st(self)._parse_(_st(self)._source()));
  248. return $1;
  249. }, function($ctx1) {$ctx1.fill(self,"compileExpression:on:",{aString:aString,anObject:anObject},smalltalk.Compiler)})},
  250. messageSends: ["currentClass:", "class", "source:", ",", "compileNode:", "parse:", "source"]}),
  251. smalltalk.Compiler);
  252. smalltalk.addMethod(
  253. "_compileNode_",
  254. smalltalk.method({
  255. selector: "compileNode:",
  256. fn: function (aNode){
  257. var self=this;
  258. var generator,result;
  259. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  260. generator=_st(_st(self)._codeGeneratorClass())._new();
  261. $1=generator;
  262. _st($1)._source_(_st(self)._source());
  263. $2=_st($1)._currentClass_(_st(self)._currentClass());
  264. result=_st(generator)._compileNode_(aNode);
  265. _st(self)._unknownVariables_([]);
  266. $3=result;
  267. return $3;
  268. }, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,generator:generator,result:result},smalltalk.Compiler)})},
  269. messageSends: ["new", "codeGeneratorClass", "source:", "source", "currentClass:", "currentClass", "compileNode:", "unknownVariables:"]}),
  270. smalltalk.Compiler);
  271. smalltalk.addMethod(
  272. "_currentClass",
  273. smalltalk.method({
  274. selector: "currentClass",
  275. fn: function (){
  276. var self=this;
  277. return smalltalk.withContext(function($ctx1) { var $1;
  278. $1=self["@currentClass"];
  279. return $1;
  280. }, function($ctx1) {$ctx1.fill(self,"currentClass",{},smalltalk.Compiler)})},
  281. messageSends: []}),
  282. smalltalk.Compiler);
  283. smalltalk.addMethod(
  284. "_currentClass_",
  285. smalltalk.method({
  286. selector: "currentClass:",
  287. fn: function (aClass){
  288. var self=this;
  289. return smalltalk.withContext(function($ctx1) { self["@currentClass"]=aClass;
  290. return self}, function($ctx1) {$ctx1.fill(self,"currentClass:",{aClass:aClass},smalltalk.Compiler)})},
  291. messageSends: []}),
  292. smalltalk.Compiler);
  293. smalltalk.addMethod(
  294. "_eval_",
  295. smalltalk.method({
  296. selector: "eval:",
  297. fn: function (aString){
  298. var self=this;
  299. return smalltalk.withContext(function($ctx1) { return eval(aString);
  300. return self}, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString},smalltalk.Compiler)})},
  301. messageSends: []}),
  302. smalltalk.Compiler);
  303. smalltalk.addMethod(
  304. "_evaluateExpression_",
  305. smalltalk.method({
  306. selector: "evaluateExpression:",
  307. fn: function (aString){
  308. var self=this;
  309. return smalltalk.withContext(function($ctx1) { var $1;
  310. $1=_st(self)._evaluateExpression_on_(aString,_st((smalltalk.DoIt || DoIt))._new());
  311. return $1;
  312. }, function($ctx1) {$ctx1.fill(self,"evaluateExpression:",{aString:aString},smalltalk.Compiler)})},
  313. messageSends: ["evaluateExpression:on:", "new"]}),
  314. smalltalk.Compiler);
  315. smalltalk.addMethod(
  316. "_evaluateExpression_on_",
  317. smalltalk.method({
  318. selector: "evaluateExpression:on:",
  319. fn: function (aString,anObject){
  320. var self=this;
  321. var result,method;
  322. return smalltalk.withContext(function($ctx1) { var $1;
  323. method=_st(self)._eval_(_st(self)._compileExpression_on_(aString,anObject));
  324. _st(method)._category_("xxxDoIt");
  325. _st(_st(anObject)._class())._addCompiledMethod_(method);
  326. result=_st(anObject)._xxxDoIt();
  327. _st(_st(anObject)._class())._removeCompiledMethod_(method);
  328. $1=result;
  329. return $1;
  330. }, function($ctx1) {$ctx1.fill(self,"evaluateExpression:on:",{aString:aString,anObject:anObject,result:result,method:method},smalltalk.Compiler)})},
  331. messageSends: ["eval:", "compileExpression:on:", "category:", "addCompiledMethod:", "class", "xxxDoIt", "removeCompiledMethod:"]}),
  332. smalltalk.Compiler);
  333. smalltalk.addMethod(
  334. "_install_forClass_category_",
  335. smalltalk.method({
  336. selector: "install:forClass:category:",
  337. fn: function (aString,aBehavior,anotherString){
  338. var self=this;
  339. return smalltalk.withContext(function($ctx1) { var $1;
  340. $1=_st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._installMethod_forClass_category_(_st(self)._eval_(_st(self)._compile_forClass_(aString,aBehavior)),aBehavior,anotherString);
  341. return $1;
  342. }, function($ctx1) {$ctx1.fill(self,"install:forClass:category:",{aString:aString,aBehavior:aBehavior,anotherString:anotherString},smalltalk.Compiler)})},
  343. messageSends: ["installMethod:forClass:category:", "eval:", "compile:forClass:", "new"]}),
  344. smalltalk.Compiler);
  345. smalltalk.addMethod(
  346. "_parse_",
  347. smalltalk.method({
  348. selector: "parse:",
  349. fn: function (aString){
  350. var self=this;
  351. return smalltalk.withContext(function($ctx1) { var $1;
  352. $1=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._parse_(aString);
  353. return $1;
  354. }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString},smalltalk.Compiler)})},
  355. messageSends: ["parse:", "current"]}),
  356. smalltalk.Compiler);
  357. smalltalk.addMethod(
  358. "_parseExpression_",
  359. smalltalk.method({
  360. selector: "parseExpression:",
  361. fn: function (aString){
  362. var self=this;
  363. return smalltalk.withContext(function($ctx1) { var $1;
  364. $1=_st(self)._parse_(_st(_st("doIt ^[").__comma(aString)).__comma("] value"));
  365. return $1;
  366. }, function($ctx1) {$ctx1.fill(self,"parseExpression:",{aString:aString},smalltalk.Compiler)})},
  367. messageSends: ["parse:", ","]}),
  368. smalltalk.Compiler);
  369. smalltalk.addMethod(
  370. "_recompile_",
  371. smalltalk.method({
  372. selector: "recompile:",
  373. fn: function (aClass){
  374. var self=this;
  375. return smalltalk.withContext(function($ctx1) { var $1;
  376. _st(_st(aClass)._methodDictionary())._do_((function(each){
  377. return smalltalk.withContext(function($ctx2) { _st(console)._log_(_st(_st(_st(aClass)._name()).__comma(" >> ")).__comma(_st(each)._selector()));
  378. return _st(self)._install_forClass_category_(_st(each)._source(),aClass,_st(each)._category());
  379. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  380. $1=_st(aClass)._isMetaclass();
  381. if(! smalltalk.assert($1)){
  382. _st(self)._recompile_(_st(aClass)._class());
  383. };
  384. return self}, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass},smalltalk.Compiler)})},
  385. messageSends: ["do:", "log:", ",", "selector", "name", "install:forClass:category:", "source", "category", "methodDictionary", "ifFalse:", "recompile:", "class", "isMetaclass"]}),
  386. smalltalk.Compiler);
  387. smalltalk.addMethod(
  388. "_recompileAll",
  389. smalltalk.method({
  390. selector: "recompileAll",
  391. fn: function (){
  392. var self=this;
  393. return smalltalk.withContext(function($ctx1) { var $1,$2;
  394. _st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes())._do_((function(each){
  395. return smalltalk.withContext(function($ctx2) { $1=(smalltalk.Transcript || Transcript);
  396. _st($1)._show_(each);
  397. $2=_st($1)._cr();
  398. $2;
  399. return _st((function(){
  400. return smalltalk.withContext(function($ctx3) { return _st(self)._recompile_(each);
  401. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((100));
  402. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  403. return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{},smalltalk.Compiler)})},
  404. messageSends: ["do:", "show:", "cr", "valueWithTimeout:", "recompile:", "classes", "current"]}),
  405. smalltalk.Compiler);
  406. smalltalk.addMethod(
  407. "_source",
  408. smalltalk.method({
  409. selector: "source",
  410. fn: function (){
  411. var self=this;
  412. return smalltalk.withContext(function($ctx1) { var $2,$1;
  413. $2=self["@source"];
  414. if(($receiver = $2) == nil || $receiver == undefined){
  415. $1="";
  416. } else {
  417. $1=$2;
  418. };
  419. return $1;
  420. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.Compiler)})},
  421. messageSends: ["ifNil:"]}),
  422. smalltalk.Compiler);
  423. smalltalk.addMethod(
  424. "_source_",
  425. smalltalk.method({
  426. selector: "source:",
  427. fn: function (aString){
  428. var self=this;
  429. return smalltalk.withContext(function($ctx1) { self["@source"]=aString;
  430. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.Compiler)})},
  431. messageSends: []}),
  432. smalltalk.Compiler);
  433. smalltalk.addMethod(
  434. "_unknownVariables",
  435. smalltalk.method({
  436. selector: "unknownVariables",
  437. fn: function (){
  438. var self=this;
  439. return smalltalk.withContext(function($ctx1) { var $1;
  440. $1=self["@unknownVariables"];
  441. return $1;
  442. }, function($ctx1) {$ctx1.fill(self,"unknownVariables",{},smalltalk.Compiler)})},
  443. messageSends: []}),
  444. smalltalk.Compiler);
  445. smalltalk.addMethod(
  446. "_unknownVariables_",
  447. smalltalk.method({
  448. selector: "unknownVariables:",
  449. fn: function (aCollection){
  450. var self=this;
  451. return smalltalk.withContext(function($ctx1) { self["@unknownVariables"]=aCollection;
  452. return self}, function($ctx1) {$ctx1.fill(self,"unknownVariables:",{aCollection:aCollection},smalltalk.Compiler)})},
  453. messageSends: []}),
  454. smalltalk.Compiler);
  455. smalltalk.addMethod(
  456. "_recompile_",
  457. smalltalk.method({
  458. selector: "recompile:",
  459. fn: function (aClass){
  460. var self=this;
  461. return smalltalk.withContext(function($ctx1) { _st(_st(self)._new())._recompile_(aClass);
  462. return self}, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass},smalltalk.Compiler.klass)})},
  463. messageSends: ["recompile:", "new"]}),
  464. smalltalk.Compiler.klass);
  465. smalltalk.addMethod(
  466. "_recompileAll",
  467. smalltalk.method({
  468. selector: "recompileAll",
  469. fn: function (){
  470. var self=this;
  471. return smalltalk.withContext(function($ctx1) { _st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes())._do_((function(each){
  472. return smalltalk.withContext(function($ctx2) { return _st(self)._recompile_(each);
  473. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  474. return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{},smalltalk.Compiler.klass)})},
  475. messageSends: ["do:", "recompile:", "classes", "current"]}),
  476. smalltalk.Compiler.klass);
  477. smalltalk.addClass('DoIt', smalltalk.Object, [], 'Compiler-Core');
  478. smalltalk.addClass('NodeVisitor', smalltalk.Object, [], 'Compiler-Core');
  479. smalltalk.addMethod(
  480. "_visit_",
  481. smalltalk.method({
  482. selector: "visit:",
  483. fn: function (aNode){
  484. var self=this;
  485. return smalltalk.withContext(function($ctx1) { var $1;
  486. $1=_st(aNode)._accept_(self);
  487. return $1;
  488. }, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode},smalltalk.NodeVisitor)})},
  489. messageSends: ["accept:"]}),
  490. smalltalk.NodeVisitor);
  491. smalltalk.addMethod(
  492. "_visitAll_",
  493. smalltalk.method({
  494. selector: "visitAll:",
  495. fn: function (aCollection){
  496. var self=this;
  497. return smalltalk.withContext(function($ctx1) { var $1;
  498. $1=_st(aCollection)._collect_((function(each){
  499. return smalltalk.withContext(function($ctx2) { return _st(self)._visit_(each);
  500. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  501. return $1;
  502. }, function($ctx1) {$ctx1.fill(self,"visitAll:",{aCollection:aCollection},smalltalk.NodeVisitor)})},
  503. messageSends: ["collect:", "visit:"]}),
  504. smalltalk.NodeVisitor);
  505. smalltalk.addMethod(
  506. "_visitAssignmentNode_",
  507. smalltalk.method({
  508. selector: "visitAssignmentNode:",
  509. fn: function (aNode){
  510. var self=this;
  511. return smalltalk.withContext(function($ctx1) { var $1;
  512. $1=_st(self)._visitNode_(aNode);
  513. return $1;
  514. }, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  515. messageSends: ["visitNode:"]}),
  516. smalltalk.NodeVisitor);
  517. smalltalk.addMethod(
  518. "_visitBlockNode_",
  519. smalltalk.method({
  520. selector: "visitBlockNode:",
  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,"visitBlockNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  527. messageSends: ["visitNode:"]}),
  528. smalltalk.NodeVisitor);
  529. smalltalk.addMethod(
  530. "_visitBlockSequenceNode_",
  531. smalltalk.method({
  532. selector: "visitBlockSequenceNode:",
  533. fn: function (aNode){
  534. var self=this;
  535. return smalltalk.withContext(function($ctx1) { var $1;
  536. $1=_st(self)._visitSequenceNode_(aNode);
  537. return $1;
  538. }, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  539. messageSends: ["visitSequenceNode:"]}),
  540. smalltalk.NodeVisitor);
  541. smalltalk.addMethod(
  542. "_visitCascadeNode_",
  543. smalltalk.method({
  544. selector: "visitCascadeNode:",
  545. fn: function (aNode){
  546. var self=this;
  547. return smalltalk.withContext(function($ctx1) { var $1;
  548. $1=_st(self)._visitNode_(aNode);
  549. return $1;
  550. }, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  551. messageSends: ["visitNode:"]}),
  552. smalltalk.NodeVisitor);
  553. smalltalk.addMethod(
  554. "_visitClassReferenceNode_",
  555. smalltalk.method({
  556. selector: "visitClassReferenceNode:",
  557. fn: function (aNode){
  558. var self=this;
  559. return smalltalk.withContext(function($ctx1) { var $1;
  560. $1=_st(self)._visitVariableNode_(aNode);
  561. return $1;
  562. }, function($ctx1) {$ctx1.fill(self,"visitClassReferenceNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  563. messageSends: ["visitVariableNode:"]}),
  564. smalltalk.NodeVisitor);
  565. smalltalk.addMethod(
  566. "_visitDynamicArrayNode_",
  567. smalltalk.method({
  568. selector: "visitDynamicArrayNode:",
  569. fn: function (aNode){
  570. var self=this;
  571. return smalltalk.withContext(function($ctx1) { var $1;
  572. $1=_st(self)._visitNode_(aNode);
  573. return $1;
  574. }, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  575. messageSends: ["visitNode:"]}),
  576. smalltalk.NodeVisitor);
  577. smalltalk.addMethod(
  578. "_visitDynamicDictionaryNode_",
  579. smalltalk.method({
  580. selector: "visitDynamicDictionaryNode:",
  581. fn: function (aNode){
  582. var self=this;
  583. return smalltalk.withContext(function($ctx1) { var $1;
  584. $1=_st(self)._visitNode_(aNode);
  585. return $1;
  586. }, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  587. messageSends: ["visitNode:"]}),
  588. smalltalk.NodeVisitor);
  589. smalltalk.addMethod(
  590. "_visitJSStatementNode_",
  591. smalltalk.method({
  592. selector: "visitJSStatementNode:",
  593. fn: function (aNode){
  594. var self=this;
  595. return smalltalk.withContext(function($ctx1) { var $1;
  596. $1=_st(self)._visitNode_(aNode);
  597. return $1;
  598. }, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  599. messageSends: ["visitNode:"]}),
  600. smalltalk.NodeVisitor);
  601. smalltalk.addMethod(
  602. "_visitMethodNode_",
  603. smalltalk.method({
  604. selector: "visitMethodNode:",
  605. fn: function (aNode){
  606. var self=this;
  607. return smalltalk.withContext(function($ctx1) { var $1;
  608. $1=_st(self)._visitNode_(aNode);
  609. return $1;
  610. }, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  611. messageSends: ["visitNode:"]}),
  612. smalltalk.NodeVisitor);
  613. smalltalk.addMethod(
  614. "_visitNode_",
  615. smalltalk.method({
  616. selector: "visitNode:",
  617. fn: function (aNode){
  618. var self=this;
  619. return smalltalk.withContext(function($ctx1) { var $1;
  620. $1=_st(self)._visitAll_(_st(aNode)._nodes());
  621. return $1;
  622. }, function($ctx1) {$ctx1.fill(self,"visitNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  623. messageSends: ["visitAll:", "nodes"]}),
  624. smalltalk.NodeVisitor);
  625. smalltalk.addMethod(
  626. "_visitReturnNode_",
  627. smalltalk.method({
  628. selector: "visitReturnNode:",
  629. fn: function (aNode){
  630. var self=this;
  631. return smalltalk.withContext(function($ctx1) { var $1;
  632. $1=_st(self)._visitNode_(aNode);
  633. return $1;
  634. }, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  635. messageSends: ["visitNode:"]}),
  636. smalltalk.NodeVisitor);
  637. smalltalk.addMethod(
  638. "_visitSendNode_",
  639. smalltalk.method({
  640. selector: "visitSendNode:",
  641. fn: function (aNode){
  642. var self=this;
  643. return smalltalk.withContext(function($ctx1) { var $1;
  644. $1=_st(self)._visitNode_(aNode);
  645. return $1;
  646. }, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  647. messageSends: ["visitNode:"]}),
  648. smalltalk.NodeVisitor);
  649. smalltalk.addMethod(
  650. "_visitSequenceNode_",
  651. smalltalk.method({
  652. selector: "visitSequenceNode:",
  653. fn: function (aNode){
  654. var self=this;
  655. return smalltalk.withContext(function($ctx1) { var $1;
  656. $1=_st(self)._visitNode_(aNode);
  657. return $1;
  658. }, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  659. messageSends: ["visitNode:"]}),
  660. smalltalk.NodeVisitor);
  661. smalltalk.addMethod(
  662. "_visitValueNode_",
  663. smalltalk.method({
  664. selector: "visitValueNode:",
  665. fn: function (aNode){
  666. var self=this;
  667. return smalltalk.withContext(function($ctx1) { var $1;
  668. $1=_st(self)._visitNode_(aNode);
  669. return $1;
  670. }, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  671. messageSends: ["visitNode:"]}),
  672. smalltalk.NodeVisitor);
  673. smalltalk.addMethod(
  674. "_visitVariableNode_",
  675. smalltalk.method({
  676. selector: "visitVariableNode:",
  677. fn: function (aNode){
  678. var self=this;
  679. return smalltalk.withContext(function($ctx1) { var $1;
  680. $1=_st(self)._visitNode_(aNode);
  681. return $1;
  682. }, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  683. messageSends: ["visitNode:"]}),
  684. smalltalk.NodeVisitor);