Compiler-AST.js 68 KB

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