Compiler-Core.deploy.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  1. smalltalk.addPackage('Compiler-Core', {});
  2. smalltalk.addClass('Compiler', smalltalk.Object, ['currentClass', 'source', 'unknownVariables', 'codeGeneratorClass'], 'Compiler-Core');
  3. smalltalk.addMethod(
  4. "_codeGeneratorClass",
  5. smalltalk.method({
  6. selector: "codeGeneratorClass",
  7. fn: function () {
  8. var self=this;
  9. return (($receiver = self['@codeGeneratorClass']) == nil || $receiver == undefined) ? (function(){return (smalltalk.FunCodeGenerator || FunCodeGenerator);})() : $receiver;
  10. return self;}
  11. }),
  12. smalltalk.Compiler);
  13. smalltalk.addMethod(
  14. "_codeGeneratorClass_",
  15. smalltalk.method({
  16. selector: "codeGeneratorClass:",
  17. fn: function (aClass) {
  18. var self=this;
  19. (self['@codeGeneratorClass']=aClass);
  20. return self;}
  21. }),
  22. smalltalk.Compiler);
  23. smalltalk.addMethod(
  24. "_compile_",
  25. smalltalk.method({
  26. selector: "compile:",
  27. fn: function (aString) {
  28. var self=this;
  29. return smalltalk.send(self, "_compileNode_", [smalltalk.send(self, "_parse_", [aString])]);
  30. return self;}
  31. }),
  32. smalltalk.Compiler);
  33. smalltalk.addMethod(
  34. "_compile_forClass_",
  35. smalltalk.method({
  36. selector: "compile:forClass:",
  37. fn: function (aString, aClass) {
  38. var self=this;
  39. smalltalk.send(self, "_currentClass_", [aClass]);
  40. smalltalk.send(self, "_source_", [aString]);
  41. return smalltalk.send(self, "_compile_", [aString]);
  42. return self;}
  43. }),
  44. smalltalk.Compiler);
  45. smalltalk.addMethod(
  46. "_compileExpression_",
  47. smalltalk.method({
  48. selector: "compileExpression:",
  49. fn: function (aString) {
  50. var self=this;
  51. smalltalk.send(self, "_currentClass_", [(smalltalk.DoIt || DoIt)]);
  52. smalltalk.send(self, "_source_", [smalltalk.send(smalltalk.send("doIt ^[", "__comma", [aString]), "__comma", ["] value"])]);
  53. return smalltalk.send(self, "_compileNode_", [smalltalk.send(self, "_parse_", [smalltalk.send(self, "_source", [])])]);
  54. return self;}
  55. }),
  56. smalltalk.Compiler);
  57. smalltalk.addMethod(
  58. "_compileNode_",
  59. smalltalk.method({
  60. selector: "compileNode:",
  61. fn: function (aNode) {
  62. var self=this;
  63. var generator=nil;
  64. var result=nil;
  65. (generator=smalltalk.send(smalltalk.send(self, "_codeGeneratorClass", []), "_new", []));
  66. (function($rec){smalltalk.send($rec, "_source_", [smalltalk.send(self, "_source", [])]);return smalltalk.send($rec, "_currentClass_", [smalltalk.send(self, "_currentClass", [])]);})(generator);
  67. (result=smalltalk.send(generator, "_compileNode_", [aNode]));
  68. smalltalk.send(self, "_unknownVariables_", [[]]);
  69. return result;
  70. return self;}
  71. }),
  72. smalltalk.Compiler);
  73. smalltalk.addMethod(
  74. "_currentClass",
  75. smalltalk.method({
  76. selector: "currentClass",
  77. fn: function () {
  78. var self=this;
  79. return self['@currentClass'];
  80. return self;}
  81. }),
  82. smalltalk.Compiler);
  83. smalltalk.addMethod(
  84. "_currentClass_",
  85. smalltalk.method({
  86. selector: "currentClass:",
  87. fn: function (aClass) {
  88. var self=this;
  89. (self['@currentClass']=aClass);
  90. return self;}
  91. }),
  92. smalltalk.Compiler);
  93. smalltalk.addMethod(
  94. "_eval_",
  95. smalltalk.method({
  96. selector: "eval:",
  97. fn: function (aString) {
  98. var self=this;
  99. return eval(aString);
  100. return self;}
  101. }),
  102. smalltalk.Compiler);
  103. smalltalk.addMethod(
  104. "_evaluateExpression_",
  105. smalltalk.method({
  106. selector: "evaluateExpression:",
  107. fn: function (aString) {
  108. var self=this;
  109. var result=nil;
  110. smalltalk.send((smalltalk.DoIt || DoIt), "_addCompiledMethod_", [smalltalk.send(self, "_eval_", [smalltalk.send(self, "_compileExpression_", [aString])])]);
  111. (result=smalltalk.send(smalltalk.send((smalltalk.DoIt || DoIt), "_new", []), "_doIt", []));
  112. smalltalk.send((smalltalk.DoIt || DoIt), "_removeCompiledMethod_", [smalltalk.send(smalltalk.send((smalltalk.DoIt || DoIt), "_methodDictionary", []), "_at_", ["doIt"])]);
  113. return result;
  114. return self;}
  115. }),
  116. smalltalk.Compiler);
  117. smalltalk.addMethod(
  118. "_parse_",
  119. smalltalk.method({
  120. selector: "parse:",
  121. fn: function (aString) {
  122. var self=this;
  123. return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_parse_", [aString]);
  124. return self;}
  125. }),
  126. smalltalk.Compiler);
  127. smalltalk.addMethod(
  128. "_parseExpression_",
  129. smalltalk.method({
  130. selector: "parseExpression:",
  131. fn: function (aString) {
  132. var self=this;
  133. return smalltalk.send(self, "_parse_", [smalltalk.send(smalltalk.send("doIt ^[", "__comma", [aString]), "__comma", ["] value"])]);
  134. return self;}
  135. }),
  136. smalltalk.Compiler);
  137. smalltalk.addMethod(
  138. "_recompile_",
  139. smalltalk.method({
  140. selector: "recompile:",
  141. fn: function (aClass) {
  142. var self=this;
  143. smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_do_", [(function(each){return smalltalk.send(self, "_install_forClass_category_", [smalltalk.send(each, "_source", []), aClass, smalltalk.send(each, "_category", [])]);})]);
  144. smalltalk.send(self, "_setupClass_", [aClass]);
  145. ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_recompile_", [smalltalk.send(aClass, "_class", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_recompile_", [smalltalk.send(aClass, "_class", [])]);})]));
  146. return self;}
  147. }),
  148. smalltalk.Compiler);
  149. smalltalk.addMethod(
  150. "_recompileAll",
  151. smalltalk.method({
  152. selector: "recompileAll",
  153. fn: function () {
  154. var self=this;
  155. smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_classes", []), "_do_", [(function(each){(function($rec){smalltalk.send($rec, "_show_", [each]);return smalltalk.send($rec, "_cr", []);})((smalltalk.Transcript || Transcript));return smalltalk.send((function(){return smalltalk.send(self, "_recompile_", [each]);}), "_valueWithTimeout_", [(100)]);})]);
  156. return self;}
  157. }),
  158. smalltalk.Compiler);
  159. smalltalk.addMethod(
  160. "_setupClass_",
  161. smalltalk.method({
  162. selector: "setupClass:",
  163. fn: function (aClass) {
  164. var self=this;
  165. smalltalk.init(aClass);
  166. return self;}
  167. }),
  168. smalltalk.Compiler);
  169. smalltalk.addMethod(
  170. "_source",
  171. smalltalk.method({
  172. selector: "source",
  173. fn: function () {
  174. var self=this;
  175. return (($receiver = self['@source']) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
  176. return self;}
  177. }),
  178. smalltalk.Compiler);
  179. smalltalk.addMethod(
  180. "_source_",
  181. smalltalk.method({
  182. selector: "source:",
  183. fn: function (aString) {
  184. var self=this;
  185. (self['@source']=aString);
  186. return self;}
  187. }),
  188. smalltalk.Compiler);
  189. smalltalk.addMethod(
  190. "_unknownVariables",
  191. smalltalk.method({
  192. selector: "unknownVariables",
  193. fn: function () {
  194. var self=this;
  195. return self['@unknownVariables'];
  196. return self;}
  197. }),
  198. smalltalk.Compiler);
  199. smalltalk.addMethod(
  200. "_unknownVariables_",
  201. smalltalk.method({
  202. selector: "unknownVariables:",
  203. fn: function (aCollection) {
  204. var self=this;
  205. (self['@unknownVariables']=aCollection);
  206. return self;}
  207. }),
  208. smalltalk.Compiler);
  209. smalltalk.addMethod(
  210. "_recompile_",
  211. smalltalk.method({
  212. selector: "recompile:",
  213. fn: function (aClass) {
  214. var self=this;
  215. smalltalk.send(smalltalk.send(self, "_new", []), "_recompile_", [aClass]);
  216. return self;}
  217. }),
  218. smalltalk.Compiler.klass);
  219. smalltalk.addMethod(
  220. "_recompileAll",
  221. smalltalk.method({
  222. selector: "recompileAll",
  223. fn: function () {
  224. var self=this;
  225. smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_classes", []), "_do_", [(function(each){return smalltalk.send(self, "_recompile_", [each]);})]);
  226. return self;}
  227. }),
  228. smalltalk.Compiler.klass);
  229. smalltalk.addClass('DoIt', smalltalk.Object, [], 'Compiler-Core');
  230. smalltalk.addClass('JSStream', smalltalk.Object, ['stream'], 'Compiler-Core');
  231. smalltalk.addMethod(
  232. "_contents",
  233. smalltalk.method({
  234. selector: "contents",
  235. fn: function () {
  236. var self=this;
  237. return smalltalk.send(self['@stream'], "_contents", []);
  238. return self;}
  239. }),
  240. smalltalk.JSStream);
  241. smalltalk.addMethod(
  242. "_initialize",
  243. smalltalk.method({
  244. selector: "initialize",
  245. fn: function () {
  246. var self=this;
  247. smalltalk.send(self, "_initialize", [], smalltalk.JSStream.superclass || nil);
  248. (self['@stream']=smalltalk.send("", "_writeStream", []));
  249. return self;}
  250. }),
  251. smalltalk.JSStream);
  252. smalltalk.addMethod(
  253. "_lf",
  254. smalltalk.method({
  255. selector: "lf",
  256. fn: function () {
  257. var self=this;
  258. smalltalk.send(self['@stream'], "_lf", []);
  259. return self;}
  260. }),
  261. smalltalk.JSStream);
  262. smalltalk.addMethod(
  263. "_nextPut_",
  264. smalltalk.method({
  265. selector: "nextPut:",
  266. fn: function (aString) {
  267. var self=this;
  268. smalltalk.send(self['@stream'], "_nextPut_", [aString]);
  269. return self;}
  270. }),
  271. smalltalk.JSStream);
  272. smalltalk.addMethod(
  273. "_nextPutAll_",
  274. smalltalk.method({
  275. selector: "nextPutAll:",
  276. fn: function (aString) {
  277. var self=this;
  278. smalltalk.send(self['@stream'], "_nextPutAll_", [aString]);
  279. return self;}
  280. }),
  281. smalltalk.JSStream);
  282. smalltalk.addMethod(
  283. "_nextPutAssignment_to_",
  284. smalltalk.method({
  285. selector: "nextPutAssignment:to:",
  286. fn: function (varInstruction, valueInstruction) {
  287. var self=this;
  288. smalltalk.send(varInstruction, "_emitOn_", [self]);
  289. smalltalk.send(self['@stream'], "_nextPutAll_", ["="]);
  290. smalltalk.send(valueInstruction, "_emitOn_", [self]);
  291. return self;}
  292. }),
  293. smalltalk.JSStream);
  294. smalltalk.addMethod(
  295. "_nextPutClosureWith_arguments_",
  296. smalltalk.method({
  297. selector: "nextPutClosureWith:arguments:",
  298. fn: function (aBlock, anArray) {
  299. var self=this;
  300. smalltalk.send(self['@stream'], "_nextPutAll_", ["(function("]);
  301. smalltalk.send(anArray, "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPut_", [","]);})]);
  302. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["){"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  303. smalltalk.send(aBlock, "_value", []);
  304. smalltalk.send(self['@stream'], "_nextPutAll_", ["})"]);
  305. return self;}
  306. }),
  307. smalltalk.JSStream);
  308. smalltalk.addMethod(
  309. "_nextPutFunctionWith_arguments_",
  310. smalltalk.method({
  311. selector: "nextPutFunctionWith:arguments:",
  312. fn: function (aBlock, anArray) {
  313. var self=this;
  314. smalltalk.send(self['@stream'], "_nextPutAll_", ["fn: function("]);
  315. smalltalk.send(anArray, "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPut_", [","]);})]);
  316. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["){"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  317. smalltalk.send(self, "_nextPutVar_", ["$return"]);
  318. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["var self=this;"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  319. smalltalk.send(aBlock, "_value", []);
  320. smalltalk.send(self['@stream'], "_nextPutAll_", ["return $return || self;}"]);
  321. return self;}
  322. }),
  323. smalltalk.JSStream);
  324. smalltalk.addMethod(
  325. "_nextPutMethodDeclaration_with_",
  326. smalltalk.method({
  327. selector: "nextPutMethodDeclaration:with:",
  328. fn: function (aMethod, aBlock) {
  329. var self=this;
  330. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["smalltalk.method({"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("selector: \x22", "__comma", [smalltalk.send(aMethod, "_selector", [])]), "__comma", ["\x22,"])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("source: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_source", []), "_asJavascript", [])]), "__comma", [","])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  331. smalltalk.send(aBlock, "_value", []);
  332. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(",", "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])]), "__comma", ["messageSends: "])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aMethod, "_messageSends", []), "_asArray", []), "_asJavascript", []), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("args: ", "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aMethod, "_arguments", []), "_collect_", [(function(each){return smalltalk.send(each, "_value", []);})]), "_asArray", []), "_asJavascript", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["referencedClasses: ["]);})(self['@stream']);
  333. smalltalk.send(smalltalk.send(aMethod, "_classReferences", []), "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(each, "_asJavascript", [])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
  334. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["]"]);return smalltalk.send($rec, "_nextPutAll_", ["})"]);})(self['@stream']);
  335. return self;}
  336. }),
  337. smalltalk.JSStream);
  338. smalltalk.addMethod(
  339. "_nextPutNonLocalReturnHandlingWith_",
  340. smalltalk.method({
  341. selector: "nextPutNonLocalReturnHandlingWith:",
  342. fn: function (aBlock) {
  343. var self=this;
  344. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["var $early={};"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["try {"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  345. smalltalk.send(aBlock, "_value", []);
  346. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["}"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["catch(e) {if(e===$early)return e[0]; throw e}"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  347. return self;}
  348. }),
  349. smalltalk.JSStream);
  350. smalltalk.addMethod(
  351. "_nextPutNonLocalReturnWith_",
  352. smalltalk.method({
  353. selector: "nextPutNonLocalReturnWith:",
  354. fn: function (aBlock) {
  355. var self=this;
  356. smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){throw $early=["]);
  357. smalltalk.send(aBlock, "_value", []);
  358. smalltalk.send(self['@stream'], "_nextPutAll_", ["]})()"]);
  359. return self;}
  360. }),
  361. smalltalk.JSStream);
  362. smalltalk.addMethod(
  363. "_nextPutReturnWith_",
  364. smalltalk.method({
  365. selector: "nextPutReturnWith:",
  366. fn: function (aBlock) {
  367. var self=this;
  368. smalltalk.send(self['@stream'], "_nextPutAll_", ["$return="]);
  369. smalltalk.send(aBlock, "_value", []);
  370. return self;}
  371. }),
  372. smalltalk.JSStream);
  373. smalltalk.addMethod(
  374. "_nextPutSendTo_selector_arguments_",
  375. smalltalk.method({
  376. selector: "nextPutSendTo:selector:arguments:",
  377. fn: function (receiver, selector, arguments) {
  378. var self=this;
  379. smalltalk.send(self['@stream'], "_nextPutAll_", ["smalltalk.send("]);
  380. smalltalk.send(receiver, "_emitOn_", [self]);
  381. smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(",\x22", "__comma", [smalltalk.send(selector, "_asSelector", [])]), "__comma", ["\x22,["])]);
  382. smalltalk.send(arguments, "_do_separatedBy_", [(function(each){return smalltalk.send(each, "_emitOn_", [self]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
  383. smalltalk.send(self['@stream'], "_nextPutAll_", ["])"]);
  384. return self;}
  385. }),
  386. smalltalk.JSStream);
  387. smalltalk.addMethod(
  388. "_nextPutSequenceWith_",
  389. smalltalk.method({
  390. selector: "nextPutSequenceWith:",
  391. fn: function (aBlock) {
  392. var self=this;
  393. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["switch(smalltalk.thisContext.pc){"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  394. smalltalk.send(aBlock, "_value", []);
  395. (function($rec){smalltalk.send($rec, "_nextPutAll_", ["};"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  396. return self;}
  397. }),
  398. smalltalk.JSStream);
  399. smalltalk.addMethod(
  400. "_nextPutStatement_with_",
  401. smalltalk.method({
  402. selector: "nextPutStatement:with:",
  403. fn: function (anInteger, aBlock) {
  404. var self=this;
  405. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("case ", "__comma", [smalltalk.send(anInteger, "_asString", [])]), "__comma", [":"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  406. smalltalk.send(aBlock, "_value", []);
  407. (function($rec){smalltalk.send($rec, "_nextPutAll_", [";"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("smalltalk.thisContext.pc=", "__comma", [smalltalk.send(((($receiver = anInteger).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])), "_asString", [])]), "__comma", [";"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  408. return self;}
  409. }),
  410. smalltalk.JSStream);
  411. smalltalk.addMethod(
  412. "_nextPutVar_",
  413. smalltalk.method({
  414. selector: "nextPutVar:",
  415. fn: function (aString) {
  416. var self=this;
  417. (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("var ", "__comma", [aString]), "__comma", [";"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  418. return self;}
  419. }),
  420. smalltalk.JSStream);
  421. smalltalk.addMethod(
  422. "_nextPutVars_",
  423. smalltalk.method({
  424. selector: "nextPutVars:",
  425. fn: function (aCollection) {
  426. var self=this;
  427. smalltalk.send(self['@stream'], "_nextPutAll_", ["var "]);
  428. smalltalk.send(aCollection, "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]);
  429. (function($rec){smalltalk.send($rec, "_nextPutAll_", [";"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']);
  430. return self;}
  431. }),
  432. smalltalk.JSStream);
  433. smalltalk.addClass('NodeVisitor', smalltalk.Object, [], 'Compiler-Core');
  434. smalltalk.addMethod(
  435. "_visit_",
  436. smalltalk.method({
  437. selector: "visit:",
  438. fn: function (aNode) {
  439. var self=this;
  440. smalltalk.send(aNode, "_accept_", [self]);
  441. return self;}
  442. }),
  443. smalltalk.NodeVisitor);
  444. smalltalk.addMethod(
  445. "_visitAll_",
  446. smalltalk.method({
  447. selector: "visitAll:",
  448. fn: function (aCollection) {
  449. var self=this;
  450. smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
  451. return self;}
  452. }),
  453. smalltalk.NodeVisitor);
  454. smalltalk.addMethod(
  455. "_visitAssignmentNode_",
  456. smalltalk.method({
  457. selector: "visitAssignmentNode:",
  458. fn: function (aNode) {
  459. var self=this;
  460. smalltalk.send(self, "_visitNode_", [aNode]);
  461. return self;}
  462. }),
  463. smalltalk.NodeVisitor);
  464. smalltalk.addMethod(
  465. "_visitBlockNode_",
  466. smalltalk.method({
  467. selector: "visitBlockNode:",
  468. fn: function (aNode) {
  469. var self=this;
  470. smalltalk.send(self, "_visitNode_", [aNode]);
  471. return self;}
  472. }),
  473. smalltalk.NodeVisitor);
  474. smalltalk.addMethod(
  475. "_visitBlockSequenceNode_",
  476. smalltalk.method({
  477. selector: "visitBlockSequenceNode:",
  478. fn: function (aNode) {
  479. var self=this;
  480. smalltalk.send(self, "_visitSequenceNode_", [aNode]);
  481. return self;}
  482. }),
  483. smalltalk.NodeVisitor);
  484. smalltalk.addMethod(
  485. "_visitCascadeNode_",
  486. smalltalk.method({
  487. selector: "visitCascadeNode:",
  488. fn: function (aNode) {
  489. var self=this;
  490. smalltalk.send(self, "_visitNode_", [aNode]);
  491. return self;}
  492. }),
  493. smalltalk.NodeVisitor);
  494. smalltalk.addMethod(
  495. "_visitClassReferenceNode_",
  496. smalltalk.method({
  497. selector: "visitClassReferenceNode:",
  498. fn: function (aNode) {
  499. var self=this;
  500. smalltalk.send(self, "_visitNode_", [aNode]);
  501. return self;}
  502. }),
  503. smalltalk.NodeVisitor);
  504. smalltalk.addMethod(
  505. "_visitDynamicArrayNode_",
  506. smalltalk.method({
  507. selector: "visitDynamicArrayNode:",
  508. fn: function (aNode) {
  509. var self=this;
  510. smalltalk.send(self, "_visitNode_", [aNode]);
  511. return self;}
  512. }),
  513. smalltalk.NodeVisitor);
  514. smalltalk.addMethod(
  515. "_visitDynamicDictionaryNode_",
  516. smalltalk.method({
  517. selector: "visitDynamicDictionaryNode:",
  518. fn: function (aNode) {
  519. var self=this;
  520. smalltalk.send(self, "_visitNode_", [aNode]);
  521. return self;}
  522. }),
  523. smalltalk.NodeVisitor);
  524. smalltalk.addMethod(
  525. "_visitJSStatementNode_",
  526. smalltalk.method({
  527. selector: "visitJSStatementNode:",
  528. fn: function (aNode) {
  529. var self=this;
  530. smalltalk.send(self, "_visitNode_", [aNode]);
  531. return self;}
  532. }),
  533. smalltalk.NodeVisitor);
  534. smalltalk.addMethod(
  535. "_visitMethodNode_",
  536. smalltalk.method({
  537. selector: "visitMethodNode:",
  538. fn: function (aNode) {
  539. var self=this;
  540. smalltalk.send(self, "_visitNode_", [aNode]);
  541. return self;}
  542. }),
  543. smalltalk.NodeVisitor);
  544. smalltalk.addMethod(
  545. "_visitNode_",
  546. smalltalk.method({
  547. selector: "visitNode:",
  548. fn: function (aNode) {
  549. var self=this;
  550. smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]);
  551. return self;}
  552. }),
  553. smalltalk.NodeVisitor);
  554. smalltalk.addMethod(
  555. "_visitReturnNode_",
  556. smalltalk.method({
  557. selector: "visitReturnNode:",
  558. fn: function (aNode) {
  559. var self=this;
  560. smalltalk.send(self, "_visitNode_", [aNode]);
  561. return self;}
  562. }),
  563. smalltalk.NodeVisitor);
  564. smalltalk.addMethod(
  565. "_visitSendNode_",
  566. smalltalk.method({
  567. selector: "visitSendNode:",
  568. fn: function (aNode) {
  569. var self=this;
  570. smalltalk.send(self, "_visitNode_", [aNode]);
  571. return self;}
  572. }),
  573. smalltalk.NodeVisitor);
  574. smalltalk.addMethod(
  575. "_visitSequenceNode_",
  576. smalltalk.method({
  577. selector: "visitSequenceNode:",
  578. fn: function (aNode) {
  579. var self=this;
  580. smalltalk.send(self, "_visitNode_", [aNode]);
  581. return self;}
  582. }),
  583. smalltalk.NodeVisitor);
  584. smalltalk.addMethod(
  585. "_visitValueNode_",
  586. smalltalk.method({
  587. selector: "visitValueNode:",
  588. fn: function (aNode) {
  589. var self=this;
  590. smalltalk.send(self, "_visitNode_", [aNode]);
  591. return self;}
  592. }),
  593. smalltalk.NodeVisitor);
  594. smalltalk.addMethod(
  595. "_visitVariableNode_",
  596. smalltalk.method({
  597. selector: "visitVariableNode:",
  598. fn: function (aNode) {
  599. var self=this;
  600. smalltalk.send(self, "_visitNode_", [aNode]);
  601. return self;}
  602. }),
  603. smalltalk.NodeVisitor);