Compiler-Core.deploy.js 25 KB

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