2
0

Compiler-AST.js 67 KB

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