Compiler-Core.js 34 KB

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