Compiler-AST.js 64 KB

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