Compiler-Core.js 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055
  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. return smalltalk.withContext(function($ctx1) {
  85. var $1;
  86. $1=["self", "super", "true", "false", "nil", "thisContext"];
  87. return $1;
  88. }, function($ctx1) {$ctx1.fill(self,"pseudoVariables",{},smalltalk.AbstractCodeGenerator)})},
  89. args: [],
  90. source: "pseudoVariables\x0a\x09^#('self' 'super' 'true' 'false' 'nil' 'thisContext')",
  91. messageSends: [],
  92. referencedClasses: []
  93. }),
  94. smalltalk.AbstractCodeGenerator);
  95. smalltalk.addMethod(
  96. smalltalk.method({
  97. selector: "safeVariableNameFor:",
  98. category: 'accessing',
  99. fn: function (aString){
  100. var self=this;
  101. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  102. return smalltalk.withContext(function($ctx1) {
  103. var $2,$1;
  104. $2=_st(_st(_st($Smalltalk())._current())._reservedWords())._includes_(aString);
  105. if(smalltalk.assert($2)){
  106. $1=_st(aString).__comma("_");
  107. } else {
  108. $1=aString;
  109. };
  110. return $1;
  111. }, function($ctx1) {$ctx1.fill(self,"safeVariableNameFor:",{aString:aString},smalltalk.AbstractCodeGenerator)})},
  112. args: ["aString"],
  113. source: "safeVariableNameFor: aString\x0a\x09^(Smalltalk current reservedWords includes: aString)\x0a\x09\x09ifTrue: [aString, '_']\x0a\x09\x09ifFalse: [aString]",
  114. messageSends: ["ifTrue:ifFalse:", ",", "includes:", "reservedWords", "current"],
  115. referencedClasses: ["Smalltalk"]
  116. }),
  117. smalltalk.AbstractCodeGenerator);
  118. smalltalk.addMethod(
  119. smalltalk.method({
  120. selector: "source",
  121. category: 'accessing',
  122. fn: function (){
  123. var self=this;
  124. return smalltalk.withContext(function($ctx1) {
  125. var $2,$1;
  126. $2=self["@source"];
  127. if(($receiver = $2) == nil || $receiver == undefined){
  128. $1="";
  129. } else {
  130. $1=$2;
  131. };
  132. return $1;
  133. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.AbstractCodeGenerator)})},
  134. args: [],
  135. source: "source\x0a\x09^source ifNil: ['']",
  136. messageSends: ["ifNil:"],
  137. referencedClasses: []
  138. }),
  139. smalltalk.AbstractCodeGenerator);
  140. smalltalk.addMethod(
  141. smalltalk.method({
  142. selector: "source:",
  143. category: 'accessing',
  144. fn: function (aString){
  145. var self=this;
  146. return smalltalk.withContext(function($ctx1) {
  147. self["@source"]=aString;
  148. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.AbstractCodeGenerator)})},
  149. args: ["aString"],
  150. source: "source: aString\x0a\x09source := aString",
  151. messageSends: [],
  152. referencedClasses: []
  153. }),
  154. smalltalk.AbstractCodeGenerator);
  155. smalltalk.addClass('CodeGenerator', smalltalk.AbstractCodeGenerator, [], 'Compiler-Core');
  156. 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."
  157. smalltalk.addMethod(
  158. smalltalk.method({
  159. selector: "compileNode:",
  160. category: 'compiling',
  161. fn: function (aNode){
  162. var self=this;
  163. var ir,stream;
  164. return smalltalk.withContext(function($ctx1) {
  165. var $2,$3,$1;
  166. _st(_st(self)._semanticAnalyzer())._visit_(aNode);
  167. ir=_st(_st(self)._translator())._visit_(aNode);
  168. $2=_st(self)._irTranslator();
  169. _st($2)._visit_(ir);
  170. $3=_st($2)._contents();
  171. $1=$3;
  172. return $1;
  173. }, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,ir:ir,stream:stream},smalltalk.CodeGenerator)})},
  174. args: ["aNode"],
  175. 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",
  176. messageSends: ["visit:", "semanticAnalyzer", "translator", "irTranslator", "contents"],
  177. referencedClasses: []
  178. }),
  179. smalltalk.CodeGenerator);
  180. smalltalk.addMethod(
  181. smalltalk.method({
  182. selector: "irTranslator",
  183. category: 'compiling',
  184. fn: function (){
  185. var self=this;
  186. function $IRJSTranslator(){return smalltalk.IRJSTranslator||(typeof IRJSTranslator=="undefined"?nil:IRJSTranslator)}
  187. return smalltalk.withContext(function($ctx1) {
  188. var $1;
  189. $1=_st($IRJSTranslator())._new();
  190. return $1;
  191. }, function($ctx1) {$ctx1.fill(self,"irTranslator",{},smalltalk.CodeGenerator)})},
  192. args: [],
  193. source: "irTranslator\x0a\x09^ IRJSTranslator new",
  194. messageSends: ["new"],
  195. referencedClasses: ["IRJSTranslator"]
  196. }),
  197. smalltalk.CodeGenerator);
  198. smalltalk.addMethod(
  199. smalltalk.method({
  200. selector: "semanticAnalyzer",
  201. category: 'compiling',
  202. fn: function (){
  203. var self=this;
  204. function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
  205. return smalltalk.withContext(function($ctx1) {
  206. var $1;
  207. $1=_st($SemanticAnalyzer())._on_(_st(self)._currentClass());
  208. return $1;
  209. }, function($ctx1) {$ctx1.fill(self,"semanticAnalyzer",{},smalltalk.CodeGenerator)})},
  210. args: [],
  211. source: "semanticAnalyzer\x0a\x09^ SemanticAnalyzer on: self currentClass",
  212. messageSends: ["on:", "currentClass"],
  213. referencedClasses: ["SemanticAnalyzer"]
  214. }),
  215. smalltalk.CodeGenerator);
  216. smalltalk.addMethod(
  217. smalltalk.method({
  218. selector: "translator",
  219. category: 'compiling',
  220. fn: function (){
  221. var self=this;
  222. function $IRASTTranslator(){return smalltalk.IRASTTranslator||(typeof IRASTTranslator=="undefined"?nil:IRASTTranslator)}
  223. return smalltalk.withContext(function($ctx1) {
  224. var $2,$3,$1;
  225. $2=_st($IRASTTranslator())._new();
  226. _st($2)._source_(_st(self)._source());
  227. _st($2)._theClass_(_st(self)._currentClass());
  228. $3=_st($2)._yourself();
  229. $1=$3;
  230. return $1;
  231. }, function($ctx1) {$ctx1.fill(self,"translator",{},smalltalk.CodeGenerator)})},
  232. args: [],
  233. source: "translator\x0a\x09^ IRASTTranslator new\x0a\x09\x09source: self source;\x0a\x09\x09theClass: self currentClass;\x0a\x09\x09yourself",
  234. messageSends: ["source:", "source", "new", "theClass:", "currentClass", "yourself"],
  235. referencedClasses: ["IRASTTranslator"]
  236. }),
  237. smalltalk.CodeGenerator);
  238. smalltalk.addClass('Compiler', smalltalk.Object, ['currentClass', 'source', 'unknownVariables', 'codeGeneratorClass'], 'Compiler-Core');
  239. 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`"
  240. smalltalk.addMethod(
  241. smalltalk.method({
  242. selector: "codeGeneratorClass",
  243. category: 'accessing',
  244. fn: function (){
  245. var self=this;
  246. function $InliningCodeGenerator(){return smalltalk.InliningCodeGenerator||(typeof InliningCodeGenerator=="undefined"?nil:InliningCodeGenerator)}
  247. return smalltalk.withContext(function($ctx1) {
  248. var $2,$1;
  249. $2=self["@codeGeneratorClass"];
  250. if(($receiver = $2) == nil || $receiver == undefined){
  251. $1=$InliningCodeGenerator();
  252. } else {
  253. $1=$2;
  254. };
  255. return $1;
  256. }, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass",{},smalltalk.Compiler)})},
  257. args: [],
  258. source: "codeGeneratorClass\x0a\x09^codeGeneratorClass ifNil: [InliningCodeGenerator]",
  259. messageSends: ["ifNil:"],
  260. referencedClasses: ["InliningCodeGenerator"]
  261. }),
  262. smalltalk.Compiler);
  263. smalltalk.addMethod(
  264. smalltalk.method({
  265. selector: "codeGeneratorClass:",
  266. category: 'accessing',
  267. fn: function (aClass){
  268. var self=this;
  269. return smalltalk.withContext(function($ctx1) {
  270. self["@codeGeneratorClass"]=aClass;
  271. return self}, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass:",{aClass:aClass},smalltalk.Compiler)})},
  272. args: ["aClass"],
  273. source: "codeGeneratorClass: aClass\x0a\x09codeGeneratorClass := aClass",
  274. messageSends: [],
  275. referencedClasses: []
  276. }),
  277. smalltalk.Compiler);
  278. smalltalk.addMethod(
  279. smalltalk.method({
  280. selector: "compile:",
  281. category: 'compiling',
  282. fn: function (aString){
  283. var self=this;
  284. return smalltalk.withContext(function($ctx1) {
  285. var $1;
  286. $1=_st(self)._compileNode_(_st(self)._parse_(aString));
  287. return $1;
  288. }, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString},smalltalk.Compiler)})},
  289. args: ["aString"],
  290. source: "compile: aString\x0a\x09^self compileNode: (self parse: aString)",
  291. messageSends: ["compileNode:", "parse:"],
  292. referencedClasses: []
  293. }),
  294. smalltalk.Compiler);
  295. smalltalk.addMethod(
  296. smalltalk.method({
  297. selector: "compile:forClass:",
  298. category: 'compiling',
  299. fn: function (aString,aClass){
  300. var self=this;
  301. return smalltalk.withContext(function($ctx1) {
  302. var $1;
  303. _st(self)._currentClass_(aClass);
  304. _st(self)._source_(aString);
  305. $1=_st(self)._compile_(aString);
  306. return $1;
  307. }, function($ctx1) {$ctx1.fill(self,"compile:forClass:",{aString:aString,aClass:aClass},smalltalk.Compiler)})},
  308. args: ["aString", "aClass"],
  309. source: "compile: aString forClass: aClass\x0a\x09self currentClass: aClass.\x0a\x09self source: aString.\x0a\x09^self compile: aString",
  310. messageSends: ["currentClass:", "source:", "compile:"],
  311. referencedClasses: []
  312. }),
  313. smalltalk.Compiler);
  314. smalltalk.addMethod(
  315. smalltalk.method({
  316. selector: "compileExpression:",
  317. category: 'compiling',
  318. fn: function (aString){
  319. var self=this;
  320. function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  321. return smalltalk.withContext(function($ctx1) {
  322. var $1;
  323. _st(self)._currentClass_($DoIt());
  324. _st(self)._source_(_st(_st("doIt ^[").__comma(aString)).__comma("] value"));
  325. $1=_st(self)._compileNode_(_st(self)._parse_(_st(self)._source()));
  326. return $1;
  327. }, function($ctx1) {$ctx1.fill(self,"compileExpression:",{aString:aString},smalltalk.Compiler)})},
  328. args: ["aString"],
  329. source: "compileExpression: aString\x0a\x09self currentClass: DoIt.\x0a\x09self source: 'doIt ^[', aString, '] value'.\x0a\x09^self compileNode: (self parse: self source)",
  330. messageSends: ["currentClass:", "source:", ",", "compileNode:", "parse:", "source"],
  331. referencedClasses: ["DoIt"]
  332. }),
  333. smalltalk.Compiler);
  334. smalltalk.addMethod(
  335. smalltalk.method({
  336. selector: "compileExpression:on:",
  337. category: 'compiling',
  338. fn: function (aString,anObject){
  339. var self=this;
  340. return smalltalk.withContext(function($ctx1) {
  341. var $1;
  342. _st(self)._currentClass_(_st(anObject)._class());
  343. _st(self)._source_(_st(_st("xxxDoIt ^[").__comma(aString)).__comma("] value"));
  344. $1=_st(self)._compileNode_(_st(self)._parse_(_st(self)._source()));
  345. return $1;
  346. }, function($ctx1) {$ctx1.fill(self,"compileExpression:on:",{aString:aString,anObject:anObject},smalltalk.Compiler)})},
  347. args: ["aString", "anObject"],
  348. source: "compileExpression: aString on: anObject\x0a\x09self currentClass: anObject class.\x0a\x09self source: 'xxxDoIt ^[', aString, '] value'.\x0a\x09^self compileNode: (self parse: self source)",
  349. messageSends: ["currentClass:", "class", "source:", ",", "compileNode:", "parse:", "source"],
  350. referencedClasses: []
  351. }),
  352. smalltalk.Compiler);
  353. smalltalk.addMethod(
  354. smalltalk.method({
  355. selector: "compileNode:",
  356. category: 'compiling',
  357. fn: function (aNode){
  358. var self=this;
  359. var generator,result;
  360. return smalltalk.withContext(function($ctx1) {
  361. var $1,$2,$3;
  362. generator=_st(_st(self)._codeGeneratorClass())._new();
  363. $1=generator;
  364. _st($1)._source_(_st(self)._source());
  365. $2=_st($1)._currentClass_(_st(self)._currentClass());
  366. result=_st(generator)._compileNode_(aNode);
  367. _st(self)._unknownVariables_([]);
  368. $3=result;
  369. return $3;
  370. }, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,generator:generator,result:result},smalltalk.Compiler)})},
  371. args: ["aNode"],
  372. 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",
  373. messageSends: ["new", "codeGeneratorClass", "source:", "source", "currentClass:", "currentClass", "compileNode:", "unknownVariables:"],
  374. referencedClasses: []
  375. }),
  376. smalltalk.Compiler);
  377. smalltalk.addMethod(
  378. smalltalk.method({
  379. selector: "currentClass",
  380. category: 'accessing',
  381. fn: function (){
  382. var self=this;
  383. return smalltalk.withContext(function($ctx1) {
  384. var $1;
  385. $1=self["@currentClass"];
  386. return $1;
  387. }, function($ctx1) {$ctx1.fill(self,"currentClass",{},smalltalk.Compiler)})},
  388. args: [],
  389. source: "currentClass\x0a\x09^currentClass",
  390. messageSends: [],
  391. referencedClasses: []
  392. }),
  393. smalltalk.Compiler);
  394. smalltalk.addMethod(
  395. smalltalk.method({
  396. selector: "currentClass:",
  397. category: 'accessing',
  398. fn: function (aClass){
  399. var self=this;
  400. return smalltalk.withContext(function($ctx1) {
  401. self["@currentClass"]=aClass;
  402. return self}, function($ctx1) {$ctx1.fill(self,"currentClass:",{aClass:aClass},smalltalk.Compiler)})},
  403. args: ["aClass"],
  404. source: "currentClass: aClass\x0a\x09currentClass := aClass",
  405. messageSends: [],
  406. referencedClasses: []
  407. }),
  408. smalltalk.Compiler);
  409. smalltalk.addMethod(
  410. smalltalk.method({
  411. selector: "eval:",
  412. category: 'compiling',
  413. fn: function (aString){
  414. var self=this;
  415. return smalltalk.withContext(function($ctx1) {
  416. return eval(aString);
  417. return self}, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString},smalltalk.Compiler)})},
  418. args: ["aString"],
  419. source: "eval: aString\x0a\x09<return eval(aString)>",
  420. messageSends: [],
  421. referencedClasses: []
  422. }),
  423. smalltalk.Compiler);
  424. smalltalk.addMethod(
  425. smalltalk.method({
  426. selector: "evaluateExpression:",
  427. category: 'compiling',
  428. fn: function (aString){
  429. var self=this;
  430. function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  431. return smalltalk.withContext(function($ctx1) {
  432. var $1;
  433. $1=_st(self)._evaluateExpression_on_(aString,_st($DoIt())._new());
  434. return $1;
  435. }, function($ctx1) {$ctx1.fill(self,"evaluateExpression:",{aString:aString},smalltalk.Compiler)})},
  436. args: ["aString"],
  437. 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",
  438. messageSends: ["evaluateExpression:on:", "new"],
  439. referencedClasses: ["DoIt"]
  440. }),
  441. smalltalk.Compiler);
  442. smalltalk.addMethod(
  443. smalltalk.method({
  444. selector: "evaluateExpression:on:",
  445. category: 'compiling',
  446. fn: function (aString,anObject){
  447. var self=this;
  448. var result,method;
  449. return smalltalk.withContext(function($ctx1) {
  450. var $1;
  451. method=_st(self)._eval_(_st(self)._compileExpression_on_(aString,anObject));
  452. _st(method)._category_("xxxDoIt");
  453. _st(_st(anObject)._class())._addCompiledMethod_(method);
  454. result=_st(anObject)._xxxDoIt();
  455. _st(_st(anObject)._class())._removeCompiledMethod_(method);
  456. $1=result;
  457. return $1;
  458. }, function($ctx1) {$ctx1.fill(self,"evaluateExpression:on:",{aString:aString,anObject:anObject,result:result,method:method},smalltalk.Compiler)})},
  459. args: ["aString", "anObject"],
  460. 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",
  461. messageSends: ["eval:", "compileExpression:on:", "category:", "addCompiledMethod:", "class", "xxxDoIt", "removeCompiledMethod:"],
  462. referencedClasses: []
  463. }),
  464. smalltalk.Compiler);
  465. smalltalk.addMethod(
  466. smalltalk.method({
  467. selector: "install:forClass:category:",
  468. category: 'compiling',
  469. fn: function (aString,aBehavior,anotherString){
  470. var self=this;
  471. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  472. return smalltalk.withContext(function($ctx1) {
  473. var $1;
  474. $1=_st(_st($ClassBuilder())._new())._installMethod_forClass_category_(_st(self)._eval_(_st(self)._compile_forClass_(aString,aBehavior)),aBehavior,anotherString);
  475. return $1;
  476. }, function($ctx1) {$ctx1.fill(self,"install:forClass:category:",{aString:aString,aBehavior:aBehavior,anotherString:anotherString},smalltalk.Compiler)})},
  477. args: ["aString", "aBehavior", "anotherString"],
  478. 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",
  479. messageSends: ["installMethod:forClass:category:", "eval:", "compile:forClass:", "new"],
  480. referencedClasses: ["ClassBuilder"]
  481. }),
  482. smalltalk.Compiler);
  483. smalltalk.addMethod(
  484. smalltalk.method({
  485. selector: "parse:",
  486. category: 'compiling',
  487. fn: function (aString){
  488. var self=this;
  489. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  490. return smalltalk.withContext(function($ctx1) {
  491. var $1;
  492. $1=_st(_st($Smalltalk())._current())._parse_(aString);
  493. return $1;
  494. }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString},smalltalk.Compiler)})},
  495. args: ["aString"],
  496. source: "parse: aString\x0a\x09^Smalltalk current parse: aString",
  497. messageSends: ["parse:", "current"],
  498. referencedClasses: ["Smalltalk"]
  499. }),
  500. smalltalk.Compiler);
  501. smalltalk.addMethod(
  502. smalltalk.method({
  503. selector: "parseExpression:",
  504. category: 'compiling',
  505. fn: function (aString){
  506. var self=this;
  507. return smalltalk.withContext(function($ctx1) {
  508. var $1;
  509. $1=_st(self)._parse_(_st(_st("doIt ^[").__comma(aString)).__comma("] value"));
  510. return $1;
  511. }, function($ctx1) {$ctx1.fill(self,"parseExpression:",{aString:aString},smalltalk.Compiler)})},
  512. args: ["aString"],
  513. source: "parseExpression: aString\x0a\x09^self parse: 'doIt ^[', aString, '] value'",
  514. messageSends: ["parse:", ","],
  515. referencedClasses: []
  516. }),
  517. smalltalk.Compiler);
  518. smalltalk.addMethod(
  519. smalltalk.method({
  520. selector: "recompile:",
  521. category: 'compiling',
  522. fn: function (aClass){
  523. var self=this;
  524. return smalltalk.withContext(function($ctx1) {
  525. var $1;
  526. _st(_st(aClass)._methodDictionary())._do_((function(each){
  527. return smalltalk.withContext(function($ctx2) {
  528. _st(console)._log_(_st(_st(_st(aClass)._name()).__comma(" >> ")).__comma(_st(each)._selector()));
  529. return _st(self)._install_forClass_category_(_st(each)._source(),aClass,_st(each)._category());
  530. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  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 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]",
  538. messageSends: ["do:", "log:", ",", "selector", "name", "install:forClass:category:", "source", "category", "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.addMethod(
  676. smalltalk.method({
  677. selector: "xxxDoIt",
  678. category: 'xxxDoIt',
  679. fn: function (){
  680. var self=this;
  681. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  682. return smalltalk.withContext(function($ctx1) {
  683. var $1;
  684. $1=_st((function(){
  685. return smalltalk.withContext(function($ctx2) {
  686. return _st(_st(_st($Smalltalk())._current())._packages())._do_((function(each){
  687. return smalltalk.withContext(function($ctx3) {
  688. return _st(each)._commit();
  689. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  690. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._value();
  691. return $1;
  692. }, function($ctx1) {$ctx1.fill(self,"xxxDoIt",{},smalltalk.DoIt)})},
  693. args: [],
  694. source: "xxxDoIt ^[Smalltalk current packages do: [ :each |\x0a\x09each commit ]] value",
  695. messageSends: ["value", "do:", "commit", "packages", "current"],
  696. referencedClasses: ["Smalltalk"]
  697. }),
  698. smalltalk.DoIt);
  699. smalltalk.addClass('NodeVisitor', smalltalk.Object, [], 'Compiler-Core');
  700. smalltalk.NodeVisitor.comment="I am the abstract super class of all AST node visitors."
  701. smalltalk.addMethod(
  702. smalltalk.method({
  703. selector: "visit:",
  704. category: 'visiting',
  705. fn: function (aNode){
  706. var self=this;
  707. return smalltalk.withContext(function($ctx1) {
  708. var $1;
  709. $1=_st(aNode)._accept_(self);
  710. return $1;
  711. }, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode},smalltalk.NodeVisitor)})},
  712. args: ["aNode"],
  713. source: "visit: aNode\x0a\x09^ aNode accept: self",
  714. messageSends: ["accept:"],
  715. referencedClasses: []
  716. }),
  717. smalltalk.NodeVisitor);
  718. smalltalk.addMethod(
  719. smalltalk.method({
  720. selector: "visitAll:",
  721. category: 'visiting',
  722. fn: function (aCollection){
  723. var self=this;
  724. return smalltalk.withContext(function($ctx1) {
  725. var $1;
  726. $1=_st(aCollection)._collect_((function(each){
  727. return smalltalk.withContext(function($ctx2) {
  728. return _st(self)._visit_(each);
  729. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  730. return $1;
  731. }, function($ctx1) {$ctx1.fill(self,"visitAll:",{aCollection:aCollection},smalltalk.NodeVisitor)})},
  732. args: ["aCollection"],
  733. source: "visitAll: aCollection\x0a\x09^ aCollection collect: [ :each | self visit: each ]",
  734. messageSends: ["collect:", "visit:"],
  735. referencedClasses: []
  736. }),
  737. smalltalk.NodeVisitor);
  738. smalltalk.addMethod(
  739. smalltalk.method({
  740. selector: "visitAssignmentNode:",
  741. category: 'visiting',
  742. fn: function (aNode){
  743. var self=this;
  744. return smalltalk.withContext(function($ctx1) {
  745. var $1;
  746. $1=_st(self)._visitNode_(aNode);
  747. return $1;
  748. }, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  749. args: ["aNode"],
  750. source: "visitAssignmentNode: aNode\x0a\x09^ self visitNode: aNode",
  751. messageSends: ["visitNode:"],
  752. referencedClasses: []
  753. }),
  754. smalltalk.NodeVisitor);
  755. smalltalk.addMethod(
  756. smalltalk.method({
  757. selector: "visitBlockNode:",
  758. category: 'visiting',
  759. fn: function (aNode){
  760. var self=this;
  761. return smalltalk.withContext(function($ctx1) {
  762. var $1;
  763. $1=_st(self)._visitNode_(aNode);
  764. return $1;
  765. }, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  766. args: ["aNode"],
  767. source: "visitBlockNode: aNode\x0a\x09^ self visitNode: aNode",
  768. messageSends: ["visitNode:"],
  769. referencedClasses: []
  770. }),
  771. smalltalk.NodeVisitor);
  772. smalltalk.addMethod(
  773. smalltalk.method({
  774. selector: "visitBlockSequenceNode:",
  775. category: 'visiting',
  776. fn: function (aNode){
  777. var self=this;
  778. return smalltalk.withContext(function($ctx1) {
  779. var $1;
  780. $1=_st(self)._visitSequenceNode_(aNode);
  781. return $1;
  782. }, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  783. args: ["aNode"],
  784. source: "visitBlockSequenceNode: aNode\x0a\x09^ self visitSequenceNode: aNode",
  785. messageSends: ["visitSequenceNode:"],
  786. referencedClasses: []
  787. }),
  788. smalltalk.NodeVisitor);
  789. smalltalk.addMethod(
  790. smalltalk.method({
  791. selector: "visitCascadeNode:",
  792. category: 'visiting',
  793. fn: function (aNode){
  794. var self=this;
  795. return smalltalk.withContext(function($ctx1) {
  796. var $1;
  797. $1=_st(self)._visitNode_(aNode);
  798. return $1;
  799. }, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  800. args: ["aNode"],
  801. source: "visitCascadeNode: aNode\x0a\x09^ self visitNode: aNode",
  802. messageSends: ["visitNode:"],
  803. referencedClasses: []
  804. }),
  805. smalltalk.NodeVisitor);
  806. smalltalk.addMethod(
  807. smalltalk.method({
  808. selector: "visitClassReferenceNode:",
  809. category: 'visiting',
  810. fn: function (aNode){
  811. var self=this;
  812. return smalltalk.withContext(function($ctx1) {
  813. var $1;
  814. $1=_st(self)._visitVariableNode_(aNode);
  815. return $1;
  816. }, function($ctx1) {$ctx1.fill(self,"visitClassReferenceNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  817. args: ["aNode"],
  818. source: "visitClassReferenceNode: aNode\x0a\x09^ self visitVariableNode: aNode",
  819. messageSends: ["visitVariableNode:"],
  820. referencedClasses: []
  821. }),
  822. smalltalk.NodeVisitor);
  823. smalltalk.addMethod(
  824. smalltalk.method({
  825. selector: "visitDynamicArrayNode:",
  826. category: 'visiting',
  827. fn: function (aNode){
  828. var self=this;
  829. return smalltalk.withContext(function($ctx1) {
  830. var $1;
  831. $1=_st(self)._visitNode_(aNode);
  832. return $1;
  833. }, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  834. args: ["aNode"],
  835. source: "visitDynamicArrayNode: aNode\x0a\x09^ self visitNode: aNode",
  836. messageSends: ["visitNode:"],
  837. referencedClasses: []
  838. }),
  839. smalltalk.NodeVisitor);
  840. smalltalk.addMethod(
  841. smalltalk.method({
  842. selector: "visitDynamicDictionaryNode:",
  843. category: 'visiting',
  844. fn: function (aNode){
  845. var self=this;
  846. return smalltalk.withContext(function($ctx1) {
  847. var $1;
  848. $1=_st(self)._visitNode_(aNode);
  849. return $1;
  850. }, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  851. args: ["aNode"],
  852. source: "visitDynamicDictionaryNode: aNode\x0a\x09^ self visitNode: aNode",
  853. messageSends: ["visitNode:"],
  854. referencedClasses: []
  855. }),
  856. smalltalk.NodeVisitor);
  857. smalltalk.addMethod(
  858. smalltalk.method({
  859. selector: "visitJSStatementNode:",
  860. category: 'visiting',
  861. fn: function (aNode){
  862. var self=this;
  863. return smalltalk.withContext(function($ctx1) {
  864. var $1;
  865. $1=_st(self)._visitNode_(aNode);
  866. return $1;
  867. }, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  868. args: ["aNode"],
  869. source: "visitJSStatementNode: aNode\x0a\x09^ self visitNode: aNode",
  870. messageSends: ["visitNode:"],
  871. referencedClasses: []
  872. }),
  873. smalltalk.NodeVisitor);
  874. smalltalk.addMethod(
  875. smalltalk.method({
  876. selector: "visitMethodNode:",
  877. category: 'visiting',
  878. fn: function (aNode){
  879. var self=this;
  880. return smalltalk.withContext(function($ctx1) {
  881. var $1;
  882. $1=_st(self)._visitNode_(aNode);
  883. return $1;
  884. }, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  885. args: ["aNode"],
  886. source: "visitMethodNode: aNode\x0a\x09^ self visitNode: aNode",
  887. messageSends: ["visitNode:"],
  888. referencedClasses: []
  889. }),
  890. smalltalk.NodeVisitor);
  891. smalltalk.addMethod(
  892. smalltalk.method({
  893. selector: "visitNode:",
  894. category: 'visiting',
  895. fn: function (aNode){
  896. var self=this;
  897. return smalltalk.withContext(function($ctx1) {
  898. var $1;
  899. $1=_st(self)._visitAll_(_st(aNode)._nodes());
  900. return $1;
  901. }, function($ctx1) {$ctx1.fill(self,"visitNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  902. args: ["aNode"],
  903. source: "visitNode: aNode\x0a\x09^ self visitAll: aNode nodes",
  904. messageSends: ["visitAll:", "nodes"],
  905. referencedClasses: []
  906. }),
  907. smalltalk.NodeVisitor);
  908. smalltalk.addMethod(
  909. smalltalk.method({
  910. selector: "visitReturnNode:",
  911. category: 'visiting',
  912. fn: function (aNode){
  913. var self=this;
  914. return smalltalk.withContext(function($ctx1) {
  915. var $1;
  916. $1=_st(self)._visitNode_(aNode);
  917. return $1;
  918. }, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  919. args: ["aNode"],
  920. source: "visitReturnNode: aNode\x0a\x09^ self visitNode: aNode",
  921. messageSends: ["visitNode:"],
  922. referencedClasses: []
  923. }),
  924. smalltalk.NodeVisitor);
  925. smalltalk.addMethod(
  926. smalltalk.method({
  927. selector: "visitSendNode:",
  928. category: 'visiting',
  929. fn: function (aNode){
  930. var self=this;
  931. return smalltalk.withContext(function($ctx1) {
  932. var $1;
  933. $1=_st(self)._visitNode_(aNode);
  934. return $1;
  935. }, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  936. args: ["aNode"],
  937. source: "visitSendNode: aNode\x0a\x09^ self visitNode: aNode",
  938. messageSends: ["visitNode:"],
  939. referencedClasses: []
  940. }),
  941. smalltalk.NodeVisitor);
  942. smalltalk.addMethod(
  943. smalltalk.method({
  944. selector: "visitSequenceNode:",
  945. category: 'visiting',
  946. fn: function (aNode){
  947. var self=this;
  948. return smalltalk.withContext(function($ctx1) {
  949. var $1;
  950. $1=_st(self)._visitNode_(aNode);
  951. return $1;
  952. }, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  953. args: ["aNode"],
  954. source: "visitSequenceNode: aNode\x0a\x09^ self visitNode: aNode",
  955. messageSends: ["visitNode:"],
  956. referencedClasses: []
  957. }),
  958. smalltalk.NodeVisitor);
  959. smalltalk.addMethod(
  960. smalltalk.method({
  961. selector: "visitValueNode:",
  962. category: 'visiting',
  963. fn: function (aNode){
  964. var self=this;
  965. return smalltalk.withContext(function($ctx1) {
  966. var $1;
  967. $1=_st(self)._visitNode_(aNode);
  968. return $1;
  969. }, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  970. args: ["aNode"],
  971. source: "visitValueNode: aNode\x0a\x09^ self visitNode: aNode",
  972. messageSends: ["visitNode:"],
  973. referencedClasses: []
  974. }),
  975. smalltalk.NodeVisitor);
  976. smalltalk.addMethod(
  977. smalltalk.method({
  978. selector: "visitVariableNode:",
  979. category: 'visiting',
  980. fn: function (aNode){
  981. var self=this;
  982. return smalltalk.withContext(function($ctx1) {
  983. var $1;
  984. $1=_st(self)._visitNode_(aNode);
  985. return $1;
  986. }, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
  987. args: ["aNode"],
  988. source: "visitVariableNode: aNode\x0a\x09^ self visitNode: aNode",
  989. messageSends: ["visitNode:"],
  990. referencedClasses: []
  991. }),
  992. smalltalk.NodeVisitor);