Compiler-AST.deploy.js 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540
  1. define("amber/Compiler-AST", ["amber_vm/smalltalk","amber_vm/nil","amber_vm/_st"], function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Compiler-AST');
  3. smalltalk.addClass('Node', smalltalk.Object, ['parent', 'position', 'nodes', 'shouldBeInlined', 'shouldBeAliased'], 'Compiler-AST');
  4. smalltalk.addMethod(
  5. smalltalk.method({
  6. selector: "accept:",
  7. fn: function (aVisitor){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx1) {
  10. var $1;
  11. $1=_st(aVisitor)._visitNode_(self);
  12. return $1;
  13. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.Node)})},
  14. messageSends: ["visitNode:"]}),
  15. smalltalk.Node);
  16. smalltalk.addMethod(
  17. smalltalk.method({
  18. selector: "addNode:",
  19. fn: function (aNode){
  20. var self=this;
  21. return smalltalk.withContext(function($ctx1) {
  22. _st(self._nodes())._add_(aNode);
  23. _st(aNode)._parent_(self);
  24. return self}, function($ctx1) {$ctx1.fill(self,"addNode:",{aNode:aNode},smalltalk.Node)})},
  25. messageSends: ["add:", "nodes", "parent:"]}),
  26. smalltalk.Node);
  27. smalltalk.addMethod(
  28. smalltalk.method({
  29. selector: "extent",
  30. fn: function (){
  31. var self=this;
  32. return smalltalk.withContext(function($ctx1) {
  33. var $2,$3,$1;
  34. $2=self._nextNode();
  35. if(($receiver = $2) == nil || $receiver == undefined){
  36. $3=self._parent();
  37. if(($receiver = $3) == nil || $receiver == undefined){
  38. $1=$3;
  39. } else {
  40. var node;
  41. node=$receiver;
  42. $1=_st(node)._extent();
  43. };
  44. } else {
  45. var node;
  46. node=$receiver;
  47. $1=_st(node)._position();
  48. };
  49. return $1;
  50. }, function($ctx1) {$ctx1.fill(self,"extent",{},smalltalk.Node)})},
  51. messageSends: ["ifNil:ifNotNil:", "ifNotNil:", "extent", "parent", "position", "nextNode"]}),
  52. smalltalk.Node);
  53. smalltalk.addMethod(
  54. smalltalk.method({
  55. selector: "isAssignmentNode",
  56. fn: function (){
  57. var self=this;
  58. return smalltalk.withContext(function($ctx1) {
  59. return false;
  60. }, function($ctx1) {$ctx1.fill(self,"isAssignmentNode",{},smalltalk.Node)})},
  61. messageSends: []}),
  62. smalltalk.Node);
  63. smalltalk.addMethod(
  64. smalltalk.method({
  65. selector: "isBlockNode",
  66. fn: function (){
  67. var self=this;
  68. return smalltalk.withContext(function($ctx1) {
  69. return false;
  70. }, function($ctx1) {$ctx1.fill(self,"isBlockNode",{},smalltalk.Node)})},
  71. messageSends: []}),
  72. smalltalk.Node);
  73. smalltalk.addMethod(
  74. smalltalk.method({
  75. selector: "isBlockSequenceNode",
  76. fn: function (){
  77. var self=this;
  78. return smalltalk.withContext(function($ctx1) {
  79. return false;
  80. }, function($ctx1) {$ctx1.fill(self,"isBlockSequenceNode",{},smalltalk.Node)})},
  81. messageSends: []}),
  82. smalltalk.Node);
  83. smalltalk.addMethod(
  84. smalltalk.method({
  85. selector: "isImmutable",
  86. fn: function (){
  87. var self=this;
  88. return smalltalk.withContext(function($ctx1) {
  89. return false;
  90. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.Node)})},
  91. messageSends: []}),
  92. smalltalk.Node);
  93. smalltalk.addMethod(
  94. smalltalk.method({
  95. selector: "isJSStatementNode",
  96. fn: function (){
  97. var self=this;
  98. return smalltalk.withContext(function($ctx1) {
  99. return false;
  100. }, function($ctx1) {$ctx1.fill(self,"isJSStatementNode",{},smalltalk.Node)})},
  101. messageSends: []}),
  102. smalltalk.Node);
  103. smalltalk.addMethod(
  104. smalltalk.method({
  105. selector: "isNode",
  106. fn: function (){
  107. var self=this;
  108. return smalltalk.withContext(function($ctx1) {
  109. return true;
  110. }, function($ctx1) {$ctx1.fill(self,"isNode",{},smalltalk.Node)})},
  111. messageSends: []}),
  112. smalltalk.Node);
  113. smalltalk.addMethod(
  114. smalltalk.method({
  115. selector: "isReturnNode",
  116. fn: function (){
  117. var self=this;
  118. return smalltalk.withContext(function($ctx1) {
  119. return false;
  120. }, function($ctx1) {$ctx1.fill(self,"isReturnNode",{},smalltalk.Node)})},
  121. messageSends: []}),
  122. smalltalk.Node);
  123. smalltalk.addMethod(
  124. smalltalk.method({
  125. selector: "isSendNode",
  126. fn: function (){
  127. var self=this;
  128. return smalltalk.withContext(function($ctx1) {
  129. return false;
  130. }, function($ctx1) {$ctx1.fill(self,"isSendNode",{},smalltalk.Node)})},
  131. messageSends: []}),
  132. smalltalk.Node);
  133. smalltalk.addMethod(
  134. smalltalk.method({
  135. selector: "isValueNode",
  136. fn: function (){
  137. var self=this;
  138. return smalltalk.withContext(function($ctx1) {
  139. return false;
  140. }, function($ctx1) {$ctx1.fill(self,"isValueNode",{},smalltalk.Node)})},
  141. messageSends: []}),
  142. smalltalk.Node);
  143. smalltalk.addMethod(
  144. smalltalk.method({
  145. selector: "nextNode",
  146. fn: function (){
  147. var self=this;
  148. return smalltalk.withContext(function($ctx1) {
  149. var $2,$1;
  150. $2=self._parent();
  151. if(($receiver = $2) == nil || $receiver == undefined){
  152. $1=$2;
  153. } else {
  154. var node;
  155. node=$receiver;
  156. $1=_st(node)._nextNode_(self);
  157. };
  158. return $1;
  159. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.Node)})},
  160. messageSends: ["ifNotNil:", "nextNode:", "parent"]}),
  161. smalltalk.Node);
  162. smalltalk.addMethod(
  163. smalltalk.method({
  164. selector: "nextNode:",
  165. fn: function (aNode){
  166. var self=this;
  167. return smalltalk.withContext(function($ctx1) {
  168. var $1;
  169. $1=_st(self._nodes())._at_ifAbsent_(_st(_st(self._nodes())._indexOf_(aNode)).__plus((1)),(function(){
  170. return smalltalk.withContext(function($ctx2) {
  171. return nil;
  172. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  173. return $1;
  174. }, function($ctx1) {$ctx1.fill(self,"nextNode:",{aNode:aNode},smalltalk.Node)})},
  175. messageSends: ["at:ifAbsent:", "+", "indexOf:", "nodes"]}),
  176. smalltalk.Node);
  177. smalltalk.addMethod(
  178. smalltalk.method({
  179. selector: "nodes",
  180. fn: function (){
  181. var self=this;
  182. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  183. return smalltalk.withContext(function($ctx1) {
  184. var $2,$1;
  185. $2=self["@nodes"];
  186. if(($receiver = $2) == nil || $receiver == undefined){
  187. self["@nodes"]=_st($Array())._new();
  188. $1=self["@nodes"];
  189. } else {
  190. $1=$2;
  191. };
  192. return $1;
  193. }, function($ctx1) {$ctx1.fill(self,"nodes",{},smalltalk.Node)})},
  194. messageSends: ["ifNil:", "new"]}),
  195. smalltalk.Node);
  196. smalltalk.addMethod(
  197. smalltalk.method({
  198. selector: "nodes:",
  199. fn: function (aCollection){
  200. var self=this;
  201. return smalltalk.withContext(function($ctx1) {
  202. self["@nodes"]=aCollection;
  203. _st(aCollection)._do_((function(each){
  204. return smalltalk.withContext(function($ctx2) {
  205. return _st(each)._parent_(self);
  206. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  207. return self}, function($ctx1) {$ctx1.fill(self,"nodes:",{aCollection:aCollection},smalltalk.Node)})},
  208. messageSends: ["do:", "parent:"]}),
  209. smalltalk.Node);
  210. smalltalk.addMethod(
  211. smalltalk.method({
  212. selector: "parent",
  213. fn: function (){
  214. var self=this;
  215. return smalltalk.withContext(function($ctx1) {
  216. var $1;
  217. $1=self["@parent"];
  218. return $1;
  219. }, function($ctx1) {$ctx1.fill(self,"parent",{},smalltalk.Node)})},
  220. messageSends: []}),
  221. smalltalk.Node);
  222. smalltalk.addMethod(
  223. smalltalk.method({
  224. selector: "parent:",
  225. fn: function (aNode){
  226. var self=this;
  227. return smalltalk.withContext(function($ctx1) {
  228. self["@parent"]=aNode;
  229. return self}, function($ctx1) {$ctx1.fill(self,"parent:",{aNode:aNode},smalltalk.Node)})},
  230. messageSends: []}),
  231. smalltalk.Node);
  232. smalltalk.addMethod(
  233. smalltalk.method({
  234. selector: "position",
  235. fn: function (){
  236. var self=this;
  237. return smalltalk.withContext(function($ctx1) {
  238. var $2,$3,$1;
  239. $2=self["@position"];
  240. if(($receiver = $2) == nil || $receiver == undefined){
  241. $3=self._parent();
  242. if(($receiver = $3) == nil || $receiver == undefined){
  243. $1=$3;
  244. } else {
  245. var node;
  246. node=$receiver;
  247. $1=_st(node)._position();
  248. };
  249. } else {
  250. $1=$2;
  251. };
  252. return $1;
  253. }, function($ctx1) {$ctx1.fill(self,"position",{},smalltalk.Node)})},
  254. messageSends: ["ifNil:", "ifNotNil:", "position", "parent"]}),
  255. smalltalk.Node);
  256. smalltalk.addMethod(
  257. smalltalk.method({
  258. selector: "position:",
  259. fn: function (aPosition){
  260. var self=this;
  261. return smalltalk.withContext(function($ctx1) {
  262. self["@position"]=aPosition;
  263. return self}, function($ctx1) {$ctx1.fill(self,"position:",{aPosition:aPosition},smalltalk.Node)})},
  264. messageSends: []}),
  265. smalltalk.Node);
  266. smalltalk.addMethod(
  267. smalltalk.method({
  268. selector: "shouldBeAliased",
  269. fn: function (){
  270. var self=this;
  271. return smalltalk.withContext(function($ctx1) {
  272. var $2,$1;
  273. $2=self["@shouldBeAliased"];
  274. if(($receiver = $2) == nil || $receiver == undefined){
  275. $1=false;
  276. } else {
  277. $1=$2;
  278. };
  279. return $1;
  280. }, function($ctx1) {$ctx1.fill(self,"shouldBeAliased",{},smalltalk.Node)})},
  281. messageSends: ["ifNil:"]}),
  282. smalltalk.Node);
  283. smalltalk.addMethod(
  284. smalltalk.method({
  285. selector: "shouldBeAliased:",
  286. fn: function (aBoolean){
  287. var self=this;
  288. return smalltalk.withContext(function($ctx1) {
  289. self["@shouldBeAliased"]=aBoolean;
  290. return self}, function($ctx1) {$ctx1.fill(self,"shouldBeAliased:",{aBoolean:aBoolean},smalltalk.Node)})},
  291. messageSends: []}),
  292. smalltalk.Node);
  293. smalltalk.addMethod(
  294. smalltalk.method({
  295. selector: "shouldBeInlined",
  296. fn: function (){
  297. var self=this;
  298. return smalltalk.withContext(function($ctx1) {
  299. var $2,$1;
  300. $2=self["@shouldBeInlined"];
  301. if(($receiver = $2) == nil || $receiver == undefined){
  302. $1=false;
  303. } else {
  304. $1=$2;
  305. };
  306. return $1;
  307. }, function($ctx1) {$ctx1.fill(self,"shouldBeInlined",{},smalltalk.Node)})},
  308. messageSends: ["ifNil:"]}),
  309. smalltalk.Node);
  310. smalltalk.addMethod(
  311. smalltalk.method({
  312. selector: "shouldBeInlined:",
  313. fn: function (aBoolean){
  314. var self=this;
  315. return smalltalk.withContext(function($ctx1) {
  316. self["@shouldBeInlined"]=aBoolean;
  317. return self}, function($ctx1) {$ctx1.fill(self,"shouldBeInlined:",{aBoolean:aBoolean},smalltalk.Node)})},
  318. messageSends: []}),
  319. smalltalk.Node);
  320. smalltalk.addMethod(
  321. smalltalk.method({
  322. selector: "stopOnStepping",
  323. fn: function (){
  324. var self=this;
  325. return smalltalk.withContext(function($ctx1) {
  326. return false;
  327. }, function($ctx1) {$ctx1.fill(self,"stopOnStepping",{},smalltalk.Node)})},
  328. messageSends: []}),
  329. smalltalk.Node);
  330. smalltalk.addMethod(
  331. smalltalk.method({
  332. selector: "subtreeNeedsAliasing",
  333. fn: function (){
  334. var self=this;
  335. return smalltalk.withContext(function($ctx1) {
  336. var $1;
  337. $1=_st(_st(self._shouldBeAliased())._or_((function(){
  338. return smalltalk.withContext(function($ctx2) {
  339. return self._shouldBeInlined();
  340. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._or_((function(){
  341. return smalltalk.withContext(function($ctx2) {
  342. return _st(_st(self._nodes())._detect_ifNone_((function(each){
  343. return smalltalk.withContext(function($ctx3) {
  344. return _st(each)._subtreeNeedsAliasing();
  345. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}),(function(){
  346. return smalltalk.withContext(function($ctx3) {
  347. return false;
  348. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}))).__tild_eq(false);
  349. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  350. return $1;
  351. }, function($ctx1) {$ctx1.fill(self,"subtreeNeedsAliasing",{},smalltalk.Node)})},
  352. messageSends: ["or:", "~=", "detect:ifNone:", "subtreeNeedsAliasing", "nodes", "shouldBeInlined", "shouldBeAliased"]}),
  353. smalltalk.Node);
  354. smalltalk.addClass('AssignmentNode', smalltalk.Node, ['left', 'right'], 'Compiler-AST');
  355. smalltalk.addMethod(
  356. smalltalk.method({
  357. selector: "accept:",
  358. fn: function (aVisitor){
  359. var self=this;
  360. return smalltalk.withContext(function($ctx1) {
  361. var $1;
  362. $1=_st(aVisitor)._visitAssignmentNode_(self);
  363. return $1;
  364. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.AssignmentNode)})},
  365. messageSends: ["visitAssignmentNode:"]}),
  366. smalltalk.AssignmentNode);
  367. smalltalk.addMethod(
  368. smalltalk.method({
  369. selector: "isAssignmentNode",
  370. fn: function (){
  371. var self=this;
  372. return smalltalk.withContext(function($ctx1) {
  373. return true;
  374. }, function($ctx1) {$ctx1.fill(self,"isAssignmentNode",{},smalltalk.AssignmentNode)})},
  375. messageSends: []}),
  376. smalltalk.AssignmentNode);
  377. smalltalk.addMethod(
  378. smalltalk.method({
  379. selector: "left",
  380. fn: function (){
  381. var self=this;
  382. return smalltalk.withContext(function($ctx1) {
  383. var $1;
  384. $1=self["@left"];
  385. return $1;
  386. }, function($ctx1) {$ctx1.fill(self,"left",{},smalltalk.AssignmentNode)})},
  387. messageSends: []}),
  388. smalltalk.AssignmentNode);
  389. smalltalk.addMethod(
  390. smalltalk.method({
  391. selector: "left:",
  392. fn: function (aNode){
  393. var self=this;
  394. return smalltalk.withContext(function($ctx1) {
  395. self["@left"]=aNode;
  396. return self}, function($ctx1) {$ctx1.fill(self,"left:",{aNode:aNode},smalltalk.AssignmentNode)})},
  397. messageSends: []}),
  398. smalltalk.AssignmentNode);
  399. smalltalk.addMethod(
  400. smalltalk.method({
  401. selector: "nodes",
  402. fn: function (){
  403. var self=this;
  404. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  405. return smalltalk.withContext(function($ctx1) {
  406. var $1;
  407. $1=_st($Array())._with_with_(self._left(),self._right());
  408. return $1;
  409. }, function($ctx1) {$ctx1.fill(self,"nodes",{},smalltalk.AssignmentNode)})},
  410. messageSends: ["with:with:", "left", "right"]}),
  411. smalltalk.AssignmentNode);
  412. smalltalk.addMethod(
  413. smalltalk.method({
  414. selector: "right",
  415. fn: function (){
  416. var self=this;
  417. return smalltalk.withContext(function($ctx1) {
  418. var $1;
  419. $1=self["@right"];
  420. return $1;
  421. }, function($ctx1) {$ctx1.fill(self,"right",{},smalltalk.AssignmentNode)})},
  422. messageSends: []}),
  423. smalltalk.AssignmentNode);
  424. smalltalk.addMethod(
  425. smalltalk.method({
  426. selector: "right:",
  427. fn: function (aNode){
  428. var self=this;
  429. return smalltalk.withContext(function($ctx1) {
  430. self["@right"]=aNode;
  431. return self}, function($ctx1) {$ctx1.fill(self,"right:",{aNode:aNode},smalltalk.AssignmentNode)})},
  432. messageSends: []}),
  433. smalltalk.AssignmentNode);
  434. smalltalk.addClass('BlockNode', smalltalk.Node, ['parameters', 'scope'], 'Compiler-AST');
  435. smalltalk.addMethod(
  436. smalltalk.method({
  437. selector: "accept:",
  438. fn: function (aVisitor){
  439. var self=this;
  440. return smalltalk.withContext(function($ctx1) {
  441. var $1;
  442. $1=_st(aVisitor)._visitBlockNode_(self);
  443. return $1;
  444. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.BlockNode)})},
  445. messageSends: ["visitBlockNode:"]}),
  446. smalltalk.BlockNode);
  447. smalltalk.addMethod(
  448. smalltalk.method({
  449. selector: "isBlockNode",
  450. fn: function (){
  451. var self=this;
  452. return smalltalk.withContext(function($ctx1) {
  453. return true;
  454. }, function($ctx1) {$ctx1.fill(self,"isBlockNode",{},smalltalk.BlockNode)})},
  455. messageSends: []}),
  456. smalltalk.BlockNode);
  457. smalltalk.addMethod(
  458. smalltalk.method({
  459. selector: "parameters",
  460. fn: function (){
  461. var self=this;
  462. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  463. return smalltalk.withContext(function($ctx1) {
  464. var $2,$1;
  465. $2=self["@parameters"];
  466. if(($receiver = $2) == nil || $receiver == undefined){
  467. self["@parameters"]=_st($Array())._new();
  468. $1=self["@parameters"];
  469. } else {
  470. $1=$2;
  471. };
  472. return $1;
  473. }, function($ctx1) {$ctx1.fill(self,"parameters",{},smalltalk.BlockNode)})},
  474. messageSends: ["ifNil:", "new"]}),
  475. smalltalk.BlockNode);
  476. smalltalk.addMethod(
  477. smalltalk.method({
  478. selector: "parameters:",
  479. fn: function (aCollection){
  480. var self=this;
  481. return smalltalk.withContext(function($ctx1) {
  482. self["@parameters"]=aCollection;
  483. return self}, function($ctx1) {$ctx1.fill(self,"parameters:",{aCollection:aCollection},smalltalk.BlockNode)})},
  484. messageSends: []}),
  485. smalltalk.BlockNode);
  486. smalltalk.addMethod(
  487. smalltalk.method({
  488. selector: "scope",
  489. fn: function (){
  490. var self=this;
  491. return smalltalk.withContext(function($ctx1) {
  492. var $1;
  493. $1=self["@scope"];
  494. return $1;
  495. }, function($ctx1) {$ctx1.fill(self,"scope",{},smalltalk.BlockNode)})},
  496. messageSends: []}),
  497. smalltalk.BlockNode);
  498. smalltalk.addMethod(
  499. smalltalk.method({
  500. selector: "scope:",
  501. fn: function (aLexicalScope){
  502. var self=this;
  503. return smalltalk.withContext(function($ctx1) {
  504. self["@scope"]=aLexicalScope;
  505. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aLexicalScope:aLexicalScope},smalltalk.BlockNode)})},
  506. messageSends: []}),
  507. smalltalk.BlockNode);
  508. smalltalk.addMethod(
  509. smalltalk.method({
  510. selector: "subtreeNeedsAliasing",
  511. fn: function (){
  512. var self=this;
  513. return smalltalk.withContext(function($ctx1) {
  514. var $1;
  515. $1=_st(self._shouldBeAliased())._or_((function(){
  516. return smalltalk.withContext(function($ctx2) {
  517. return self._shouldBeInlined();
  518. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  519. return $1;
  520. }, function($ctx1) {$ctx1.fill(self,"subtreeNeedsAliasing",{},smalltalk.BlockNode)})},
  521. messageSends: ["or:", "shouldBeInlined", "shouldBeAliased"]}),
  522. smalltalk.BlockNode);
  523. smalltalk.addClass('CascadeNode', smalltalk.Node, ['receiver'], 'Compiler-AST');
  524. smalltalk.addMethod(
  525. smalltalk.method({
  526. selector: "accept:",
  527. fn: function (aVisitor){
  528. var self=this;
  529. return smalltalk.withContext(function($ctx1) {
  530. var $1;
  531. $1=_st(aVisitor)._visitCascadeNode_(self);
  532. return $1;
  533. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.CascadeNode)})},
  534. messageSends: ["visitCascadeNode:"]}),
  535. smalltalk.CascadeNode);
  536. smalltalk.addMethod(
  537. smalltalk.method({
  538. selector: "receiver",
  539. fn: function (){
  540. var self=this;
  541. return smalltalk.withContext(function($ctx1) {
  542. var $1;
  543. $1=self["@receiver"];
  544. return $1;
  545. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.CascadeNode)})},
  546. messageSends: []}),
  547. smalltalk.CascadeNode);
  548. smalltalk.addMethod(
  549. smalltalk.method({
  550. selector: "receiver:",
  551. fn: function (aNode){
  552. var self=this;
  553. return smalltalk.withContext(function($ctx1) {
  554. self["@receiver"]=aNode;
  555. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{aNode:aNode},smalltalk.CascadeNode)})},
  556. messageSends: []}),
  557. smalltalk.CascadeNode);
  558. smalltalk.addClass('DynamicArrayNode', smalltalk.Node, [], 'Compiler-AST');
  559. smalltalk.addMethod(
  560. smalltalk.method({
  561. selector: "accept:",
  562. fn: function (aVisitor){
  563. var self=this;
  564. return smalltalk.withContext(function($ctx1) {
  565. var $1;
  566. $1=_st(aVisitor)._visitDynamicArrayNode_(self);
  567. return $1;
  568. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.DynamicArrayNode)})},
  569. messageSends: ["visitDynamicArrayNode:"]}),
  570. smalltalk.DynamicArrayNode);
  571. smalltalk.addClass('DynamicDictionaryNode', smalltalk.Node, [], 'Compiler-AST');
  572. smalltalk.addMethod(
  573. smalltalk.method({
  574. selector: "accept:",
  575. fn: function (aVisitor){
  576. var self=this;
  577. return smalltalk.withContext(function($ctx1) {
  578. var $1;
  579. $1=_st(aVisitor)._visitDynamicDictionaryNode_(self);
  580. return $1;
  581. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.DynamicDictionaryNode)})},
  582. messageSends: ["visitDynamicDictionaryNode:"]}),
  583. smalltalk.DynamicDictionaryNode);
  584. smalltalk.addClass('JSStatementNode', smalltalk.Node, ['source'], 'Compiler-AST');
  585. smalltalk.addMethod(
  586. smalltalk.method({
  587. selector: "accept:",
  588. fn: function (aVisitor){
  589. var self=this;
  590. return smalltalk.withContext(function($ctx1) {
  591. var $1;
  592. $1=_st(aVisitor)._visitJSStatementNode_(self);
  593. return $1;
  594. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.JSStatementNode)})},
  595. messageSends: ["visitJSStatementNode:"]}),
  596. smalltalk.JSStatementNode);
  597. smalltalk.addMethod(
  598. smalltalk.method({
  599. selector: "isJSStatementNode",
  600. fn: function (){
  601. var self=this;
  602. return smalltalk.withContext(function($ctx1) {
  603. return true;
  604. }, function($ctx1) {$ctx1.fill(self,"isJSStatementNode",{},smalltalk.JSStatementNode)})},
  605. messageSends: []}),
  606. smalltalk.JSStatementNode);
  607. smalltalk.addMethod(
  608. smalltalk.method({
  609. selector: "source",
  610. fn: function (){
  611. var self=this;
  612. return smalltalk.withContext(function($ctx1) {
  613. var $2,$1;
  614. $2=self["@source"];
  615. if(($receiver = $2) == nil || $receiver == undefined){
  616. $1="";
  617. } else {
  618. $1=$2;
  619. };
  620. return $1;
  621. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.JSStatementNode)})},
  622. messageSends: ["ifNil:"]}),
  623. smalltalk.JSStatementNode);
  624. smalltalk.addMethod(
  625. smalltalk.method({
  626. selector: "source:",
  627. fn: function (aString){
  628. var self=this;
  629. return smalltalk.withContext(function($ctx1) {
  630. self["@source"]=aString;
  631. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.JSStatementNode)})},
  632. messageSends: []}),
  633. smalltalk.JSStatementNode);
  634. smalltalk.addClass('MethodNode', smalltalk.Node, ['selector', 'arguments', 'source', 'scope', 'classReferences', 'messageSends', 'superSends'], 'Compiler-AST');
  635. smalltalk.addMethod(
  636. smalltalk.method({
  637. selector: "accept:",
  638. fn: function (aVisitor){
  639. var self=this;
  640. return smalltalk.withContext(function($ctx1) {
  641. var $1;
  642. $1=_st(aVisitor)._visitMethodNode_(self);
  643. return $1;
  644. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.MethodNode)})},
  645. messageSends: ["visitMethodNode:"]}),
  646. smalltalk.MethodNode);
  647. smalltalk.addMethod(
  648. smalltalk.method({
  649. selector: "arguments",
  650. fn: function (){
  651. var self=this;
  652. return smalltalk.withContext(function($ctx1) {
  653. var $2,$1;
  654. $2=self["@arguments"];
  655. if(($receiver = $2) == nil || $receiver == undefined){
  656. $1=[];
  657. } else {
  658. $1=$2;
  659. };
  660. return $1;
  661. }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.MethodNode)})},
  662. messageSends: ["ifNil:"]}),
  663. smalltalk.MethodNode);
  664. smalltalk.addMethod(
  665. smalltalk.method({
  666. selector: "arguments:",
  667. fn: function (aCollection){
  668. var self=this;
  669. return smalltalk.withContext(function($ctx1) {
  670. self["@arguments"]=aCollection;
  671. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection},smalltalk.MethodNode)})},
  672. messageSends: []}),
  673. smalltalk.MethodNode);
  674. smalltalk.addMethod(
  675. smalltalk.method({
  676. selector: "classReferences",
  677. fn: function (){
  678. var self=this;
  679. return smalltalk.withContext(function($ctx1) {
  680. var $1;
  681. $1=self["@classReferences"];
  682. return $1;
  683. }, function($ctx1) {$ctx1.fill(self,"classReferences",{},smalltalk.MethodNode)})},
  684. messageSends: []}),
  685. smalltalk.MethodNode);
  686. smalltalk.addMethod(
  687. smalltalk.method({
  688. selector: "classReferences:",
  689. fn: function (aCollection){
  690. var self=this;
  691. return smalltalk.withContext(function($ctx1) {
  692. self["@classReferences"]=aCollection;
  693. return self}, function($ctx1) {$ctx1.fill(self,"classReferences:",{aCollection:aCollection},smalltalk.MethodNode)})},
  694. messageSends: []}),
  695. smalltalk.MethodNode);
  696. smalltalk.addMethod(
  697. smalltalk.method({
  698. selector: "extent",
  699. fn: function (){
  700. var self=this;
  701. return smalltalk.withContext(function($ctx1) {
  702. var $1;
  703. $1=_st(_st(_st(self._source())._lines())._size()).__at(_st(_st(_st(_st(self._source())._lines())._last())._size()).__plus((1)));
  704. return $1;
  705. }, function($ctx1) {$ctx1.fill(self,"extent",{},smalltalk.MethodNode)})},
  706. messageSends: ["@", "+", "size", "last", "lines", "source"]}),
  707. smalltalk.MethodNode);
  708. smalltalk.addMethod(
  709. smalltalk.method({
  710. selector: "messageSends",
  711. fn: function (){
  712. var self=this;
  713. return smalltalk.withContext(function($ctx1) {
  714. var $1;
  715. $1=self["@messageSends"];
  716. return $1;
  717. }, function($ctx1) {$ctx1.fill(self,"messageSends",{},smalltalk.MethodNode)})},
  718. messageSends: []}),
  719. smalltalk.MethodNode);
  720. smalltalk.addMethod(
  721. smalltalk.method({
  722. selector: "messageSends:",
  723. fn: function (aCollection){
  724. var self=this;
  725. return smalltalk.withContext(function($ctx1) {
  726. self["@messageSends"]=aCollection;
  727. return self}, function($ctx1) {$ctx1.fill(self,"messageSends:",{aCollection:aCollection},smalltalk.MethodNode)})},
  728. messageSends: []}),
  729. smalltalk.MethodNode);
  730. smalltalk.addMethod(
  731. smalltalk.method({
  732. selector: "scope",
  733. fn: function (){
  734. var self=this;
  735. return smalltalk.withContext(function($ctx1) {
  736. var $1;
  737. $1=self["@scope"];
  738. return $1;
  739. }, function($ctx1) {$ctx1.fill(self,"scope",{},smalltalk.MethodNode)})},
  740. messageSends: []}),
  741. smalltalk.MethodNode);
  742. smalltalk.addMethod(
  743. smalltalk.method({
  744. selector: "scope:",
  745. fn: function (aMethodScope){
  746. var self=this;
  747. return smalltalk.withContext(function($ctx1) {
  748. self["@scope"]=aMethodScope;
  749. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aMethodScope:aMethodScope},smalltalk.MethodNode)})},
  750. messageSends: []}),
  751. smalltalk.MethodNode);
  752. smalltalk.addMethod(
  753. smalltalk.method({
  754. selector: "selector",
  755. fn: function (){
  756. var self=this;
  757. return smalltalk.withContext(function($ctx1) {
  758. var $1;
  759. $1=self["@selector"];
  760. return $1;
  761. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.MethodNode)})},
  762. messageSends: []}),
  763. smalltalk.MethodNode);
  764. smalltalk.addMethod(
  765. smalltalk.method({
  766. selector: "selector:",
  767. fn: function (aString){
  768. var self=this;
  769. return smalltalk.withContext(function($ctx1) {
  770. self["@selector"]=aString;
  771. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.MethodNode)})},
  772. messageSends: []}),
  773. smalltalk.MethodNode);
  774. smalltalk.addMethod(
  775. smalltalk.method({
  776. selector: "source",
  777. fn: function (){
  778. var self=this;
  779. return smalltalk.withContext(function($ctx1) {
  780. var $1;
  781. $1=self["@source"];
  782. return $1;
  783. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.MethodNode)})},
  784. messageSends: []}),
  785. smalltalk.MethodNode);
  786. smalltalk.addMethod(
  787. smalltalk.method({
  788. selector: "source:",
  789. fn: function (aString){
  790. var self=this;
  791. return smalltalk.withContext(function($ctx1) {
  792. self["@source"]=aString;
  793. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.MethodNode)})},
  794. messageSends: []}),
  795. smalltalk.MethodNode);
  796. smalltalk.addMethod(
  797. smalltalk.method({
  798. selector: "superSends",
  799. fn: function (){
  800. var self=this;
  801. return smalltalk.withContext(function($ctx1) {
  802. var $1;
  803. $1=self["@superSends"];
  804. return $1;
  805. }, function($ctx1) {$ctx1.fill(self,"superSends",{},smalltalk.MethodNode)})},
  806. messageSends: []}),
  807. smalltalk.MethodNode);
  808. smalltalk.addMethod(
  809. smalltalk.method({
  810. selector: "superSends:",
  811. fn: function (aCollection){
  812. var self=this;
  813. return smalltalk.withContext(function($ctx1) {
  814. self["@superSends"]=aCollection;
  815. return self}, function($ctx1) {$ctx1.fill(self,"superSends:",{aCollection:aCollection},smalltalk.MethodNode)})},
  816. messageSends: []}),
  817. smalltalk.MethodNode);
  818. smalltalk.addClass('ReturnNode', smalltalk.Node, ['scope'], 'Compiler-AST');
  819. smalltalk.addMethod(
  820. smalltalk.method({
  821. selector: "accept:",
  822. fn: function (aVisitor){
  823. var self=this;
  824. return smalltalk.withContext(function($ctx1) {
  825. var $1;
  826. $1=_st(aVisitor)._visitReturnNode_(self);
  827. return $1;
  828. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.ReturnNode)})},
  829. messageSends: ["visitReturnNode:"]}),
  830. smalltalk.ReturnNode);
  831. smalltalk.addMethod(
  832. smalltalk.method({
  833. selector: "isReturnNode",
  834. fn: function (){
  835. var self=this;
  836. return smalltalk.withContext(function($ctx1) {
  837. return true;
  838. }, function($ctx1) {$ctx1.fill(self,"isReturnNode",{},smalltalk.ReturnNode)})},
  839. messageSends: []}),
  840. smalltalk.ReturnNode);
  841. smalltalk.addMethod(
  842. smalltalk.method({
  843. selector: "nonLocalReturn",
  844. fn: function (){
  845. var self=this;
  846. return smalltalk.withContext(function($ctx1) {
  847. var $1;
  848. $1=_st(_st(self._scope())._isMethodScope())._not();
  849. return $1;
  850. }, function($ctx1) {$ctx1.fill(self,"nonLocalReturn",{},smalltalk.ReturnNode)})},
  851. messageSends: ["not", "isMethodScope", "scope"]}),
  852. smalltalk.ReturnNode);
  853. smalltalk.addMethod(
  854. smalltalk.method({
  855. selector: "scope",
  856. fn: function (){
  857. var self=this;
  858. return smalltalk.withContext(function($ctx1) {
  859. var $1;
  860. $1=self["@scope"];
  861. return $1;
  862. }, function($ctx1) {$ctx1.fill(self,"scope",{},smalltalk.ReturnNode)})},
  863. messageSends: []}),
  864. smalltalk.ReturnNode);
  865. smalltalk.addMethod(
  866. smalltalk.method({
  867. selector: "scope:",
  868. fn: function (aLexicalScope){
  869. var self=this;
  870. return smalltalk.withContext(function($ctx1) {
  871. self["@scope"]=aLexicalScope;
  872. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aLexicalScope:aLexicalScope},smalltalk.ReturnNode)})},
  873. messageSends: []}),
  874. smalltalk.ReturnNode);
  875. smalltalk.addClass('SendNode', smalltalk.Node, ['selector', 'arguments', 'receiver', 'superSend', 'index'], 'Compiler-AST');
  876. smalltalk.addMethod(
  877. smalltalk.method({
  878. selector: "accept:",
  879. fn: function (aVisitor){
  880. var self=this;
  881. return smalltalk.withContext(function($ctx1) {
  882. var $1;
  883. $1=_st(aVisitor)._visitSendNode_(self);
  884. return $1;
  885. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.SendNode)})},
  886. messageSends: ["visitSendNode:"]}),
  887. smalltalk.SendNode);
  888. smalltalk.addMethod(
  889. smalltalk.method({
  890. selector: "arguments",
  891. fn: function (){
  892. var self=this;
  893. return smalltalk.withContext(function($ctx1) {
  894. var $2,$1;
  895. $2=self["@arguments"];
  896. if(($receiver = $2) == nil || $receiver == undefined){
  897. self["@arguments"]=[];
  898. $1=self["@arguments"];
  899. } else {
  900. $1=$2;
  901. };
  902. return $1;
  903. }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.SendNode)})},
  904. messageSends: ["ifNil:"]}),
  905. smalltalk.SendNode);
  906. smalltalk.addMethod(
  907. smalltalk.method({
  908. selector: "arguments:",
  909. fn: function (aCollection){
  910. var self=this;
  911. return smalltalk.withContext(function($ctx1) {
  912. self["@arguments"]=aCollection;
  913. _st(aCollection)._do_((function(each){
  914. return smalltalk.withContext(function($ctx2) {
  915. return _st(each)._parent_(self);
  916. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  917. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection},smalltalk.SendNode)})},
  918. messageSends: ["do:", "parent:"]}),
  919. smalltalk.SendNode);
  920. smalltalk.addMethod(
  921. smalltalk.method({
  922. selector: "cascadeNodeWithMessages:",
  923. fn: function (aCollection){
  924. var self=this;
  925. var first;
  926. function $SendNode(){return smalltalk.SendNode||(typeof SendNode=="undefined"?nil:SendNode)}
  927. function $CascadeNode(){return smalltalk.CascadeNode||(typeof CascadeNode=="undefined"?nil:CascadeNode)}
  928. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  929. return smalltalk.withContext(function($ctx1) {
  930. var $1,$2,$4,$5,$3;
  931. $1=_st($SendNode())._new();
  932. _st($1)._selector_(self._selector());
  933. _st($1)._arguments_(self._arguments());
  934. $2=_st($1)._yourself();
  935. first=$2;
  936. $4=_st($CascadeNode())._new();
  937. _st($4)._receiver_(self._receiver());
  938. _st($4)._nodes_(_st(_st($Array())._with_(first)).__comma(aCollection));
  939. $5=_st($4)._yourself();
  940. $3=$5;
  941. return $3;
  942. }, function($ctx1) {$ctx1.fill(self,"cascadeNodeWithMessages:",{aCollection:aCollection,first:first},smalltalk.SendNode)})},
  943. messageSends: ["selector:", "selector", "new", "arguments:", "arguments", "yourself", "receiver:", "receiver", "nodes:", ",", "with:"]}),
  944. smalltalk.SendNode);
  945. smalltalk.addMethod(
  946. smalltalk.method({
  947. selector: "index",
  948. fn: function (){
  949. var self=this;
  950. return smalltalk.withContext(function($ctx1) {
  951. var $1;
  952. $1=self["@index"];
  953. return $1;
  954. }, function($ctx1) {$ctx1.fill(self,"index",{},smalltalk.SendNode)})},
  955. messageSends: []}),
  956. smalltalk.SendNode);
  957. smalltalk.addMethod(
  958. smalltalk.method({
  959. selector: "index:",
  960. fn: function (anInteger){
  961. var self=this;
  962. return smalltalk.withContext(function($ctx1) {
  963. self["@index"]=anInteger;
  964. return self}, function($ctx1) {$ctx1.fill(self,"index:",{anInteger:anInteger},smalltalk.SendNode)})},
  965. messageSends: []}),
  966. smalltalk.SendNode);
  967. smalltalk.addMethod(
  968. smalltalk.method({
  969. selector: "isSendNode",
  970. fn: function (){
  971. var self=this;
  972. return smalltalk.withContext(function($ctx1) {
  973. return true;
  974. }, function($ctx1) {$ctx1.fill(self,"isSendNode",{},smalltalk.SendNode)})},
  975. messageSends: []}),
  976. smalltalk.SendNode);
  977. smalltalk.addMethod(
  978. smalltalk.method({
  979. selector: "nodes",
  980. fn: function (){
  981. var self=this;
  982. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  983. return smalltalk.withContext(function($ctx1) {
  984. var $2,$3,$1;
  985. $2=_st($Array())._withAll_(self._arguments());
  986. _st($2)._add_(self._receiver());
  987. $3=_st($2)._yourself();
  988. $1=$3;
  989. return $1;
  990. }, function($ctx1) {$ctx1.fill(self,"nodes",{},smalltalk.SendNode)})},
  991. messageSends: ["add:", "receiver", "withAll:", "arguments", "yourself"]}),
  992. smalltalk.SendNode);
  993. smalltalk.addMethod(
  994. smalltalk.method({
  995. selector: "receiver",
  996. fn: function (){
  997. var self=this;
  998. return smalltalk.withContext(function($ctx1) {
  999. var $1;
  1000. $1=self["@receiver"];
  1001. return $1;
  1002. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.SendNode)})},
  1003. messageSends: []}),
  1004. smalltalk.SendNode);
  1005. smalltalk.addMethod(
  1006. smalltalk.method({
  1007. selector: "receiver:",
  1008. fn: function (aNode){
  1009. var self=this;
  1010. return smalltalk.withContext(function($ctx1) {
  1011. var $1;
  1012. self["@receiver"]=aNode;
  1013. $1=_st(aNode)._isNode();
  1014. if(smalltalk.assert($1)){
  1015. _st(aNode)._parent_(self);
  1016. };
  1017. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{aNode:aNode},smalltalk.SendNode)})},
  1018. messageSends: ["ifTrue:", "parent:", "isNode"]}),
  1019. smalltalk.SendNode);
  1020. smalltalk.addMethod(
  1021. smalltalk.method({
  1022. selector: "selector",
  1023. fn: function (){
  1024. var self=this;
  1025. return smalltalk.withContext(function($ctx1) {
  1026. var $1;
  1027. $1=self["@selector"];
  1028. return $1;
  1029. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.SendNode)})},
  1030. messageSends: []}),
  1031. smalltalk.SendNode);
  1032. smalltalk.addMethod(
  1033. smalltalk.method({
  1034. selector: "selector:",
  1035. fn: function (aString){
  1036. var self=this;
  1037. return smalltalk.withContext(function($ctx1) {
  1038. self["@selector"]=aString;
  1039. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.SendNode)})},
  1040. messageSends: []}),
  1041. smalltalk.SendNode);
  1042. smalltalk.addMethod(
  1043. smalltalk.method({
  1044. selector: "stopOnStepping",
  1045. fn: function (){
  1046. var self=this;
  1047. return smalltalk.withContext(function($ctx1) {
  1048. return true;
  1049. }, function($ctx1) {$ctx1.fill(self,"stopOnStepping",{},smalltalk.SendNode)})},
  1050. messageSends: []}),
  1051. smalltalk.SendNode);
  1052. smalltalk.addMethod(
  1053. smalltalk.method({
  1054. selector: "superSend",
  1055. fn: function (){
  1056. var self=this;
  1057. return smalltalk.withContext(function($ctx1) {
  1058. var $2,$1;
  1059. $2=self["@superSend"];
  1060. if(($receiver = $2) == nil || $receiver == undefined){
  1061. $1=false;
  1062. } else {
  1063. $1=$2;
  1064. };
  1065. return $1;
  1066. }, function($ctx1) {$ctx1.fill(self,"superSend",{},smalltalk.SendNode)})},
  1067. messageSends: ["ifNil:"]}),
  1068. smalltalk.SendNode);
  1069. smalltalk.addMethod(
  1070. smalltalk.method({
  1071. selector: "superSend:",
  1072. fn: function (aBoolean){
  1073. var self=this;
  1074. return smalltalk.withContext(function($ctx1) {
  1075. self["@superSend"]=aBoolean;
  1076. return self}, function($ctx1) {$ctx1.fill(self,"superSend:",{aBoolean:aBoolean},smalltalk.SendNode)})},
  1077. messageSends: []}),
  1078. smalltalk.SendNode);
  1079. smalltalk.addMethod(
  1080. smalltalk.method({
  1081. selector: "valueForReceiver:",
  1082. fn: function (anObject){
  1083. var self=this;
  1084. function $SendNode(){return smalltalk.SendNode||(typeof SendNode=="undefined"?nil:SendNode)}
  1085. return smalltalk.withContext(function($ctx1) {
  1086. var $2,$3,$5,$4,$6,$1;
  1087. $2=_st($SendNode())._new();
  1088. _st($2)._position_(self._position());
  1089. $3=$2;
  1090. $5=self._receiver();
  1091. if(($receiver = $5) == nil || $receiver == undefined){
  1092. $4=anObject;
  1093. } else {
  1094. $4=_st(self._receiver())._valueForReceiver_(anObject);
  1095. };
  1096. _st($3)._receiver_($4);
  1097. _st($2)._selector_(self._selector());
  1098. _st($2)._arguments_(self._arguments());
  1099. $6=_st($2)._yourself();
  1100. $1=$6;
  1101. return $1;
  1102. }, function($ctx1) {$ctx1.fill(self,"valueForReceiver:",{anObject:anObject},smalltalk.SendNode)})},
  1103. messageSends: ["position:", "position", "new", "receiver:", "ifNil:ifNotNil:", "valueForReceiver:", "receiver", "selector:", "selector", "arguments:", "arguments", "yourself"]}),
  1104. smalltalk.SendNode);
  1105. smalltalk.addClass('SequenceNode', smalltalk.Node, ['temps', 'scope'], 'Compiler-AST');
  1106. smalltalk.addMethod(
  1107. smalltalk.method({
  1108. selector: "accept:",
  1109. fn: function (aVisitor){
  1110. var self=this;
  1111. return smalltalk.withContext(function($ctx1) {
  1112. var $1;
  1113. $1=_st(aVisitor)._visitSequenceNode_(self);
  1114. return $1;
  1115. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.SequenceNode)})},
  1116. messageSends: ["visitSequenceNode:"]}),
  1117. smalltalk.SequenceNode);
  1118. smalltalk.addMethod(
  1119. smalltalk.method({
  1120. selector: "asBlockSequenceNode",
  1121. fn: function (){
  1122. var self=this;
  1123. function $BlockSequenceNode(){return smalltalk.BlockSequenceNode||(typeof BlockSequenceNode=="undefined"?nil:BlockSequenceNode)}
  1124. return smalltalk.withContext(function($ctx1) {
  1125. var $2,$3,$1;
  1126. $2=_st($BlockSequenceNode())._new();
  1127. _st($2)._position_(self._position());
  1128. _st($2)._nodes_(self._nodes());
  1129. _st($2)._temps_(self._temps());
  1130. $3=_st($2)._yourself();
  1131. $1=$3;
  1132. return $1;
  1133. }, function($ctx1) {$ctx1.fill(self,"asBlockSequenceNode",{},smalltalk.SequenceNode)})},
  1134. messageSends: ["position:", "position", "new", "nodes:", "nodes", "temps:", "temps", "yourself"]}),
  1135. smalltalk.SequenceNode);
  1136. smalltalk.addMethod(
  1137. smalltalk.method({
  1138. selector: "scope",
  1139. fn: function (){
  1140. var self=this;
  1141. return smalltalk.withContext(function($ctx1) {
  1142. var $1;
  1143. $1=self["@scope"];
  1144. return $1;
  1145. }, function($ctx1) {$ctx1.fill(self,"scope",{},smalltalk.SequenceNode)})},
  1146. messageSends: []}),
  1147. smalltalk.SequenceNode);
  1148. smalltalk.addMethod(
  1149. smalltalk.method({
  1150. selector: "scope:",
  1151. fn: function (aLexicalScope){
  1152. var self=this;
  1153. return smalltalk.withContext(function($ctx1) {
  1154. self["@scope"]=aLexicalScope;
  1155. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aLexicalScope:aLexicalScope},smalltalk.SequenceNode)})},
  1156. messageSends: []}),
  1157. smalltalk.SequenceNode);
  1158. smalltalk.addMethod(
  1159. smalltalk.method({
  1160. selector: "temps",
  1161. fn: function (){
  1162. var self=this;
  1163. return smalltalk.withContext(function($ctx1) {
  1164. var $2,$1;
  1165. $2=self["@temps"];
  1166. if(($receiver = $2) == nil || $receiver == undefined){
  1167. $1=[];
  1168. } else {
  1169. $1=$2;
  1170. };
  1171. return $1;
  1172. }, function($ctx1) {$ctx1.fill(self,"temps",{},smalltalk.SequenceNode)})},
  1173. messageSends: ["ifNil:"]}),
  1174. smalltalk.SequenceNode);
  1175. smalltalk.addMethod(
  1176. smalltalk.method({
  1177. selector: "temps:",
  1178. fn: function (aCollection){
  1179. var self=this;
  1180. return smalltalk.withContext(function($ctx1) {
  1181. self["@temps"]=aCollection;
  1182. return self}, function($ctx1) {$ctx1.fill(self,"temps:",{aCollection:aCollection},smalltalk.SequenceNode)})},
  1183. messageSends: []}),
  1184. smalltalk.SequenceNode);
  1185. smalltalk.addClass('BlockSequenceNode', smalltalk.SequenceNode, [], 'Compiler-AST');
  1186. smalltalk.addMethod(
  1187. smalltalk.method({
  1188. selector: "accept:",
  1189. fn: function (aVisitor){
  1190. var self=this;
  1191. return smalltalk.withContext(function($ctx1) {
  1192. var $1;
  1193. $1=_st(aVisitor)._visitBlockSequenceNode_(self);
  1194. return $1;
  1195. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.BlockSequenceNode)})},
  1196. messageSends: ["visitBlockSequenceNode:"]}),
  1197. smalltalk.BlockSequenceNode);
  1198. smalltalk.addMethod(
  1199. smalltalk.method({
  1200. selector: "isBlockSequenceNode",
  1201. fn: function (){
  1202. var self=this;
  1203. return smalltalk.withContext(function($ctx1) {
  1204. return true;
  1205. }, function($ctx1) {$ctx1.fill(self,"isBlockSequenceNode",{},smalltalk.BlockSequenceNode)})},
  1206. messageSends: []}),
  1207. smalltalk.BlockSequenceNode);
  1208. smalltalk.addClass('ValueNode', smalltalk.Node, ['value'], 'Compiler-AST');
  1209. smalltalk.addMethod(
  1210. smalltalk.method({
  1211. selector: "accept:",
  1212. fn: function (aVisitor){
  1213. var self=this;
  1214. return smalltalk.withContext(function($ctx1) {
  1215. var $1;
  1216. $1=_st(aVisitor)._visitValueNode_(self);
  1217. return $1;
  1218. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.ValueNode)})},
  1219. messageSends: ["visitValueNode:"]}),
  1220. smalltalk.ValueNode);
  1221. smalltalk.addMethod(
  1222. smalltalk.method({
  1223. selector: "isImmutable",
  1224. fn: function (){
  1225. var self=this;
  1226. return smalltalk.withContext(function($ctx1) {
  1227. var $1;
  1228. $1=_st(self._value())._isImmutable();
  1229. return $1;
  1230. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.ValueNode)})},
  1231. messageSends: ["isImmutable", "value"]}),
  1232. smalltalk.ValueNode);
  1233. smalltalk.addMethod(
  1234. smalltalk.method({
  1235. selector: "isValueNode",
  1236. fn: function (){
  1237. var self=this;
  1238. return smalltalk.withContext(function($ctx1) {
  1239. return true;
  1240. }, function($ctx1) {$ctx1.fill(self,"isValueNode",{},smalltalk.ValueNode)})},
  1241. messageSends: []}),
  1242. smalltalk.ValueNode);
  1243. smalltalk.addMethod(
  1244. smalltalk.method({
  1245. selector: "value",
  1246. fn: function (){
  1247. var self=this;
  1248. return smalltalk.withContext(function($ctx1) {
  1249. var $1;
  1250. $1=self["@value"];
  1251. return $1;
  1252. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.ValueNode)})},
  1253. messageSends: []}),
  1254. smalltalk.ValueNode);
  1255. smalltalk.addMethod(
  1256. smalltalk.method({
  1257. selector: "value:",
  1258. fn: function (anObject){
  1259. var self=this;
  1260. return smalltalk.withContext(function($ctx1) {
  1261. self["@value"]=anObject;
  1262. return self}, function($ctx1) {$ctx1.fill(self,"value:",{anObject:anObject},smalltalk.ValueNode)})},
  1263. messageSends: []}),
  1264. smalltalk.ValueNode);
  1265. smalltalk.addClass('VariableNode', smalltalk.ValueNode, ['assigned', 'binding'], 'Compiler-AST');
  1266. smalltalk.addMethod(
  1267. smalltalk.method({
  1268. selector: "accept:",
  1269. fn: function (aVisitor){
  1270. var self=this;
  1271. return smalltalk.withContext(function($ctx1) {
  1272. var $1;
  1273. $1=_st(aVisitor)._visitVariableNode_(self);
  1274. return $1;
  1275. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.VariableNode)})},
  1276. messageSends: ["visitVariableNode:"]}),
  1277. smalltalk.VariableNode);
  1278. smalltalk.addMethod(
  1279. smalltalk.method({
  1280. selector: "alias",
  1281. fn: function (){
  1282. var self=this;
  1283. return smalltalk.withContext(function($ctx1) {
  1284. var $1;
  1285. $1=_st(self._binding())._alias();
  1286. return $1;
  1287. }, function($ctx1) {$ctx1.fill(self,"alias",{},smalltalk.VariableNode)})},
  1288. messageSends: ["alias", "binding"]}),
  1289. smalltalk.VariableNode);
  1290. smalltalk.addMethod(
  1291. smalltalk.method({
  1292. selector: "assigned",
  1293. fn: function (){
  1294. var self=this;
  1295. return smalltalk.withContext(function($ctx1) {
  1296. var $2,$1;
  1297. $2=self["@assigned"];
  1298. if(($receiver = $2) == nil || $receiver == undefined){
  1299. $1=false;
  1300. } else {
  1301. $1=$2;
  1302. };
  1303. return $1;
  1304. }, function($ctx1) {$ctx1.fill(self,"assigned",{},smalltalk.VariableNode)})},
  1305. messageSends: ["ifNil:"]}),
  1306. smalltalk.VariableNode);
  1307. smalltalk.addMethod(
  1308. smalltalk.method({
  1309. selector: "assigned:",
  1310. fn: function (aBoolean){
  1311. var self=this;
  1312. return smalltalk.withContext(function($ctx1) {
  1313. self["@assigned"]=aBoolean;
  1314. return self}, function($ctx1) {$ctx1.fill(self,"assigned:",{aBoolean:aBoolean},smalltalk.VariableNode)})},
  1315. messageSends: []}),
  1316. smalltalk.VariableNode);
  1317. smalltalk.addMethod(
  1318. smalltalk.method({
  1319. selector: "beAssigned",
  1320. fn: function (){
  1321. var self=this;
  1322. return smalltalk.withContext(function($ctx1) {
  1323. _st(self._binding())._validateAssignment();
  1324. self["@assigned"]=true;
  1325. return self}, function($ctx1) {$ctx1.fill(self,"beAssigned",{},smalltalk.VariableNode)})},
  1326. messageSends: ["validateAssignment", "binding"]}),
  1327. smalltalk.VariableNode);
  1328. smalltalk.addMethod(
  1329. smalltalk.method({
  1330. selector: "binding",
  1331. fn: function (){
  1332. var self=this;
  1333. return smalltalk.withContext(function($ctx1) {
  1334. var $1;
  1335. $1=self["@binding"];
  1336. return $1;
  1337. }, function($ctx1) {$ctx1.fill(self,"binding",{},smalltalk.VariableNode)})},
  1338. messageSends: []}),
  1339. smalltalk.VariableNode);
  1340. smalltalk.addMethod(
  1341. smalltalk.method({
  1342. selector: "binding:",
  1343. fn: function (aScopeVar){
  1344. var self=this;
  1345. return smalltalk.withContext(function($ctx1) {
  1346. self["@binding"]=aScopeVar;
  1347. return self}, function($ctx1) {$ctx1.fill(self,"binding:",{aScopeVar:aScopeVar},smalltalk.VariableNode)})},
  1348. messageSends: []}),
  1349. smalltalk.VariableNode);
  1350. smalltalk.addMethod(
  1351. smalltalk.method({
  1352. selector: "isImmutable",
  1353. fn: function (){
  1354. var self=this;
  1355. return smalltalk.withContext(function($ctx1) {
  1356. return false;
  1357. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.VariableNode)})},
  1358. messageSends: []}),
  1359. smalltalk.VariableNode);
  1360. smalltalk.addClass('ClassReferenceNode', smalltalk.VariableNode, [], 'Compiler-AST');
  1361. smalltalk.addMethod(
  1362. smalltalk.method({
  1363. selector: "accept:",
  1364. fn: function (aVisitor){
  1365. var self=this;
  1366. return smalltalk.withContext(function($ctx1) {
  1367. var $1;
  1368. $1=_st(aVisitor)._visitClassReferenceNode_(self);
  1369. return $1;
  1370. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.ClassReferenceNode)})},
  1371. messageSends: ["visitClassReferenceNode:"]}),
  1372. smalltalk.ClassReferenceNode);
  1373. smalltalk.addMethod(
  1374. smalltalk.method({
  1375. selector: "isNode",
  1376. fn: function (){
  1377. var self=this;
  1378. return smalltalk.withContext(function($ctx1) {
  1379. return false;
  1380. }, function($ctx1) {$ctx1.fill(self,"isNode",{},smalltalk.Object)})},
  1381. messageSends: []}),
  1382. smalltalk.Object);
  1383. smalltalk.addMethod(
  1384. smalltalk.method({
  1385. selector: "ast",
  1386. fn: function (){
  1387. var self=this;
  1388. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1389. return smalltalk.withContext(function($ctx1) {
  1390. var $1;
  1391. _st(self._source())._ifEmpty_((function(){
  1392. return smalltalk.withContext(function($ctx2) {
  1393. return self._error_("Method source is empty");
  1394. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1395. $1=_st(_st($Smalltalk())._current())._parse_(self._source());
  1396. return $1;
  1397. }, function($ctx1) {$ctx1.fill(self,"ast",{},smalltalk.CompiledMethod)})},
  1398. messageSends: ["ifEmpty:", "error:", "source", "parse:", "current"]}),
  1399. smalltalk.CompiledMethod);
  1400. });