2
0

Compiler-Core.deploy.js 25 KB

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