Compiler-Core.deploy.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765
  1. smalltalk.addPackage('Compiler-Core');
  2. smalltalk.addClass('AbstractCodeGenerator', smalltalk.Object, ['currentClass', 'source'], 'Compiler-Core');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "classNameFor:",
  6. fn: function (aClass){
  7. var self=this;
  8. return smalltalk.withContext(function($ctx1) {
  9. 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. smalltalk.method({
  27. selector: "compileNode:",
  28. fn: function (aNode){
  29. var self=this;
  30. return smalltalk.withContext(function($ctx1) {
  31. _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. smalltalk.method({
  37. selector: "currentClass",
  38. fn: function (){
  39. var self=this;
  40. return smalltalk.withContext(function($ctx1) {
  41. 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. smalltalk.method({
  49. selector: "currentClass:",
  50. fn: function (aClass){
  51. var self=this;
  52. return smalltalk.withContext(function($ctx1) {
  53. 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. smalltalk.method({
  59. selector: "pseudoVariables",
  60. fn: function (){
  61. var self=this;
  62. return smalltalk.withContext(function($ctx1) {
  63. 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. smalltalk.method({
  71. selector: "safeVariableNameFor:",
  72. fn: function (aString){
  73. var self=this;
  74. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  75. return smalltalk.withContext(function($ctx1) {
  76. 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. smalltalk.method({
  89. selector: "source",
  90. fn: function (){
  91. var self=this;
  92. return smalltalk.withContext(function($ctx1) {
  93. 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. smalltalk.method({
  106. selector: "source:",
  107. fn: function (aString){
  108. var self=this;
  109. return smalltalk.withContext(function($ctx1) {
  110. 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. smalltalk.method({
  117. selector: "compileNode:",
  118. fn: function (aNode){
  119. var self=this;
  120. var ir,stream;
  121. return smalltalk.withContext(function($ctx1) {
  122. 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. smalltalk.method({
  135. selector: "irTranslator",
  136. fn: function (){
  137. var self=this;
  138. function $IRJSTranslator(){return smalltalk.IRJSTranslator||(typeof IRJSTranslator=="undefined"?nil:IRJSTranslator)}
  139. return smalltalk.withContext(function($ctx1) {
  140. 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. smalltalk.method({
  148. selector: "semanticAnalyzer",
  149. fn: function (){
  150. var self=this;
  151. function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
  152. return smalltalk.withContext(function($ctx1) {
  153. 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. smalltalk.method({
  161. selector: "translator",
  162. fn: function (){
  163. var self=this;
  164. function $IRASTTranslator(){return smalltalk.IRASTTranslator||(typeof IRASTTranslator=="undefined"?nil:IRASTTranslator)}
  165. return smalltalk.withContext(function($ctx1) {
  166. 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. smalltalk.method({
  179. selector: "codeGeneratorClass",
  180. fn: function (){
  181. var self=this;
  182. function $InliningCodeGenerator(){return smalltalk.InliningCodeGenerator||(typeof InliningCodeGenerator=="undefined"?nil:InliningCodeGenerator)}
  183. return smalltalk.withContext(function($ctx1) {
  184. 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. smalltalk.method({
  197. selector: "codeGeneratorClass:",
  198. fn: function (aClass){
  199. var self=this;
  200. return smalltalk.withContext(function($ctx1) {
  201. 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. smalltalk.method({
  207. selector: "compile:",
  208. fn: function (aString){
  209. var self=this;
  210. return smalltalk.withContext(function($ctx1) {
  211. 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. smalltalk.method({
  219. selector: "compile:forClass:",
  220. fn: function (aString,aClass){
  221. var self=this;
  222. return smalltalk.withContext(function($ctx1) {
  223. 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. smalltalk.method({
  233. selector: "compileExpression:",
  234. fn: function (aString){
  235. var self=this;
  236. function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  237. return smalltalk.withContext(function($ctx1) {
  238. 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. smalltalk.method({
  248. selector: "compileExpression:on:",
  249. fn: function (aString,anObject){
  250. var self=this;
  251. return smalltalk.withContext(function($ctx1) {
  252. 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. smalltalk.method({
  262. selector: "compileNode:",
  263. fn: function (aNode){
  264. var self=this;
  265. var generator,result;
  266. return smalltalk.withContext(function($ctx1) {
  267. 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. smalltalk.method({
  281. selector: "currentClass",
  282. fn: function (){
  283. var self=this;
  284. return smalltalk.withContext(function($ctx1) {
  285. 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. smalltalk.method({
  293. selector: "currentClass:",
  294. fn: function (aClass){
  295. var self=this;
  296. return smalltalk.withContext(function($ctx1) {
  297. 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. smalltalk.method({
  303. selector: "eval:",
  304. fn: function (aString){
  305. var self=this;
  306. return smalltalk.withContext(function($ctx1) {
  307. 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. smalltalk.method({
  313. selector: "evaluateExpression:",
  314. fn: function (aString){
  315. var self=this;
  316. function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  317. return smalltalk.withContext(function($ctx1) {
  318. 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. smalltalk.method({
  326. selector: "evaluateExpression:on:",
  327. fn: function (aString,anObject){
  328. var self=this;
  329. var result,method;
  330. return smalltalk.withContext(function($ctx1) {
  331. 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. smalltalk.method({
  344. selector: "install:forClass:category:",
  345. fn: function (aString,aBehavior,anotherString){
  346. var self=this;
  347. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  348. return smalltalk.withContext(function($ctx1) {
  349. 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. smalltalk.method({
  357. selector: "parse:",
  358. fn: function (aString){
  359. var self=this;
  360. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  361. return smalltalk.withContext(function($ctx1) {
  362. 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. smalltalk.method({
  370. selector: "parseExpression:",
  371. fn: function (aString){
  372. var self=this;
  373. return smalltalk.withContext(function($ctx1) {
  374. 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. smalltalk.method({
  382. selector: "recompile:",
  383. fn: function (aClass){
  384. var self=this;
  385. return smalltalk.withContext(function($ctx1) {
  386. var $1;
  387. _st(_st(aClass)._methodDictionary())._do_((function(each){
  388. return smalltalk.withContext(function($ctx2) {
  389. _st(console)._log_(_st(_st(_st(aClass)._name()).__comma(" >> ")).__comma(_st(each)._selector()));
  390. return _st(self)._install_forClass_category_(_st(each)._source(),aClass,_st(each)._category());
  391. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  392. $1=_st(aClass)._isMetaclass();
  393. if(! smalltalk.assert($1)){
  394. _st(self)._recompile_(_st(aClass)._class());
  395. };
  396. return self}, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass},smalltalk.Compiler)})},
  397. messageSends: ["do:", "log:", ",", "selector", "name", "install:forClass:category:", "source", "category", "methodDictionary", "ifFalse:", "recompile:", "class", "isMetaclass"]}),
  398. smalltalk.Compiler);
  399. smalltalk.addMethod(
  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) {
  407. var $1,$2;
  408. _st(_st(_st($Smalltalk())._current())._classes())._do_((function(each){
  409. return smalltalk.withContext(function($ctx2) {
  410. $1=$Transcript();
  411. _st($1)._show_(each);
  412. $2=_st($1)._cr();
  413. $2;
  414. return _st((function(){
  415. return smalltalk.withContext(function($ctx3) {
  416. return _st(self)._recompile_(each);
  417. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((100));
  418. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  419. return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{},smalltalk.Compiler)})},
  420. messageSends: ["do:", "show:", "cr", "valueWithTimeout:", "recompile:", "classes", "current"]}),
  421. smalltalk.Compiler);
  422. smalltalk.addMethod(
  423. smalltalk.method({
  424. selector: "source",
  425. fn: function (){
  426. var self=this;
  427. return smalltalk.withContext(function($ctx1) {
  428. var $2,$1;
  429. $2=self["@source"];
  430. if(($receiver = $2) == nil || $receiver == undefined){
  431. $1="";
  432. } else {
  433. $1=$2;
  434. };
  435. return $1;
  436. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.Compiler)})},
  437. messageSends: ["ifNil:"]}),
  438. smalltalk.Compiler);
  439. smalltalk.addMethod(
  440. smalltalk.method({
  441. selector: "source:",
  442. fn: function (aString){
  443. var self=this;
  444. return smalltalk.withContext(function($ctx1) {
  445. self["@source"]=aString;
  446. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.Compiler)})},
  447. messageSends: []}),
  448. smalltalk.Compiler);
  449. smalltalk.addMethod(
  450. smalltalk.method({
  451. selector: "unknownVariables",
  452. fn: function (){
  453. var self=this;
  454. return smalltalk.withContext(function($ctx1) {
  455. var $1;
  456. $1=self["@unknownVariables"];
  457. return $1;
  458. }, function($ctx1) {$ctx1.fill(self,"unknownVariables",{},smalltalk.Compiler)})},
  459. messageSends: []}),
  460. smalltalk.Compiler);
  461. smalltalk.addMethod(
  462. smalltalk.method({
  463. selector: "unknownVariables:",
  464. fn: function (aCollection){
  465. var self=this;
  466. return smalltalk.withContext(function($ctx1) {
  467. self["@unknownVariables"]=aCollection;
  468. return self}, function($ctx1) {$ctx1.fill(self,"unknownVariables:",{aCollection:aCollection},smalltalk.Compiler)})},
  469. messageSends: []}),
  470. smalltalk.Compiler);
  471. smalltalk.addMethod(
  472. smalltalk.method({
  473. selector: "recompile:",
  474. fn: function (aClass){
  475. var self=this;
  476. return smalltalk.withContext(function($ctx1) {
  477. _st(_st(self)._new())._recompile_(aClass);
  478. return self}, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass},smalltalk.Compiler.klass)})},
  479. messageSends: ["recompile:", "new"]}),
  480. smalltalk.Compiler.klass);
  481. smalltalk.addMethod(
  482. smalltalk.method({
  483. selector: "recompileAll",
  484. fn: function (){
  485. var self=this;
  486. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  487. return smalltalk.withContext(function($ctx1) {
  488. _st(_st(_st($Smalltalk())._current())._classes())._do_((function(each){
  489. return smalltalk.withContext(function($ctx2) {
  490. return _st(self)._recompile_(each);
  491. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  492. return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{},smalltalk.Compiler.klass)})},
  493. messageSends: ["do:", "recompile:", "classes", "current"]}),
  494. smalltalk.Compiler.klass);
  495. smalltalk.addClass('DoIt', smalltalk.Object, [], 'Compiler-Core');
  496. smalltalk.addClass('NodeVisitor', smalltalk.Object, [], 'Compiler-Core');
  497. smalltalk.addMethod(
  498. smalltalk.method({
  499. selector: "visit:",
  500. fn: function (aNode){
  501. var self=this;
  502. return smalltalk.withContext(function($ctx1) {
  503. var $1;
  504. $1=_st(aNode)._accept_(self);
  505. return $1;
  506. }, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode},smalltalk.NodeVisitor)})},
  507. messageSends: ["accept:"]}),
  508. smalltalk.NodeVisitor);
  509. smalltalk.addMethod(
  510. smalltalk.method({
  511. selector: "visitAll:",
  512. fn: function (aCollection){
  513. var self=this;
  514. return smalltalk.withContext(function($ctx1) {
  515. var $1;
  516. $1=_st(aCollection)._collect_((function(each){
  517. return smalltalk.withContext(function($ctx2) {
  518. return _st(self)._visit_(each);
  519. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  520. return $1;
  521. }, function($ctx1) {$ctx1.fill(self,"visitAll:",{aCollection:aCollection},smalltalk.NodeVisitor)})},
  522. messageSends: ["collect:", "visit:"]}),
  523. smalltalk.NodeVisitor);
  524. smalltalk.addMethod(
  525. smalltalk.method({
  526. selector: "visitAssignmentNode:",
  527. fn: function (aNode){
  528. var self=this;
  529. return smalltalk.withContext(function($ctx1) {
  530. var $1;
  531. $1=_st(self)._visitNode_(aNode);
  532. return $1;
  533. }, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  534. messageSends: ["visitNode:"]}),
  535. smalltalk.NodeVisitor);
  536. smalltalk.addMethod(
  537. smalltalk.method({
  538. selector: "visitBlockNode:",
  539. fn: function (aNode){
  540. var self=this;
  541. return smalltalk.withContext(function($ctx1) {
  542. var $1;
  543. $1=_st(self)._visitNode_(aNode);
  544. return $1;
  545. }, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  546. messageSends: ["visitNode:"]}),
  547. smalltalk.NodeVisitor);
  548. smalltalk.addMethod(
  549. smalltalk.method({
  550. selector: "visitBlockSequenceNode:",
  551. fn: function (aNode){
  552. var self=this;
  553. return smalltalk.withContext(function($ctx1) {
  554. var $1;
  555. $1=_st(self)._visitSequenceNode_(aNode);
  556. return $1;
  557. }, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  558. messageSends: ["visitSequenceNode:"]}),
  559. smalltalk.NodeVisitor);
  560. smalltalk.addMethod(
  561. smalltalk.method({
  562. selector: "visitCascadeNode:",
  563. fn: function (aNode){
  564. var self=this;
  565. return smalltalk.withContext(function($ctx1) {
  566. var $1;
  567. $1=_st(self)._visitNode_(aNode);
  568. return $1;
  569. }, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  570. messageSends: ["visitNode:"]}),
  571. smalltalk.NodeVisitor);
  572. smalltalk.addMethod(
  573. smalltalk.method({
  574. selector: "visitClassReferenceNode:",
  575. fn: function (aNode){
  576. var self=this;
  577. return smalltalk.withContext(function($ctx1) {
  578. var $1;
  579. $1=_st(self)._visitVariableNode_(aNode);
  580. return $1;
  581. }, function($ctx1) {$ctx1.fill(self,"visitClassReferenceNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  582. messageSends: ["visitVariableNode:"]}),
  583. smalltalk.NodeVisitor);
  584. smalltalk.addMethod(
  585. smalltalk.method({
  586. selector: "visitDynamicArrayNode:",
  587. fn: function (aNode){
  588. var self=this;
  589. return smalltalk.withContext(function($ctx1) {
  590. var $1;
  591. $1=_st(self)._visitNode_(aNode);
  592. return $1;
  593. }, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  594. messageSends: ["visitNode:"]}),
  595. smalltalk.NodeVisitor);
  596. smalltalk.addMethod(
  597. smalltalk.method({
  598. selector: "visitDynamicDictionaryNode:",
  599. fn: function (aNode){
  600. var self=this;
  601. return smalltalk.withContext(function($ctx1) {
  602. var $1;
  603. $1=_st(self)._visitNode_(aNode);
  604. return $1;
  605. }, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  606. messageSends: ["visitNode:"]}),
  607. smalltalk.NodeVisitor);
  608. smalltalk.addMethod(
  609. smalltalk.method({
  610. selector: "visitJSStatementNode:",
  611. fn: function (aNode){
  612. var self=this;
  613. return smalltalk.withContext(function($ctx1) {
  614. var $1;
  615. $1=_st(self)._visitNode_(aNode);
  616. return $1;
  617. }, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  618. messageSends: ["visitNode:"]}),
  619. smalltalk.NodeVisitor);
  620. smalltalk.addMethod(
  621. smalltalk.method({
  622. selector: "visitMethodNode:",
  623. fn: function (aNode){
  624. var self=this;
  625. return smalltalk.withContext(function($ctx1) {
  626. var $1;
  627. $1=_st(self)._visitNode_(aNode);
  628. return $1;
  629. }, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  630. messageSends: ["visitNode:"]}),
  631. smalltalk.NodeVisitor);
  632. smalltalk.addMethod(
  633. smalltalk.method({
  634. selector: "visitNode:",
  635. fn: function (aNode){
  636. var self=this;
  637. return smalltalk.withContext(function($ctx1) {
  638. var $1;
  639. $1=_st(self)._visitAll_(_st(aNode)._nodes());
  640. return $1;
  641. }, function($ctx1) {$ctx1.fill(self,"visitNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  642. messageSends: ["visitAll:", "nodes"]}),
  643. smalltalk.NodeVisitor);
  644. smalltalk.addMethod(
  645. smalltalk.method({
  646. selector: "visitReturnNode:",
  647. fn: function (aNode){
  648. var self=this;
  649. return smalltalk.withContext(function($ctx1) {
  650. var $1;
  651. $1=_st(self)._visitNode_(aNode);
  652. return $1;
  653. }, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  654. messageSends: ["visitNode:"]}),
  655. smalltalk.NodeVisitor);
  656. smalltalk.addMethod(
  657. smalltalk.method({
  658. selector: "visitSendNode:",
  659. fn: function (aNode){
  660. var self=this;
  661. return smalltalk.withContext(function($ctx1) {
  662. var $1;
  663. $1=_st(self)._visitNode_(aNode);
  664. return $1;
  665. }, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  666. messageSends: ["visitNode:"]}),
  667. smalltalk.NodeVisitor);
  668. smalltalk.addMethod(
  669. smalltalk.method({
  670. selector: "visitSequenceNode:",
  671. fn: function (aNode){
  672. var self=this;
  673. return smalltalk.withContext(function($ctx1) {
  674. var $1;
  675. $1=_st(self)._visitNode_(aNode);
  676. return $1;
  677. }, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  678. messageSends: ["visitNode:"]}),
  679. smalltalk.NodeVisitor);
  680. smalltalk.addMethod(
  681. smalltalk.method({
  682. selector: "visitValueNode:",
  683. fn: function (aNode){
  684. var self=this;
  685. return smalltalk.withContext(function($ctx1) {
  686. var $1;
  687. $1=_st(self)._visitNode_(aNode);
  688. return $1;
  689. }, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  690. messageSends: ["visitNode:"]}),
  691. smalltalk.NodeVisitor);
  692. smalltalk.addMethod(
  693. smalltalk.method({
  694. selector: "visitVariableNode:",
  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,"visitVariableNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  702. messageSends: ["visitNode:"]}),
  703. smalltalk.NodeVisitor);