Compiler-AST.js 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448
  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.addClass('BlockNode', smalltalk.Node, ['parameters', 'scope'], 'Compiler-AST');
  736. smalltalk.BlockNode.comment="I represent an block closure node.";
  737. smalltalk.addMethod(
  738. smalltalk.method({
  739. selector: "accept:",
  740. category: 'visiting',
  741. fn: function (aVisitor){
  742. var self=this;
  743. return smalltalk.withContext(function($ctx1) {
  744. var $1;
  745. $1=_st(aVisitor)._visitBlockNode_(self);
  746. return $1;
  747. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.BlockNode)})},
  748. args: ["aVisitor"],
  749. source: "accept: aVisitor\x0a\x09^ aVisitor visitBlockNode: self",
  750. messageSends: ["visitBlockNode:"],
  751. referencedClasses: []
  752. }),
  753. smalltalk.BlockNode);
  754. smalltalk.addMethod(
  755. smalltalk.method({
  756. selector: "isBlockNode",
  757. category: 'testing',
  758. fn: function (){
  759. var self=this;
  760. return smalltalk.withContext(function($ctx1) {
  761. return true;
  762. }, function($ctx1) {$ctx1.fill(self,"isBlockNode",{},smalltalk.BlockNode)})},
  763. args: [],
  764. source: "isBlockNode\x0a\x09^true",
  765. messageSends: [],
  766. referencedClasses: []
  767. }),
  768. smalltalk.BlockNode);
  769. smalltalk.addMethod(
  770. smalltalk.method({
  771. selector: "nextChild",
  772. category: 'accessing',
  773. fn: function (){
  774. var self=this;
  775. return smalltalk.withContext(function($ctx1) {
  776. return self;
  777. }, function($ctx1) {$ctx1.fill(self,"nextChild",{},smalltalk.BlockNode)})},
  778. args: [],
  779. source: "nextChild\x0a\x09\x22Answer the receiver as we want to avoid eager evaluation\x22\x0a\x09\x0a\x09^ self",
  780. messageSends: [],
  781. referencedClasses: []
  782. }),
  783. smalltalk.BlockNode);
  784. smalltalk.addMethod(
  785. smalltalk.method({
  786. selector: "nextNode:",
  787. category: 'accessing',
  788. fn: function (aNode){
  789. var self=this;
  790. return smalltalk.withContext(function($ctx1) {
  791. return self;
  792. }, function($ctx1) {$ctx1.fill(self,"nextNode:",{aNode:aNode},smalltalk.BlockNode)})},
  793. args: ["aNode"],
  794. source: "nextNode: aNode\x0a\x09\x22Answer the receiver as we want to avoid eager evaluation\x22\x0a\x09\x0a\x09^ self",
  795. messageSends: [],
  796. referencedClasses: []
  797. }),
  798. smalltalk.BlockNode);
  799. smalltalk.addMethod(
  800. smalltalk.method({
  801. selector: "parameters",
  802. category: 'accessing',
  803. fn: function (){
  804. var self=this;
  805. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  806. return smalltalk.withContext(function($ctx1) {
  807. var $2,$1;
  808. $2=self["@parameters"];
  809. if(($receiver = $2) == nil || $receiver == null){
  810. self["@parameters"]=_st($Array())._new();
  811. $1=self["@parameters"];
  812. } else {
  813. $1=$2;
  814. };
  815. return $1;
  816. }, function($ctx1) {$ctx1.fill(self,"parameters",{},smalltalk.BlockNode)})},
  817. args: [],
  818. source: "parameters\x0a\x09^parameters ifNil: [parameters := Array new]",
  819. messageSends: ["ifNil:", "new"],
  820. referencedClasses: ["Array"]
  821. }),
  822. smalltalk.BlockNode);
  823. smalltalk.addMethod(
  824. smalltalk.method({
  825. selector: "parameters:",
  826. category: 'accessing',
  827. fn: function (aCollection){
  828. var self=this;
  829. return smalltalk.withContext(function($ctx1) {
  830. self["@parameters"]=aCollection;
  831. return self}, function($ctx1) {$ctx1.fill(self,"parameters:",{aCollection:aCollection},smalltalk.BlockNode)})},
  832. args: ["aCollection"],
  833. source: "parameters: aCollection\x0a\x09parameters := aCollection",
  834. messageSends: [],
  835. referencedClasses: []
  836. }),
  837. smalltalk.BlockNode);
  838. smalltalk.addMethod(
  839. smalltalk.method({
  840. selector: "scope",
  841. category: 'accessing',
  842. fn: function (){
  843. var self=this;
  844. return smalltalk.withContext(function($ctx1) {
  845. var $1;
  846. $1=self["@scope"];
  847. return $1;
  848. }, function($ctx1) {$ctx1.fill(self,"scope",{},smalltalk.BlockNode)})},
  849. args: [],
  850. source: "scope\x0a\x09^ scope",
  851. messageSends: [],
  852. referencedClasses: []
  853. }),
  854. smalltalk.BlockNode);
  855. smalltalk.addMethod(
  856. smalltalk.method({
  857. selector: "scope:",
  858. category: 'accessing',
  859. fn: function (aLexicalScope){
  860. var self=this;
  861. return smalltalk.withContext(function($ctx1) {
  862. self["@scope"]=aLexicalScope;
  863. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aLexicalScope:aLexicalScope},smalltalk.BlockNode)})},
  864. args: ["aLexicalScope"],
  865. source: "scope: aLexicalScope\x0a\x09scope := aLexicalScope",
  866. messageSends: [],
  867. referencedClasses: []
  868. }),
  869. smalltalk.BlockNode);
  870. smalltalk.addMethod(
  871. smalltalk.method({
  872. selector: "subtreeNeedsAliasing",
  873. category: 'testing',
  874. fn: function (){
  875. var self=this;
  876. return smalltalk.withContext(function($ctx1) {
  877. var $1;
  878. $1=_st(self._shouldBeAliased())._or_((function(){
  879. return smalltalk.withContext(function($ctx2) {
  880. return self._shouldBeInlined();
  881. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  882. return $1;
  883. }, function($ctx1) {$ctx1.fill(self,"subtreeNeedsAliasing",{},smalltalk.BlockNode)})},
  884. args: [],
  885. source: "subtreeNeedsAliasing\x0a\x09^ self shouldBeAliased or: [ self shouldBeInlined ]",
  886. messageSends: ["or:", "shouldBeAliased", "shouldBeInlined"],
  887. referencedClasses: []
  888. }),
  889. smalltalk.BlockNode);
  890. smalltalk.addClass('CascadeNode', smalltalk.Node, ['receiver'], 'Compiler-AST');
  891. smalltalk.CascadeNode.comment="I represent an cascade node.";
  892. smalltalk.addMethod(
  893. smalltalk.method({
  894. selector: "accept:",
  895. category: 'visiting',
  896. fn: function (aVisitor){
  897. var self=this;
  898. return smalltalk.withContext(function($ctx1) {
  899. var $1;
  900. $1=_st(aVisitor)._visitCascadeNode_(self);
  901. return $1;
  902. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.CascadeNode)})},
  903. args: ["aVisitor"],
  904. source: "accept: aVisitor\x0a\x09^ aVisitor visitCascadeNode: self",
  905. messageSends: ["visitCascadeNode:"],
  906. referencedClasses: []
  907. }),
  908. smalltalk.CascadeNode);
  909. smalltalk.addMethod(
  910. smalltalk.method({
  911. selector: "isCascadeNode",
  912. category: 'testing',
  913. fn: function (){
  914. var self=this;
  915. return smalltalk.withContext(function($ctx1) {
  916. return true;
  917. }, function($ctx1) {$ctx1.fill(self,"isCascadeNode",{},smalltalk.CascadeNode)})},
  918. args: [],
  919. source: "isCascadeNode\x0a\x09^ true",
  920. messageSends: [],
  921. referencedClasses: []
  922. }),
  923. smalltalk.CascadeNode);
  924. smalltalk.addMethod(
  925. smalltalk.method({
  926. selector: "receiver",
  927. category: 'accessing',
  928. fn: function (){
  929. var self=this;
  930. return smalltalk.withContext(function($ctx1) {
  931. var $1;
  932. $1=self["@receiver"];
  933. return $1;
  934. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.CascadeNode)})},
  935. args: [],
  936. source: "receiver\x0a\x09^receiver",
  937. messageSends: [],
  938. referencedClasses: []
  939. }),
  940. smalltalk.CascadeNode);
  941. smalltalk.addMethod(
  942. smalltalk.method({
  943. selector: "receiver:",
  944. category: 'accessing',
  945. fn: function (aNode){
  946. var self=this;
  947. return smalltalk.withContext(function($ctx1) {
  948. self["@receiver"]=aNode;
  949. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{aNode:aNode},smalltalk.CascadeNode)})},
  950. args: ["aNode"],
  951. source: "receiver: aNode\x0a\x09receiver := aNode",
  952. messageSends: [],
  953. referencedClasses: []
  954. }),
  955. smalltalk.CascadeNode);
  956. smalltalk.addClass('DynamicArrayNode', smalltalk.Node, [], 'Compiler-AST');
  957. smalltalk.DynamicArrayNode.comment="I represent an dynamic array node.";
  958. smalltalk.addMethod(
  959. smalltalk.method({
  960. selector: "accept:",
  961. category: 'visiting',
  962. fn: function (aVisitor){
  963. var self=this;
  964. return smalltalk.withContext(function($ctx1) {
  965. var $1;
  966. $1=_st(aVisitor)._visitDynamicArrayNode_(self);
  967. return $1;
  968. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.DynamicArrayNode)})},
  969. args: ["aVisitor"],
  970. source: "accept: aVisitor\x0a\x09^ aVisitor visitDynamicArrayNode: self",
  971. messageSends: ["visitDynamicArrayNode:"],
  972. referencedClasses: []
  973. }),
  974. smalltalk.DynamicArrayNode);
  975. smalltalk.addClass('DynamicDictionaryNode', smalltalk.Node, [], 'Compiler-AST');
  976. smalltalk.DynamicDictionaryNode.comment="I represent an dynamic dictionary node.";
  977. smalltalk.addMethod(
  978. smalltalk.method({
  979. selector: "accept:",
  980. category: 'visiting',
  981. fn: function (aVisitor){
  982. var self=this;
  983. return smalltalk.withContext(function($ctx1) {
  984. var $1;
  985. $1=_st(aVisitor)._visitDynamicDictionaryNode_(self);
  986. return $1;
  987. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.DynamicDictionaryNode)})},
  988. args: ["aVisitor"],
  989. source: "accept: aVisitor\x0a\x09^ aVisitor visitDynamicDictionaryNode: self",
  990. messageSends: ["visitDynamicDictionaryNode:"],
  991. referencedClasses: []
  992. }),
  993. smalltalk.DynamicDictionaryNode);
  994. smalltalk.addClass('JSStatementNode', smalltalk.Node, ['source'], 'Compiler-AST');
  995. smalltalk.JSStatementNode.comment="I represent an JavaScript statement node.";
  996. smalltalk.addMethod(
  997. smalltalk.method({
  998. selector: "accept:",
  999. category: 'visiting',
  1000. fn: function (aVisitor){
  1001. var self=this;
  1002. return smalltalk.withContext(function($ctx1) {
  1003. var $1;
  1004. $1=_st(aVisitor)._visitJSStatementNode_(self);
  1005. return $1;
  1006. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.JSStatementNode)})},
  1007. args: ["aVisitor"],
  1008. source: "accept: aVisitor\x0a\x09^ aVisitor visitJSStatementNode: self",
  1009. messageSends: ["visitJSStatementNode:"],
  1010. referencedClasses: []
  1011. }),
  1012. smalltalk.JSStatementNode);
  1013. smalltalk.addMethod(
  1014. smalltalk.method({
  1015. selector: "isJSStatementNode",
  1016. category: 'testing',
  1017. fn: function (){
  1018. var self=this;
  1019. return smalltalk.withContext(function($ctx1) {
  1020. return true;
  1021. }, function($ctx1) {$ctx1.fill(self,"isJSStatementNode",{},smalltalk.JSStatementNode)})},
  1022. args: [],
  1023. source: "isJSStatementNode\x0a\x09^ true",
  1024. messageSends: [],
  1025. referencedClasses: []
  1026. }),
  1027. smalltalk.JSStatementNode);
  1028. smalltalk.addMethod(
  1029. smalltalk.method({
  1030. selector: "source",
  1031. category: 'accessing',
  1032. fn: function (){
  1033. var self=this;
  1034. return smalltalk.withContext(function($ctx1) {
  1035. var $2,$1;
  1036. $2=self["@source"];
  1037. if(($receiver = $2) == nil || $receiver == null){
  1038. $1="";
  1039. } else {
  1040. $1=$2;
  1041. };
  1042. return $1;
  1043. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.JSStatementNode)})},
  1044. args: [],
  1045. source: "source\x0a\x09^source ifNil: ['']",
  1046. messageSends: ["ifNil:"],
  1047. referencedClasses: []
  1048. }),
  1049. smalltalk.JSStatementNode);
  1050. smalltalk.addMethod(
  1051. smalltalk.method({
  1052. selector: "source:",
  1053. category: 'accessing',
  1054. fn: function (aString){
  1055. var self=this;
  1056. return smalltalk.withContext(function($ctx1) {
  1057. self["@source"]=aString;
  1058. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.JSStatementNode)})},
  1059. args: ["aString"],
  1060. source: "source: aString\x0a\x09source := aString",
  1061. messageSends: [],
  1062. referencedClasses: []
  1063. }),
  1064. smalltalk.JSStatementNode);
  1065. smalltalk.addClass('MethodNode', smalltalk.Node, ['selector', 'arguments', 'source', 'scope', 'classReferences', 'sendIndexes', 'superSends'], 'Compiler-AST');
  1066. smalltalk.MethodNode.comment="I represent an method node.\x0a\x0aA method node must be the root and only method node of a valid AST.";
  1067. smalltalk.addMethod(
  1068. smalltalk.method({
  1069. selector: "accept:",
  1070. category: 'visiting',
  1071. fn: function (aVisitor){
  1072. var self=this;
  1073. return smalltalk.withContext(function($ctx1) {
  1074. var $1;
  1075. $1=_st(aVisitor)._visitMethodNode_(self);
  1076. return $1;
  1077. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.MethodNode)})},
  1078. args: ["aVisitor"],
  1079. source: "accept: aVisitor\x0a\x09^ aVisitor visitMethodNode: self",
  1080. messageSends: ["visitMethodNode:"],
  1081. referencedClasses: []
  1082. }),
  1083. smalltalk.MethodNode);
  1084. smalltalk.addMethod(
  1085. smalltalk.method({
  1086. selector: "arguments",
  1087. category: 'accessing',
  1088. fn: function (){
  1089. var self=this;
  1090. return smalltalk.withContext(function($ctx1) {
  1091. var $2,$1;
  1092. $2=self["@arguments"];
  1093. if(($receiver = $2) == nil || $receiver == null){
  1094. $1=[];
  1095. } else {
  1096. $1=$2;
  1097. };
  1098. return $1;
  1099. }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.MethodNode)})},
  1100. args: [],
  1101. source: "arguments\x0a\x09^arguments ifNil: [#()]",
  1102. messageSends: ["ifNil:"],
  1103. referencedClasses: []
  1104. }),
  1105. smalltalk.MethodNode);
  1106. smalltalk.addMethod(
  1107. smalltalk.method({
  1108. selector: "arguments:",
  1109. category: 'accessing',
  1110. fn: function (aCollection){
  1111. var self=this;
  1112. return smalltalk.withContext(function($ctx1) {
  1113. self["@arguments"]=aCollection;
  1114. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection},smalltalk.MethodNode)})},
  1115. args: ["aCollection"],
  1116. source: "arguments: aCollection\x0a\x09arguments := aCollection",
  1117. messageSends: [],
  1118. referencedClasses: []
  1119. }),
  1120. smalltalk.MethodNode);
  1121. smalltalk.addMethod(
  1122. smalltalk.method({
  1123. selector: "classReferences",
  1124. category: 'accessing',
  1125. fn: function (){
  1126. var self=this;
  1127. return smalltalk.withContext(function($ctx1) {
  1128. var $1;
  1129. $1=self["@classReferences"];
  1130. return $1;
  1131. }, function($ctx1) {$ctx1.fill(self,"classReferences",{},smalltalk.MethodNode)})},
  1132. args: [],
  1133. source: "classReferences\x0a\x09^ classReferences",
  1134. messageSends: [],
  1135. referencedClasses: []
  1136. }),
  1137. smalltalk.MethodNode);
  1138. smalltalk.addMethod(
  1139. smalltalk.method({
  1140. selector: "classReferences:",
  1141. category: 'accessing',
  1142. fn: function (aCollection){
  1143. var self=this;
  1144. return smalltalk.withContext(function($ctx1) {
  1145. self["@classReferences"]=aCollection;
  1146. return self}, function($ctx1) {$ctx1.fill(self,"classReferences:",{aCollection:aCollection},smalltalk.MethodNode)})},
  1147. args: ["aCollection"],
  1148. source: "classReferences: aCollection\x0a\x09classReferences := aCollection",
  1149. messageSends: [],
  1150. referencedClasses: []
  1151. }),
  1152. smalltalk.MethodNode);
  1153. smalltalk.addMethod(
  1154. smalltalk.method({
  1155. selector: "extent",
  1156. category: 'accessing',
  1157. fn: function (){
  1158. var self=this;
  1159. return smalltalk.withContext(function($ctx1) {
  1160. var $4,$3,$2,$1;
  1161. $4=self._source();
  1162. $ctx1.sendIdx["source"]=1;
  1163. $3=_st($4)._lines();
  1164. $ctx1.sendIdx["lines"]=1;
  1165. $2=_st($3)._size();
  1166. $ctx1.sendIdx["size"]=1;
  1167. $1=_st($2).__at(_st(_st(_st(_st(self._source())._lines())._last())._size()).__plus((1)));
  1168. return $1;
  1169. }, function($ctx1) {$ctx1.fill(self,"extent",{},smalltalk.MethodNode)})},
  1170. args: [],
  1171. source: "extent\x0a\x09^ self source lines size @ (self source lines last size + 1)",
  1172. messageSends: ["@", "size", "lines", "source", "+", "last"],
  1173. referencedClasses: []
  1174. }),
  1175. smalltalk.MethodNode);
  1176. smalltalk.addMethod(
  1177. smalltalk.method({
  1178. selector: "messageSends",
  1179. category: 'accessing',
  1180. fn: function (){
  1181. var self=this;
  1182. return smalltalk.withContext(function($ctx1) {
  1183. var $1;
  1184. $1=_st(self._sendIndexes())._keys();
  1185. return $1;
  1186. }, function($ctx1) {$ctx1.fill(self,"messageSends",{},smalltalk.MethodNode)})},
  1187. args: [],
  1188. source: "messageSends\x0a\x09^ self sendIndexes keys",
  1189. messageSends: ["keys", "sendIndexes"],
  1190. referencedClasses: []
  1191. }),
  1192. smalltalk.MethodNode);
  1193. smalltalk.addMethod(
  1194. smalltalk.method({
  1195. selector: "method",
  1196. category: 'accessing',
  1197. fn: function (){
  1198. var self=this;
  1199. return smalltalk.withContext(function($ctx1) {
  1200. return self;
  1201. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.MethodNode)})},
  1202. args: [],
  1203. source: "method\x0a\x09^ self",
  1204. messageSends: [],
  1205. referencedClasses: []
  1206. }),
  1207. smalltalk.MethodNode);
  1208. smalltalk.addMethod(
  1209. smalltalk.method({
  1210. selector: "scope",
  1211. category: 'accessing',
  1212. fn: function (){
  1213. var self=this;
  1214. return smalltalk.withContext(function($ctx1) {
  1215. var $1;
  1216. $1=self["@scope"];
  1217. return $1;
  1218. }, function($ctx1) {$ctx1.fill(self,"scope",{},smalltalk.MethodNode)})},
  1219. args: [],
  1220. source: "scope\x0a\x09^ scope",
  1221. messageSends: [],
  1222. referencedClasses: []
  1223. }),
  1224. smalltalk.MethodNode);
  1225. smalltalk.addMethod(
  1226. smalltalk.method({
  1227. selector: "scope:",
  1228. category: 'accessing',
  1229. fn: function (aMethodScope){
  1230. var self=this;
  1231. return smalltalk.withContext(function($ctx1) {
  1232. self["@scope"]=aMethodScope;
  1233. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aMethodScope:aMethodScope},smalltalk.MethodNode)})},
  1234. args: ["aMethodScope"],
  1235. source: "scope: aMethodScope\x0a\x09scope := aMethodScope",
  1236. messageSends: [],
  1237. referencedClasses: []
  1238. }),
  1239. smalltalk.MethodNode);
  1240. smalltalk.addMethod(
  1241. smalltalk.method({
  1242. selector: "selector",
  1243. category: 'accessing',
  1244. fn: function (){
  1245. var self=this;
  1246. return smalltalk.withContext(function($ctx1) {
  1247. var $1;
  1248. $1=self["@selector"];
  1249. return $1;
  1250. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.MethodNode)})},
  1251. args: [],
  1252. source: "selector\x0a\x09^selector",
  1253. messageSends: [],
  1254. referencedClasses: []
  1255. }),
  1256. smalltalk.MethodNode);
  1257. smalltalk.addMethod(
  1258. smalltalk.method({
  1259. selector: "selector:",
  1260. category: 'accessing',
  1261. fn: function (aString){
  1262. var self=this;
  1263. return smalltalk.withContext(function($ctx1) {
  1264. self["@selector"]=aString;
  1265. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.MethodNode)})},
  1266. args: ["aString"],
  1267. source: "selector: aString\x0a\x09selector := aString",
  1268. messageSends: [],
  1269. referencedClasses: []
  1270. }),
  1271. smalltalk.MethodNode);
  1272. smalltalk.addMethod(
  1273. smalltalk.method({
  1274. selector: "sendIndexes",
  1275. category: 'accessing',
  1276. fn: function (){
  1277. var self=this;
  1278. return smalltalk.withContext(function($ctx1) {
  1279. var $1;
  1280. $1=self["@sendIndexes"];
  1281. return $1;
  1282. }, function($ctx1) {$ctx1.fill(self,"sendIndexes",{},smalltalk.MethodNode)})},
  1283. args: [],
  1284. source: "sendIndexes\x0a\x09^ sendIndexes",
  1285. messageSends: [],
  1286. referencedClasses: []
  1287. }),
  1288. smalltalk.MethodNode);
  1289. smalltalk.addMethod(
  1290. smalltalk.method({
  1291. selector: "sendIndexes:",
  1292. category: 'accessing',
  1293. fn: function (aDictionary){
  1294. var self=this;
  1295. return smalltalk.withContext(function($ctx1) {
  1296. self["@sendIndexes"]=aDictionary;
  1297. return self}, function($ctx1) {$ctx1.fill(self,"sendIndexes:",{aDictionary:aDictionary},smalltalk.MethodNode)})},
  1298. args: ["aDictionary"],
  1299. source: "sendIndexes: aDictionary\x0a\x09sendIndexes := aDictionary",
  1300. messageSends: [],
  1301. referencedClasses: []
  1302. }),
  1303. smalltalk.MethodNode);
  1304. smalltalk.addMethod(
  1305. smalltalk.method({
  1306. selector: "source",
  1307. category: 'accessing',
  1308. fn: function (){
  1309. var self=this;
  1310. return smalltalk.withContext(function($ctx1) {
  1311. var $1;
  1312. $1=self["@source"];
  1313. return $1;
  1314. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.MethodNode)})},
  1315. args: [],
  1316. source: "source\x0a\x09^source",
  1317. messageSends: [],
  1318. referencedClasses: []
  1319. }),
  1320. smalltalk.MethodNode);
  1321. smalltalk.addMethod(
  1322. smalltalk.method({
  1323. selector: "source:",
  1324. category: 'accessing',
  1325. fn: function (aString){
  1326. var self=this;
  1327. return smalltalk.withContext(function($ctx1) {
  1328. self["@source"]=aString;
  1329. return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.MethodNode)})},
  1330. args: ["aString"],
  1331. source: "source: aString\x0a\x09source := aString",
  1332. messageSends: [],
  1333. referencedClasses: []
  1334. }),
  1335. smalltalk.MethodNode);
  1336. smalltalk.addMethod(
  1337. smalltalk.method({
  1338. selector: "superSends",
  1339. category: 'accessing',
  1340. fn: function (){
  1341. var self=this;
  1342. return smalltalk.withContext(function($ctx1) {
  1343. var $1;
  1344. $1=self["@superSends"];
  1345. return $1;
  1346. }, function($ctx1) {$ctx1.fill(self,"superSends",{},smalltalk.MethodNode)})},
  1347. args: [],
  1348. source: "superSends\x0a\x09^ superSends",
  1349. messageSends: [],
  1350. referencedClasses: []
  1351. }),
  1352. smalltalk.MethodNode);
  1353. smalltalk.addMethod(
  1354. smalltalk.method({
  1355. selector: "superSends:",
  1356. category: 'accessing',
  1357. fn: function (aCollection){
  1358. var self=this;
  1359. return smalltalk.withContext(function($ctx1) {
  1360. self["@superSends"]=aCollection;
  1361. return self}, function($ctx1) {$ctx1.fill(self,"superSends:",{aCollection:aCollection},smalltalk.MethodNode)})},
  1362. args: ["aCollection"],
  1363. source: "superSends: aCollection\x0a\x09superSends := aCollection",
  1364. messageSends: [],
  1365. referencedClasses: []
  1366. }),
  1367. smalltalk.MethodNode);
  1368. smalltalk.addClass('ReturnNode', smalltalk.Node, ['scope'], 'Compiler-AST');
  1369. smalltalk.ReturnNode.comment="I represent an return node. At the AST level, there is not difference between a local return or non-local return.";
  1370. smalltalk.addMethod(
  1371. smalltalk.method({
  1372. selector: "accept:",
  1373. category: 'visiting',
  1374. fn: function (aVisitor){
  1375. var self=this;
  1376. return smalltalk.withContext(function($ctx1) {
  1377. var $1;
  1378. $1=_st(aVisitor)._visitReturnNode_(self);
  1379. return $1;
  1380. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.ReturnNode)})},
  1381. args: ["aVisitor"],
  1382. source: "accept: aVisitor\x0a\x09^ aVisitor visitReturnNode: self",
  1383. messageSends: ["visitReturnNode:"],
  1384. referencedClasses: []
  1385. }),
  1386. smalltalk.ReturnNode);
  1387. smalltalk.addMethod(
  1388. smalltalk.method({
  1389. selector: "isReturnNode",
  1390. category: 'testing',
  1391. fn: function (){
  1392. var self=this;
  1393. return smalltalk.withContext(function($ctx1) {
  1394. return true;
  1395. }, function($ctx1) {$ctx1.fill(self,"isReturnNode",{},smalltalk.ReturnNode)})},
  1396. args: [],
  1397. source: "isReturnNode\x0a\x09^ true",
  1398. messageSends: [],
  1399. referencedClasses: []
  1400. }),
  1401. smalltalk.ReturnNode);
  1402. smalltalk.addMethod(
  1403. smalltalk.method({
  1404. selector: "nonLocalReturn",
  1405. category: 'testing',
  1406. fn: function (){
  1407. var self=this;
  1408. return smalltalk.withContext(function($ctx1) {
  1409. var $1;
  1410. $1=_st(_st(self._scope())._isMethodScope())._not();
  1411. return $1;
  1412. }, function($ctx1) {$ctx1.fill(self,"nonLocalReturn",{},smalltalk.ReturnNode)})},
  1413. args: [],
  1414. source: "nonLocalReturn\x0a\x09^ self scope isMethodScope not",
  1415. messageSends: ["not", "isMethodScope", "scope"],
  1416. referencedClasses: []
  1417. }),
  1418. smalltalk.ReturnNode);
  1419. smalltalk.addMethod(
  1420. smalltalk.method({
  1421. selector: "scope",
  1422. category: 'accessing',
  1423. fn: function (){
  1424. var self=this;
  1425. return smalltalk.withContext(function($ctx1) {
  1426. var $1;
  1427. $1=self["@scope"];
  1428. return $1;
  1429. }, function($ctx1) {$ctx1.fill(self,"scope",{},smalltalk.ReturnNode)})},
  1430. args: [],
  1431. source: "scope\x0a\x09^ scope",
  1432. messageSends: [],
  1433. referencedClasses: []
  1434. }),
  1435. smalltalk.ReturnNode);
  1436. smalltalk.addMethod(
  1437. smalltalk.method({
  1438. selector: "scope:",
  1439. category: 'accessing',
  1440. fn: function (aLexicalScope){
  1441. var self=this;
  1442. return smalltalk.withContext(function($ctx1) {
  1443. self["@scope"]=aLexicalScope;
  1444. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aLexicalScope:aLexicalScope},smalltalk.ReturnNode)})},
  1445. args: ["aLexicalScope"],
  1446. source: "scope: aLexicalScope\x0a\x09scope := aLexicalScope",
  1447. messageSends: [],
  1448. referencedClasses: []
  1449. }),
  1450. smalltalk.ReturnNode);
  1451. smalltalk.addClass('SendNode', smalltalk.Node, ['selector', 'arguments', 'receiver', 'superSend', 'index'], 'Compiler-AST');
  1452. smalltalk.SendNode.comment="I represent an message send node.";
  1453. smalltalk.addMethod(
  1454. smalltalk.method({
  1455. selector: "accept:",
  1456. category: 'visiting',
  1457. fn: function (aVisitor){
  1458. var self=this;
  1459. return smalltalk.withContext(function($ctx1) {
  1460. var $1;
  1461. $1=_st(aVisitor)._visitSendNode_(self);
  1462. return $1;
  1463. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.SendNode)})},
  1464. args: ["aVisitor"],
  1465. source: "accept: aVisitor\x0a\x09^ aVisitor visitSendNode: self",
  1466. messageSends: ["visitSendNode:"],
  1467. referencedClasses: []
  1468. }),
  1469. smalltalk.SendNode);
  1470. smalltalk.addMethod(
  1471. smalltalk.method({
  1472. selector: "arguments",
  1473. category: 'accessing',
  1474. fn: function (){
  1475. var self=this;
  1476. return smalltalk.withContext(function($ctx1) {
  1477. var $2,$1;
  1478. $2=self["@arguments"];
  1479. if(($receiver = $2) == nil || $receiver == null){
  1480. self["@arguments"]=[];
  1481. $1=self["@arguments"];
  1482. } else {
  1483. $1=$2;
  1484. };
  1485. return $1;
  1486. }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.SendNode)})},
  1487. args: [],
  1488. source: "arguments\x0a\x09^arguments ifNil: [arguments := #()]",
  1489. messageSends: ["ifNil:"],
  1490. referencedClasses: []
  1491. }),
  1492. smalltalk.SendNode);
  1493. smalltalk.addMethod(
  1494. smalltalk.method({
  1495. selector: "arguments:",
  1496. category: 'accessing',
  1497. fn: function (aCollection){
  1498. var self=this;
  1499. return smalltalk.withContext(function($ctx1) {
  1500. self["@arguments"]=aCollection;
  1501. _st(aCollection)._do_((function(each){
  1502. return smalltalk.withContext(function($ctx2) {
  1503. return _st(each)._parent_(self);
  1504. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1505. return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection},smalltalk.SendNode)})},
  1506. args: ["aCollection"],
  1507. source: "arguments: aCollection\x0a\x09arguments := aCollection.\x0a\x09aCollection do: [ :each | each parent: self ]",
  1508. messageSends: ["do:", "parent:"],
  1509. referencedClasses: []
  1510. }),
  1511. smalltalk.SendNode);
  1512. smalltalk.addMethod(
  1513. smalltalk.method({
  1514. selector: "cascadeNodeWithMessages:",
  1515. category: 'accessing',
  1516. fn: function (aCollection){
  1517. var self=this;
  1518. var first;
  1519. function $SendNode(){return smalltalk.SendNode||(typeof SendNode=="undefined"?nil:SendNode)}
  1520. function $CascadeNode(){return smalltalk.CascadeNode||(typeof CascadeNode=="undefined"?nil:CascadeNode)}
  1521. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  1522. return smalltalk.withContext(function($ctx1) {
  1523. var $1,$2,$4,$5,$3;
  1524. $1=_st($SendNode())._new();
  1525. $ctx1.sendIdx["new"]=1;
  1526. _st($1)._selector_(self._selector());
  1527. _st($1)._arguments_(self._arguments());
  1528. $2=_st($1)._yourself();
  1529. $ctx1.sendIdx["yourself"]=1;
  1530. first=$2;
  1531. $4=_st($CascadeNode())._new();
  1532. _st($4)._receiver_(self._receiver());
  1533. _st($4)._nodes_(_st(_st($Array())._with_(first)).__comma(aCollection));
  1534. $5=_st($4)._yourself();
  1535. $3=$5;
  1536. return $3;
  1537. }, function($ctx1) {$ctx1.fill(self,"cascadeNodeWithMessages:",{aCollection:aCollection,first:first},smalltalk.SendNode)})},
  1538. args: ["aCollection"],
  1539. 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",
  1540. messageSends: ["selector:", "new", "selector", "arguments:", "arguments", "yourself", "receiver:", "receiver", "nodes:", ",", "with:"],
  1541. referencedClasses: ["SendNode", "CascadeNode", "Array"]
  1542. }),
  1543. smalltalk.SendNode);
  1544. smalltalk.addMethod(
  1545. smalltalk.method({
  1546. selector: "index",
  1547. category: 'accessing',
  1548. fn: function (){
  1549. var self=this;
  1550. return smalltalk.withContext(function($ctx1) {
  1551. var $1;
  1552. $1=self["@index"];
  1553. return $1;
  1554. }, function($ctx1) {$ctx1.fill(self,"index",{},smalltalk.SendNode)})},
  1555. args: [],
  1556. source: "index\x0a\x09^ index",
  1557. messageSends: [],
  1558. referencedClasses: []
  1559. }),
  1560. smalltalk.SendNode);
  1561. smalltalk.addMethod(
  1562. smalltalk.method({
  1563. selector: "index:",
  1564. category: 'accessing',
  1565. fn: function (anInteger){
  1566. var self=this;
  1567. return smalltalk.withContext(function($ctx1) {
  1568. self["@index"]=anInteger;
  1569. return self}, function($ctx1) {$ctx1.fill(self,"index:",{anInteger:anInteger},smalltalk.SendNode)})},
  1570. args: ["anInteger"],
  1571. source: "index: anInteger\x0a\x09index := anInteger",
  1572. messageSends: [],
  1573. referencedClasses: []
  1574. }),
  1575. smalltalk.SendNode);
  1576. smalltalk.addMethod(
  1577. smalltalk.method({
  1578. selector: "isCascadeSendNode",
  1579. category: 'testing',
  1580. fn: function (){
  1581. var self=this;
  1582. return smalltalk.withContext(function($ctx1) {
  1583. var $1;
  1584. $1=_st(self._parent())._isCascadeNode();
  1585. return $1;
  1586. }, function($ctx1) {$ctx1.fill(self,"isCascadeSendNode",{},smalltalk.SendNode)})},
  1587. args: [],
  1588. source: "isCascadeSendNode\x0a\x09^ self parent isCascadeNode",
  1589. messageSends: ["isCascadeNode", "parent"],
  1590. referencedClasses: []
  1591. }),
  1592. smalltalk.SendNode);
  1593. smalltalk.addMethod(
  1594. smalltalk.method({
  1595. selector: "isSendNode",
  1596. category: 'testing',
  1597. fn: function (){
  1598. var self=this;
  1599. return smalltalk.withContext(function($ctx1) {
  1600. return true;
  1601. }, function($ctx1) {$ctx1.fill(self,"isSendNode",{},smalltalk.SendNode)})},
  1602. args: [],
  1603. source: "isSendNode\x0a\x09^ true",
  1604. messageSends: [],
  1605. referencedClasses: []
  1606. }),
  1607. smalltalk.SendNode);
  1608. smalltalk.addMethod(
  1609. smalltalk.method({
  1610. selector: "nodes",
  1611. category: 'accessing',
  1612. fn: function (){
  1613. var self=this;
  1614. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  1615. return smalltalk.withContext(function($ctx1) {
  1616. var $1,$3,$2,$5,$6,$4;
  1617. $1=self._receiver();
  1618. $ctx1.sendIdx["receiver"]=1;
  1619. if(($receiver = $1) == nil || $receiver == null){
  1620. $3=self._arguments();
  1621. $ctx1.sendIdx["arguments"]=1;
  1622. $2=_st($3)._copy();
  1623. return $2;
  1624. } else {
  1625. $1;
  1626. };
  1627. $5=_st($Array())._with_(self._receiver());
  1628. _st($5)._addAll_(self._arguments());
  1629. $6=_st($5)._yourself();
  1630. $4=$6;
  1631. return $4;
  1632. }, function($ctx1) {$ctx1.fill(self,"nodes",{},smalltalk.SendNode)})},
  1633. args: [],
  1634. 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",
  1635. messageSends: ["ifNil:", "receiver", "copy", "arguments", "addAll:", "with:", "yourself"],
  1636. referencedClasses: ["Array"]
  1637. }),
  1638. smalltalk.SendNode);
  1639. smalltalk.addMethod(
  1640. smalltalk.method({
  1641. selector: "receiver",
  1642. category: 'accessing',
  1643. fn: function (){
  1644. var self=this;
  1645. return smalltalk.withContext(function($ctx1) {
  1646. var $1;
  1647. $1=self["@receiver"];
  1648. return $1;
  1649. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.SendNode)})},
  1650. args: [],
  1651. source: "receiver\x0a\x09^receiver",
  1652. messageSends: [],
  1653. referencedClasses: []
  1654. }),
  1655. smalltalk.SendNode);
  1656. smalltalk.addMethod(
  1657. smalltalk.method({
  1658. selector: "receiver:",
  1659. category: 'accessing',
  1660. fn: function (aNode){
  1661. var self=this;
  1662. return smalltalk.withContext(function($ctx1) {
  1663. var $1;
  1664. self["@receiver"]=aNode;
  1665. $1=_st(aNode)._isNode();
  1666. if(smalltalk.assert($1)){
  1667. _st(aNode)._parent_(self);
  1668. };
  1669. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{aNode:aNode},smalltalk.SendNode)})},
  1670. args: ["aNode"],
  1671. source: "receiver: aNode\x0a\x09receiver := aNode.\x0a\x09aNode isNode ifTrue: [\x0a\x09\x09aNode parent: self ]",
  1672. messageSends: ["ifTrue:", "isNode", "parent:"],
  1673. referencedClasses: []
  1674. }),
  1675. smalltalk.SendNode);
  1676. smalltalk.addMethod(
  1677. smalltalk.method({
  1678. selector: "selector",
  1679. category: 'accessing',
  1680. fn: function (){
  1681. var self=this;
  1682. return smalltalk.withContext(function($ctx1) {
  1683. var $1;
  1684. $1=self["@selector"];
  1685. return $1;
  1686. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.SendNode)})},
  1687. args: [],
  1688. source: "selector\x0a\x09^selector",
  1689. messageSends: [],
  1690. referencedClasses: []
  1691. }),
  1692. smalltalk.SendNode);
  1693. smalltalk.addMethod(
  1694. smalltalk.method({
  1695. selector: "selector:",
  1696. category: 'accessing',
  1697. fn: function (aString){
  1698. var self=this;
  1699. return smalltalk.withContext(function($ctx1) {
  1700. self["@selector"]=aString;
  1701. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.SendNode)})},
  1702. args: ["aString"],
  1703. source: "selector: aString\x0a\x09selector := aString",
  1704. messageSends: [],
  1705. referencedClasses: []
  1706. }),
  1707. smalltalk.SendNode);
  1708. smalltalk.addMethod(
  1709. smalltalk.method({
  1710. selector: "shouldBeAliased",
  1711. category: 'testing',
  1712. fn: function (){
  1713. var self=this;
  1714. var sends;
  1715. return smalltalk.withContext(function($ctx1) {
  1716. var $1;
  1717. sends=_st(_st(_st(self._method())._sendIndexes())._at_(self._selector()))._size();
  1718. $1=_st(smalltalk.SendNode.superclass.fn.prototype._shouldBeAliased.apply(_st(self), []))._or_((function(){
  1719. return smalltalk.withContext(function($ctx2) {
  1720. return _st(_st(_st(sends).__gt((1)))._and_((function(){
  1721. return smalltalk.withContext(function($ctx3) {
  1722. return _st(self._index()).__lt(sends);
  1723. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})})))._and_((function(){
  1724. return smalltalk.withContext(function($ctx3) {
  1725. return self._isReferenced();
  1726. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  1727. $ctx2.sendIdx["and:"]=1;
  1728. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1729. return $1;
  1730. }, function($ctx1) {$ctx1.fill(self,"shouldBeAliased",{sends:sends},smalltalk.SendNode)})},
  1731. args: [],
  1732. 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 ] ]",
  1733. messageSends: ["size", "at:", "sendIndexes", "method", "selector", "or:", "shouldBeAliased", "and:", ">", "<", "index", "isReferenced"],
  1734. referencedClasses: []
  1735. }),
  1736. smalltalk.SendNode);
  1737. smalltalk.addMethod(
  1738. smalltalk.method({
  1739. selector: "stopOnStepping",
  1740. category: 'testing',
  1741. fn: function (){
  1742. var self=this;
  1743. return smalltalk.withContext(function($ctx1) {
  1744. return true;
  1745. }, function($ctx1) {$ctx1.fill(self,"stopOnStepping",{},smalltalk.SendNode)})},
  1746. args: [],
  1747. source: "stopOnStepping\x0a\x09^ true",
  1748. messageSends: [],
  1749. referencedClasses: []
  1750. }),
  1751. smalltalk.SendNode);
  1752. smalltalk.addMethod(
  1753. smalltalk.method({
  1754. selector: "superSend",
  1755. category: 'accessing',
  1756. fn: function (){
  1757. var self=this;
  1758. return smalltalk.withContext(function($ctx1) {
  1759. var $2,$1;
  1760. $2=self["@superSend"];
  1761. if(($receiver = $2) == nil || $receiver == null){
  1762. $1=false;
  1763. } else {
  1764. $1=$2;
  1765. };
  1766. return $1;
  1767. }, function($ctx1) {$ctx1.fill(self,"superSend",{},smalltalk.SendNode)})},
  1768. args: [],
  1769. source: "superSend\x0a\x09^ superSend ifNil: [ false ]",
  1770. messageSends: ["ifNil:"],
  1771. referencedClasses: []
  1772. }),
  1773. smalltalk.SendNode);
  1774. smalltalk.addMethod(
  1775. smalltalk.method({
  1776. selector: "superSend:",
  1777. category: 'accessing',
  1778. fn: function (aBoolean){
  1779. var self=this;
  1780. return smalltalk.withContext(function($ctx1) {
  1781. self["@superSend"]=aBoolean;
  1782. return self}, function($ctx1) {$ctx1.fill(self,"superSend:",{aBoolean:aBoolean},smalltalk.SendNode)})},
  1783. args: ["aBoolean"],
  1784. source: "superSend: aBoolean\x0a\x09superSend := aBoolean",
  1785. messageSends: [],
  1786. referencedClasses: []
  1787. }),
  1788. smalltalk.SendNode);
  1789. smalltalk.addMethod(
  1790. smalltalk.method({
  1791. selector: "valueForReceiver:",
  1792. category: 'accessing',
  1793. fn: function (anObject){
  1794. var self=this;
  1795. function $SendNode(){return smalltalk.SendNode||(typeof SendNode=="undefined"?nil:SendNode)}
  1796. return smalltalk.withContext(function($ctx1) {
  1797. var $2,$3,$5,$4,$6,$1;
  1798. $2=_st($SendNode())._new();
  1799. _st($2)._position_(self._position());
  1800. $3=$2;
  1801. $5=self._receiver();
  1802. $ctx1.sendIdx["receiver"]=1;
  1803. if(($receiver = $5) == nil || $receiver == null){
  1804. $4=anObject;
  1805. } else {
  1806. $4=_st(self._receiver())._valueForReceiver_(anObject);
  1807. };
  1808. _st($3)._receiver_($4);
  1809. _st($2)._selector_(self._selector());
  1810. _st($2)._arguments_(self._arguments());
  1811. $6=_st($2)._yourself();
  1812. $1=$6;
  1813. return $1;
  1814. }, function($ctx1) {$ctx1.fill(self,"valueForReceiver:",{anObject:anObject},smalltalk.SendNode)})},
  1815. args: ["anObject"],
  1816. 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",
  1817. messageSends: ["position:", "new", "position", "receiver:", "ifNil:ifNotNil:", "receiver", "valueForReceiver:", "selector:", "selector", "arguments:", "arguments", "yourself"],
  1818. referencedClasses: ["SendNode"]
  1819. }),
  1820. smalltalk.SendNode);
  1821. smalltalk.addClass('SequenceNode', smalltalk.Node, ['temps', 'scope'], 'Compiler-AST');
  1822. 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).";
  1823. smalltalk.addMethod(
  1824. smalltalk.method({
  1825. selector: "accept:",
  1826. category: 'visiting',
  1827. fn: function (aVisitor){
  1828. var self=this;
  1829. return smalltalk.withContext(function($ctx1) {
  1830. var $1;
  1831. $1=_st(aVisitor)._visitSequenceNode_(self);
  1832. return $1;
  1833. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.SequenceNode)})},
  1834. args: ["aVisitor"],
  1835. source: "accept: aVisitor\x0a\x09^ aVisitor visitSequenceNode: self",
  1836. messageSends: ["visitSequenceNode:"],
  1837. referencedClasses: []
  1838. }),
  1839. smalltalk.SequenceNode);
  1840. smalltalk.addMethod(
  1841. smalltalk.method({
  1842. selector: "asBlockSequenceNode",
  1843. category: 'converting',
  1844. fn: function (){
  1845. var self=this;
  1846. function $BlockSequenceNode(){return smalltalk.BlockSequenceNode||(typeof BlockSequenceNode=="undefined"?nil:BlockSequenceNode)}
  1847. return smalltalk.withContext(function($ctx1) {
  1848. var $2,$3,$1;
  1849. $2=_st($BlockSequenceNode())._new();
  1850. _st($2)._position_(self._position());
  1851. _st($2)._nodes_(self._nodes());
  1852. _st($2)._temps_(self._temps());
  1853. $3=_st($2)._yourself();
  1854. $1=$3;
  1855. return $1;
  1856. }, function($ctx1) {$ctx1.fill(self,"asBlockSequenceNode",{},smalltalk.SequenceNode)})},
  1857. args: [],
  1858. source: "asBlockSequenceNode\x0a\x09^BlockSequenceNode new\x0a\x09\x09position: self position;\x0a\x09\x09nodes: self nodes;\x0a\x09\x09temps: self temps;\x0a\x09\x09yourself",
  1859. messageSends: ["position:", "new", "position", "nodes:", "nodes", "temps:", "temps", "yourself"],
  1860. referencedClasses: ["BlockSequenceNode"]
  1861. }),
  1862. smalltalk.SequenceNode);
  1863. smalltalk.addMethod(
  1864. smalltalk.method({
  1865. selector: "isSequenceNode",
  1866. category: 'testing',
  1867. fn: function (){
  1868. var self=this;
  1869. return smalltalk.withContext(function($ctx1) {
  1870. return true;
  1871. }, function($ctx1) {$ctx1.fill(self,"isSequenceNode",{},smalltalk.SequenceNode)})},
  1872. args: [],
  1873. source: "isSequenceNode\x0a\x09^ true",
  1874. messageSends: [],
  1875. referencedClasses: []
  1876. }),
  1877. smalltalk.SequenceNode);
  1878. smalltalk.addMethod(
  1879. smalltalk.method({
  1880. selector: "scope",
  1881. category: 'accessing',
  1882. fn: function (){
  1883. var self=this;
  1884. return smalltalk.withContext(function($ctx1) {
  1885. var $1;
  1886. $1=self["@scope"];
  1887. return $1;
  1888. }, function($ctx1) {$ctx1.fill(self,"scope",{},smalltalk.SequenceNode)})},
  1889. args: [],
  1890. source: "scope\x0a\x09^ scope",
  1891. messageSends: [],
  1892. referencedClasses: []
  1893. }),
  1894. smalltalk.SequenceNode);
  1895. smalltalk.addMethod(
  1896. smalltalk.method({
  1897. selector: "scope:",
  1898. category: 'accessing',
  1899. fn: function (aLexicalScope){
  1900. var self=this;
  1901. return smalltalk.withContext(function($ctx1) {
  1902. self["@scope"]=aLexicalScope;
  1903. return self}, function($ctx1) {$ctx1.fill(self,"scope:",{aLexicalScope:aLexicalScope},smalltalk.SequenceNode)})},
  1904. args: ["aLexicalScope"],
  1905. source: "scope: aLexicalScope\x0a\x09scope := aLexicalScope",
  1906. messageSends: [],
  1907. referencedClasses: []
  1908. }),
  1909. smalltalk.SequenceNode);
  1910. smalltalk.addMethod(
  1911. smalltalk.method({
  1912. selector: "temps",
  1913. category: 'accessing',
  1914. fn: function (){
  1915. var self=this;
  1916. return smalltalk.withContext(function($ctx1) {
  1917. var $2,$1;
  1918. $2=self["@temps"];
  1919. if(($receiver = $2) == nil || $receiver == null){
  1920. $1=[];
  1921. } else {
  1922. $1=$2;
  1923. };
  1924. return $1;
  1925. }, function($ctx1) {$ctx1.fill(self,"temps",{},smalltalk.SequenceNode)})},
  1926. args: [],
  1927. source: "temps\x0a\x09^temps ifNil: [#()]",
  1928. messageSends: ["ifNil:"],
  1929. referencedClasses: []
  1930. }),
  1931. smalltalk.SequenceNode);
  1932. smalltalk.addMethod(
  1933. smalltalk.method({
  1934. selector: "temps:",
  1935. category: 'accessing',
  1936. fn: function (aCollection){
  1937. var self=this;
  1938. return smalltalk.withContext(function($ctx1) {
  1939. self["@temps"]=aCollection;
  1940. return self}, function($ctx1) {$ctx1.fill(self,"temps:",{aCollection:aCollection},smalltalk.SequenceNode)})},
  1941. args: ["aCollection"],
  1942. source: "temps: aCollection\x0a\x09temps := aCollection",
  1943. messageSends: [],
  1944. referencedClasses: []
  1945. }),
  1946. smalltalk.SequenceNode);
  1947. smalltalk.addClass('BlockSequenceNode', smalltalk.SequenceNode, [], 'Compiler-AST');
  1948. smalltalk.BlockSequenceNode.comment="I represent an special sequence node for block scopes.";
  1949. smalltalk.addMethod(
  1950. smalltalk.method({
  1951. selector: "accept:",
  1952. category: 'visiting',
  1953. fn: function (aVisitor){
  1954. var self=this;
  1955. return smalltalk.withContext(function($ctx1) {
  1956. var $1;
  1957. $1=_st(aVisitor)._visitBlockSequenceNode_(self);
  1958. return $1;
  1959. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.BlockSequenceNode)})},
  1960. args: ["aVisitor"],
  1961. source: "accept: aVisitor\x0a\x09^ aVisitor visitBlockSequenceNode: self",
  1962. messageSends: ["visitBlockSequenceNode:"],
  1963. referencedClasses: []
  1964. }),
  1965. smalltalk.BlockSequenceNode);
  1966. smalltalk.addMethod(
  1967. smalltalk.method({
  1968. selector: "isBlockSequenceNode",
  1969. category: 'testing',
  1970. fn: function (){
  1971. var self=this;
  1972. return smalltalk.withContext(function($ctx1) {
  1973. return true;
  1974. }, function($ctx1) {$ctx1.fill(self,"isBlockSequenceNode",{},smalltalk.BlockSequenceNode)})},
  1975. args: [],
  1976. source: "isBlockSequenceNode\x0a\x09^true",
  1977. messageSends: [],
  1978. referencedClasses: []
  1979. }),
  1980. smalltalk.BlockSequenceNode);
  1981. smalltalk.addClass('ValueNode', smalltalk.Node, ['value'], 'Compiler-AST');
  1982. smalltalk.ValueNode.comment="I represent a value node.";
  1983. smalltalk.addMethod(
  1984. smalltalk.method({
  1985. selector: "accept:",
  1986. category: 'visiting',
  1987. fn: function (aVisitor){
  1988. var self=this;
  1989. return smalltalk.withContext(function($ctx1) {
  1990. var $1;
  1991. $1=_st(aVisitor)._visitValueNode_(self);
  1992. return $1;
  1993. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.ValueNode)})},
  1994. args: ["aVisitor"],
  1995. source: "accept: aVisitor\x0a\x09^ aVisitor visitValueNode: self",
  1996. messageSends: ["visitValueNode:"],
  1997. referencedClasses: []
  1998. }),
  1999. smalltalk.ValueNode);
  2000. smalltalk.addMethod(
  2001. smalltalk.method({
  2002. selector: "isImmutable",
  2003. category: 'testing',
  2004. fn: function (){
  2005. var self=this;
  2006. return smalltalk.withContext(function($ctx1) {
  2007. var $1;
  2008. $1=_st(self._value())._isImmutable();
  2009. return $1;
  2010. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.ValueNode)})},
  2011. args: [],
  2012. source: "isImmutable\x0a\x09^ self value isImmutable",
  2013. messageSends: ["isImmutable", "value"],
  2014. referencedClasses: []
  2015. }),
  2016. smalltalk.ValueNode);
  2017. smalltalk.addMethod(
  2018. smalltalk.method({
  2019. selector: "isValueNode",
  2020. category: 'testing',
  2021. fn: function (){
  2022. var self=this;
  2023. return smalltalk.withContext(function($ctx1) {
  2024. return true;
  2025. }, function($ctx1) {$ctx1.fill(self,"isValueNode",{},smalltalk.ValueNode)})},
  2026. args: [],
  2027. source: "isValueNode\x0a\x09^true",
  2028. messageSends: [],
  2029. referencedClasses: []
  2030. }),
  2031. smalltalk.ValueNode);
  2032. smalltalk.addMethod(
  2033. smalltalk.method({
  2034. selector: "value",
  2035. category: 'accessing',
  2036. fn: function (){
  2037. var self=this;
  2038. return smalltalk.withContext(function($ctx1) {
  2039. var $1;
  2040. $1=self["@value"];
  2041. return $1;
  2042. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.ValueNode)})},
  2043. args: [],
  2044. source: "value\x0a\x09^value",
  2045. messageSends: [],
  2046. referencedClasses: []
  2047. }),
  2048. smalltalk.ValueNode);
  2049. smalltalk.addMethod(
  2050. smalltalk.method({
  2051. selector: "value:",
  2052. category: 'accessing',
  2053. fn: function (anObject){
  2054. var self=this;
  2055. return smalltalk.withContext(function($ctx1) {
  2056. self["@value"]=anObject;
  2057. return self}, function($ctx1) {$ctx1.fill(self,"value:",{anObject:anObject},smalltalk.ValueNode)})},
  2058. args: ["anObject"],
  2059. source: "value: anObject\x0a\x09value := anObject",
  2060. messageSends: [],
  2061. referencedClasses: []
  2062. }),
  2063. smalltalk.ValueNode);
  2064. smalltalk.addMethod(
  2065. smalltalk.method({
  2066. selector: "xxxDoIt",
  2067. category: 'xxxDoIt',
  2068. fn: function (){
  2069. var self=this;
  2070. return smalltalk.withContext(function($ctx1) {
  2071. var $1;
  2072. $1=_st((function(){
  2073. return smalltalk.withContext(function($ctx2) {
  2074. return self._stack();
  2075. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._value();
  2076. return $1;
  2077. }, function($ctx1) {$ctx1.fill(self,"xxxDoIt",{},smalltalk.ValueNode)})},
  2078. args: [],
  2079. source: "xxxDoIt ^[self stack] value",
  2080. messageSends: ["value", "stack"],
  2081. referencedClasses: []
  2082. }),
  2083. smalltalk.ValueNode);
  2084. smalltalk.addClass('VariableNode', smalltalk.ValueNode, ['assigned', 'binding'], 'Compiler-AST');
  2085. smalltalk.VariableNode.comment="I represent an variable node.";
  2086. smalltalk.addMethod(
  2087. smalltalk.method({
  2088. selector: "accept:",
  2089. category: 'visiting',
  2090. fn: function (aVisitor){
  2091. var self=this;
  2092. return smalltalk.withContext(function($ctx1) {
  2093. var $1;
  2094. $1=_st(aVisitor)._visitVariableNode_(self);
  2095. return $1;
  2096. }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},smalltalk.VariableNode)})},
  2097. args: ["aVisitor"],
  2098. source: "accept: aVisitor\x0a\x09^ aVisitor visitVariableNode: self",
  2099. messageSends: ["visitVariableNode:"],
  2100. referencedClasses: []
  2101. }),
  2102. smalltalk.VariableNode);
  2103. smalltalk.addMethod(
  2104. smalltalk.method({
  2105. selector: "alias",
  2106. category: 'accessing',
  2107. fn: function (){
  2108. var self=this;
  2109. return smalltalk.withContext(function($ctx1) {
  2110. var $1;
  2111. $1=_st(self._binding())._alias();
  2112. return $1;
  2113. }, function($ctx1) {$ctx1.fill(self,"alias",{},smalltalk.VariableNode)})},
  2114. args: [],
  2115. source: "alias\x0a\x09^ self binding alias",
  2116. messageSends: ["alias", "binding"],
  2117. referencedClasses: []
  2118. }),
  2119. smalltalk.VariableNode);
  2120. smalltalk.addMethod(
  2121. smalltalk.method({
  2122. selector: "assigned",
  2123. category: 'accessing',
  2124. fn: function (){
  2125. var self=this;
  2126. return smalltalk.withContext(function($ctx1) {
  2127. var $2,$1;
  2128. $2=self["@assigned"];
  2129. if(($receiver = $2) == nil || $receiver == null){
  2130. $1=false;
  2131. } else {
  2132. $1=$2;
  2133. };
  2134. return $1;
  2135. }, function($ctx1) {$ctx1.fill(self,"assigned",{},smalltalk.VariableNode)})},
  2136. args: [],
  2137. source: "assigned\x0a\x09^assigned ifNil: [false]",
  2138. messageSends: ["ifNil:"],
  2139. referencedClasses: []
  2140. }),
  2141. smalltalk.VariableNode);
  2142. smalltalk.addMethod(
  2143. smalltalk.method({
  2144. selector: "assigned:",
  2145. category: 'accessing',
  2146. fn: function (aBoolean){
  2147. var self=this;
  2148. return smalltalk.withContext(function($ctx1) {
  2149. self["@assigned"]=aBoolean;
  2150. return self}, function($ctx1) {$ctx1.fill(self,"assigned:",{aBoolean:aBoolean},smalltalk.VariableNode)})},
  2151. args: ["aBoolean"],
  2152. source: "assigned: aBoolean\x0a\x09assigned := aBoolean",
  2153. messageSends: [],
  2154. referencedClasses: []
  2155. }),
  2156. smalltalk.VariableNode);
  2157. smalltalk.addMethod(
  2158. smalltalk.method({
  2159. selector: "beAssigned",
  2160. category: 'accessing',
  2161. fn: function (){
  2162. var self=this;
  2163. return smalltalk.withContext(function($ctx1) {
  2164. _st(self._binding())._validateAssignment();
  2165. self["@assigned"]=true;
  2166. return self}, function($ctx1) {$ctx1.fill(self,"beAssigned",{},smalltalk.VariableNode)})},
  2167. args: [],
  2168. source: "beAssigned\x0a\x09self binding validateAssignment.\x0a\x09assigned := true",
  2169. messageSends: ["validateAssignment", "binding"],
  2170. referencedClasses: []
  2171. }),
  2172. smalltalk.VariableNode);
  2173. smalltalk.addMethod(
  2174. smalltalk.method({
  2175. selector: "binding",
  2176. category: 'accessing',
  2177. fn: function (){
  2178. var self=this;
  2179. return smalltalk.withContext(function($ctx1) {
  2180. var $1;
  2181. $1=self["@binding"];
  2182. return $1;
  2183. }, function($ctx1) {$ctx1.fill(self,"binding",{},smalltalk.VariableNode)})},
  2184. args: [],
  2185. source: "binding\x0a\x09^ binding",
  2186. messageSends: [],
  2187. referencedClasses: []
  2188. }),
  2189. smalltalk.VariableNode);
  2190. smalltalk.addMethod(
  2191. smalltalk.method({
  2192. selector: "binding:",
  2193. category: 'accessing',
  2194. fn: function (aScopeVar){
  2195. var self=this;
  2196. return smalltalk.withContext(function($ctx1) {
  2197. self["@binding"]=aScopeVar;
  2198. return self}, function($ctx1) {$ctx1.fill(self,"binding:",{aScopeVar:aScopeVar},smalltalk.VariableNode)})},
  2199. args: ["aScopeVar"],
  2200. source: "binding: aScopeVar\x0a\x09binding := aScopeVar",
  2201. messageSends: [],
  2202. referencedClasses: []
  2203. }),
  2204. smalltalk.VariableNode);
  2205. smalltalk.addMethod(
  2206. smalltalk.method({
  2207. selector: "isArgument",
  2208. category: 'testing',
  2209. fn: function (){
  2210. var self=this;
  2211. return smalltalk.withContext(function($ctx1) {
  2212. var $1;
  2213. $1=_st(self._binding())._isArgVar();
  2214. return $1;
  2215. }, function($ctx1) {$ctx1.fill(self,"isArgument",{},smalltalk.VariableNode)})},
  2216. args: [],
  2217. source: "isArgument\x0a\x09^ self binding isArgVar",
  2218. messageSends: ["isArgVar", "binding"],
  2219. referencedClasses: []
  2220. }),
  2221. smalltalk.VariableNode);
  2222. smalltalk.addMethod(
  2223. smalltalk.method({
  2224. selector: "isImmutable",
  2225. category: 'testing',
  2226. fn: function (){
  2227. var self=this;
  2228. return smalltalk.withContext(function($ctx1) {
  2229. var $1;
  2230. $1=_st(self._binding())._isImmutable();
  2231. return $1;
  2232. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.VariableNode)})},
  2233. args: [],
  2234. source: "isImmutable\x0a\x09^ self binding isImmutable",
  2235. messageSends: ["isImmutable", "binding"],
  2236. referencedClasses: []
  2237. }),
  2238. smalltalk.VariableNode);
  2239. smalltalk.addMethod(
  2240. smalltalk.method({
  2241. selector: "isVariableNode",
  2242. category: 'testing',
  2243. fn: function (){
  2244. var self=this;
  2245. return smalltalk.withContext(function($ctx1) {
  2246. return true;
  2247. }, function($ctx1) {$ctx1.fill(self,"isVariableNode",{},smalltalk.VariableNode)})},
  2248. args: [],
  2249. source: "isVariableNode\x0a\x09^ true",
  2250. messageSends: [],
  2251. referencedClasses: []
  2252. }),
  2253. smalltalk.VariableNode);
  2254. smalltalk.addMethod(
  2255. smalltalk.method({
  2256. selector: "isNode",
  2257. category: '*Compiler-AST',
  2258. fn: function (){
  2259. var self=this;
  2260. return smalltalk.withContext(function($ctx1) {
  2261. return false;
  2262. }, function($ctx1) {$ctx1.fill(self,"isNode",{},smalltalk.Object)})},
  2263. args: [],
  2264. source: "isNode\x0a\x09^ false",
  2265. messageSends: [],
  2266. referencedClasses: []
  2267. }),
  2268. smalltalk.Object);
  2269. smalltalk.addMethod(
  2270. smalltalk.method({
  2271. selector: "ast",
  2272. category: '*Compiler-AST',
  2273. fn: function (){
  2274. var self=this;
  2275. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2276. return smalltalk.withContext(function($ctx1) {
  2277. var $1,$2;
  2278. $1=self._source();
  2279. $ctx1.sendIdx["source"]=1;
  2280. _st($1)._ifEmpty_((function(){
  2281. return smalltalk.withContext(function($ctx2) {
  2282. return self._error_("Method source is empty");
  2283. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2284. $2=_st(_st($Smalltalk())._current())._parse_(self._source());
  2285. return $2;
  2286. }, function($ctx1) {$ctx1.fill(self,"ast",{},smalltalk.CompiledMethod)})},
  2287. args: [],
  2288. source: "ast\x0a\x09self source ifEmpty: [ self error: 'Method source is empty' ].\x0a\x09\x0a\x09^ Smalltalk current parse: self source",
  2289. messageSends: ["ifEmpty:", "source", "error:", "parse:", "current"],
  2290. referencedClasses: ["Smalltalk"]
  2291. }),
  2292. smalltalk.CompiledMethod);
  2293. });