Compiler-AST.js 61 KB

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