1
0

Compiler-Core.js 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030
  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(_st(aClass)._methodDictionary())._values())._do_displayingProgress_((function(each){
  528. return smalltalk.withContext(function($ctx2) {
  529. return _st(self)._install_forClass_category_(_st(each)._source(),aClass,_st(each)._category());
  530. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),_st("Recompiling ").__comma(_st(aClass)._name()));
  531. $1=_st(aClass)._isMetaclass();
  532. if(! smalltalk.assert($1)){
  533. _st(self)._recompile_(_st(aClass)._class());
  534. };
  535. return self}, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass},smalltalk.Compiler)})},
  536. args: ["aClass"],
  537. source: "recompile: aClass\x0a\x09aClass methodDictionary values\x0a\x09\x09do: [ :each | self install: each source forClass: aClass category: each category ]\x0a\x09\x09displayingProgress: 'Recompiling ', aClass name.\x0a\x09\x22self setupClass: aClass.\x22\x0a\x09aClass isMetaclass ifFalse: [ self recompile: aClass class ]",
  538. messageSends: ["do:displayingProgress:", "install:forClass:category:", "source", "category", ",", "name", "values", "methodDictionary", "ifFalse:", "recompile:", "class", "isMetaclass"],
  539. referencedClasses: []
  540. }),
  541. smalltalk.Compiler);
  542. smalltalk.addMethod(
  543. smalltalk.method({
  544. selector: "recompileAll",
  545. category: 'compiling',
  546. fn: function (){
  547. var self=this;
  548. function $Transcript(){return smalltalk.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
  549. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  550. return smalltalk.withContext(function($ctx1) {
  551. var $1,$2;
  552. _st(_st(_st($Smalltalk())._current())._classes())._do_((function(each){
  553. return smalltalk.withContext(function($ctx2) {
  554. $1=$Transcript();
  555. _st($1)._show_(each);
  556. $2=_st($1)._cr();
  557. $2;
  558. return _st((function(){
  559. return smalltalk.withContext(function($ctx3) {
  560. return _st(self)._recompile_(each);
  561. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((100));
  562. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  563. return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{},smalltalk.Compiler)})},
  564. args: [],
  565. source: "recompileAll\x0a\x09Smalltalk current classes do: [:each |\x0a\x09\x09Transcript show: each; cr.\x0a\x09\x09[self recompile: each] valueWithTimeout: 100]",
  566. messageSends: ["do:", "show:", "cr", "valueWithTimeout:", "recompile:", "classes", "current"],
  567. referencedClasses: ["Transcript", "Smalltalk"]
  568. }),
  569. smalltalk.Compiler);
  570. smalltalk.addMethod(
  571. smalltalk.method({
  572. selector: "source",
  573. category: 'accessing',
  574. fn: function (){
  575. var self=this;
  576. return smalltalk.withContext(function($ctx1) {
  577. var $2,$1;
  578. $2=self["@source"];
  579. if(($receiver = $2) == nil || $receiver == undefined){
  580. $1="";
  581. } else {
  582. $1=$2;
  583. };
  584. return $1;
  585. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.Compiler)})},
  586. args: [],
  587. source: "source\x0a\x09^source ifNil: ['']",
  588. messageSends: ["ifNil:"],
  589. referencedClasses: []
  590. }),
  591. smalltalk.Compiler);
  592. smalltalk.addMethod(
  593. smalltalk.method({
  594. selector: "source:",
  595. category: 'accessing',
  596. fn: function (aString){
  597. var self=this;
  598. return smalltalk.withContext(function($ctx1) {
  599. self["@source"]=aString;
  600. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.Compiler)})},
  601. args: ["aString"],
  602. source: "source: aString\x0a\x09source := aString",
  603. messageSends: [],
  604. referencedClasses: []
  605. }),
  606. smalltalk.Compiler);
  607. smalltalk.addMethod(
  608. smalltalk.method({
  609. selector: "unknownVariables",
  610. category: 'accessing',
  611. fn: function (){
  612. var self=this;
  613. return smalltalk.withContext(function($ctx1) {
  614. var $1;
  615. $1=self["@unknownVariables"];
  616. return $1;
  617. }, function($ctx1) {$ctx1.fill(self,"unknownVariables",{},smalltalk.Compiler)})},
  618. args: [],
  619. source: "unknownVariables\x0a\x09^unknownVariables",
  620. messageSends: [],
  621. referencedClasses: []
  622. }),
  623. smalltalk.Compiler);
  624. smalltalk.addMethod(
  625. smalltalk.method({
  626. selector: "unknownVariables:",
  627. category: 'accessing',
  628. fn: function (aCollection){
  629. var self=this;
  630. return smalltalk.withContext(function($ctx1) {
  631. self["@unknownVariables"]=aCollection;
  632. return self}, function($ctx1) {$ctx1.fill(self,"unknownVariables:",{aCollection:aCollection},smalltalk.Compiler)})},
  633. args: ["aCollection"],
  634. source: "unknownVariables: aCollection\x0a\x09unknownVariables := aCollection",
  635. messageSends: [],
  636. referencedClasses: []
  637. }),
  638. smalltalk.Compiler);
  639. smalltalk.addMethod(
  640. smalltalk.method({
  641. selector: "recompile:",
  642. category: 'compiling',
  643. fn: function (aClass){
  644. var self=this;
  645. return smalltalk.withContext(function($ctx1) {
  646. _st(_st(self)._new())._recompile_(aClass);
  647. return self}, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass},smalltalk.Compiler.klass)})},
  648. args: ["aClass"],
  649. source: "recompile: aClass\x0a\x09self new recompile: aClass",
  650. messageSends: ["recompile:", "new"],
  651. referencedClasses: []
  652. }),
  653. smalltalk.Compiler.klass);
  654. smalltalk.addMethod(
  655. smalltalk.method({
  656. selector: "recompileAll",
  657. category: 'compiling',
  658. fn: function (){
  659. var self=this;
  660. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  661. return smalltalk.withContext(function($ctx1) {
  662. _st(_st(_st($Smalltalk())._current())._classes())._do_((function(each){
  663. return smalltalk.withContext(function($ctx2) {
  664. return _st(self)._recompile_(each);
  665. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  666. return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{},smalltalk.Compiler.klass)})},
  667. args: [],
  668. source: "recompileAll\x0a\x09Smalltalk current classes do: [:each |\x0a\x09\x09self recompile: each]",
  669. messageSends: ["do:", "recompile:", "classes", "current"],
  670. referencedClasses: ["Smalltalk"]
  671. }),
  672. smalltalk.Compiler.klass);
  673. smalltalk.addClass('DoIt', smalltalk.Object, [], 'Compiler-Core');
  674. smalltalk.DoIt.comment="`DoIt` is the class used to compile and evaluate expressions. See `Compiler >> evaluateExpression:`."
  675. smalltalk.addClass('NodeVisitor', smalltalk.Object, [], 'Compiler-Core');
  676. smalltalk.NodeVisitor.comment="I am the abstract super class of all AST node visitors."
  677. smalltalk.addMethod(
  678. smalltalk.method({
  679. selector: "visit:",
  680. category: 'visiting',
  681. fn: function (aNode){
  682. var self=this;
  683. return smalltalk.withContext(function($ctx1) {
  684. var $1;
  685. $1=_st(aNode)._accept_(self);
  686. return $1;
  687. }, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode},smalltalk.NodeVisitor)})},
  688. args: ["aNode"],
  689. source: "visit: aNode\x0a\x09^ aNode accept: self",
  690. messageSends: ["accept:"],
  691. referencedClasses: []
  692. }),
  693. smalltalk.NodeVisitor);
  694. smalltalk.addMethod(
  695. smalltalk.method({
  696. selector: "visitAll:",
  697. category: 'visiting',
  698. fn: function (aCollection){
  699. var self=this;
  700. return smalltalk.withContext(function($ctx1) {
  701. var $1;
  702. $1=_st(aCollection)._collect_((function(each){
  703. return smalltalk.withContext(function($ctx2) {
  704. return _st(self)._visit_(each);
  705. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  706. return $1;
  707. }, function($ctx1) {$ctx1.fill(self,"visitAll:",{aCollection:aCollection},smalltalk.NodeVisitor)})},
  708. args: ["aCollection"],
  709. source: "visitAll: aCollection\x0a\x09^ aCollection collect: [ :each | self visit: each ]",
  710. messageSends: ["collect:", "visit:"],
  711. referencedClasses: []
  712. }),
  713. smalltalk.NodeVisitor);
  714. smalltalk.addMethod(
  715. smalltalk.method({
  716. selector: "visitAssignmentNode:",
  717. category: 'visiting',
  718. fn: function (aNode){
  719. var self=this;
  720. return smalltalk.withContext(function($ctx1) {
  721. var $1;
  722. $1=_st(self)._visitNode_(aNode);
  723. return $1;
  724. }, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  725. args: ["aNode"],
  726. source: "visitAssignmentNode: aNode\x0a\x09^ self visitNode: aNode",
  727. messageSends: ["visitNode:"],
  728. referencedClasses: []
  729. }),
  730. smalltalk.NodeVisitor);
  731. smalltalk.addMethod(
  732. smalltalk.method({
  733. selector: "visitBlockNode:",
  734. category: 'visiting',
  735. fn: function (aNode){
  736. var self=this;
  737. return smalltalk.withContext(function($ctx1) {
  738. var $1;
  739. $1=_st(self)._visitNode_(aNode);
  740. return $1;
  741. }, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  742. args: ["aNode"],
  743. source: "visitBlockNode: aNode\x0a\x09^ self visitNode: aNode",
  744. messageSends: ["visitNode:"],
  745. referencedClasses: []
  746. }),
  747. smalltalk.NodeVisitor);
  748. smalltalk.addMethod(
  749. smalltalk.method({
  750. selector: "visitBlockSequenceNode:",
  751. category: 'visiting',
  752. fn: function (aNode){
  753. var self=this;
  754. return smalltalk.withContext(function($ctx1) {
  755. var $1;
  756. $1=_st(self)._visitSequenceNode_(aNode);
  757. return $1;
  758. }, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  759. args: ["aNode"],
  760. source: "visitBlockSequenceNode: aNode\x0a\x09^ self visitSequenceNode: aNode",
  761. messageSends: ["visitSequenceNode:"],
  762. referencedClasses: []
  763. }),
  764. smalltalk.NodeVisitor);
  765. smalltalk.addMethod(
  766. smalltalk.method({
  767. selector: "visitCascadeNode:",
  768. category: 'visiting',
  769. fn: function (aNode){
  770. var self=this;
  771. return smalltalk.withContext(function($ctx1) {
  772. var $1;
  773. $1=_st(self)._visitNode_(aNode);
  774. return $1;
  775. }, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  776. args: ["aNode"],
  777. source: "visitCascadeNode: aNode\x0a\x09^ self visitNode: aNode",
  778. messageSends: ["visitNode:"],
  779. referencedClasses: []
  780. }),
  781. smalltalk.NodeVisitor);
  782. smalltalk.addMethod(
  783. smalltalk.method({
  784. selector: "visitClassReferenceNode:",
  785. category: 'visiting',
  786. fn: function (aNode){
  787. var self=this;
  788. return smalltalk.withContext(function($ctx1) {
  789. var $1;
  790. $1=_st(self)._visitVariableNode_(aNode);
  791. return $1;
  792. }, function($ctx1) {$ctx1.fill(self,"visitClassReferenceNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  793. args: ["aNode"],
  794. source: "visitClassReferenceNode: aNode\x0a\x09^ self visitVariableNode: aNode",
  795. messageSends: ["visitVariableNode:"],
  796. referencedClasses: []
  797. }),
  798. smalltalk.NodeVisitor);
  799. smalltalk.addMethod(
  800. smalltalk.method({
  801. selector: "visitDynamicArrayNode:",
  802. category: 'visiting',
  803. fn: function (aNode){
  804. var self=this;
  805. return smalltalk.withContext(function($ctx1) {
  806. var $1;
  807. $1=_st(self)._visitNode_(aNode);
  808. return $1;
  809. }, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  810. args: ["aNode"],
  811. source: "visitDynamicArrayNode: aNode\x0a\x09^ self visitNode: aNode",
  812. messageSends: ["visitNode:"],
  813. referencedClasses: []
  814. }),
  815. smalltalk.NodeVisitor);
  816. smalltalk.addMethod(
  817. smalltalk.method({
  818. selector: "visitDynamicDictionaryNode:",
  819. category: 'visiting',
  820. fn: function (aNode){
  821. var self=this;
  822. return smalltalk.withContext(function($ctx1) {
  823. var $1;
  824. $1=_st(self)._visitNode_(aNode);
  825. return $1;
  826. }, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  827. args: ["aNode"],
  828. source: "visitDynamicDictionaryNode: aNode\x0a\x09^ self visitNode: aNode",
  829. messageSends: ["visitNode:"],
  830. referencedClasses: []
  831. }),
  832. smalltalk.NodeVisitor);
  833. smalltalk.addMethod(
  834. smalltalk.method({
  835. selector: "visitJSStatementNode:",
  836. category: 'visiting',
  837. fn: function (aNode){
  838. var self=this;
  839. return smalltalk.withContext(function($ctx1) {
  840. var $1;
  841. $1=_st(self)._visitNode_(aNode);
  842. return $1;
  843. }, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  844. args: ["aNode"],
  845. source: "visitJSStatementNode: aNode\x0a\x09^ self visitNode: aNode",
  846. messageSends: ["visitNode:"],
  847. referencedClasses: []
  848. }),
  849. smalltalk.NodeVisitor);
  850. smalltalk.addMethod(
  851. smalltalk.method({
  852. selector: "visitMethodNode:",
  853. category: 'visiting',
  854. fn: function (aNode){
  855. var self=this;
  856. return smalltalk.withContext(function($ctx1) {
  857. var $1;
  858. $1=_st(self)._visitNode_(aNode);
  859. return $1;
  860. }, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  861. args: ["aNode"],
  862. source: "visitMethodNode: aNode\x0a\x09^ self visitNode: aNode",
  863. messageSends: ["visitNode:"],
  864. referencedClasses: []
  865. }),
  866. smalltalk.NodeVisitor);
  867. smalltalk.addMethod(
  868. smalltalk.method({
  869. selector: "visitNode:",
  870. category: 'visiting',
  871. fn: function (aNode){
  872. var self=this;
  873. return smalltalk.withContext(function($ctx1) {
  874. var $1;
  875. $1=_st(self)._visitAll_(_st(aNode)._nodes());
  876. return $1;
  877. }, function($ctx1) {$ctx1.fill(self,"visitNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  878. args: ["aNode"],
  879. source: "visitNode: aNode\x0a\x09^ self visitAll: aNode nodes",
  880. messageSends: ["visitAll:", "nodes"],
  881. referencedClasses: []
  882. }),
  883. smalltalk.NodeVisitor);
  884. smalltalk.addMethod(
  885. smalltalk.method({
  886. selector: "visitReturnNode:",
  887. category: 'visiting',
  888. fn: function (aNode){
  889. var self=this;
  890. return smalltalk.withContext(function($ctx1) {
  891. var $1;
  892. $1=_st(self)._visitNode_(aNode);
  893. return $1;
  894. }, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  895. args: ["aNode"],
  896. source: "visitReturnNode: aNode\x0a\x09^ self visitNode: aNode",
  897. messageSends: ["visitNode:"],
  898. referencedClasses: []
  899. }),
  900. smalltalk.NodeVisitor);
  901. smalltalk.addMethod(
  902. smalltalk.method({
  903. selector: "visitSendNode:",
  904. category: 'visiting',
  905. fn: function (aNode){
  906. var self=this;
  907. return smalltalk.withContext(function($ctx1) {
  908. var $1;
  909. $1=_st(self)._visitNode_(aNode);
  910. return $1;
  911. }, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  912. args: ["aNode"],
  913. source: "visitSendNode: aNode\x0a\x09^ self visitNode: aNode",
  914. messageSends: ["visitNode:"],
  915. referencedClasses: []
  916. }),
  917. smalltalk.NodeVisitor);
  918. smalltalk.addMethod(
  919. smalltalk.method({
  920. selector: "visitSequenceNode:",
  921. category: 'visiting',
  922. fn: function (aNode){
  923. var self=this;
  924. return smalltalk.withContext(function($ctx1) {
  925. var $1;
  926. $1=_st(self)._visitNode_(aNode);
  927. return $1;
  928. }, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  929. args: ["aNode"],
  930. source: "visitSequenceNode: aNode\x0a\x09^ self visitNode: aNode",
  931. messageSends: ["visitNode:"],
  932. referencedClasses: []
  933. }),
  934. smalltalk.NodeVisitor);
  935. smalltalk.addMethod(
  936. smalltalk.method({
  937. selector: "visitValueNode:",
  938. category: 'visiting',
  939. fn: function (aNode){
  940. var self=this;
  941. return smalltalk.withContext(function($ctx1) {
  942. var $1;
  943. $1=_st(self)._visitNode_(aNode);
  944. return $1;
  945. }, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  946. args: ["aNode"],
  947. source: "visitValueNode: aNode\x0a\x09^ self visitNode: aNode",
  948. messageSends: ["visitNode:"],
  949. referencedClasses: []
  950. }),
  951. smalltalk.NodeVisitor);
  952. smalltalk.addMethod(
  953. smalltalk.method({
  954. selector: "visitVariableNode:",
  955. category: 'visiting',
  956. fn: function (aNode){
  957. var self=this;
  958. return smalltalk.withContext(function($ctx1) {
  959. var $1;
  960. $1=_st(self)._visitNode_(aNode);
  961. return $1;
  962. }, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  963. args: ["aNode"],
  964. source: "visitVariableNode: aNode\x0a\x09^ self visitNode: aNode",
  965. messageSends: ["visitNode:"],
  966. referencedClasses: []
  967. }),
  968. smalltalk.NodeVisitor);