Compiler-AST.js 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153
  1. smalltalk.addPackage('Compiler-AST');
  2. smalltalk.addClass('Node', smalltalk.Object, ['parent', 'position', 'nodes', 'shouldBeInlined', 'shouldBeAliased'], 'Compiler-AST');
  3. smalltalk.Node.comment="I am the abstract root class of the abstract syntax tree.\x0a\x0aConcrete classes should implement `#accept:` to allow visiting.\x0a\x0a`position` holds a point containing line and column number of the symbol location in the original source file.";
  4. smalltalk.addMethod(
  5. smalltalk.method({
  6. selector: "accept:",
  7. category: 'visiting',
  8. fn: function (aVisitor){
  9. var self=this;
  10. return smalltalk.withContext(function($ctx1) {
  11. var $1;
  12. $1=_st(aVisitor)._visitNode_(self);
  13. return $1;
  14. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.Node)})},
  15. args: ["aVisitor"],
  16. source: "accept: aVisitor\x0a\x09^ aVisitor visitNode: self",
  17. messageSends: ["visitNode:"],
  18. referencedClasses: []
  19. }),
  20. smalltalk.Node);
  21. smalltalk.addMethod(
  22. smalltalk.method({
  23. selector: "addNode:",
  24. category: 'accessing',
  25. fn: function (aNode){
  26. var self=this;
  27. return smalltalk.withContext(function($ctx1) {
  28. _st(self._nodes())._add_(aNode);
  29. _st(aNode)._parent_(self);
  30. return self}, function($ctx1) {$ctx1.fill(self,"addNode:",{aNode:aNode},smalltalk.Node)})},
  31. args: ["aNode"],
  32. source: "addNode: aNode\x0a\x09self nodes add: aNode.\x0a\x09aNode parent: self",
  33. messageSends: ["add:", "nodes", "parent:"],
  34. referencedClasses: []
  35. }),
  36. smalltalk.Node);
  37. smalltalk.addMethod(
  38. smalltalk.method({
  39. selector: "extent",
  40. category: 'accessing',
  41. fn: function (){
  42. var self=this;
  43. return smalltalk.withContext(function($ctx1) {
  44. var $2,$3,$1;
  45. $2=self._nextNode();
  46. if(($receiver = $2) == nil || $receiver == undefined){
  47. $3=self._parent();
  48. if(($receiver = $3) == nil || $receiver == undefined){
  49. $1=$3;
  50. } else {
  51. var node;
  52. node=$receiver;
  53. $1=_st(node)._extent();
  54. };
  55. } else {
  56. var node;
  57. node=$receiver;
  58. $1=_st(node)._position();
  59. };
  60. return $1;
  61. }, function($ctx1) {$ctx1.fill(self,"extent",{},smalltalk.Node)})},
  62. args: [],
  63. source: "extent\x0a\x09\x22Answer the line and column of the end position of the receiver in the source code\x22\x0a\x09\x0a\x09^ self nextNode \x0a\x09\x09ifNil: [ self parent ifNotNil: [ :node | node extent ] ]\x0a\x09\x09ifNotNil: [ :node | node position ]",
  64. messageSends: ["ifNil:ifNotNil:", "ifNotNil:", "extent", "parent", "position", "nextNode"],
  65. referencedClasses: []
  66. }),
  67. smalltalk.Node);
  68. smalltalk.addMethod(
  69. smalltalk.method({
  70. selector: "isAssignmentNode",
  71. category: 'testing',
  72. fn: function (){
  73. var self=this;
  74. return smalltalk.withContext(function($ctx1) {
  75. return false;
  76. }, function($ctx1) {$ctx1.fill(self,"isAssignmentNode",{},smalltalk.Node)})},
  77. args: [],
  78. source: "isAssignmentNode\x0a\x09^ false",
  79. messageSends: [],
  80. referencedClasses: []
  81. }),
  82. smalltalk.Node);
  83. smalltalk.addMethod(
  84. smalltalk.method({
  85. selector: "isBlockNode",
  86. category: 'testing',
  87. fn: function (){
  88. var self=this;
  89. return smalltalk.withContext(function($ctx1) {
  90. return false;
  91. }, function($ctx1) {$ctx1.fill(self,"isBlockNode",{},smalltalk.Node)})},
  92. args: [],
  93. source: "isBlockNode\x0a\x09^false",
  94. messageSends: [],
  95. referencedClasses: []
  96. }),
  97. smalltalk.Node);
  98. smalltalk.addMethod(
  99. smalltalk.method({
  100. selector: "isBlockSequenceNode",
  101. category: 'testing',
  102. fn: function (){
  103. var self=this;
  104. return smalltalk.withContext(function($ctx1) {
  105. return false;
  106. }, function($ctx1) {$ctx1.fill(self,"isBlockSequenceNode",{},smalltalk.Node)})},
  107. args: [],
  108. source: "isBlockSequenceNode\x0a\x09^false",
  109. messageSends: [],
  110. referencedClasses: []
  111. }),
  112. smalltalk.Node);
  113. smalltalk.addMethod(
  114. smalltalk.method({
  115. selector: "isImmutable",
  116. category: 'testing',
  117. fn: function (){
  118. var self=this;
  119. return smalltalk.withContext(function($ctx1) {
  120. return false;
  121. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.Node)})},
  122. args: [],
  123. source: "isImmutable\x0a\x09^false",
  124. messageSends: [],
  125. referencedClasses: []
  126. }),
  127. smalltalk.Node);
  128. smalltalk.addMethod(
  129. smalltalk.method({
  130. selector: "isJSStatementNode",
  131. category: 'testing',
  132. fn: function (){
  133. var self=this;
  134. return smalltalk.withContext(function($ctx1) {
  135. return false;
  136. }, function($ctx1) {$ctx1.fill(self,"isJSStatementNode",{},smalltalk.Node)})},
  137. args: [],
  138. source: "isJSStatementNode\x0a\x09^ false",
  139. messageSends: [],
  140. referencedClasses: []
  141. }),
  142. smalltalk.Node);
  143. smalltalk.addMethod(
  144. smalltalk.method({
  145. selector: "isNode",
  146. category: 'testing',
  147. fn: function (){
  148. var self=this;
  149. return smalltalk.withContext(function($ctx1) {
  150. return true;
  151. }, function($ctx1) {$ctx1.fill(self,"isNode",{},smalltalk.Node)})},
  152. args: [],
  153. source: "isNode\x0a\x09^ true",
  154. messageSends: [],
  155. referencedClasses: []
  156. }),
  157. smalltalk.Node);
  158. smalltalk.addMethod(
  159. smalltalk.method({
  160. selector: "isReturnNode",
  161. category: 'testing',
  162. fn: function (){
  163. var self=this;
  164. return smalltalk.withContext(function($ctx1) {
  165. return false;
  166. }, function($ctx1) {$ctx1.fill(self,"isReturnNode",{},smalltalk.Node)})},
  167. args: [],
  168. source: "isReturnNode\x0a\x09^false",
  169. messageSends: [],
  170. referencedClasses: []
  171. }),
  172. smalltalk.Node);
  173. smalltalk.addMethod(
  174. smalltalk.method({
  175. selector: "isSendNode",
  176. category: 'testing',
  177. fn: function (){
  178. var self=this;
  179. return smalltalk.withContext(function($ctx1) {
  180. return false;
  181. }, function($ctx1) {$ctx1.fill(self,"isSendNode",{},smalltalk.Node)})},
  182. args: [],
  183. source: "isSendNode\x0a\x09^false",
  184. messageSends: [],
  185. referencedClasses: []
  186. }),
  187. smalltalk.Node);
  188. smalltalk.addMethod(
  189. smalltalk.method({
  190. selector: "isValueNode",
  191. category: 'testing',
  192. fn: function (){
  193. var self=this;
  194. return smalltalk.withContext(function($ctx1) {
  195. return false;
  196. }, function($ctx1) {$ctx1.fill(self,"isValueNode",{},smalltalk.Node)})},
  197. args: [],
  198. source: "isValueNode\x0a\x09^false",
  199. messageSends: [],
  200. referencedClasses: []
  201. }),
  202. smalltalk.Node);
  203. smalltalk.addMethod(
  204. smalltalk.method({
  205. selector: "nextChild",
  206. category: 'accessing',
  207. fn: function (){
  208. var self=this;
  209. return smalltalk.withContext(function($ctx1) {
  210. var $2,$1;
  211. $2=_st(self._nodes())._isEmpty();
  212. if(smalltalk.assert($2)){
  213. $1=self;
  214. } else {
  215. $1=_st(_st(self._nodes())._first())._nextChild();
  216. };
  217. return $1;
  218. }, function($ctx1) {$ctx1.fill(self,"nextChild",{},smalltalk.Node)})},
  219. args: [],
  220. source: "nextChild\x0a\x09\x22Answer the next node after aNode.\x0a\x09Recurse into the possible children of the receiver to answer the next node to be evaluated\x22\x0a\x09\x0a\x09^ self nodes isEmpty\x0a\x09\x09ifTrue: [ self ]\x0a\x09\x09ifFalse: [ self nodes first nextChild ]",
  221. messageSends: ["ifTrue:ifFalse:", "nextChild", "first", "nodes", "isEmpty"],
  222. referencedClasses: []
  223. }),
  224. smalltalk.Node);
  225. smalltalk.addMethod(
  226. smalltalk.method({
  227. selector: "nextNode",
  228. category: 'accessing',
  229. fn: function (){
  230. var self=this;
  231. return smalltalk.withContext(function($ctx1) {
  232. var $2,$1;
  233. $2=self._parent();
  234. if(($receiver = $2) == nil || $receiver == undefined){
  235. $1=$2;
  236. } else {
  237. var node;
  238. node=$receiver;
  239. $1=_st(node)._nextNode_(self);
  240. };
  241. return $1;
  242. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.Node)})},
  243. args: [],
  244. source: "nextNode\x0a\x09^ self parent ifNotNil: [ :node |\x0a\x09\x09node nextNode: self ]",
  245. messageSends: ["ifNotNil:", "nextNode:", "parent"],
  246. referencedClasses: []
  247. }),
  248. smalltalk.Node);
  249. smalltalk.addMethod(
  250. smalltalk.method({
  251. selector: "nextNode:",
  252. category: 'accessing',
  253. fn: function (aNode){
  254. var self=this;
  255. var next;
  256. return smalltalk.withContext(function($ctx1) {
  257. var $1,$2;
  258. var $early={};
  259. try {
  260. next=_st(self._nodes())._at_ifAbsent_(_st(_st(self._nodes())._indexOf_(aNode)).__plus((1)),(function(){
  261. return smalltalk.withContext(function($ctx2) {
  262. $1=self;
  263. throw $early=[$1];
  264. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  265. $2=_st(next)._nextChild();
  266. return $2;
  267. }
  268. catch(e) {if(e===$early)return e[0]; throw e}
  269. }, function($ctx1) {$ctx1.fill(self,"nextNode:",{aNode:aNode,next:next},smalltalk.Node)})},
  270. args: ["aNode"],
  271. source: "nextNode: aNode\x0a\x09\x22Answer the next node after aNode.\x0a\x09Recurse into the possible children of the next node to answer the next node to be evaluated\x22\x0a\x09\x0a\x09| next |\x0a\x09\x0a\x09next := self nodes \x0a\x09\x09at: (self nodes indexOf: aNode) + 1\x0a\x09\x09ifAbsent: [ ^ self ].\x0a\x09\x0a\x09^ next nextChild",
  272. messageSends: ["at:ifAbsent:", "+", "indexOf:", "nodes", "nextChild"],
  273. referencedClasses: []
  274. }),
  275. smalltalk.Node);
  276. smalltalk.addMethod(
  277. smalltalk.method({
  278. selector: "nodes",
  279. category: 'accessing',
  280. fn: function (){
  281. var self=this;
  282. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  283. return smalltalk.withContext(function($ctx1) {
  284. var $2,$1;
  285. $2=self["@nodes"];
  286. if(($receiver = $2) == nil || $receiver == undefined){
  287. self["@nodes"]=_st($Array())._new();
  288. $1=self["@nodes"];
  289. } else {
  290. $1=$2;
  291. };
  292. return $1;
  293. }, function($ctx1) {$ctx1.fill(self,"nodes",{},smalltalk.Node)})},
  294. args: [],
  295. source: "nodes\x0a\x09^nodes ifNil: [nodes := Array new]",
  296. messageSends: ["ifNil:", "new"],
  297. referencedClasses: ["Array"]
  298. }),
  299. smalltalk.Node);
  300. smalltalk.addMethod(
  301. smalltalk.method({
  302. selector: "nodes:",
  303. category: 'building',
  304. fn: function (aCollection){
  305. var self=this;
  306. return smalltalk.withContext(function($ctx1) {
  307. self["@nodes"]=aCollection;
  308. _st(aCollection)._do_((function(each){
  309. return smalltalk.withContext(function($ctx2) {
  310. return _st(each)._parent_(self);
  311. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  312. return self}, function($ctx1) {$ctx1.fill(self,"nodes:",{aCollection:aCollection},smalltalk.Node)})},
  313. args: ["aCollection"],
  314. source: "nodes: aCollection\x0a\x09nodes := aCollection.\x0a\x09aCollection do: [ :each | each parent: self ]",
  315. messageSends: ["do:", "parent:"],
  316. referencedClasses: []
  317. }),
  318. smalltalk.Node);
  319. smalltalk.addMethod(
  320. smalltalk.method({
  321. selector: "parent",
  322. category: 'accessing',
  323. fn: function (){
  324. var self=this;
  325. return smalltalk.withContext(function($ctx1) {
  326. var $1;
  327. $1=self["@parent"];
  328. return $1;
  329. }, function($ctx1) {$ctx1.fill(self,"parent",{},smalltalk.Node)})},
  330. args: [],
  331. source: "parent\x0a\x09^ parent",
  332. messageSends: [],
  333. referencedClasses: []
  334. }),
  335. smalltalk.Node);
  336. smalltalk.addMethod(
  337. smalltalk.method({
  338. selector: "parent:",
  339. category: 'accessing',
  340. fn: function (aNode){
  341. var self=this;
  342. return smalltalk.withContext(function($ctx1) {
  343. self["@parent"]=aNode;
  344. return self}, function($ctx1) {$ctx1.fill(self,"parent:",{aNode:aNode},smalltalk.Node)})},
  345. args: ["aNode"],
  346. source: "parent: aNode\x0a\x09parent := aNode",
  347. messageSends: [],
  348. referencedClasses: []
  349. }),
  350. smalltalk.Node);
  351. smalltalk.addMethod(
  352. smalltalk.method({
  353. selector: "position",
  354. category: 'accessing',
  355. fn: function (){
  356. var self=this;
  357. return smalltalk.withContext(function($ctx1) {
  358. var $2,$3,$1;
  359. $2=self["@position"];
  360. if(($receiver = $2) == nil || $receiver == undefined){
  361. $3=self._parent();
  362. if(($receiver = $3) == nil || $receiver == undefined){
  363. $1=$3;
  364. } else {
  365. var node;
  366. node=$receiver;
  367. $1=_st(node)._position();
  368. };
  369. } else {
  370. $1=$2;
  371. };
  372. return $1;
  373. }, function($ctx1) {$ctx1.fill(self,"position",{},smalltalk.Node)})},
  374. args: [],
  375. source: "position\x0a\x09\x22answer the line and column of the receiver in the source code\x22\x0a\x09\x0a\x09^ position ifNil: [ \x0a\x09\x09self parent ifNotNil: [ :node | node position ] ]",
  376. messageSends: ["ifNil:", "ifNotNil:", "position", "parent"],
  377. referencedClasses: []
  378. }),
  379. smalltalk.Node);
  380. smalltalk.addMethod(
  381. smalltalk.method({
  382. selector: "position:",
  383. category: 'building',
  384. fn: function (aPosition){
  385. var self=this;
  386. return smalltalk.withContext(function($ctx1) {
  387. self["@position"]=aPosition;
  388. return self}, function($ctx1) {$ctx1.fill(self,"position:",{aPosition:aPosition},smalltalk.Node)})},
  389. args: ["aPosition"],
  390. source: "position: aPosition\x0a\x09position := aPosition",
  391. messageSends: [],
  392. referencedClasses: []
  393. }),
  394. smalltalk.Node);
  395. smalltalk.addMethod(
  396. smalltalk.method({
  397. selector: "shouldBeAliased",
  398. category: 'accessing',
  399. fn: function (){
  400. var self=this;
  401. return smalltalk.withContext(function($ctx1) {
  402. var $2,$1;
  403. $2=self["@shouldBeAliased"];
  404. if(($receiver = $2) == nil || $receiver == undefined){
  405. $1=false;
  406. } else {
  407. $1=$2;
  408. };
  409. return $1;
  410. }, function($ctx1) {$ctx1.fill(self,"shouldBeAliased",{},smalltalk.Node)})},
  411. args: [],
  412. source: "shouldBeAliased\x0a\x09^ shouldBeAliased ifNil: [ false ]",
  413. messageSends: ["ifNil:"],
  414. referencedClasses: []
  415. }),
  416. smalltalk.Node);
  417. smalltalk.addMethod(
  418. smalltalk.method({
  419. selector: "shouldBeAliased:",
  420. category: 'accessing',
  421. fn: function (aBoolean){
  422. var self=this;
  423. return smalltalk.withContext(function($ctx1) {
  424. self["@shouldBeAliased"]=aBoolean;
  425. return self}, function($ctx1) {$ctx1.fill(self,"shouldBeAliased:",{aBoolean:aBoolean},smalltalk.Node)})},
  426. args: ["aBoolean"],
  427. source: "shouldBeAliased: aBoolean\x0a\x09shouldBeAliased := aBoolean",
  428. messageSends: [],
  429. referencedClasses: []
  430. }),
  431. smalltalk.Node);
  432. smalltalk.addMethod(
  433. smalltalk.method({
  434. selector: "shouldBeInlined",
  435. category: 'accessing',
  436. fn: function (){
  437. var self=this;
  438. return smalltalk.withContext(function($ctx1) {
  439. var $2,$1;
  440. $2=self["@shouldBeInlined"];
  441. if(($receiver = $2) == nil || $receiver == undefined){
  442. $1=false;
  443. } else {
  444. $1=$2;
  445. };
  446. return $1;
  447. }, function($ctx1) {$ctx1.fill(self,"shouldBeInlined",{},smalltalk.Node)})},
  448. args: [],
  449. source: "shouldBeInlined\x0a\x09^ shouldBeInlined ifNil: [ false ]",
  450. messageSends: ["ifNil:"],
  451. referencedClasses: []
  452. }),
  453. smalltalk.Node);
  454. smalltalk.addMethod(
  455. smalltalk.method({
  456. selector: "shouldBeInlined:",
  457. category: 'accessing',
  458. fn: function (aBoolean){
  459. var self=this;
  460. return smalltalk.withContext(function($ctx1) {
  461. self["@shouldBeInlined"]=aBoolean;
  462. return self}, function($ctx1) {$ctx1.fill(self,"shouldBeInlined:",{aBoolean:aBoolean},smalltalk.Node)})},
  463. args: ["aBoolean"],
  464. source: "shouldBeInlined: aBoolean\x0a\x09shouldBeInlined := aBoolean",
  465. messageSends: [],
  466. referencedClasses: []
  467. }),
  468. smalltalk.Node);
  469. smalltalk.addMethod(
  470. smalltalk.method({
  471. selector: "stopOnStepping",
  472. category: 'testing',
  473. fn: function (){
  474. var self=this;
  475. return smalltalk.withContext(function($ctx1) {
  476. return false;
  477. }, function($ctx1) {$ctx1.fill(self,"stopOnStepping",{},smalltalk.Node)})},
  478. args: [],
  479. source: "stopOnStepping\x0a\x09^ false",
  480. messageSends: [],
  481. referencedClasses: []
  482. }),
  483. smalltalk.Node);
  484. smalltalk.addMethod(
  485. smalltalk.method({
  486. selector: "subtreeNeedsAliasing",
  487. category: 'testing',
  488. fn: function (){
  489. var self=this;
  490. return smalltalk.withContext(function($ctx1) {
  491. var $1;
  492. $1=_st(_st(self._shouldBeAliased())._or_((function(){
  493. return smalltalk.withContext(function($ctx2) {
  494. return self._shouldBeInlined();
  495. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._or_((function(){
  496. return smalltalk.withContext(function($ctx2) {
  497. return _st(_st(self._nodes())._detect_ifNone_((function(each){
  498. return smalltalk.withContext(function($ctx3) {
  499. return _st(each)._subtreeNeedsAliasing();
  500. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}),(function(){
  501. return smalltalk.withContext(function($ctx3) {
  502. return false;
  503. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}))).__tild_eq(false);
  504. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  505. return $1;
  506. }, function($ctx1) {$ctx1.fill(self,"subtreeNeedsAliasing",{},smalltalk.Node)})},
  507. args: [],
  508. source: "subtreeNeedsAliasing\x0a\x09^(self shouldBeAliased or: [ self shouldBeInlined ]) or: [\x0a\x09\x09(self nodes detect: [ :each | each subtreeNeedsAliasing ] ifNone: [ false ]) ~= false ]",
  509. messageSends: ["or:", "~=", "detect:ifNone:", "subtreeNeedsAliasing", "nodes", "shouldBeInlined", "shouldBeAliased"],
  510. referencedClasses: []
  511. }),
  512. smalltalk.Node);
  513. smalltalk.addClass('AssignmentNode', smalltalk.Node, ['left', 'right'], 'Compiler-AST');
  514. smalltalk.AssignmentNode.comment="I represent an assignment node.";
  515. smalltalk.addMethod(
  516. smalltalk.method({
  517. selector: "accept:",
  518. category: 'visiting',
  519. fn: function (aVisitor){
  520. var self=this;
  521. return smalltalk.withContext(function($ctx1) {
  522. var $1;
  523. $1=_st(aVisitor)._visitAssignmentNode_(self);
  524. return $1;
  525. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.AssignmentNode)})},
  526. args: ["aVisitor"],
  527. source: "accept: aVisitor\x0a\x09^ aVisitor visitAssignmentNode: self",
  528. messageSends: ["visitAssignmentNode:"],
  529. referencedClasses: []
  530. }),
  531. smalltalk.AssignmentNode);
  532. smalltalk.addMethod(
  533. smalltalk.method({
  534. selector: "isAssignmentNode",
  535. category: 'testing',
  536. fn: function (){
  537. var self=this;
  538. return smalltalk.withContext(function($ctx1) {
  539. return true;
  540. }, function($ctx1) {$ctx1.fill(self,"isAssignmentNode",{},smalltalk.AssignmentNode)})},
  541. args: [],
  542. source: "isAssignmentNode\x0a\x09^ true",
  543. messageSends: [],
  544. referencedClasses: []
  545. }),
  546. smalltalk.AssignmentNode);
  547. smalltalk.addMethod(
  548. smalltalk.method({
  549. selector: "left",
  550. category: 'accessing',
  551. fn: function (){
  552. var self=this;
  553. return smalltalk.withContext(function($ctx1) {
  554. var $1;
  555. $1=self["@left"];
  556. return $1;
  557. }, function($ctx1) {$ctx1.fill(self,"left",{},smalltalk.AssignmentNode)})},
  558. args: [],
  559. source: "left\x0a\x09^left",
  560. messageSends: [],
  561. referencedClasses: []
  562. }),
  563. smalltalk.AssignmentNode);
  564. smalltalk.addMethod(
  565. smalltalk.method({
  566. selector: "left:",
  567. category: 'accessing',
  568. fn: function (aNode){
  569. var self=this;
  570. return smalltalk.withContext(function($ctx1) {
  571. self["@left"]=aNode;
  572. _st(aNode)._parent_(self);
  573. return self}, function($ctx1) {$ctx1.fill(self,"left:",{aNode:aNode},smalltalk.AssignmentNode)})},
  574. args: ["aNode"],
  575. source: "left: aNode\x0a\x09left := aNode.\x0a\x09aNode parent: self",
  576. messageSends: ["parent:"],
  577. referencedClasses: []
  578. }),
  579. smalltalk.AssignmentNode);
  580. smalltalk.addMethod(
  581. smalltalk.method({
  582. selector: "nodes",
  583. category: 'accessing',
  584. fn: function (){
  585. var self=this;
  586. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  587. return smalltalk.withContext(function($ctx1) {
  588. var $1;
  589. $1=_st($Array())._with_with_(self._left(),self._right());
  590. return $1;
  591. }, function($ctx1) {$ctx1.fill(self,"nodes",{},smalltalk.AssignmentNode)})},
  592. args: [],
  593. source: "nodes\x0a\x09^ Array with: self left with: self right",
  594. messageSends: ["with:with:", "left", "right"],
  595. referencedClasses: ["Array"]
  596. }),
  597. smalltalk.AssignmentNode);
  598. smalltalk.addMethod(
  599. smalltalk.method({
  600. selector: "right",
  601. category: 'accessing',
  602. fn: function (){
  603. var self=this;
  604. return smalltalk.withContext(function($ctx1) {
  605. var $1;
  606. $1=self["@right"];
  607. return $1;
  608. }, function($ctx1) {$ctx1.fill(self,"right",{},smalltalk.AssignmentNode)})},
  609. args: [],
  610. source: "right\x0a\x09^right",
  611. messageSends: [],
  612. referencedClasses: []
  613. }),
  614. smalltalk.AssignmentNode);
  615. smalltalk.addMethod(
  616. smalltalk.method({
  617. selector: "right:",
  618. category: 'accessing',
  619. fn: function (aNode){
  620. var self=this;
  621. return smalltalk.withContext(function($ctx1) {
  622. self["@right"]=aNode;
  623. _st(aNode)._parent_(self);
  624. return self}, function($ctx1) {$ctx1.fill(self,"right:",{aNode:aNode},smalltalk.AssignmentNode)})},
  625. args: ["aNode"],
  626. source: "right: aNode\x0a\x09right := aNode.\x0a\x09aNode parent: self",
  627. messageSends: ["parent:"],
  628. referencedClasses: []
  629. }),
  630. smalltalk.AssignmentNode);
  631. smalltalk.addClass('BlockNode', smalltalk.Node, ['parameters', 'scope'], 'Compiler-AST');
  632. smalltalk.BlockNode.comment="I represent an block closure node.";
  633. smalltalk.addMethod(
  634. smalltalk.method({
  635. selector: "accept:",
  636. category: 'visiting',
  637. fn: function (aVisitor){
  638. var self=this;
  639. return smalltalk.withContext(function($ctx1) {
  640. var $1;
  641. $1=_st(aVisitor)._visitBlockNode_(self);
  642. return $1;
  643. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.BlockNode)})},
  644. args: ["aVisitor"],
  645. source: "accept: aVisitor\x0a\x09^ aVisitor visitBlockNode: self",
  646. messageSends: ["visitBlockNode:"],
  647. referencedClasses: []
  648. }),
  649. smalltalk.BlockNode);
  650. smalltalk.addMethod(
  651. smalltalk.method({
  652. selector: "isBlockNode",
  653. category: 'testing',
  654. fn: function (){
  655. var self=this;
  656. return smalltalk.withContext(function($ctx1) {
  657. return true;
  658. }, function($ctx1) {$ctx1.fill(self,"isBlockNode",{},smalltalk.BlockNode)})},
  659. args: [],
  660. source: "isBlockNode\x0a\x09^true",
  661. messageSends: [],
  662. referencedClasses: []
  663. }),
  664. smalltalk.BlockNode);
  665. smalltalk.addMethod(
  666. smalltalk.method({
  667. selector: "nextNode:",
  668. category: 'accessing',
  669. fn: function (aNode){
  670. var self=this;
  671. return smalltalk.withContext(function($ctx1) {
  672. var $1;
  673. $1=self;
  674. return $1;
  675. }, function($ctx1) {$ctx1.fill(self,"nextNode:",{aNode:aNode},smalltalk.BlockNode)})},
  676. args: ["aNode"],
  677. source: "nextNode: aNode\x0a\x09\x22Answer the receiver as we want to avoid eager evaluation\x22\x0a\x09\x0a\x09^ self",
  678. messageSends: [],
  679. referencedClasses: []
  680. }),
  681. smalltalk.BlockNode);
  682. smalltalk.addMethod(
  683. smalltalk.method({
  684. selector: "parameters",
  685. category: 'accessing',
  686. fn: function (){
  687. var self=this;
  688. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  689. return smalltalk.withContext(function($ctx1) {
  690. var $2,$1;
  691. $2=self["@parameters"];
  692. if(($receiver = $2) == nil || $receiver == undefined){
  693. self["@parameters"]=_st($Array())._new();
  694. $1=self["@parameters"];
  695. } else {
  696. $1=$2;
  697. };
  698. return $1;
  699. }, function($ctx1) {$ctx1.fill(self,"parameters",{},smalltalk.BlockNode)})},
  700. args: [],
  701. source: "parameters\x0a\x09^parameters ifNil: [parameters := Array new]",
  702. messageSends: ["ifNil:", "new"],
  703. referencedClasses: ["Array"]
  704. }),
  705. smalltalk.BlockNode);
  706. smalltalk.addMethod(
  707. smalltalk.method({
  708. selector: "parameters:",
  709. category: 'accessing',
  710. fn: function (aCollection){
  711. var self=this;
  712. return smalltalk.withContext(function($ctx1) {
  713. self["@parameters"]=aCollection;
  714. return self}, function($ctx1) {$ctx1.fill(self,"parameters:",{aCollection:aCollection},smalltalk.BlockNode)})},
  715. args: ["aCollection"],
  716. source: "parameters: aCollection\x0a\x09parameters := aCollection",
  717. messageSends: [],
  718. referencedClasses: []
  719. }),
  720. smalltalk.BlockNode);
  721. smalltalk.addMethod(
  722. smalltalk.method({
  723. selector: "scope",
  724. category: 'accessing',
  725. fn: function (){
  726. var self=this;
  727. return smalltalk.withContext(function($ctx1) {
  728. var $1;
  729. $1=self["@scope"];
  730. return $1;
  731. }, function($ctx1) {$ctx1.fill(self,"scope",{},smalltalk.BlockNode)})},
  732. args: [],
  733. source: "scope\x0a\x09^ scope",
  734. messageSends: [],
  735. referencedClasses: []
  736. }),
  737. smalltalk.BlockNode);
  738. smalltalk.addMethod(
  739. smalltalk.method({
  740. selector: "scope:",
  741. category: 'accessing',
  742. fn: function (aLexicalScope){
  743. var self=this;
  744. return smalltalk.withContext(function($ctx1) {
  745. self["@scope"]=aLexicalScope;
  746. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aLexicalScope:aLexicalScope},smalltalk.BlockNode)})},
  747. args: ["aLexicalScope"],
  748. source: "scope: aLexicalScope\x0a\x09scope := aLexicalScope",
  749. messageSends: [],
  750. referencedClasses: []
  751. }),
  752. smalltalk.BlockNode);
  753. smalltalk.addMethod(
  754. smalltalk.method({
  755. selector: "subtreeNeedsAliasing",
  756. category: 'testing',
  757. fn: function (){
  758. var self=this;
  759. return smalltalk.withContext(function($ctx1) {
  760. var $1;
  761. $1=_st(self._shouldBeAliased())._or_((function(){
  762. return smalltalk.withContext(function($ctx2) {
  763. return self._shouldBeInlined();
  764. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  765. return $1;
  766. }, function($ctx1) {$ctx1.fill(self,"subtreeNeedsAliasing",{},smalltalk.BlockNode)})},
  767. args: [],
  768. source: "subtreeNeedsAliasing\x0a\x09^ self shouldBeAliased or: [ self shouldBeInlined ]",
  769. messageSends: ["or:", "shouldBeInlined", "shouldBeAliased"],
  770. referencedClasses: []
  771. }),
  772. smalltalk.BlockNode);
  773. smalltalk.addClass('CascadeNode', smalltalk.Node, ['receiver'], 'Compiler-AST');
  774. smalltalk.CascadeNode.comment="I represent an cascade node.";
  775. smalltalk.addMethod(
  776. smalltalk.method({
  777. selector: "accept:",
  778. category: 'visiting',
  779. fn: function (aVisitor){
  780. var self=this;
  781. return smalltalk.withContext(function($ctx1) {
  782. var $1;
  783. $1=_st(aVisitor)._visitCascadeNode_(self);
  784. return $1;
  785. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.CascadeNode)})},
  786. args: ["aVisitor"],
  787. source: "accept: aVisitor\x0a\x09^ aVisitor visitCascadeNode: self",
  788. messageSends: ["visitCascadeNode:"],
  789. referencedClasses: []
  790. }),
  791. smalltalk.CascadeNode);
  792. smalltalk.addMethod(
  793. smalltalk.method({
  794. selector: "receiver",
  795. category: 'accessing',
  796. fn: function (){
  797. var self=this;
  798. return smalltalk.withContext(function($ctx1) {
  799. var $1;
  800. $1=self["@receiver"];
  801. return $1;
  802. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.CascadeNode)})},
  803. args: [],
  804. source: "receiver\x0a\x09^receiver",
  805. messageSends: [],
  806. referencedClasses: []
  807. }),
  808. smalltalk.CascadeNode);
  809. smalltalk.addMethod(
  810. smalltalk.method({
  811. selector: "receiver:",
  812. category: 'accessing',
  813. fn: function (aNode){
  814. var self=this;
  815. return smalltalk.withContext(function($ctx1) {
  816. self["@receiver"]=aNode;
  817. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{aNode:aNode},smalltalk.CascadeNode)})},
  818. args: ["aNode"],
  819. source: "receiver: aNode\x0a\x09receiver := aNode",
  820. messageSends: [],
  821. referencedClasses: []
  822. }),
  823. smalltalk.CascadeNode);
  824. smalltalk.addClass('DynamicArrayNode', smalltalk.Node, [], 'Compiler-AST');
  825. smalltalk.DynamicArrayNode.comment="I represent an dynamic array node.";
  826. smalltalk.addMethod(
  827. smalltalk.method({
  828. selector: "accept:",
  829. category: 'visiting',
  830. fn: function (aVisitor){
  831. var self=this;
  832. return smalltalk.withContext(function($ctx1) {
  833. var $1;
  834. $1=_st(aVisitor)._visitDynamicArrayNode_(self);
  835. return $1;
  836. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.DynamicArrayNode)})},
  837. args: ["aVisitor"],
  838. source: "accept: aVisitor\x0a\x09^ aVisitor visitDynamicArrayNode: self",
  839. messageSends: ["visitDynamicArrayNode:"],
  840. referencedClasses: []
  841. }),
  842. smalltalk.DynamicArrayNode);
  843. smalltalk.addClass('DynamicDictionaryNode', smalltalk.Node, [], 'Compiler-AST');
  844. smalltalk.DynamicDictionaryNode.comment="I represent an dynamic dictionary node.";
  845. smalltalk.addMethod(
  846. smalltalk.method({
  847. selector: "accept:",
  848. category: 'visiting',
  849. fn: function (aVisitor){
  850. var self=this;
  851. return smalltalk.withContext(function($ctx1) {
  852. var $1;
  853. $1=_st(aVisitor)._visitDynamicDictionaryNode_(self);
  854. return $1;
  855. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.DynamicDictionaryNode)})},
  856. args: ["aVisitor"],
  857. source: "accept: aVisitor\x0a\x09^ aVisitor visitDynamicDictionaryNode: self",
  858. messageSends: ["visitDynamicDictionaryNode:"],
  859. referencedClasses: []
  860. }),
  861. smalltalk.DynamicDictionaryNode);
  862. smalltalk.addClass('JSStatementNode', smalltalk.Node, ['source'], 'Compiler-AST');
  863. smalltalk.JSStatementNode.comment="I represent an JavaScript statement node.";
  864. smalltalk.addMethod(
  865. smalltalk.method({
  866. selector: "accept:",
  867. category: 'visiting',
  868. fn: function (aVisitor){
  869. var self=this;
  870. return smalltalk.withContext(function($ctx1) {
  871. var $1;
  872. $1=_st(aVisitor)._visitJSStatementNode_(self);
  873. return $1;
  874. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.JSStatementNode)})},
  875. args: ["aVisitor"],
  876. source: "accept: aVisitor\x0a\x09^ aVisitor visitJSStatementNode: self",
  877. messageSends: ["visitJSStatementNode:"],
  878. referencedClasses: []
  879. }),
  880. smalltalk.JSStatementNode);
  881. smalltalk.addMethod(
  882. smalltalk.method({
  883. selector: "isJSStatementNode",
  884. category: 'testing',
  885. fn: function (){
  886. var self=this;
  887. return smalltalk.withContext(function($ctx1) {
  888. return true;
  889. }, function($ctx1) {$ctx1.fill(self,"isJSStatementNode",{},smalltalk.JSStatementNode)})},
  890. args: [],
  891. source: "isJSStatementNode\x0a\x09^ true",
  892. messageSends: [],
  893. referencedClasses: []
  894. }),
  895. smalltalk.JSStatementNode);
  896. smalltalk.addMethod(
  897. smalltalk.method({
  898. selector: "source",
  899. category: 'accessing',
  900. fn: function (){
  901. var self=this;
  902. return smalltalk.withContext(function($ctx1) {
  903. var $2,$1;
  904. $2=self["@source"];
  905. if(($receiver = $2) == nil || $receiver == undefined){
  906. $1="";
  907. } else {
  908. $1=$2;
  909. };
  910. return $1;
  911. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.JSStatementNode)})},
  912. args: [],
  913. source: "source\x0a\x09^source ifNil: ['']",
  914. messageSends: ["ifNil:"],
  915. referencedClasses: []
  916. }),
  917. smalltalk.JSStatementNode);
  918. smalltalk.addMethod(
  919. smalltalk.method({
  920. selector: "source:",
  921. category: 'accessing',
  922. fn: function (aString){
  923. var self=this;
  924. return smalltalk.withContext(function($ctx1) {
  925. self["@source"]=aString;
  926. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.JSStatementNode)})},
  927. args: ["aString"],
  928. source: "source: aString\x0a\x09source := aString",
  929. messageSends: [],
  930. referencedClasses: []
  931. }),
  932. smalltalk.JSStatementNode);
  933. smalltalk.addClass('MethodNode', smalltalk.Node, ['selector', 'arguments', 'source', 'scope', 'classReferences', 'messageSends', 'superSends'], 'Compiler-AST');
  934. smalltalk.MethodNode.comment="I represent an method node.\x0a\x0aA method node must be the root and only method node of a valid AST.";
  935. smalltalk.addMethod(
  936. smalltalk.method({
  937. selector: "accept:",
  938. category: 'visiting',
  939. fn: function (aVisitor){
  940. var self=this;
  941. return smalltalk.withContext(function($ctx1) {
  942. var $1;
  943. $1=_st(aVisitor)._visitMethodNode_(self);
  944. return $1;
  945. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.MethodNode)})},
  946. args: ["aVisitor"],
  947. source: "accept: aVisitor\x0a\x09^ aVisitor visitMethodNode: self",
  948. messageSends: ["visitMethodNode:"],
  949. referencedClasses: []
  950. }),
  951. smalltalk.MethodNode);
  952. smalltalk.addMethod(
  953. smalltalk.method({
  954. selector: "arguments",
  955. category: 'accessing',
  956. fn: function (){
  957. var self=this;
  958. return smalltalk.withContext(function($ctx1) {
  959. var $2,$1;
  960. $2=self["@arguments"];
  961. if(($receiver = $2) == nil || $receiver == undefined){
  962. $1=[];
  963. } else {
  964. $1=$2;
  965. };
  966. return $1;
  967. }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.MethodNode)})},
  968. args: [],
  969. source: "arguments\x0a\x09^arguments ifNil: [#()]",
  970. messageSends: ["ifNil:"],
  971. referencedClasses: []
  972. }),
  973. smalltalk.MethodNode);
  974. smalltalk.addMethod(
  975. smalltalk.method({
  976. selector: "arguments:",
  977. category: 'accessing',
  978. fn: function (aCollection){
  979. var self=this;
  980. return smalltalk.withContext(function($ctx1) {
  981. self["@arguments"]=aCollection;
  982. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection},smalltalk.MethodNode)})},
  983. args: ["aCollection"],
  984. source: "arguments: aCollection\x0a\x09arguments := aCollection",
  985. messageSends: [],
  986. referencedClasses: []
  987. }),
  988. smalltalk.MethodNode);
  989. smalltalk.addMethod(
  990. smalltalk.method({
  991. selector: "classReferences",
  992. category: 'accessing',
  993. fn: function (){
  994. var self=this;
  995. return smalltalk.withContext(function($ctx1) {
  996. var $1;
  997. $1=self["@classReferences"];
  998. return $1;
  999. }, function($ctx1) {$ctx1.fill(self,"classReferences",{},smalltalk.MethodNode)})},
  1000. args: [],
  1001. source: "classReferences\x0a\x09^ classReferences",
  1002. messageSends: [],
  1003. referencedClasses: []
  1004. }),
  1005. smalltalk.MethodNode);
  1006. smalltalk.addMethod(
  1007. smalltalk.method({
  1008. selector: "classReferences:",
  1009. category: 'accessing',
  1010. fn: function (aCollection){
  1011. var self=this;
  1012. return smalltalk.withContext(function($ctx1) {
  1013. self["@classReferences"]=aCollection;
  1014. return self}, function($ctx1) {$ctx1.fill(self,"classReferences:",{aCollection:aCollection},smalltalk.MethodNode)})},
  1015. args: ["aCollection"],
  1016. source: "classReferences: aCollection\x0a\x09classReferences := aCollection",
  1017. messageSends: [],
  1018. referencedClasses: []
  1019. }),
  1020. smalltalk.MethodNode);
  1021. smalltalk.addMethod(
  1022. smalltalk.method({
  1023. selector: "extent",
  1024. category: 'accessing',
  1025. fn: function (){
  1026. var self=this;
  1027. return smalltalk.withContext(function($ctx1) {
  1028. var $1;
  1029. $1=_st(_st(_st(self._source())._lines())._size()).__at(_st(_st(_st(_st(self._source())._lines())._last())._size()).__plus((1)));
  1030. return $1;
  1031. }, function($ctx1) {$ctx1.fill(self,"extent",{},smalltalk.MethodNode)})},
  1032. args: [],
  1033. source: "extent\x0a\x09^ self source lines size @ (self source lines last size + 1)",
  1034. messageSends: ["@", "+", "size", "last", "lines", "source"],
  1035. referencedClasses: []
  1036. }),
  1037. smalltalk.MethodNode);
  1038. smalltalk.addMethod(
  1039. smalltalk.method({
  1040. selector: "messageSends",
  1041. category: 'accessing',
  1042. fn: function (){
  1043. var self=this;
  1044. return smalltalk.withContext(function($ctx1) {
  1045. var $1;
  1046. $1=self["@messageSends"];
  1047. return $1;
  1048. }, function($ctx1) {$ctx1.fill(self,"messageSends",{},smalltalk.MethodNode)})},
  1049. args: [],
  1050. source: "messageSends\x0a\x09^ messageSends",
  1051. messageSends: [],
  1052. referencedClasses: []
  1053. }),
  1054. smalltalk.MethodNode);
  1055. smalltalk.addMethod(
  1056. smalltalk.method({
  1057. selector: "messageSends:",
  1058. category: 'accessing',
  1059. fn: function (aCollection){
  1060. var self=this;
  1061. return smalltalk.withContext(function($ctx1) {
  1062. self["@messageSends"]=aCollection;
  1063. return self}, function($ctx1) {$ctx1.fill(self,"messageSends:",{aCollection:aCollection},smalltalk.MethodNode)})},
  1064. args: ["aCollection"],
  1065. source: "messageSends: aCollection\x0a\x09messageSends := aCollection",
  1066. messageSends: [],
  1067. referencedClasses: []
  1068. }),
  1069. smalltalk.MethodNode);
  1070. smalltalk.addMethod(
  1071. smalltalk.method({
  1072. selector: "scope",
  1073. category: 'accessing',
  1074. fn: function (){
  1075. var self=this;
  1076. return smalltalk.withContext(function($ctx1) {
  1077. var $1;
  1078. $1=self["@scope"];
  1079. return $1;
  1080. }, function($ctx1) {$ctx1.fill(self,"scope",{},smalltalk.MethodNode)})},
  1081. args: [],
  1082. source: "scope\x0a\x09^ scope",
  1083. messageSends: [],
  1084. referencedClasses: []
  1085. }),
  1086. smalltalk.MethodNode);
  1087. smalltalk.addMethod(
  1088. smalltalk.method({
  1089. selector: "scope:",
  1090. category: 'accessing',
  1091. fn: function (aMethodScope){
  1092. var self=this;
  1093. return smalltalk.withContext(function($ctx1) {
  1094. self["@scope"]=aMethodScope;
  1095. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aMethodScope:aMethodScope},smalltalk.MethodNode)})},
  1096. args: ["aMethodScope"],
  1097. source: "scope: aMethodScope\x0a\x09scope := aMethodScope",
  1098. messageSends: [],
  1099. referencedClasses: []
  1100. }),
  1101. smalltalk.MethodNode);
  1102. smalltalk.addMethod(
  1103. smalltalk.method({
  1104. selector: "selector",
  1105. category: 'accessing',
  1106. fn: function (){
  1107. var self=this;
  1108. return smalltalk.withContext(function($ctx1) {
  1109. var $1;
  1110. $1=self["@selector"];
  1111. return $1;
  1112. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.MethodNode)})},
  1113. args: [],
  1114. source: "selector\x0a\x09^selector",
  1115. messageSends: [],
  1116. referencedClasses: []
  1117. }),
  1118. smalltalk.MethodNode);
  1119. smalltalk.addMethod(
  1120. smalltalk.method({
  1121. selector: "selector:",
  1122. category: 'accessing',
  1123. fn: function (aString){
  1124. var self=this;
  1125. return smalltalk.withContext(function($ctx1) {
  1126. self["@selector"]=aString;
  1127. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.MethodNode)})},
  1128. args: ["aString"],
  1129. source: "selector: aString\x0a\x09selector := aString",
  1130. messageSends: [],
  1131. referencedClasses: []
  1132. }),
  1133. smalltalk.MethodNode);
  1134. smalltalk.addMethod(
  1135. smalltalk.method({
  1136. selector: "source",
  1137. category: 'accessing',
  1138. fn: function (){
  1139. var self=this;
  1140. return smalltalk.withContext(function($ctx1) {
  1141. var $1;
  1142. $1=self["@source"];
  1143. return $1;
  1144. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.MethodNode)})},
  1145. args: [],
  1146. source: "source\x0a\x09^source",
  1147. messageSends: [],
  1148. referencedClasses: []
  1149. }),
  1150. smalltalk.MethodNode);
  1151. smalltalk.addMethod(
  1152. smalltalk.method({
  1153. selector: "source:",
  1154. category: 'accessing',
  1155. fn: function (aString){
  1156. var self=this;
  1157. return smalltalk.withContext(function($ctx1) {
  1158. self["@source"]=aString;
  1159. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.MethodNode)})},
  1160. args: ["aString"],
  1161. source: "source: aString\x0a\x09source := aString",
  1162. messageSends: [],
  1163. referencedClasses: []
  1164. }),
  1165. smalltalk.MethodNode);
  1166. smalltalk.addMethod(
  1167. smalltalk.method({
  1168. selector: "superSends",
  1169. category: 'accessing',
  1170. fn: function (){
  1171. var self=this;
  1172. return smalltalk.withContext(function($ctx1) {
  1173. var $1;
  1174. $1=self["@superSends"];
  1175. return $1;
  1176. }, function($ctx1) {$ctx1.fill(self,"superSends",{},smalltalk.MethodNode)})},
  1177. args: [],
  1178. source: "superSends\x0a\x09^ superSends",
  1179. messageSends: [],
  1180. referencedClasses: []
  1181. }),
  1182. smalltalk.MethodNode);
  1183. smalltalk.addMethod(
  1184. smalltalk.method({
  1185. selector: "superSends:",
  1186. category: 'accessing',
  1187. fn: function (aCollection){
  1188. var self=this;
  1189. return smalltalk.withContext(function($ctx1) {
  1190. self["@superSends"]=aCollection;
  1191. return self}, function($ctx1) {$ctx1.fill(self,"superSends:",{aCollection:aCollection},smalltalk.MethodNode)})},
  1192. args: ["aCollection"],
  1193. source: "superSends: aCollection\x0a\x09superSends := aCollection",
  1194. messageSends: [],
  1195. referencedClasses: []
  1196. }),
  1197. smalltalk.MethodNode);
  1198. smalltalk.addClass('ReturnNode', smalltalk.Node, ['scope'], 'Compiler-AST');
  1199. smalltalk.ReturnNode.comment="I represent an return node. At the AST level, there is not difference between a local return or non-local return.";
  1200. smalltalk.addMethod(
  1201. smalltalk.method({
  1202. selector: "accept:",
  1203. category: 'visiting',
  1204. fn: function (aVisitor){
  1205. var self=this;
  1206. return smalltalk.withContext(function($ctx1) {
  1207. var $1;
  1208. $1=_st(aVisitor)._visitReturnNode_(self);
  1209. return $1;
  1210. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.ReturnNode)})},
  1211. args: ["aVisitor"],
  1212. source: "accept: aVisitor\x0a\x09^ aVisitor visitReturnNode: self",
  1213. messageSends: ["visitReturnNode:"],
  1214. referencedClasses: []
  1215. }),
  1216. smalltalk.ReturnNode);
  1217. smalltalk.addMethod(
  1218. smalltalk.method({
  1219. selector: "isReturnNode",
  1220. category: 'testing',
  1221. fn: function (){
  1222. var self=this;
  1223. return smalltalk.withContext(function($ctx1) {
  1224. return true;
  1225. }, function($ctx1) {$ctx1.fill(self,"isReturnNode",{},smalltalk.ReturnNode)})},
  1226. args: [],
  1227. source: "isReturnNode\x0a\x09^ true",
  1228. messageSends: [],
  1229. referencedClasses: []
  1230. }),
  1231. smalltalk.ReturnNode);
  1232. smalltalk.addMethod(
  1233. smalltalk.method({
  1234. selector: "nonLocalReturn",
  1235. category: 'testing',
  1236. fn: function (){
  1237. var self=this;
  1238. return smalltalk.withContext(function($ctx1) {
  1239. var $1;
  1240. $1=_st(_st(self._scope())._isMethodScope())._not();
  1241. return $1;
  1242. }, function($ctx1) {$ctx1.fill(self,"nonLocalReturn",{},smalltalk.ReturnNode)})},
  1243. args: [],
  1244. source: "nonLocalReturn\x0a\x09^ self scope isMethodScope not",
  1245. messageSends: ["not", "isMethodScope", "scope"],
  1246. referencedClasses: []
  1247. }),
  1248. smalltalk.ReturnNode);
  1249. smalltalk.addMethod(
  1250. smalltalk.method({
  1251. selector: "scope",
  1252. category: 'accessing',
  1253. fn: function (){
  1254. var self=this;
  1255. return smalltalk.withContext(function($ctx1) {
  1256. var $1;
  1257. $1=self["@scope"];
  1258. return $1;
  1259. }, function($ctx1) {$ctx1.fill(self,"scope",{},smalltalk.ReturnNode)})},
  1260. args: [],
  1261. source: "scope\x0a\x09^ scope",
  1262. messageSends: [],
  1263. referencedClasses: []
  1264. }),
  1265. smalltalk.ReturnNode);
  1266. smalltalk.addMethod(
  1267. smalltalk.method({
  1268. selector: "scope:",
  1269. category: 'accessing',
  1270. fn: function (aLexicalScope){
  1271. var self=this;
  1272. return smalltalk.withContext(function($ctx1) {
  1273. self["@scope"]=aLexicalScope;
  1274. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aLexicalScope:aLexicalScope},smalltalk.ReturnNode)})},
  1275. args: ["aLexicalScope"],
  1276. source: "scope: aLexicalScope\x0a\x09scope := aLexicalScope",
  1277. messageSends: [],
  1278. referencedClasses: []
  1279. }),
  1280. smalltalk.ReturnNode);
  1281. smalltalk.addClass('SendNode', smalltalk.Node, ['selector', 'arguments', 'receiver', 'superSend', 'index'], 'Compiler-AST');
  1282. smalltalk.SendNode.comment="I represent an message send node.";
  1283. smalltalk.addMethod(
  1284. smalltalk.method({
  1285. selector: "accept:",
  1286. category: 'visiting',
  1287. fn: function (aVisitor){
  1288. var self=this;
  1289. return smalltalk.withContext(function($ctx1) {
  1290. var $1;
  1291. $1=_st(aVisitor)._visitSendNode_(self);
  1292. return $1;
  1293. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.SendNode)})},
  1294. args: ["aVisitor"],
  1295. source: "accept: aVisitor\x0a\x09^ aVisitor visitSendNode: self",
  1296. messageSends: ["visitSendNode:"],
  1297. referencedClasses: []
  1298. }),
  1299. smalltalk.SendNode);
  1300. smalltalk.addMethod(
  1301. smalltalk.method({
  1302. selector: "arguments",
  1303. category: 'accessing',
  1304. fn: function (){
  1305. var self=this;
  1306. return smalltalk.withContext(function($ctx1) {
  1307. var $2,$1;
  1308. $2=self["@arguments"];
  1309. if(($receiver = $2) == nil || $receiver == undefined){
  1310. self["@arguments"]=[];
  1311. $1=self["@arguments"];
  1312. } else {
  1313. $1=$2;
  1314. };
  1315. return $1;
  1316. }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.SendNode)})},
  1317. args: [],
  1318. source: "arguments\x0a\x09^arguments ifNil: [arguments := #()]",
  1319. messageSends: ["ifNil:"],
  1320. referencedClasses: []
  1321. }),
  1322. smalltalk.SendNode);
  1323. smalltalk.addMethod(
  1324. smalltalk.method({
  1325. selector: "arguments:",
  1326. category: 'accessing',
  1327. fn: function (aCollection){
  1328. var self=this;
  1329. return smalltalk.withContext(function($ctx1) {
  1330. self["@arguments"]=aCollection;
  1331. _st(aCollection)._do_((function(each){
  1332. return smalltalk.withContext(function($ctx2) {
  1333. return _st(each)._parent_(self);
  1334. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1335. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection},smalltalk.SendNode)})},
  1336. args: ["aCollection"],
  1337. source: "arguments: aCollection\x0a\x09arguments := aCollection.\x0a\x09aCollection do: [ :each | each parent: self ]",
  1338. messageSends: ["do:", "parent:"],
  1339. referencedClasses: []
  1340. }),
  1341. smalltalk.SendNode);
  1342. smalltalk.addMethod(
  1343. smalltalk.method({
  1344. selector: "cascadeNodeWithMessages:",
  1345. category: 'accessing',
  1346. fn: function (aCollection){
  1347. var self=this;
  1348. var first;
  1349. function $SendNode(){return smalltalk.SendNode||(typeof SendNode=="undefined"?nil:SendNode)}
  1350. function $CascadeNode(){return smalltalk.CascadeNode||(typeof CascadeNode=="undefined"?nil:CascadeNode)}
  1351. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  1352. return smalltalk.withContext(function($ctx1) {
  1353. var $1,$2,$4,$5,$3;
  1354. $1=_st($SendNode())._new();
  1355. _st($1)._selector_(self._selector());
  1356. _st($1)._arguments_(self._arguments());
  1357. $2=_st($1)._yourself();
  1358. first=$2;
  1359. $4=_st($CascadeNode())._new();
  1360. _st($4)._receiver_(self._receiver());
  1361. _st($4)._nodes_(_st(_st($Array())._with_(first)).__comma(aCollection));
  1362. $5=_st($4)._yourself();
  1363. $3=$5;
  1364. return $3;
  1365. }, function($ctx1) {$ctx1.fill(self,"cascadeNodeWithMessages:",{aCollection:aCollection,first:first},smalltalk.SendNode)})},
  1366. args: ["aCollection"],
  1367. source: "cascadeNodeWithMessages: aCollection\x0a\x09| first |\x0a\x09first := SendNode new\x0a\x09\x09selector: self selector;\x0a\x09\x09arguments: self arguments;\x0a\x09\x09yourself.\x0a\x09^CascadeNode new\x0a\x09\x09receiver: self receiver;\x0a\x09\x09nodes: (Array with: first), aCollection;\x0a\x09\x09yourself",
  1368. messageSends: ["selector:", "selector", "new", "arguments:", "arguments", "yourself", "receiver:", "receiver", "nodes:", ",", "with:"],
  1369. referencedClasses: ["SendNode", "CascadeNode", "Array"]
  1370. }),
  1371. smalltalk.SendNode);
  1372. smalltalk.addMethod(
  1373. smalltalk.method({
  1374. selector: "index",
  1375. category: 'accessing',
  1376. fn: function (){
  1377. var self=this;
  1378. return smalltalk.withContext(function($ctx1) {
  1379. var $1;
  1380. $1=self["@index"];
  1381. return $1;
  1382. }, function($ctx1) {$ctx1.fill(self,"index",{},smalltalk.SendNode)})},
  1383. args: [],
  1384. source: "index\x0a\x09^ index",
  1385. messageSends: [],
  1386. referencedClasses: []
  1387. }),
  1388. smalltalk.SendNode);
  1389. smalltalk.addMethod(
  1390. smalltalk.method({
  1391. selector: "index:",
  1392. category: 'accessing',
  1393. fn: function (anInteger){
  1394. var self=this;
  1395. return smalltalk.withContext(function($ctx1) {
  1396. self["@index"]=anInteger;
  1397. return self}, function($ctx1) {$ctx1.fill(self,"index:",{anInteger:anInteger},smalltalk.SendNode)})},
  1398. args: ["anInteger"],
  1399. source: "index: anInteger\x0a\x09index := anInteger",
  1400. messageSends: [],
  1401. referencedClasses: []
  1402. }),
  1403. smalltalk.SendNode);
  1404. smalltalk.addMethod(
  1405. smalltalk.method({
  1406. selector: "isSendNode",
  1407. category: 'testing',
  1408. fn: function (){
  1409. var self=this;
  1410. return smalltalk.withContext(function($ctx1) {
  1411. return true;
  1412. }, function($ctx1) {$ctx1.fill(self,"isSendNode",{},smalltalk.SendNode)})},
  1413. args: [],
  1414. source: "isSendNode\x0a\x09^ true",
  1415. messageSends: [],
  1416. referencedClasses: []
  1417. }),
  1418. smalltalk.SendNode);
  1419. smalltalk.addMethod(
  1420. smalltalk.method({
  1421. selector: "nodes",
  1422. category: 'accessing',
  1423. fn: function (){
  1424. var self=this;
  1425. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  1426. return smalltalk.withContext(function($ctx1) {
  1427. var $2,$3,$1;
  1428. $2=_st($Array())._withAll_(self._arguments());
  1429. _st($2)._add_(self._receiver());
  1430. $3=_st($2)._yourself();
  1431. $1=$3;
  1432. return $1;
  1433. }, function($ctx1) {$ctx1.fill(self,"nodes",{},smalltalk.SendNode)})},
  1434. args: [],
  1435. source: "nodes\x0a\x09^ (Array withAll: self arguments)\x0a\x09\x09add: self receiver;\x0a\x09\x09yourself",
  1436. messageSends: ["add:", "receiver", "withAll:", "arguments", "yourself"],
  1437. referencedClasses: ["Array"]
  1438. }),
  1439. smalltalk.SendNode);
  1440. smalltalk.addMethod(
  1441. smalltalk.method({
  1442. selector: "receiver",
  1443. category: 'accessing',
  1444. fn: function (){
  1445. var self=this;
  1446. return smalltalk.withContext(function($ctx1) {
  1447. var $1;
  1448. $1=self["@receiver"];
  1449. return $1;
  1450. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.SendNode)})},
  1451. args: [],
  1452. source: "receiver\x0a\x09^receiver",
  1453. messageSends: [],
  1454. referencedClasses: []
  1455. }),
  1456. smalltalk.SendNode);
  1457. smalltalk.addMethod(
  1458. smalltalk.method({
  1459. selector: "receiver:",
  1460. category: 'accessing',
  1461. fn: function (aNode){
  1462. var self=this;
  1463. return smalltalk.withContext(function($ctx1) {
  1464. var $1;
  1465. self["@receiver"]=aNode;
  1466. $1=_st(aNode)._isNode();
  1467. if(smalltalk.assert($1)){
  1468. _st(aNode)._parent_(self);
  1469. };
  1470. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{aNode:aNode},smalltalk.SendNode)})},
  1471. args: ["aNode"],
  1472. source: "receiver: aNode\x0a\x09receiver := aNode.\x0a\x09aNode isNode ifTrue: [\x0a\x09\x09aNode parent: self ]",
  1473. messageSends: ["ifTrue:", "parent:", "isNode"],
  1474. referencedClasses: []
  1475. }),
  1476. smalltalk.SendNode);
  1477. smalltalk.addMethod(
  1478. smalltalk.method({
  1479. selector: "selector",
  1480. category: 'accessing',
  1481. fn: function (){
  1482. var self=this;
  1483. return smalltalk.withContext(function($ctx1) {
  1484. var $1;
  1485. $1=self["@selector"];
  1486. return $1;
  1487. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.SendNode)})},
  1488. args: [],
  1489. source: "selector\x0a\x09^selector",
  1490. messageSends: [],
  1491. referencedClasses: []
  1492. }),
  1493. smalltalk.SendNode);
  1494. smalltalk.addMethod(
  1495. smalltalk.method({
  1496. selector: "selector:",
  1497. category: 'accessing',
  1498. fn: function (aString){
  1499. var self=this;
  1500. return smalltalk.withContext(function($ctx1) {
  1501. self["@selector"]=aString;
  1502. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.SendNode)})},
  1503. args: ["aString"],
  1504. source: "selector: aString\x0a\x09selector := aString",
  1505. messageSends: [],
  1506. referencedClasses: []
  1507. }),
  1508. smalltalk.SendNode);
  1509. smalltalk.addMethod(
  1510. smalltalk.method({
  1511. selector: "stopOnStepping",
  1512. category: 'testing',
  1513. fn: function (){
  1514. var self=this;
  1515. return smalltalk.withContext(function($ctx1) {
  1516. return true;
  1517. }, function($ctx1) {$ctx1.fill(self,"stopOnStepping",{},smalltalk.SendNode)})},
  1518. args: [],
  1519. source: "stopOnStepping\x0a\x09^ true",
  1520. messageSends: [],
  1521. referencedClasses: []
  1522. }),
  1523. smalltalk.SendNode);
  1524. smalltalk.addMethod(
  1525. smalltalk.method({
  1526. selector: "superSend",
  1527. category: 'accessing',
  1528. fn: function (){
  1529. var self=this;
  1530. return smalltalk.withContext(function($ctx1) {
  1531. var $2,$1;
  1532. $2=self["@superSend"];
  1533. if(($receiver = $2) == nil || $receiver == undefined){
  1534. $1=false;
  1535. } else {
  1536. $1=$2;
  1537. };
  1538. return $1;
  1539. }, function($ctx1) {$ctx1.fill(self,"superSend",{},smalltalk.SendNode)})},
  1540. args: [],
  1541. source: "superSend\x0a\x09^ superSend ifNil: [ false ]",
  1542. messageSends: ["ifNil:"],
  1543. referencedClasses: []
  1544. }),
  1545. smalltalk.SendNode);
  1546. smalltalk.addMethod(
  1547. smalltalk.method({
  1548. selector: "superSend:",
  1549. category: 'accessing',
  1550. fn: function (aBoolean){
  1551. var self=this;
  1552. return smalltalk.withContext(function($ctx1) {
  1553. self["@superSend"]=aBoolean;
  1554. return self}, function($ctx1) {$ctx1.fill(self,"superSend:",{aBoolean:aBoolean},smalltalk.SendNode)})},
  1555. args: ["aBoolean"],
  1556. source: "superSend: aBoolean\x0a\x09superSend := aBoolean",
  1557. messageSends: [],
  1558. referencedClasses: []
  1559. }),
  1560. smalltalk.SendNode);
  1561. smalltalk.addMethod(
  1562. smalltalk.method({
  1563. selector: "valueForReceiver:",
  1564. category: 'accessing',
  1565. fn: function (anObject){
  1566. var self=this;
  1567. function $SendNode(){return smalltalk.SendNode||(typeof SendNode=="undefined"?nil:SendNode)}
  1568. return smalltalk.withContext(function($ctx1) {
  1569. var $2,$3,$5,$4,$6,$1;
  1570. $2=_st($SendNode())._new();
  1571. _st($2)._position_(self._position());
  1572. $3=$2;
  1573. $5=self._receiver();
  1574. if(($receiver = $5) == nil || $receiver == undefined){
  1575. $4=anObject;
  1576. } else {
  1577. $4=_st(self._receiver())._valueForReceiver_(anObject);
  1578. };
  1579. _st($3)._receiver_($4);
  1580. _st($2)._selector_(self._selector());
  1581. _st($2)._arguments_(self._arguments());
  1582. $6=_st($2)._yourself();
  1583. $1=$6;
  1584. return $1;
  1585. }, function($ctx1) {$ctx1.fill(self,"valueForReceiver:",{anObject:anObject},smalltalk.SendNode)})},
  1586. args: ["anObject"],
  1587. source: "valueForReceiver: anObject\x0a\x09^SendNode new\x0a\x09\x09position: self position;\x0a\x09\x09receiver: (self receiver\x0a\x09\x09ifNil: [anObject]\x0a\x09\x09ifNotNil: [self receiver valueForReceiver: anObject]);\x0a\x09\x09selector: self selector;\x0a\x09\x09arguments: self arguments;\x0a\x09\x09yourself",
  1588. messageSends: ["position:", "position", "new", "receiver:", "ifNil:ifNotNil:", "valueForReceiver:", "receiver", "selector:", "selector", "arguments:", "arguments", "yourself"],
  1589. referencedClasses: ["SendNode"]
  1590. }),
  1591. smalltalk.SendNode);
  1592. smalltalk.addClass('SequenceNode', smalltalk.Node, ['temps', 'scope'], 'Compiler-AST');
  1593. smalltalk.SequenceNode.comment="I represent an sequence node. A sequence represent a set of instructions inside the same scope (the method scope or a block scope).";
  1594. smalltalk.addMethod(
  1595. smalltalk.method({
  1596. selector: "accept:",
  1597. category: 'visiting',
  1598. fn: function (aVisitor){
  1599. var self=this;
  1600. return smalltalk.withContext(function($ctx1) {
  1601. var $1;
  1602. $1=_st(aVisitor)._visitSequenceNode_(self);
  1603. return $1;
  1604. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.SequenceNode)})},
  1605. args: ["aVisitor"],
  1606. source: "accept: aVisitor\x0a\x09^ aVisitor visitSequenceNode: self",
  1607. messageSends: ["visitSequenceNode:"],
  1608. referencedClasses: []
  1609. }),
  1610. smalltalk.SequenceNode);
  1611. smalltalk.addMethod(
  1612. smalltalk.method({
  1613. selector: "asBlockSequenceNode",
  1614. category: 'testing',
  1615. fn: function (){
  1616. var self=this;
  1617. function $BlockSequenceNode(){return smalltalk.BlockSequenceNode||(typeof BlockSequenceNode=="undefined"?nil:BlockSequenceNode)}
  1618. return smalltalk.withContext(function($ctx1) {
  1619. var $2,$3,$1;
  1620. $2=_st($BlockSequenceNode())._new();
  1621. _st($2)._position_(self._position());
  1622. _st($2)._nodes_(self._nodes());
  1623. _st($2)._temps_(self._temps());
  1624. $3=_st($2)._yourself();
  1625. $1=$3;
  1626. return $1;
  1627. }, function($ctx1) {$ctx1.fill(self,"asBlockSequenceNode",{},smalltalk.SequenceNode)})},
  1628. args: [],
  1629. source: "asBlockSequenceNode\x0a\x09^BlockSequenceNode new\x0a\x09\x09position: self position;\x0a\x09\x09nodes: self nodes;\x0a\x09\x09temps: self temps;\x0a\x09\x09yourself",
  1630. messageSends: ["position:", "position", "new", "nodes:", "nodes", "temps:", "temps", "yourself"],
  1631. referencedClasses: ["BlockSequenceNode"]
  1632. }),
  1633. smalltalk.SequenceNode);
  1634. smalltalk.addMethod(
  1635. smalltalk.method({
  1636. selector: "scope",
  1637. category: 'accessing',
  1638. fn: function (){
  1639. var self=this;
  1640. return smalltalk.withContext(function($ctx1) {
  1641. var $1;
  1642. $1=self["@scope"];
  1643. return $1;
  1644. }, function($ctx1) {$ctx1.fill(self,"scope",{},smalltalk.SequenceNode)})},
  1645. args: [],
  1646. source: "scope\x0a\x09^ scope",
  1647. messageSends: [],
  1648. referencedClasses: []
  1649. }),
  1650. smalltalk.SequenceNode);
  1651. smalltalk.addMethod(
  1652. smalltalk.method({
  1653. selector: "scope:",
  1654. category: 'accessing',
  1655. fn: function (aLexicalScope){
  1656. var self=this;
  1657. return smalltalk.withContext(function($ctx1) {
  1658. self["@scope"]=aLexicalScope;
  1659. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aLexicalScope:aLexicalScope},smalltalk.SequenceNode)})},
  1660. args: ["aLexicalScope"],
  1661. source: "scope: aLexicalScope\x0a\x09scope := aLexicalScope",
  1662. messageSends: [],
  1663. referencedClasses: []
  1664. }),
  1665. smalltalk.SequenceNode);
  1666. smalltalk.addMethod(
  1667. smalltalk.method({
  1668. selector: "temps",
  1669. category: 'accessing',
  1670. fn: function (){
  1671. var self=this;
  1672. return smalltalk.withContext(function($ctx1) {
  1673. var $2,$1;
  1674. $2=self["@temps"];
  1675. if(($receiver = $2) == nil || $receiver == undefined){
  1676. $1=[];
  1677. } else {
  1678. $1=$2;
  1679. };
  1680. return $1;
  1681. }, function($ctx1) {$ctx1.fill(self,"temps",{},smalltalk.SequenceNode)})},
  1682. args: [],
  1683. source: "temps\x0a\x09^temps ifNil: [#()]",
  1684. messageSends: ["ifNil:"],
  1685. referencedClasses: []
  1686. }),
  1687. smalltalk.SequenceNode);
  1688. smalltalk.addMethod(
  1689. smalltalk.method({
  1690. selector: "temps:",
  1691. category: 'accessing',
  1692. fn: function (aCollection){
  1693. var self=this;
  1694. return smalltalk.withContext(function($ctx1) {
  1695. self["@temps"]=aCollection;
  1696. return self}, function($ctx1) {$ctx1.fill(self,"temps:",{aCollection:aCollection},smalltalk.SequenceNode)})},
  1697. args: ["aCollection"],
  1698. source: "temps: aCollection\x0a\x09temps := aCollection",
  1699. messageSends: [],
  1700. referencedClasses: []
  1701. }),
  1702. smalltalk.SequenceNode);
  1703. smalltalk.addClass('BlockSequenceNode', smalltalk.SequenceNode, [], 'Compiler-AST');
  1704. smalltalk.BlockSequenceNode.comment="I represent an special sequence node for block scopes.";
  1705. smalltalk.addMethod(
  1706. smalltalk.method({
  1707. selector: "accept:",
  1708. category: 'visiting',
  1709. fn: function (aVisitor){
  1710. var self=this;
  1711. return smalltalk.withContext(function($ctx1) {
  1712. var $1;
  1713. $1=_st(aVisitor)._visitBlockSequenceNode_(self);
  1714. return $1;
  1715. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.BlockSequenceNode)})},
  1716. args: ["aVisitor"],
  1717. source: "accept: aVisitor\x0a\x09^ aVisitor visitBlockSequenceNode: self",
  1718. messageSends: ["visitBlockSequenceNode:"],
  1719. referencedClasses: []
  1720. }),
  1721. smalltalk.BlockSequenceNode);
  1722. smalltalk.addMethod(
  1723. smalltalk.method({
  1724. selector: "isBlockSequenceNode",
  1725. category: 'testing',
  1726. fn: function (){
  1727. var self=this;
  1728. return smalltalk.withContext(function($ctx1) {
  1729. return true;
  1730. }, function($ctx1) {$ctx1.fill(self,"isBlockSequenceNode",{},smalltalk.BlockSequenceNode)})},
  1731. args: [],
  1732. source: "isBlockSequenceNode\x0a\x09^true",
  1733. messageSends: [],
  1734. referencedClasses: []
  1735. }),
  1736. smalltalk.BlockSequenceNode);
  1737. smalltalk.addClass('ValueNode', smalltalk.Node, ['value'], 'Compiler-AST');
  1738. smalltalk.ValueNode.comment="I represent a value node.";
  1739. smalltalk.addMethod(
  1740. smalltalk.method({
  1741. selector: "accept:",
  1742. category: 'visiting',
  1743. fn: function (aVisitor){
  1744. var self=this;
  1745. return smalltalk.withContext(function($ctx1) {
  1746. var $1;
  1747. $1=_st(aVisitor)._visitValueNode_(self);
  1748. return $1;
  1749. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.ValueNode)})},
  1750. args: ["aVisitor"],
  1751. source: "accept: aVisitor\x0a\x09^ aVisitor visitValueNode: self",
  1752. messageSends: ["visitValueNode:"],
  1753. referencedClasses: []
  1754. }),
  1755. smalltalk.ValueNode);
  1756. smalltalk.addMethod(
  1757. smalltalk.method({
  1758. selector: "isImmutable",
  1759. category: 'testing',
  1760. fn: function (){
  1761. var self=this;
  1762. return smalltalk.withContext(function($ctx1) {
  1763. var $1;
  1764. $1=_st(self._value())._isImmutable();
  1765. return $1;
  1766. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.ValueNode)})},
  1767. args: [],
  1768. source: "isImmutable\x0a\x09^ self value isImmutable",
  1769. messageSends: ["isImmutable", "value"],
  1770. referencedClasses: []
  1771. }),
  1772. smalltalk.ValueNode);
  1773. smalltalk.addMethod(
  1774. smalltalk.method({
  1775. selector: "isValueNode",
  1776. category: 'testing',
  1777. fn: function (){
  1778. var self=this;
  1779. return smalltalk.withContext(function($ctx1) {
  1780. return true;
  1781. }, function($ctx1) {$ctx1.fill(self,"isValueNode",{},smalltalk.ValueNode)})},
  1782. args: [],
  1783. source: "isValueNode\x0a\x09^true",
  1784. messageSends: [],
  1785. referencedClasses: []
  1786. }),
  1787. smalltalk.ValueNode);
  1788. smalltalk.addMethod(
  1789. smalltalk.method({
  1790. selector: "value",
  1791. category: 'accessing',
  1792. fn: function (){
  1793. var self=this;
  1794. return smalltalk.withContext(function($ctx1) {
  1795. var $1;
  1796. $1=self["@value"];
  1797. return $1;
  1798. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.ValueNode)})},
  1799. args: [],
  1800. source: "value\x0a\x09^value",
  1801. messageSends: [],
  1802. referencedClasses: []
  1803. }),
  1804. smalltalk.ValueNode);
  1805. smalltalk.addMethod(
  1806. smalltalk.method({
  1807. selector: "value:",
  1808. category: 'accessing',
  1809. fn: function (anObject){
  1810. var self=this;
  1811. return smalltalk.withContext(function($ctx1) {
  1812. self["@value"]=anObject;
  1813. return self}, function($ctx1) {$ctx1.fill(self,"value:",{anObject:anObject},smalltalk.ValueNode)})},
  1814. args: ["anObject"],
  1815. source: "value: anObject\x0a\x09value := anObject",
  1816. messageSends: [],
  1817. referencedClasses: []
  1818. }),
  1819. smalltalk.ValueNode);
  1820. smalltalk.addClass('VariableNode', smalltalk.ValueNode, ['assigned', 'binding'], 'Compiler-AST');
  1821. smalltalk.VariableNode.comment="I represent an variable node.";
  1822. smalltalk.addMethod(
  1823. smalltalk.method({
  1824. selector: "accept:",
  1825. category: 'visiting',
  1826. fn: function (aVisitor){
  1827. var self=this;
  1828. return smalltalk.withContext(function($ctx1) {
  1829. var $1;
  1830. $1=_st(aVisitor)._visitVariableNode_(self);
  1831. return $1;
  1832. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.VariableNode)})},
  1833. args: ["aVisitor"],
  1834. source: "accept: aVisitor\x0a\x09^ aVisitor visitVariableNode: self",
  1835. messageSends: ["visitVariableNode:"],
  1836. referencedClasses: []
  1837. }),
  1838. smalltalk.VariableNode);
  1839. smalltalk.addMethod(
  1840. smalltalk.method({
  1841. selector: "alias",
  1842. category: 'accessing',
  1843. fn: function (){
  1844. var self=this;
  1845. return smalltalk.withContext(function($ctx1) {
  1846. var $1;
  1847. $1=_st(self._binding())._alias();
  1848. return $1;
  1849. }, function($ctx1) {$ctx1.fill(self,"alias",{},smalltalk.VariableNode)})},
  1850. args: [],
  1851. source: "alias\x0a\x09^ self binding alias",
  1852. messageSends: ["alias", "binding"],
  1853. referencedClasses: []
  1854. }),
  1855. smalltalk.VariableNode);
  1856. smalltalk.addMethod(
  1857. smalltalk.method({
  1858. selector: "assigned",
  1859. category: 'accessing',
  1860. fn: function (){
  1861. var self=this;
  1862. return smalltalk.withContext(function($ctx1) {
  1863. var $2,$1;
  1864. $2=self["@assigned"];
  1865. if(($receiver = $2) == nil || $receiver == undefined){
  1866. $1=false;
  1867. } else {
  1868. $1=$2;
  1869. };
  1870. return $1;
  1871. }, function($ctx1) {$ctx1.fill(self,"assigned",{},smalltalk.VariableNode)})},
  1872. args: [],
  1873. source: "assigned\x0a\x09^assigned ifNil: [false]",
  1874. messageSends: ["ifNil:"],
  1875. referencedClasses: []
  1876. }),
  1877. smalltalk.VariableNode);
  1878. smalltalk.addMethod(
  1879. smalltalk.method({
  1880. selector: "assigned:",
  1881. category: 'accessing',
  1882. fn: function (aBoolean){
  1883. var self=this;
  1884. return smalltalk.withContext(function($ctx1) {
  1885. self["@assigned"]=aBoolean;
  1886. return self}, function($ctx1) {$ctx1.fill(self,"assigned:",{aBoolean:aBoolean},smalltalk.VariableNode)})},
  1887. args: ["aBoolean"],
  1888. source: "assigned: aBoolean\x0a\x09assigned := aBoolean",
  1889. messageSends: [],
  1890. referencedClasses: []
  1891. }),
  1892. smalltalk.VariableNode);
  1893. smalltalk.addMethod(
  1894. smalltalk.method({
  1895. selector: "beAssigned",
  1896. category: 'accessing',
  1897. fn: function (){
  1898. var self=this;
  1899. return smalltalk.withContext(function($ctx1) {
  1900. _st(self._binding())._validateAssignment();
  1901. self["@assigned"]=true;
  1902. return self}, function($ctx1) {$ctx1.fill(self,"beAssigned",{},smalltalk.VariableNode)})},
  1903. args: [],
  1904. source: "beAssigned\x0a\x09self binding validateAssignment.\x0a\x09assigned := true",
  1905. messageSends: ["validateAssignment", "binding"],
  1906. referencedClasses: []
  1907. }),
  1908. smalltalk.VariableNode);
  1909. smalltalk.addMethod(
  1910. smalltalk.method({
  1911. selector: "binding",
  1912. category: 'accessing',
  1913. fn: function (){
  1914. var self=this;
  1915. return smalltalk.withContext(function($ctx1) {
  1916. var $1;
  1917. $1=self["@binding"];
  1918. return $1;
  1919. }, function($ctx1) {$ctx1.fill(self,"binding",{},smalltalk.VariableNode)})},
  1920. args: [],
  1921. source: "binding\x0a\x09^ binding",
  1922. messageSends: [],
  1923. referencedClasses: []
  1924. }),
  1925. smalltalk.VariableNode);
  1926. smalltalk.addMethod(
  1927. smalltalk.method({
  1928. selector: "binding:",
  1929. category: 'accessing',
  1930. fn: function (aScopeVar){
  1931. var self=this;
  1932. return smalltalk.withContext(function($ctx1) {
  1933. self["@binding"]=aScopeVar;
  1934. return self}, function($ctx1) {$ctx1.fill(self,"binding:",{aScopeVar:aScopeVar},smalltalk.VariableNode)})},
  1935. args: ["aScopeVar"],
  1936. source: "binding: aScopeVar\x0a\x09binding := aScopeVar",
  1937. messageSends: [],
  1938. referencedClasses: []
  1939. }),
  1940. smalltalk.VariableNode);
  1941. smalltalk.addMethod(
  1942. smalltalk.method({
  1943. selector: "isImmutable",
  1944. category: 'testing',
  1945. fn: function (){
  1946. var self=this;
  1947. return smalltalk.withContext(function($ctx1) {
  1948. return false;
  1949. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.VariableNode)})},
  1950. args: [],
  1951. source: "isImmutable\x0a\x09^false",
  1952. messageSends: [],
  1953. referencedClasses: []
  1954. }),
  1955. smalltalk.VariableNode);
  1956. smalltalk.addClass('ClassReferenceNode', smalltalk.VariableNode, [], 'Compiler-AST');
  1957. smalltalk.ClassReferenceNode.comment="I represent an class reference node.";
  1958. smalltalk.addMethod(
  1959. smalltalk.method({
  1960. selector: "accept:",
  1961. category: 'visiting',
  1962. fn: function (aVisitor){
  1963. var self=this;
  1964. return smalltalk.withContext(function($ctx1) {
  1965. var $1;
  1966. $1=_st(aVisitor)._visitClassReferenceNode_(self);
  1967. return $1;
  1968. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.ClassReferenceNode)})},
  1969. args: ["aVisitor"],
  1970. source: "accept: aVisitor\x0a\x09^ aVisitor visitClassReferenceNode: self",
  1971. messageSends: ["visitClassReferenceNode:"],
  1972. referencedClasses: []
  1973. }),
  1974. smalltalk.ClassReferenceNode);
  1975. smalltalk.addMethod(
  1976. smalltalk.method({
  1977. selector: "isNode",
  1978. category: '*Compiler-AST',
  1979. fn: function (){
  1980. var self=this;
  1981. return smalltalk.withContext(function($ctx1) {
  1982. return false;
  1983. }, function($ctx1) {$ctx1.fill(self,"isNode",{},smalltalk.Object)})},
  1984. args: [],
  1985. source: "isNode\x0a\x09^ false",
  1986. messageSends: [],
  1987. referencedClasses: []
  1988. }),
  1989. smalltalk.Object);
  1990. smalltalk.addMethod(
  1991. smalltalk.method({
  1992. selector: "ast",
  1993. category: '*Compiler-AST',
  1994. fn: function (){
  1995. var self=this;
  1996. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1997. return smalltalk.withContext(function($ctx1) {
  1998. var $1;
  1999. _st(self._source())._ifEmpty_((function(){
  2000. return smalltalk.withContext(function($ctx2) {
  2001. return self._error_("Method source is empty");
  2002. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2003. $1=_st(_st($Smalltalk())._current())._parse_(self._source());
  2004. return $1;
  2005. }, function($ctx1) {$ctx1.fill(self,"ast",{},smalltalk.CompiledMethod)})},
  2006. args: [],
  2007. source: "ast\x0a\x09self source ifEmpty: [ self error: 'Method source is empty' ].\x0a\x09\x0a\x09^ Smalltalk current parse: self source",
  2008. messageSends: ["ifEmpty:", "error:", "source", "parse:", "current"],
  2009. referencedClasses: ["Smalltalk"]
  2010. }),
  2011. smalltalk.CompiledMethod);