2
0

Compiler-AST.js 61 KB

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