Compiler-AST.js 57 KB

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