1
0

Compiler-AST.js 58 KB

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