Compiler-AST.js 67 KB

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