2
0

Compiler-Core.js 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082
  1. smalltalk.addPackage('Compiler-Core');
  2. smalltalk.addClass('AbstractCodeGenerator', smalltalk.Object, ['currentClass', 'source'], 'Compiler-Core');
  3. smalltalk.AbstractCodeGenerator.comment="I am the abstract super class of all code generators and provide their common API."
  4. smalltalk.addMethod(
  5. "_classNameFor_",
  6. smalltalk.method({
  7. selector: "classNameFor:",
  8. category: 'accessing',
  9. fn: function (aClass){
  10. var self=this;
  11. return smalltalk.withContext(function($ctx1) {
  12. var $2,$3,$1;
  13. $2=_st(aClass)._isMetaclass();
  14. if(smalltalk.assert($2)){
  15. $1=_st(_st(_st(aClass)._instanceClass())._name()).__comma(".klass");
  16. } else {
  17. $3=_st(aClass)._isNil();
  18. if(smalltalk.assert($3)){
  19. $1="nil";
  20. } else {
  21. $1=_st(aClass)._name();
  22. };
  23. };
  24. return $1;
  25. }, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass},smalltalk.AbstractCodeGenerator)})},
  26. args: ["aClass"],
  27. source: "classNameFor: aClass\x0a\x09^aClass isMetaclass\x0a\x09\x09ifTrue: [aClass instanceClass name, '.klass']\x0a\x09\x09ifFalse: [\x0a\x09\x09aClass isNil\x0a\x09\x09\x09ifTrue: ['nil']\x0a\x09\x09\x09ifFalse: [aClass name]]",
  28. messageSends: ["ifTrue:ifFalse:", ",", "name", "instanceClass", "isNil", "isMetaclass"],
  29. referencedClasses: []
  30. }),
  31. smalltalk.AbstractCodeGenerator);
  32. smalltalk.addMethod(
  33. "_compileNode_",
  34. smalltalk.method({
  35. selector: "compileNode:",
  36. category: 'compiling',
  37. fn: function (aNode){
  38. var self=this;
  39. return smalltalk.withContext(function($ctx1) {
  40. _st(self)._subclassResponsibility();
  41. return self}, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode},smalltalk.AbstractCodeGenerator)})},
  42. args: ["aNode"],
  43. source: "compileNode: aNode\x0a\x09self subclassResponsibility",
  44. messageSends: ["subclassResponsibility"],
  45. referencedClasses: []
  46. }),
  47. smalltalk.AbstractCodeGenerator);
  48. smalltalk.addMethod(
  49. "_currentClass",
  50. smalltalk.method({
  51. selector: "currentClass",
  52. category: 'accessing',
  53. fn: function (){
  54. var self=this;
  55. return smalltalk.withContext(function($ctx1) {
  56. var $1;
  57. $1=self["@currentClass"];
  58. return $1;
  59. }, function($ctx1) {$ctx1.fill(self,"currentClass",{},smalltalk.AbstractCodeGenerator)})},
  60. args: [],
  61. source: "currentClass\x0a\x09^currentClass",
  62. messageSends: [],
  63. referencedClasses: []
  64. }),
  65. smalltalk.AbstractCodeGenerator);
  66. smalltalk.addMethod(
  67. "_currentClass_",
  68. smalltalk.method({
  69. selector: "currentClass:",
  70. category: 'accessing',
  71. fn: function (aClass){
  72. var self=this;
  73. return smalltalk.withContext(function($ctx1) {
  74. self["@currentClass"]=aClass;
  75. return self}, function($ctx1) {$ctx1.fill(self,"currentClass:",{aClass:aClass},smalltalk.AbstractCodeGenerator)})},
  76. args: ["aClass"],
  77. source: "currentClass: aClass\x0a\x09currentClass := aClass",
  78. messageSends: [],
  79. referencedClasses: []
  80. }),
  81. smalltalk.AbstractCodeGenerator);
  82. smalltalk.addMethod(
  83. "_pseudoVariables",
  84. smalltalk.method({
  85. selector: "pseudoVariables",
  86. category: 'accessing',
  87. fn: function (){
  88. var self=this;
  89. return smalltalk.withContext(function($ctx1) {
  90. var $1;
  91. $1=["self", "super", "true", "false", "nil", "thisContext"];
  92. return $1;
  93. }, function($ctx1) {$ctx1.fill(self,"pseudoVariables",{},smalltalk.AbstractCodeGenerator)})},
  94. args: [],
  95. source: "pseudoVariables\x0a\x09^#('self' 'super' 'true' 'false' 'nil' 'thisContext')",
  96. messageSends: [],
  97. referencedClasses: []
  98. }),
  99. smalltalk.AbstractCodeGenerator);
  100. smalltalk.addMethod(
  101. "_safeVariableNameFor_",
  102. smalltalk.method({
  103. selector: "safeVariableNameFor:",
  104. category: 'accessing',
  105. fn: function (aString){
  106. var self=this;
  107. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  108. return smalltalk.withContext(function($ctx1) {
  109. var $2,$1;
  110. $2=_st(_st(_st($Smalltalk())._current())._reservedWords())._includes_(aString);
  111. if(smalltalk.assert($2)){
  112. $1=_st(aString).__comma("_");
  113. } else {
  114. $1=aString;
  115. };
  116. return $1;
  117. }, function($ctx1) {$ctx1.fill(self,"safeVariableNameFor:",{aString:aString},smalltalk.AbstractCodeGenerator)})},
  118. args: ["aString"],
  119. source: "safeVariableNameFor: aString\x0a\x09^(Smalltalk current reservedWords includes: aString)\x0a\x09\x09ifTrue: [aString, '_']\x0a\x09\x09ifFalse: [aString]",
  120. messageSends: ["ifTrue:ifFalse:", ",", "includes:", "reservedWords", "current"],
  121. referencedClasses: ["Smalltalk"]
  122. }),
  123. smalltalk.AbstractCodeGenerator);
  124. smalltalk.addMethod(
  125. "_source",
  126. smalltalk.method({
  127. selector: "source",
  128. category: 'accessing',
  129. fn: function (){
  130. var self=this;
  131. return smalltalk.withContext(function($ctx1) {
  132. var $2,$1;
  133. $2=self["@source"];
  134. if(($receiver = $2) == nil || $receiver == undefined){
  135. $1="";
  136. } else {
  137. $1=$2;
  138. };
  139. return $1;
  140. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.AbstractCodeGenerator)})},
  141. args: [],
  142. source: "source\x0a\x09^source ifNil: ['']",
  143. messageSends: ["ifNil:"],
  144. referencedClasses: []
  145. }),
  146. smalltalk.AbstractCodeGenerator);
  147. smalltalk.addMethod(
  148. "_source_",
  149. smalltalk.method({
  150. selector: "source:",
  151. category: 'accessing',
  152. fn: function (aString){
  153. var self=this;
  154. return smalltalk.withContext(function($ctx1) {
  155. self["@source"]=aString;
  156. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.AbstractCodeGenerator)})},
  157. args: ["aString"],
  158. source: "source: aString\x0a\x09source := aString",
  159. messageSends: [],
  160. referencedClasses: []
  161. }),
  162. smalltalk.AbstractCodeGenerator);
  163. smalltalk.addClass('CodeGenerator', smalltalk.AbstractCodeGenerator, [], 'Compiler-Core');
  164. smalltalk.CodeGenerator.comment="I am a basic code generator. I generate a valid JavaScript output, but no not perform any inlining.\x0aSee `InliningCodeGenerator` for an optimized JavaScript code generation."
  165. smalltalk.addMethod(
  166. "_compileNode_",
  167. smalltalk.method({
  168. selector: "compileNode:",
  169. category: 'compiling',
  170. fn: function (aNode){
  171. var self=this;
  172. var ir,stream;
  173. return smalltalk.withContext(function($ctx1) {
  174. var $2,$3,$1;
  175. _st(_st(self)._semanticAnalyzer())._visit_(aNode);
  176. ir=_st(_st(self)._translator())._visit_(aNode);
  177. $2=_st(self)._irTranslator();
  178. _st($2)._visit_(ir);
  179. $3=_st($2)._contents();
  180. $1=$3;
  181. return $1;
  182. }, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,ir:ir,stream:stream},smalltalk.CodeGenerator)})},
  183. args: ["aNode"],
  184. source: "compileNode: aNode\x0a\x09| ir stream |\x0a\x09self semanticAnalyzer visit: aNode.\x0a\x09ir := self translator visit: aNode.\x0a\x09^ self irTranslator\x0a\x09\x09visit: ir;\x0a\x09\x09contents",
  185. messageSends: ["visit:", "semanticAnalyzer", "translator", "irTranslator", "contents"],
  186. referencedClasses: []
  187. }),
  188. smalltalk.CodeGenerator);
  189. smalltalk.addMethod(
  190. "_irTranslator",
  191. smalltalk.method({
  192. selector: "irTranslator",
  193. category: 'compiling',
  194. fn: function (){
  195. var self=this;
  196. function $IRJSTranslator(){return smalltalk.IRJSTranslator||(typeof IRJSTranslator=="undefined"?nil:IRJSTranslator)}
  197. return smalltalk.withContext(function($ctx1) {
  198. var $1;
  199. $1=_st($IRJSTranslator())._new();
  200. return $1;
  201. }, function($ctx1) {$ctx1.fill(self,"irTranslator",{},smalltalk.CodeGenerator)})},
  202. args: [],
  203. source: "irTranslator\x0a\x09^ IRJSTranslator new",
  204. messageSends: ["new"],
  205. referencedClasses: ["IRJSTranslator"]
  206. }),
  207. smalltalk.CodeGenerator);
  208. smalltalk.addMethod(
  209. "_semanticAnalyzer",
  210. smalltalk.method({
  211. selector: "semanticAnalyzer",
  212. category: 'compiling',
  213. fn: function (){
  214. var self=this;
  215. function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
  216. return smalltalk.withContext(function($ctx1) {
  217. var $1;
  218. $1=_st($SemanticAnalyzer())._on_(_st(self)._currentClass());
  219. return $1;
  220. }, function($ctx1) {$ctx1.fill(self,"semanticAnalyzer",{},smalltalk.CodeGenerator)})},
  221. args: [],
  222. source: "semanticAnalyzer\x0a\x09^ SemanticAnalyzer on: self currentClass",
  223. messageSends: ["on:", "currentClass"],
  224. referencedClasses: ["SemanticAnalyzer"]
  225. }),
  226. smalltalk.CodeGenerator);
  227. smalltalk.addMethod(
  228. "_translator",
  229. smalltalk.method({
  230. selector: "translator",
  231. category: 'compiling',
  232. fn: function (){
  233. var self=this;
  234. function $IRASTTranslator(){return smalltalk.IRASTTranslator||(typeof IRASTTranslator=="undefined"?nil:IRASTTranslator)}
  235. return smalltalk.withContext(function($ctx1) {
  236. var $2,$3,$1;
  237. $2=_st($IRASTTranslator())._new();
  238. _st($2)._source_(_st(self)._source());
  239. _st($2)._theClass_(_st(self)._currentClass());
  240. $3=_st($2)._yourself();
  241. $1=$3;
  242. return $1;
  243. }, function($ctx1) {$ctx1.fill(self,"translator",{},smalltalk.CodeGenerator)})},
  244. args: [],
  245. source: "translator\x0a\x09^ IRASTTranslator new\x0a\x09\x09source: self source;\x0a\x09\x09theClass: self currentClass;\x0a\x09\x09yourself",
  246. messageSends: ["source:", "source", "new", "theClass:", "currentClass", "yourself"],
  247. referencedClasses: ["IRASTTranslator"]
  248. }),
  249. smalltalk.CodeGenerator);
  250. smalltalk.addClass('Compiler', smalltalk.Object, ['currentClass', 'source', 'unknownVariables', 'codeGeneratorClass'], 'Compiler-Core');
  251. smalltalk.Compiler.comment="I provide the public interface for compiling Amber source code into JavaScript.\x0a\x0aThe code generator used to produce JavaScript can be plugged with `#codeGeneratorClass`.\x0aThe default code generator is an instance of `InlinedCodeGenerator`"
  252. smalltalk.addMethod(
  253. "_codeGeneratorClass",
  254. smalltalk.method({
  255. selector: "codeGeneratorClass",
  256. category: 'accessing',
  257. fn: function (){
  258. var self=this;
  259. function $InliningCodeGenerator(){return smalltalk.InliningCodeGenerator||(typeof InliningCodeGenerator=="undefined"?nil:InliningCodeGenerator)}
  260. return smalltalk.withContext(function($ctx1) {
  261. var $2,$1;
  262. $2=self["@codeGeneratorClass"];
  263. if(($receiver = $2) == nil || $receiver == undefined){
  264. $1=$InliningCodeGenerator();
  265. } else {
  266. $1=$2;
  267. };
  268. return $1;
  269. }, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass",{},smalltalk.Compiler)})},
  270. args: [],
  271. source: "codeGeneratorClass\x0a\x09^codeGeneratorClass ifNil: [InliningCodeGenerator]",
  272. messageSends: ["ifNil:"],
  273. referencedClasses: ["InliningCodeGenerator"]
  274. }),
  275. smalltalk.Compiler);
  276. smalltalk.addMethod(
  277. "_codeGeneratorClass_",
  278. smalltalk.method({
  279. selector: "codeGeneratorClass:",
  280. category: 'accessing',
  281. fn: function (aClass){
  282. var self=this;
  283. return smalltalk.withContext(function($ctx1) {
  284. self["@codeGeneratorClass"]=aClass;
  285. return self}, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass:",{aClass:aClass},smalltalk.Compiler)})},
  286. args: ["aClass"],
  287. source: "codeGeneratorClass: aClass\x0a\x09codeGeneratorClass := aClass",
  288. messageSends: [],
  289. referencedClasses: []
  290. }),
  291. smalltalk.Compiler);
  292. smalltalk.addMethod(
  293. "_compile_",
  294. smalltalk.method({
  295. selector: "compile:",
  296. category: 'compiling',
  297. fn: function (aString){
  298. var self=this;
  299. return smalltalk.withContext(function($ctx1) {
  300. var $1;
  301. $1=_st(self)._compileNode_(_st(self)._parse_(aString));
  302. return $1;
  303. }, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString},smalltalk.Compiler)})},
  304. args: ["aString"],
  305. source: "compile: aString\x0a\x09^self compileNode: (self parse: aString)",
  306. messageSends: ["compileNode:", "parse:"],
  307. referencedClasses: []
  308. }),
  309. smalltalk.Compiler);
  310. smalltalk.addMethod(
  311. "_compile_forClass_",
  312. smalltalk.method({
  313. selector: "compile:forClass:",
  314. category: 'compiling',
  315. fn: function (aString,aClass){
  316. var self=this;
  317. return smalltalk.withContext(function($ctx1) {
  318. var $1;
  319. _st(self)._currentClass_(aClass);
  320. _st(self)._source_(aString);
  321. $1=_st(self)._compile_(aString);
  322. return $1;
  323. }, function($ctx1) {$ctx1.fill(self,"compile:forClass:",{aString:aString,aClass:aClass},smalltalk.Compiler)})},
  324. args: ["aString", "aClass"],
  325. source: "compile: aString forClass: aClass\x0a\x09self currentClass: aClass.\x0a\x09self source: aString.\x0a\x09^self compile: aString",
  326. messageSends: ["currentClass:", "source:", "compile:"],
  327. referencedClasses: []
  328. }),
  329. smalltalk.Compiler);
  330. smalltalk.addMethod(
  331. "_compileExpression_",
  332. smalltalk.method({
  333. selector: "compileExpression:",
  334. category: 'compiling',
  335. fn: function (aString){
  336. var self=this;
  337. function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  338. return smalltalk.withContext(function($ctx1) {
  339. var $1;
  340. _st(self)._currentClass_($DoIt());
  341. _st(self)._source_(_st(_st("doIt ^[").__comma(aString)).__comma("] value"));
  342. $1=_st(self)._compileNode_(_st(self)._parse_(_st(self)._source()));
  343. return $1;
  344. }, function($ctx1) {$ctx1.fill(self,"compileExpression:",{aString:aString},smalltalk.Compiler)})},
  345. args: ["aString"],
  346. source: "compileExpression: aString\x0a\x09self currentClass: DoIt.\x0a\x09self source: 'doIt ^[', aString, '] value'.\x0a\x09^self compileNode: (self parse: self source)",
  347. messageSends: ["currentClass:", "source:", ",", "compileNode:", "parse:", "source"],
  348. referencedClasses: ["DoIt"]
  349. }),
  350. smalltalk.Compiler);
  351. smalltalk.addMethod(
  352. "_compileExpression_on_",
  353. smalltalk.method({
  354. selector: "compileExpression:on:",
  355. category: 'compiling',
  356. fn: function (aString,anObject){
  357. var self=this;
  358. return smalltalk.withContext(function($ctx1) {
  359. var $1;
  360. _st(self)._currentClass_(_st(anObject)._class());
  361. _st(self)._source_(_st(_st("xxxDoIt ^[").__comma(aString)).__comma("] value"));
  362. $1=_st(self)._compileNode_(_st(self)._parse_(_st(self)._source()));
  363. return $1;
  364. }, function($ctx1) {$ctx1.fill(self,"compileExpression:on:",{aString:aString,anObject:anObject},smalltalk.Compiler)})},
  365. args: ["aString", "anObject"],
  366. source: "compileExpression: aString on: anObject\x0a\x09self currentClass: anObject class.\x0a\x09self source: 'xxxDoIt ^[', aString, '] value'.\x0a\x09^self compileNode: (self parse: self source)",
  367. messageSends: ["currentClass:", "class", "source:", ",", "compileNode:", "parse:", "source"],
  368. referencedClasses: []
  369. }),
  370. smalltalk.Compiler);
  371. smalltalk.addMethod(
  372. "_compileNode_",
  373. smalltalk.method({
  374. selector: "compileNode:",
  375. category: 'compiling',
  376. fn: function (aNode){
  377. var self=this;
  378. var generator,result;
  379. return smalltalk.withContext(function($ctx1) {
  380. var $1,$2,$3;
  381. generator=_st(_st(self)._codeGeneratorClass())._new();
  382. $1=generator;
  383. _st($1)._source_(_st(self)._source());
  384. $2=_st($1)._currentClass_(_st(self)._currentClass());
  385. result=_st(generator)._compileNode_(aNode);
  386. _st(self)._unknownVariables_([]);
  387. $3=result;
  388. return $3;
  389. }, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,generator:generator,result:result},smalltalk.Compiler)})},
  390. args: ["aNode"],
  391. source: "compileNode: aNode\x0a\x09| generator result |\x0a\x09generator := self codeGeneratorClass new.\x0a\x09generator\x0a\x09\x09source: self source;\x0a\x09\x09currentClass: self currentClass.\x0a\x09result := generator compileNode: aNode.\x0a\x09self unknownVariables: #().\x0a\x09^result",
  392. messageSends: ["new", "codeGeneratorClass", "source:", "source", "currentClass:", "currentClass", "compileNode:", "unknownVariables:"],
  393. referencedClasses: []
  394. }),
  395. smalltalk.Compiler);
  396. smalltalk.addMethod(
  397. "_currentClass",
  398. smalltalk.method({
  399. selector: "currentClass",
  400. category: 'accessing',
  401. fn: function (){
  402. var self=this;
  403. return smalltalk.withContext(function($ctx1) {
  404. var $1;
  405. $1=self["@currentClass"];
  406. return $1;
  407. }, function($ctx1) {$ctx1.fill(self,"currentClass",{},smalltalk.Compiler)})},
  408. args: [],
  409. source: "currentClass\x0a\x09^currentClass",
  410. messageSends: [],
  411. referencedClasses: []
  412. }),
  413. smalltalk.Compiler);
  414. smalltalk.addMethod(
  415. "_currentClass_",
  416. smalltalk.method({
  417. selector: "currentClass:",
  418. category: 'accessing',
  419. fn: function (aClass){
  420. var self=this;
  421. return smalltalk.withContext(function($ctx1) {
  422. self["@currentClass"]=aClass;
  423. return self}, function($ctx1) {$ctx1.fill(self,"currentClass:",{aClass:aClass},smalltalk.Compiler)})},
  424. args: ["aClass"],
  425. source: "currentClass: aClass\x0a\x09currentClass := aClass",
  426. messageSends: [],
  427. referencedClasses: []
  428. }),
  429. smalltalk.Compiler);
  430. smalltalk.addMethod(
  431. "_eval_",
  432. smalltalk.method({
  433. selector: "eval:",
  434. category: 'compiling',
  435. fn: function (aString){
  436. var self=this;
  437. return smalltalk.withContext(function($ctx1) {
  438. return eval(aString);
  439. return self}, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString},smalltalk.Compiler)})},
  440. args: ["aString"],
  441. source: "eval: aString\x0a\x09<return eval(aString)>",
  442. messageSends: [],
  443. referencedClasses: []
  444. }),
  445. smalltalk.Compiler);
  446. smalltalk.addMethod(
  447. "_evaluateExpression_",
  448. smalltalk.method({
  449. selector: "evaluateExpression:",
  450. category: 'compiling',
  451. fn: function (aString){
  452. var self=this;
  453. function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  454. return smalltalk.withContext(function($ctx1) {
  455. var $1;
  456. $1=_st(self)._evaluateExpression_on_(aString,_st($DoIt())._new());
  457. return $1;
  458. }, function($ctx1) {$ctx1.fill(self,"evaluateExpression:",{aString:aString},smalltalk.Compiler)})},
  459. args: ["aString"],
  460. source: "evaluateExpression: aString\x0a\x09\x22Unlike #eval: evaluate a Smalltalk expression and answer the returned object\x22\x0a\x09^ self evaluateExpression: aString on: DoIt new",
  461. messageSends: ["evaluateExpression:on:", "new"],
  462. referencedClasses: ["DoIt"]
  463. }),
  464. smalltalk.Compiler);
  465. smalltalk.addMethod(
  466. "_evaluateExpression_on_",
  467. smalltalk.method({
  468. selector: "evaluateExpression:on:",
  469. category: 'compiling',
  470. fn: function (aString,anObject){
  471. var self=this;
  472. var result,method;
  473. return smalltalk.withContext(function($ctx1) {
  474. var $1;
  475. method=_st(self)._eval_(_st(self)._compileExpression_on_(aString,anObject));
  476. _st(method)._category_("xxxDoIt");
  477. _st(_st(anObject)._class())._addCompiledMethod_(method);
  478. result=_st(anObject)._xxxDoIt();
  479. _st(_st(anObject)._class())._removeCompiledMethod_(method);
  480. $1=result;
  481. return $1;
  482. }, function($ctx1) {$ctx1.fill(self,"evaluateExpression:on:",{aString:aString,anObject:anObject,result:result,method:method},smalltalk.Compiler)})},
  483. args: ["aString", "anObject"],
  484. source: "evaluateExpression: aString on: anObject\x0a\x09\x22Unlike #eval: evaluate a Smalltalk expression with anObject as the receiver and answer the returned object\x22\x0a\x09| result method |\x0a\x09method := self eval: (self compileExpression: aString on: anObject).\x0a\x09method category: 'xxxDoIt'.\x0a\x09anObject class addCompiledMethod: method.\x0a\x09result := anObject xxxDoIt.\x0a\x09anObject class removeCompiledMethod: method.\x0a\x09^result",
  485. messageSends: ["eval:", "compileExpression:on:", "category:", "addCompiledMethod:", "class", "xxxDoIt", "removeCompiledMethod:"],
  486. referencedClasses: []
  487. }),
  488. smalltalk.Compiler);
  489. smalltalk.addMethod(
  490. "_install_forClass_category_",
  491. smalltalk.method({
  492. selector: "install:forClass:category:",
  493. category: 'compiling',
  494. fn: function (aString,aBehavior,anotherString){
  495. var self=this;
  496. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  497. return smalltalk.withContext(function($ctx1) {
  498. var $1;
  499. $1=_st(_st($ClassBuilder())._new())._installMethod_forClass_category_(_st(self)._eval_(_st(self)._compile_forClass_(aString,aBehavior)),aBehavior,anotherString);
  500. return $1;
  501. }, function($ctx1) {$ctx1.fill(self,"install:forClass:category:",{aString:aString,aBehavior:aBehavior,anotherString:anotherString},smalltalk.Compiler)})},
  502. args: ["aString", "aBehavior", "anotherString"],
  503. source: "install: aString forClass: aBehavior category: anotherString\x0a\x09^ ClassBuilder new\x0a\x09\x09installMethod: (self eval: (self compile: aString forClass: aBehavior))\x0a\x09\x09forClass: aBehavior\x0a\x09\x09category: anotherString",
  504. messageSends: ["installMethod:forClass:category:", "eval:", "compile:forClass:", "new"],
  505. referencedClasses: ["ClassBuilder"]
  506. }),
  507. smalltalk.Compiler);
  508. smalltalk.addMethod(
  509. "_parse_",
  510. smalltalk.method({
  511. selector: "parse:",
  512. category: 'compiling',
  513. fn: function (aString){
  514. var self=this;
  515. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  516. return smalltalk.withContext(function($ctx1) {
  517. var $1;
  518. $1=_st(_st($Smalltalk())._current())._parse_(aString);
  519. return $1;
  520. }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString},smalltalk.Compiler)})},
  521. args: ["aString"],
  522. source: "parse: aString\x0a\x09^Smalltalk current parse: aString",
  523. messageSends: ["parse:", "current"],
  524. referencedClasses: ["Smalltalk"]
  525. }),
  526. smalltalk.Compiler);
  527. smalltalk.addMethod(
  528. "_parseExpression_",
  529. smalltalk.method({
  530. selector: "parseExpression:",
  531. category: 'compiling',
  532. fn: function (aString){
  533. var self=this;
  534. return smalltalk.withContext(function($ctx1) {
  535. var $1;
  536. $1=_st(self)._parse_(_st(_st("doIt ^[").__comma(aString)).__comma("] value"));
  537. return $1;
  538. }, function($ctx1) {$ctx1.fill(self,"parseExpression:",{aString:aString},smalltalk.Compiler)})},
  539. args: ["aString"],
  540. source: "parseExpression: aString\x0a\x09^self parse: 'doIt ^[', aString, '] value'",
  541. messageSends: ["parse:", ","],
  542. referencedClasses: []
  543. }),
  544. smalltalk.Compiler);
  545. smalltalk.addMethod(
  546. "_recompile_",
  547. smalltalk.method({
  548. selector: "recompile:",
  549. category: 'compiling',
  550. fn: function (aClass){
  551. var self=this;
  552. return smalltalk.withContext(function($ctx1) {
  553. var $1;
  554. _st(_st(aClass)._methodDictionary())._do_((function(each){
  555. return smalltalk.withContext(function($ctx2) {
  556. _st(console)._log_(_st(_st(_st(aClass)._name()).__comma(" >> ")).__comma(_st(each)._selector()));
  557. return _st(self)._install_forClass_category_(_st(each)._source(),aClass,_st(each)._category());
  558. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  559. $1=_st(aClass)._isMetaclass();
  560. if(! smalltalk.assert($1)){
  561. _st(self)._recompile_(_st(aClass)._class());
  562. };
  563. return self}, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass},smalltalk.Compiler)})},
  564. args: ["aClass"],
  565. source: "recompile: aClass\x0a\x09aClass methodDictionary do: [:each |\x0a\x09\x09console log: aClass name, ' >> ', each selector.\x0a\x09\x09self install: each source forClass: aClass category: each category].\x0a\x09\x22self setupClass: aClass.\x22\x0a\x09aClass isMetaclass ifFalse: [self recompile: aClass class]",
  566. messageSends: ["do:", "log:", ",", "selector", "name", "install:forClass:category:", "source", "category", "methodDictionary", "ifFalse:", "recompile:", "class", "isMetaclass"],
  567. referencedClasses: []
  568. }),
  569. smalltalk.Compiler);
  570. smalltalk.addMethod(
  571. "_recompileAll",
  572. smalltalk.method({
  573. selector: "recompileAll",
  574. category: 'compiling',
  575. fn: function (){
  576. var self=this;
  577. function $Transcript(){return smalltalk.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
  578. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  579. return smalltalk.withContext(function($ctx1) {
  580. var $1,$2;
  581. _st(_st(_st($Smalltalk())._current())._classes())._do_((function(each){
  582. return smalltalk.withContext(function($ctx2) {
  583. $1=$Transcript();
  584. _st($1)._show_(each);
  585. $2=_st($1)._cr();
  586. $2;
  587. return _st((function(){
  588. return smalltalk.withContext(function($ctx3) {
  589. return _st(self)._recompile_(each);
  590. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((100));
  591. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  592. return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{},smalltalk.Compiler)})},
  593. args: [],
  594. source: "recompileAll\x0a\x09Smalltalk current classes do: [:each |\x0a\x09\x09Transcript show: each; cr.\x0a\x09\x09[self recompile: each] valueWithTimeout: 100]",
  595. messageSends: ["do:", "show:", "cr", "valueWithTimeout:", "recompile:", "classes", "current"],
  596. referencedClasses: ["Transcript", "Smalltalk"]
  597. }),
  598. smalltalk.Compiler);
  599. smalltalk.addMethod(
  600. "_source",
  601. smalltalk.method({
  602. selector: "source",
  603. category: 'accessing',
  604. fn: function (){
  605. var self=this;
  606. return smalltalk.withContext(function($ctx1) {
  607. var $2,$1;
  608. $2=self["@source"];
  609. if(($receiver = $2) == nil || $receiver == undefined){
  610. $1="";
  611. } else {
  612. $1=$2;
  613. };
  614. return $1;
  615. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.Compiler)})},
  616. args: [],
  617. source: "source\x0a\x09^source ifNil: ['']",
  618. messageSends: ["ifNil:"],
  619. referencedClasses: []
  620. }),
  621. smalltalk.Compiler);
  622. smalltalk.addMethod(
  623. "_source_",
  624. smalltalk.method({
  625. selector: "source:",
  626. category: 'accessing',
  627. fn: function (aString){
  628. var self=this;
  629. return smalltalk.withContext(function($ctx1) {
  630. self["@source"]=aString;
  631. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.Compiler)})},
  632. args: ["aString"],
  633. source: "source: aString\x0a\x09source := aString",
  634. messageSends: [],
  635. referencedClasses: []
  636. }),
  637. smalltalk.Compiler);
  638. smalltalk.addMethod(
  639. "_unknownVariables",
  640. smalltalk.method({
  641. selector: "unknownVariables",
  642. category: 'accessing',
  643. fn: function (){
  644. var self=this;
  645. return smalltalk.withContext(function($ctx1) {
  646. var $1;
  647. $1=self["@unknownVariables"];
  648. return $1;
  649. }, function($ctx1) {$ctx1.fill(self,"unknownVariables",{},smalltalk.Compiler)})},
  650. args: [],
  651. source: "unknownVariables\x0a\x09^unknownVariables",
  652. messageSends: [],
  653. referencedClasses: []
  654. }),
  655. smalltalk.Compiler);
  656. smalltalk.addMethod(
  657. "_unknownVariables_",
  658. smalltalk.method({
  659. selector: "unknownVariables:",
  660. category: 'accessing',
  661. fn: function (aCollection){
  662. var self=this;
  663. return smalltalk.withContext(function($ctx1) {
  664. self["@unknownVariables"]=aCollection;
  665. return self}, function($ctx1) {$ctx1.fill(self,"unknownVariables:",{aCollection:aCollection},smalltalk.Compiler)})},
  666. args: ["aCollection"],
  667. source: "unknownVariables: aCollection\x0a\x09unknownVariables := aCollection",
  668. messageSends: [],
  669. referencedClasses: []
  670. }),
  671. smalltalk.Compiler);
  672. smalltalk.addMethod(
  673. "_recompile_",
  674. smalltalk.method({
  675. selector: "recompile:",
  676. category: 'compiling',
  677. fn: function (aClass){
  678. var self=this;
  679. return smalltalk.withContext(function($ctx1) {
  680. _st(_st(self)._new())._recompile_(aClass);
  681. return self}, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass},smalltalk.Compiler.klass)})},
  682. args: ["aClass"],
  683. source: "recompile: aClass\x0a\x09self new recompile: aClass",
  684. messageSends: ["recompile:", "new"],
  685. referencedClasses: []
  686. }),
  687. smalltalk.Compiler.klass);
  688. smalltalk.addMethod(
  689. "_recompileAll",
  690. smalltalk.method({
  691. selector: "recompileAll",
  692. category: 'compiling',
  693. fn: function (){
  694. var self=this;
  695. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  696. return smalltalk.withContext(function($ctx1) {
  697. _st(_st(_st($Smalltalk())._current())._classes())._do_((function(each){
  698. return smalltalk.withContext(function($ctx2) {
  699. return _st(self)._recompile_(each);
  700. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  701. return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{},smalltalk.Compiler.klass)})},
  702. args: [],
  703. source: "recompileAll\x0a\x09Smalltalk current classes do: [:each |\x0a\x09\x09self recompile: each]",
  704. messageSends: ["do:", "recompile:", "classes", "current"],
  705. referencedClasses: ["Smalltalk"]
  706. }),
  707. smalltalk.Compiler.klass);
  708. smalltalk.addClass('DoIt', smalltalk.Object, [], 'Compiler-Core');
  709. smalltalk.DoIt.comment="`DoIt` is the class used to compile and evaluate expressions. See `Compiler >> evaluateExpression:`."
  710. smalltalk.addClass('NodeVisitor', smalltalk.Object, [], 'Compiler-Core');
  711. smalltalk.NodeVisitor.comment="I am the abstract super class of all AST node visitors."
  712. smalltalk.addMethod(
  713. "_visit_",
  714. smalltalk.method({
  715. selector: "visit:",
  716. category: 'visiting',
  717. fn: function (aNode){
  718. var self=this;
  719. return smalltalk.withContext(function($ctx1) {
  720. var $1;
  721. $1=_st(aNode)._accept_(self);
  722. return $1;
  723. }, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode},smalltalk.NodeVisitor)})},
  724. args: ["aNode"],
  725. source: "visit: aNode\x0a\x09^ aNode accept: self",
  726. messageSends: ["accept:"],
  727. referencedClasses: []
  728. }),
  729. smalltalk.NodeVisitor);
  730. smalltalk.addMethod(
  731. "_visitAll_",
  732. smalltalk.method({
  733. selector: "visitAll:",
  734. category: 'visiting',
  735. fn: function (aCollection){
  736. var self=this;
  737. return smalltalk.withContext(function($ctx1) {
  738. var $1;
  739. $1=_st(aCollection)._collect_((function(each){
  740. return smalltalk.withContext(function($ctx2) {
  741. return _st(self)._visit_(each);
  742. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  743. return $1;
  744. }, function($ctx1) {$ctx1.fill(self,"visitAll:",{aCollection:aCollection},smalltalk.NodeVisitor)})},
  745. args: ["aCollection"],
  746. source: "visitAll: aCollection\x0a\x09^ aCollection collect: [ :each | self visit: each ]",
  747. messageSends: ["collect:", "visit:"],
  748. referencedClasses: []
  749. }),
  750. smalltalk.NodeVisitor);
  751. smalltalk.addMethod(
  752. "_visitAssignmentNode_",
  753. smalltalk.method({
  754. selector: "visitAssignmentNode:",
  755. category: 'visiting',
  756. fn: function (aNode){
  757. var self=this;
  758. return smalltalk.withContext(function($ctx1) {
  759. var $1;
  760. $1=_st(self)._visitNode_(aNode);
  761. return $1;
  762. }, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  763. args: ["aNode"],
  764. source: "visitAssignmentNode: aNode\x0a\x09^ self visitNode: aNode",
  765. messageSends: ["visitNode:"],
  766. referencedClasses: []
  767. }),
  768. smalltalk.NodeVisitor);
  769. smalltalk.addMethod(
  770. "_visitBlockNode_",
  771. smalltalk.method({
  772. selector: "visitBlockNode:",
  773. category: 'visiting',
  774. fn: function (aNode){
  775. var self=this;
  776. return smalltalk.withContext(function($ctx1) {
  777. var $1;
  778. $1=_st(self)._visitNode_(aNode);
  779. return $1;
  780. }, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  781. args: ["aNode"],
  782. source: "visitBlockNode: aNode\x0a\x09^ self visitNode: aNode",
  783. messageSends: ["visitNode:"],
  784. referencedClasses: []
  785. }),
  786. smalltalk.NodeVisitor);
  787. smalltalk.addMethod(
  788. "_visitBlockSequenceNode_",
  789. smalltalk.method({
  790. selector: "visitBlockSequenceNode:",
  791. category: 'visiting',
  792. fn: function (aNode){
  793. var self=this;
  794. return smalltalk.withContext(function($ctx1) {
  795. var $1;
  796. $1=_st(self)._visitSequenceNode_(aNode);
  797. return $1;
  798. }, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  799. args: ["aNode"],
  800. source: "visitBlockSequenceNode: aNode\x0a\x09^ self visitSequenceNode: aNode",
  801. messageSends: ["visitSequenceNode:"],
  802. referencedClasses: []
  803. }),
  804. smalltalk.NodeVisitor);
  805. smalltalk.addMethod(
  806. "_visitCascadeNode_",
  807. smalltalk.method({
  808. selector: "visitCascadeNode:",
  809. category: 'visiting',
  810. fn: function (aNode){
  811. var self=this;
  812. return smalltalk.withContext(function($ctx1) {
  813. var $1;
  814. $1=_st(self)._visitNode_(aNode);
  815. return $1;
  816. }, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  817. args: ["aNode"],
  818. source: "visitCascadeNode: aNode\x0a\x09^ self visitNode: aNode",
  819. messageSends: ["visitNode:"],
  820. referencedClasses: []
  821. }),
  822. smalltalk.NodeVisitor);
  823. smalltalk.addMethod(
  824. "_visitClassReferenceNode_",
  825. smalltalk.method({
  826. selector: "visitClassReferenceNode:",
  827. category: 'visiting',
  828. fn: function (aNode){
  829. var self=this;
  830. return smalltalk.withContext(function($ctx1) {
  831. var $1;
  832. $1=_st(self)._visitVariableNode_(aNode);
  833. return $1;
  834. }, function($ctx1) {$ctx1.fill(self,"visitClassReferenceNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  835. args: ["aNode"],
  836. source: "visitClassReferenceNode: aNode\x0a\x09^ self visitVariableNode: aNode",
  837. messageSends: ["visitVariableNode:"],
  838. referencedClasses: []
  839. }),
  840. smalltalk.NodeVisitor);
  841. smalltalk.addMethod(
  842. "_visitDynamicArrayNode_",
  843. smalltalk.method({
  844. selector: "visitDynamicArrayNode:",
  845. category: 'visiting',
  846. fn: function (aNode){
  847. var self=this;
  848. return smalltalk.withContext(function($ctx1) {
  849. var $1;
  850. $1=_st(self)._visitNode_(aNode);
  851. return $1;
  852. }, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  853. args: ["aNode"],
  854. source: "visitDynamicArrayNode: aNode\x0a\x09^ self visitNode: aNode",
  855. messageSends: ["visitNode:"],
  856. referencedClasses: []
  857. }),
  858. smalltalk.NodeVisitor);
  859. smalltalk.addMethod(
  860. "_visitDynamicDictionaryNode_",
  861. smalltalk.method({
  862. selector: "visitDynamicDictionaryNode:",
  863. category: 'visiting',
  864. fn: function (aNode){
  865. var self=this;
  866. return smalltalk.withContext(function($ctx1) {
  867. var $1;
  868. $1=_st(self)._visitNode_(aNode);
  869. return $1;
  870. }, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  871. args: ["aNode"],
  872. source: "visitDynamicDictionaryNode: aNode\x0a\x09^ self visitNode: aNode",
  873. messageSends: ["visitNode:"],
  874. referencedClasses: []
  875. }),
  876. smalltalk.NodeVisitor);
  877. smalltalk.addMethod(
  878. "_visitJSStatementNode_",
  879. smalltalk.method({
  880. selector: "visitJSStatementNode:",
  881. category: 'visiting',
  882. fn: function (aNode){
  883. var self=this;
  884. return smalltalk.withContext(function($ctx1) {
  885. var $1;
  886. $1=_st(self)._visitNode_(aNode);
  887. return $1;
  888. }, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  889. args: ["aNode"],
  890. source: "visitJSStatementNode: aNode\x0a\x09^ self visitNode: aNode",
  891. messageSends: ["visitNode:"],
  892. referencedClasses: []
  893. }),
  894. smalltalk.NodeVisitor);
  895. smalltalk.addMethod(
  896. "_visitMethodNode_",
  897. smalltalk.method({
  898. selector: "visitMethodNode:",
  899. category: 'visiting',
  900. fn: function (aNode){
  901. var self=this;
  902. return smalltalk.withContext(function($ctx1) {
  903. var $1;
  904. $1=_st(self)._visitNode_(aNode);
  905. return $1;
  906. }, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  907. args: ["aNode"],
  908. source: "visitMethodNode: aNode\x0a\x09^ self visitNode: aNode",
  909. messageSends: ["visitNode:"],
  910. referencedClasses: []
  911. }),
  912. smalltalk.NodeVisitor);
  913. smalltalk.addMethod(
  914. "_visitNode_",
  915. smalltalk.method({
  916. selector: "visitNode:",
  917. category: 'visiting',
  918. fn: function (aNode){
  919. var self=this;
  920. return smalltalk.withContext(function($ctx1) {
  921. var $1;
  922. $1=_st(self)._visitAll_(_st(aNode)._nodes());
  923. return $1;
  924. }, function($ctx1) {$ctx1.fill(self,"visitNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  925. args: ["aNode"],
  926. source: "visitNode: aNode\x0a\x09^ self visitAll: aNode nodes",
  927. messageSends: ["visitAll:", "nodes"],
  928. referencedClasses: []
  929. }),
  930. smalltalk.NodeVisitor);
  931. smalltalk.addMethod(
  932. "_visitReturnNode_",
  933. smalltalk.method({
  934. selector: "visitReturnNode:",
  935. category: 'visiting',
  936. fn: function (aNode){
  937. var self=this;
  938. return smalltalk.withContext(function($ctx1) {
  939. var $1;
  940. $1=_st(self)._visitNode_(aNode);
  941. return $1;
  942. }, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  943. args: ["aNode"],
  944. source: "visitReturnNode: aNode\x0a\x09^ self visitNode: aNode",
  945. messageSends: ["visitNode:"],
  946. referencedClasses: []
  947. }),
  948. smalltalk.NodeVisitor);
  949. smalltalk.addMethod(
  950. "_visitSendNode_",
  951. smalltalk.method({
  952. selector: "visitSendNode:",
  953. category: 'visiting',
  954. fn: function (aNode){
  955. var self=this;
  956. return smalltalk.withContext(function($ctx1) {
  957. var $1;
  958. $1=_st(self)._visitNode_(aNode);
  959. return $1;
  960. }, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  961. args: ["aNode"],
  962. source: "visitSendNode: aNode\x0a\x09^ self visitNode: aNode",
  963. messageSends: ["visitNode:"],
  964. referencedClasses: []
  965. }),
  966. smalltalk.NodeVisitor);
  967. smalltalk.addMethod(
  968. "_visitSequenceNode_",
  969. smalltalk.method({
  970. selector: "visitSequenceNode:",
  971. category: 'visiting',
  972. fn: function (aNode){
  973. var self=this;
  974. return smalltalk.withContext(function($ctx1) {
  975. var $1;
  976. $1=_st(self)._visitNode_(aNode);
  977. return $1;
  978. }, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  979. args: ["aNode"],
  980. source: "visitSequenceNode: aNode\x0a\x09^ self visitNode: aNode",
  981. messageSends: ["visitNode:"],
  982. referencedClasses: []
  983. }),
  984. smalltalk.NodeVisitor);
  985. smalltalk.addMethod(
  986. "_visitValueNode_",
  987. smalltalk.method({
  988. selector: "visitValueNode:",
  989. category: 'visiting',
  990. fn: function (aNode){
  991. var self=this;
  992. return smalltalk.withContext(function($ctx1) {
  993. var $1;
  994. $1=_st(self)._visitNode_(aNode);
  995. return $1;
  996. }, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  997. args: ["aNode"],
  998. source: "visitValueNode: aNode\x0a\x09^ self visitNode: aNode",
  999. messageSends: ["visitNode:"],
  1000. referencedClasses: []
  1001. }),
  1002. smalltalk.NodeVisitor);
  1003. smalltalk.addMethod(
  1004. "_visitVariableNode_",
  1005. smalltalk.method({
  1006. selector: "visitVariableNode:",
  1007. category: 'visiting',
  1008. fn: function (aNode){
  1009. var self=this;
  1010. return smalltalk.withContext(function($ctx1) {
  1011. var $1;
  1012. $1=_st(self)._visitNode_(aNode);
  1013. return $1;
  1014. }, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  1015. args: ["aNode"],
  1016. source: "visitVariableNode: aNode\x0a\x09^ self visitNode: aNode",
  1017. messageSends: ["visitNode:"],
  1018. referencedClasses: []
  1019. }),
  1020. smalltalk.NodeVisitor);