Compiler-AST.js 57 KB

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