Compiler-AST.js 61 KB

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