Compiler-AST.js 67 KB

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