Compiler-AST.js 83 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148
  1. define(["amber/boot", "require", "amber/core/Kernel-Dag", "amber/core/Kernel-Exceptions", "amber/core/Kernel-Methods"], function($boot,requirejs){"use strict";
  2. var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
  3. var $pkg = $core.addPackage("Compiler-AST");
  4. $pkg.innerEval = function (expr) { return eval(expr); };
  5. $pkg.transport = {"type":"amd","amdNamespace":"amber/core"};
  6. $core.addClass("ASTNode", $globals.DagParentNode, ["parent", "position", "source", "shouldBeAliased"], "Compiler-AST");
  7. //>>excludeStart("ide", pragmas.excludeIdeData);
  8. $globals.ASTNode.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.";
  9. //>>excludeEnd("ide");
  10. $core.addMethod(
  11. $core.method({
  12. selector: "inPosition:",
  13. protocol: "testing",
  14. fn: function (aPoint){
  15. var self=this,$self=this;
  16. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  17. return $core.withContext(function($ctx1) {
  18. //>>excludeEnd("ctx");
  19. return $recv($recv($self._positionStart()).__lt_eq(aPoint))._and_((function(){
  20. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  21. return $core.withContext(function($ctx2) {
  22. //>>excludeEnd("ctx");
  23. return $recv($self._positionEnd()).__gt_eq(aPoint);
  24. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  25. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  26. //>>excludeEnd("ctx");
  27. }));
  28. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  29. }, function($ctx1) {$ctx1.fill(self,"inPosition:",{aPoint:aPoint},$globals.ASTNode)});
  30. //>>excludeEnd("ctx");
  31. },
  32. //>>excludeStart("ide", pragmas.excludeIdeData);
  33. args: ["aPoint"],
  34. source: "inPosition: aPoint\x0a\x09^ (self positionStart <= aPoint and: [\x0a\x09\x09self positionEnd >= aPoint ])",
  35. referencedClasses: [],
  36. //>>excludeEnd("ide");
  37. messageSends: ["and:", "<=", "positionStart", ">=", "positionEnd"]
  38. }),
  39. $globals.ASTNode);
  40. $core.addMethod(
  41. $core.method({
  42. selector: "isAssignmentNode",
  43. protocol: "testing",
  44. fn: function (){
  45. var self=this,$self=this;
  46. return false;
  47. },
  48. //>>excludeStart("ide", pragmas.excludeIdeData);
  49. args: [],
  50. source: "isAssignmentNode\x0a\x09^ false",
  51. referencedClasses: [],
  52. //>>excludeEnd("ide");
  53. messageSends: []
  54. }),
  55. $globals.ASTNode);
  56. $core.addMethod(
  57. $core.method({
  58. selector: "isBlockNode",
  59. protocol: "testing",
  60. fn: function (){
  61. var self=this,$self=this;
  62. return false;
  63. },
  64. //>>excludeStart("ide", pragmas.excludeIdeData);
  65. args: [],
  66. source: "isBlockNode\x0a\x09^ false",
  67. referencedClasses: [],
  68. //>>excludeEnd("ide");
  69. messageSends: []
  70. }),
  71. $globals.ASTNode);
  72. $core.addMethod(
  73. $core.method({
  74. selector: "isBlockSequenceNode",
  75. protocol: "testing",
  76. fn: function (){
  77. var self=this,$self=this;
  78. return false;
  79. },
  80. //>>excludeStart("ide", pragmas.excludeIdeData);
  81. args: [],
  82. source: "isBlockSequenceNode\x0a\x09^ false",
  83. referencedClasses: [],
  84. //>>excludeEnd("ide");
  85. messageSends: []
  86. }),
  87. $globals.ASTNode);
  88. $core.addMethod(
  89. $core.method({
  90. selector: "isCascadeNode",
  91. protocol: "testing",
  92. fn: function (){
  93. var self=this,$self=this;
  94. return false;
  95. },
  96. //>>excludeStart("ide", pragmas.excludeIdeData);
  97. args: [],
  98. source: "isCascadeNode\x0a\x09^ false",
  99. referencedClasses: [],
  100. //>>excludeEnd("ide");
  101. messageSends: []
  102. }),
  103. $globals.ASTNode);
  104. $core.addMethod(
  105. $core.method({
  106. selector: "isImmutable",
  107. protocol: "testing",
  108. fn: function (){
  109. var self=this,$self=this;
  110. return false;
  111. },
  112. //>>excludeStart("ide", pragmas.excludeIdeData);
  113. args: [],
  114. source: "isImmutable\x0a\x09^ false",
  115. referencedClasses: [],
  116. //>>excludeEnd("ide");
  117. messageSends: []
  118. }),
  119. $globals.ASTNode);
  120. $core.addMethod(
  121. $core.method({
  122. selector: "isJSStatementNode",
  123. protocol: "testing",
  124. fn: function (){
  125. var self=this,$self=this;
  126. return false;
  127. },
  128. //>>excludeStart("ide", pragmas.excludeIdeData);
  129. args: [],
  130. source: "isJSStatementNode\x0a\x09^ false",
  131. referencedClasses: [],
  132. //>>excludeEnd("ide");
  133. messageSends: []
  134. }),
  135. $globals.ASTNode);
  136. $core.addMethod(
  137. $core.method({
  138. selector: "isNavigationNode",
  139. protocol: "testing",
  140. fn: function (){
  141. var self=this,$self=this;
  142. return false;
  143. },
  144. //>>excludeStart("ide", pragmas.excludeIdeData);
  145. args: [],
  146. source: "isNavigationNode\x0a\x09\x22Answer true if the node can be navigated to\x22\x0a\x09\x0a\x09^ false",
  147. referencedClasses: [],
  148. //>>excludeEnd("ide");
  149. messageSends: []
  150. }),
  151. $globals.ASTNode);
  152. $core.addMethod(
  153. $core.method({
  154. selector: "isReturnNode",
  155. protocol: "testing",
  156. fn: function (){
  157. var self=this,$self=this;
  158. return false;
  159. },
  160. //>>excludeStart("ide", pragmas.excludeIdeData);
  161. args: [],
  162. source: "isReturnNode\x0a\x09^ false",
  163. referencedClasses: [],
  164. //>>excludeEnd("ide");
  165. messageSends: []
  166. }),
  167. $globals.ASTNode);
  168. $core.addMethod(
  169. $core.method({
  170. selector: "isSendNode",
  171. protocol: "testing",
  172. fn: function (){
  173. var self=this,$self=this;
  174. return false;
  175. },
  176. //>>excludeStart("ide", pragmas.excludeIdeData);
  177. args: [],
  178. source: "isSendNode\x0a\x09^ false",
  179. referencedClasses: [],
  180. //>>excludeEnd("ide");
  181. messageSends: []
  182. }),
  183. $globals.ASTNode);
  184. $core.addMethod(
  185. $core.method({
  186. selector: "isSequenceNode",
  187. protocol: "testing",
  188. fn: function (){
  189. var self=this,$self=this;
  190. return false;
  191. },
  192. //>>excludeStart("ide", pragmas.excludeIdeData);
  193. args: [],
  194. source: "isSequenceNode\x0a\x09^ false",
  195. referencedClasses: [],
  196. //>>excludeEnd("ide");
  197. messageSends: []
  198. }),
  199. $globals.ASTNode);
  200. $core.addMethod(
  201. $core.method({
  202. selector: "isSuperKeyword",
  203. protocol: "testing",
  204. fn: function (){
  205. var self=this,$self=this;
  206. return false;
  207. },
  208. //>>excludeStart("ide", pragmas.excludeIdeData);
  209. args: [],
  210. source: "isSuperKeyword\x0a\x09^ false",
  211. referencedClasses: [],
  212. //>>excludeEnd("ide");
  213. messageSends: []
  214. }),
  215. $globals.ASTNode);
  216. $core.addMethod(
  217. $core.method({
  218. selector: "isValueNode",
  219. protocol: "testing",
  220. fn: function (){
  221. var self=this,$self=this;
  222. return false;
  223. },
  224. //>>excludeStart("ide", pragmas.excludeIdeData);
  225. args: [],
  226. source: "isValueNode\x0a\x09^ false",
  227. referencedClasses: [],
  228. //>>excludeEnd("ide");
  229. messageSends: []
  230. }),
  231. $globals.ASTNode);
  232. $core.addMethod(
  233. $core.method({
  234. selector: "isVariableNode",
  235. protocol: "testing",
  236. fn: function (){
  237. var self=this,$self=this;
  238. return false;
  239. },
  240. //>>excludeStart("ide", pragmas.excludeIdeData);
  241. args: [],
  242. source: "isVariableNode\x0a\x09^ false",
  243. referencedClasses: [],
  244. //>>excludeEnd("ide");
  245. messageSends: []
  246. }),
  247. $globals.ASTNode);
  248. $core.addMethod(
  249. $core.method({
  250. selector: "location:",
  251. protocol: "accessing",
  252. fn: function (aLocation){
  253. var self=this,$self=this;
  254. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  255. return $core.withContext(function($ctx1) {
  256. //>>excludeEnd("ctx");
  257. var $3,$2,$1;
  258. $3=$recv(aLocation)._start();
  259. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  260. $ctx1.sendIdx["start"]=1;
  261. //>>excludeEnd("ctx");
  262. $2=$recv($3)._line();
  263. $1=$recv($2).__at($recv($recv(aLocation)._start())._column());
  264. $self._position_($1);
  265. return self;
  266. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  267. }, function($ctx1) {$ctx1.fill(self,"location:",{aLocation:aLocation},$globals.ASTNode)});
  268. //>>excludeEnd("ctx");
  269. },
  270. //>>excludeStart("ide", pragmas.excludeIdeData);
  271. args: ["aLocation"],
  272. source: "location: aLocation\x0a\x09self position: aLocation start line @ aLocation start column",
  273. referencedClasses: [],
  274. //>>excludeEnd("ide");
  275. messageSends: ["position:", "@", "line", "start", "column"]
  276. }),
  277. $globals.ASTNode);
  278. $core.addMethod(
  279. $core.method({
  280. selector: "method",
  281. protocol: "accessing",
  282. fn: function (){
  283. var self=this,$self=this;
  284. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  285. return $core.withContext(function($ctx1) {
  286. //>>excludeEnd("ctx");
  287. var $1,$receiver;
  288. $1=$self._parent();
  289. if(($receiver = $1) == null || $receiver.a$nil){
  290. return $1;
  291. } else {
  292. var node;
  293. node=$receiver;
  294. return $recv(node)._method();
  295. }
  296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  297. }, function($ctx1) {$ctx1.fill(self,"method",{},$globals.ASTNode)});
  298. //>>excludeEnd("ctx");
  299. },
  300. //>>excludeStart("ide", pragmas.excludeIdeData);
  301. args: [],
  302. source: "method\x0a\x09^ self parent ifNotNil: [ :node | node method ]",
  303. referencedClasses: [],
  304. //>>excludeEnd("ide");
  305. messageSends: ["ifNotNil:", "parent", "method"]
  306. }),
  307. $globals.ASTNode);
  308. $core.addMethod(
  309. $core.method({
  310. selector: "navigationNodeAt:ifAbsent:",
  311. protocol: "accessing",
  312. fn: function (aPoint,aBlock){
  313. var self=this,$self=this;
  314. var children;
  315. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  316. return $core.withContext(function($ctx1) {
  317. //>>excludeEnd("ctx");
  318. var $2,$1;
  319. var $early={};
  320. try {
  321. children=$recv($self._allDagChildren())._select_((function(each){
  322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  323. return $core.withContext(function($ctx2) {
  324. //>>excludeEnd("ctx");
  325. return $recv($recv(each)._isNavigationNode())._and_((function(){
  326. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  327. return $core.withContext(function($ctx3) {
  328. //>>excludeEnd("ctx");
  329. return $recv(each)._inPosition_(aPoint);
  330. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  331. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
  332. //>>excludeEnd("ctx");
  333. }));
  334. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  335. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  336. //>>excludeEnd("ctx");
  337. }));
  338. $recv(children)._ifEmpty_((function(){
  339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  340. return $core.withContext(function($ctx2) {
  341. //>>excludeEnd("ctx");
  342. throw $early=[$recv(aBlock)._value()];
  343. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  344. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)});
  345. //>>excludeEnd("ctx");
  346. }));
  347. return $recv($recv($recv(children)._asArray())._sort_((function(a,b){
  348. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  349. return $core.withContext(function($ctx2) {
  350. //>>excludeEnd("ctx");
  351. $2=$recv(a)._positionStart();
  352. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  353. $ctx2.sendIdx["positionStart"]=1;
  354. //>>excludeEnd("ctx");
  355. $1=$recv($2)._dist_(aPoint);
  356. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  357. $ctx2.sendIdx["dist:"]=1;
  358. //>>excludeEnd("ctx");
  359. return $recv($1).__lt_eq($recv($recv(b)._positionStart())._dist_(aPoint));
  360. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  361. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,4)});
  362. //>>excludeEnd("ctx");
  363. })))._first();
  364. }
  365. catch(e) {if(e===$early)return e[0]; throw e}
  366. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  367. }, function($ctx1) {$ctx1.fill(self,"navigationNodeAt:ifAbsent:",{aPoint:aPoint,aBlock:aBlock,children:children},$globals.ASTNode)});
  368. //>>excludeEnd("ctx");
  369. },
  370. //>>excludeStart("ide", pragmas.excludeIdeData);
  371. args: ["aPoint", "aBlock"],
  372. source: "navigationNodeAt: aPoint ifAbsent: aBlock\x0a\x09\x22Answer the navigation node in the receiver's tree at aPoint \x0a\x09or nil if no navigation node was found.\x0a\x09\x0a\x09See `node >> isNaviationNode`\x22\x0a\x09\x0a\x09| children |\x0a\x09\x0a\x09children := self allDagChildren select: [ :each | \x0a\x09\x09each isNavigationNode and: [ each inPosition: aPoint ] ].\x0a\x09\x0a\x09children ifEmpty: [ ^ aBlock value ].\x0a\x09\x0a\x09^ (children asArray sort: [ :a :b | \x0a\x09\x09(a positionStart dist: aPoint) <= \x0a\x09\x09(b positionStart dist: aPoint) ]) first",
  373. referencedClasses: [],
  374. //>>excludeEnd("ide");
  375. messageSends: ["select:", "allDagChildren", "and:", "isNavigationNode", "inPosition:", "ifEmpty:", "value", "first", "sort:", "asArray", "<=", "dist:", "positionStart"]
  376. }),
  377. $globals.ASTNode);
  378. $core.addMethod(
  379. $core.method({
  380. selector: "parent",
  381. protocol: "accessing",
  382. fn: function (){
  383. var self=this,$self=this;
  384. return $self.parent;
  385. },
  386. //>>excludeStart("ide", pragmas.excludeIdeData);
  387. args: [],
  388. source: "parent\x0a\x09^ parent",
  389. referencedClasses: [],
  390. //>>excludeEnd("ide");
  391. messageSends: []
  392. }),
  393. $globals.ASTNode);
  394. $core.addMethod(
  395. $core.method({
  396. selector: "parent:",
  397. protocol: "accessing",
  398. fn: function (aNode){
  399. var self=this,$self=this;
  400. $self.parent=aNode;
  401. return self;
  402. },
  403. //>>excludeStart("ide", pragmas.excludeIdeData);
  404. args: ["aNode"],
  405. source: "parent: aNode\x0a\x09parent := aNode",
  406. referencedClasses: [],
  407. //>>excludeEnd("ide");
  408. messageSends: []
  409. }),
  410. $globals.ASTNode);
  411. $core.addMethod(
  412. $core.method({
  413. selector: "position",
  414. protocol: "accessing",
  415. fn: function (){
  416. var self=this,$self=this;
  417. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  418. return $core.withContext(function($ctx1) {
  419. //>>excludeEnd("ctx");
  420. var $1,$2,$receiver;
  421. $1=$self.position;
  422. if(($receiver = $1) == null || $receiver.a$nil){
  423. $2=$self._parent();
  424. if(($receiver = $2) == null || $receiver.a$nil){
  425. return $2;
  426. } else {
  427. var node;
  428. node=$receiver;
  429. return $recv(node)._position();
  430. }
  431. } else {
  432. return $1;
  433. }
  434. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  435. }, function($ctx1) {$ctx1.fill(self,"position",{},$globals.ASTNode)});
  436. //>>excludeEnd("ctx");
  437. },
  438. //>>excludeStart("ide", pragmas.excludeIdeData);
  439. args: [],
  440. 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 ] ]",
  441. referencedClasses: [],
  442. //>>excludeEnd("ide");
  443. messageSends: ["ifNil:", "ifNotNil:", "parent", "position"]
  444. }),
  445. $globals.ASTNode);
  446. $core.addMethod(
  447. $core.method({
  448. selector: "position:",
  449. protocol: "accessing",
  450. fn: function (aPosition){
  451. var self=this,$self=this;
  452. $self.position=aPosition;
  453. return self;
  454. },
  455. //>>excludeStart("ide", pragmas.excludeIdeData);
  456. args: ["aPosition"],
  457. source: "position: aPosition\x0a\x09position := aPosition",
  458. referencedClasses: [],
  459. //>>excludeEnd("ide");
  460. messageSends: []
  461. }),
  462. $globals.ASTNode);
  463. $core.addMethod(
  464. $core.method({
  465. selector: "positionEnd",
  466. protocol: "accessing",
  467. fn: function (){
  468. var self=this,$self=this;
  469. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  470. return $core.withContext(function($ctx1) {
  471. //>>excludeEnd("ctx");
  472. var $1,$6,$5,$4,$3,$2;
  473. $1=$self._positionStart();
  474. $6=$self._source();
  475. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  476. $ctx1.sendIdx["source"]=1;
  477. //>>excludeEnd("ctx");
  478. $5=$recv($6)._lines();
  479. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  480. $ctx1.sendIdx["lines"]=1;
  481. //>>excludeEnd("ctx");
  482. $4=$recv($5)._size();
  483. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  484. $ctx1.sendIdx["size"]=1;
  485. //>>excludeEnd("ctx");
  486. $3=$recv($4).__minus((1));
  487. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  488. $ctx1.sendIdx["-"]=1;
  489. //>>excludeEnd("ctx");
  490. $2=$recv($3).__at($recv($recv($recv($recv($self._source())._lines())._last())._size()).__minus((1)));
  491. return $recv($1).__plus($2);
  492. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  493. }, function($ctx1) {$ctx1.fill(self,"positionEnd",{},$globals.ASTNode)});
  494. //>>excludeEnd("ctx");
  495. },
  496. //>>excludeStart("ide", pragmas.excludeIdeData);
  497. args: [],
  498. source: "positionEnd\x0a\x09^ self positionStart + ((self source lines size - 1) @ (self source lines last size - 1))",
  499. referencedClasses: [],
  500. //>>excludeEnd("ide");
  501. messageSends: ["+", "positionStart", "@", "-", "size", "lines", "source", "last"]
  502. }),
  503. $globals.ASTNode);
  504. $core.addMethod(
  505. $core.method({
  506. selector: "positionStart",
  507. protocol: "accessing",
  508. fn: function (){
  509. var self=this,$self=this;
  510. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  511. return $core.withContext(function($ctx1) {
  512. //>>excludeEnd("ctx");
  513. return $self._position();
  514. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  515. }, function($ctx1) {$ctx1.fill(self,"positionStart",{},$globals.ASTNode)});
  516. //>>excludeEnd("ctx");
  517. },
  518. //>>excludeStart("ide", pragmas.excludeIdeData);
  519. args: [],
  520. source: "positionStart\x0a\x09^ self position",
  521. referencedClasses: [],
  522. //>>excludeEnd("ide");
  523. messageSends: ["position"]
  524. }),
  525. $globals.ASTNode);
  526. $core.addMethod(
  527. $core.method({
  528. selector: "requiresSmalltalkContext",
  529. protocol: "testing",
  530. fn: function (){
  531. var self=this,$self=this;
  532. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  533. return $core.withContext(function($ctx1) {
  534. //>>excludeEnd("ctx");
  535. return $recv($recv($self._dagChildren())._detect_ifNone_((function(each){
  536. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  537. return $core.withContext(function($ctx2) {
  538. //>>excludeEnd("ctx");
  539. return $recv(each)._requiresSmalltalkContext();
  540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  541. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  542. //>>excludeEnd("ctx");
  543. }),(function(){
  544. return nil;
  545. })))._notNil();
  546. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  547. }, function($ctx1) {$ctx1.fill(self,"requiresSmalltalkContext",{},$globals.ASTNode)});
  548. //>>excludeEnd("ctx");
  549. },
  550. //>>excludeStart("ide", pragmas.excludeIdeData);
  551. args: [],
  552. source: "requiresSmalltalkContext\x0a\x09\x22Answer true if the receiver requires a smalltalk context.\x0a\x09Only send nodes require a context.\x0a\x09\x0a\x09If no node requires a context, the method will be compiled without one.\x0a\x09See `IRJSTranslator` and `JSStream` for context creation\x22\x0a\x09\x0a\x09^ (self dagChildren \x0a\x09\x09detect: [ :each | each requiresSmalltalkContext ]\x0a\x09\x09ifNone: [ nil ]) notNil",
  553. referencedClasses: [],
  554. //>>excludeEnd("ide");
  555. messageSends: ["notNil", "detect:ifNone:", "dagChildren", "requiresSmalltalkContext"]
  556. }),
  557. $globals.ASTNode);
  558. $core.addMethod(
  559. $core.method({
  560. selector: "shouldBeAliased",
  561. protocol: "accessing",
  562. fn: function (){
  563. var self=this,$self=this;
  564. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  565. return $core.withContext(function($ctx1) {
  566. //>>excludeEnd("ctx");
  567. var $1,$receiver;
  568. $1=$self.shouldBeAliased;
  569. if(($receiver = $1) == null || $receiver.a$nil){
  570. return false;
  571. } else {
  572. return $1;
  573. }
  574. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  575. }, function($ctx1) {$ctx1.fill(self,"shouldBeAliased",{},$globals.ASTNode)});
  576. //>>excludeEnd("ctx");
  577. },
  578. //>>excludeStart("ide", pragmas.excludeIdeData);
  579. args: [],
  580. source: "shouldBeAliased\x0a\x09^ shouldBeAliased ifNil: [ false ]",
  581. referencedClasses: [],
  582. //>>excludeEnd("ide");
  583. messageSends: ["ifNil:"]
  584. }),
  585. $globals.ASTNode);
  586. $core.addMethod(
  587. $core.method({
  588. selector: "shouldBeAliased:",
  589. protocol: "accessing",
  590. fn: function (aBoolean){
  591. var self=this,$self=this;
  592. $self.shouldBeAliased=aBoolean;
  593. return self;
  594. },
  595. //>>excludeStart("ide", pragmas.excludeIdeData);
  596. args: ["aBoolean"],
  597. source: "shouldBeAliased: aBoolean\x0a\x09shouldBeAliased := aBoolean",
  598. referencedClasses: [],
  599. //>>excludeEnd("ide");
  600. messageSends: []
  601. }),
  602. $globals.ASTNode);
  603. $core.addMethod(
  604. $core.method({
  605. selector: "size",
  606. protocol: "accessing",
  607. fn: function (){
  608. var self=this,$self=this;
  609. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  610. return $core.withContext(function($ctx1) {
  611. //>>excludeEnd("ctx");
  612. return $recv($self._source())._size();
  613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  614. }, function($ctx1) {$ctx1.fill(self,"size",{},$globals.ASTNode)});
  615. //>>excludeEnd("ctx");
  616. },
  617. //>>excludeStart("ide", pragmas.excludeIdeData);
  618. args: [],
  619. source: "size\x0a\x09^ self source size",
  620. referencedClasses: [],
  621. //>>excludeEnd("ide");
  622. messageSends: ["size", "source"]
  623. }),
  624. $globals.ASTNode);
  625. $core.addMethod(
  626. $core.method({
  627. selector: "source",
  628. protocol: "accessing",
  629. fn: function (){
  630. var self=this,$self=this;
  631. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  632. return $core.withContext(function($ctx1) {
  633. //>>excludeEnd("ctx");
  634. var $1,$receiver;
  635. $1=$self.source;
  636. if(($receiver = $1) == null || $receiver.a$nil){
  637. return "";
  638. } else {
  639. return $1;
  640. }
  641. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  642. }, function($ctx1) {$ctx1.fill(self,"source",{},$globals.ASTNode)});
  643. //>>excludeEnd("ctx");
  644. },
  645. //>>excludeStart("ide", pragmas.excludeIdeData);
  646. args: [],
  647. source: "source\x0a\x09^ source ifNil: [ '' ]",
  648. referencedClasses: [],
  649. //>>excludeEnd("ide");
  650. messageSends: ["ifNil:"]
  651. }),
  652. $globals.ASTNode);
  653. $core.addMethod(
  654. $core.method({
  655. selector: "source:",
  656. protocol: "accessing",
  657. fn: function (aString){
  658. var self=this,$self=this;
  659. $self.source=aString;
  660. return self;
  661. },
  662. //>>excludeStart("ide", pragmas.excludeIdeData);
  663. args: ["aString"],
  664. source: "source: aString\x0a\x09source := aString",
  665. referencedClasses: [],
  666. //>>excludeEnd("ide");
  667. messageSends: []
  668. }),
  669. $globals.ASTNode);
  670. $core.addMethod(
  671. $core.method({
  672. selector: "withTail:",
  673. protocol: "building",
  674. fn: function (aCollection){
  675. var self=this,$self=this;
  676. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  677. return $core.withContext(function($ctx1) {
  678. //>>excludeEnd("ctx");
  679. var $1;
  680. return $recv(aCollection)._inject_into_(self,(function(receiver,send){
  681. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  682. return $core.withContext(function($ctx2) {
  683. //>>excludeEnd("ctx");
  684. $1=$recv($globals.SendNode)._new();
  685. $recv($1)._position_($recv(send)._position());
  686. $recv($1)._source_($recv(send)._source());
  687. $recv($1)._receiver_(receiver);
  688. $recv($1)._selector_($recv(send)._selector());
  689. $recv($1)._arguments_($recv(send)._arguments());
  690. return $recv($1)._yourself();
  691. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  692. }, function($ctx2) {$ctx2.fillBlock({receiver:receiver,send:send},$ctx1,1)});
  693. //>>excludeEnd("ctx");
  694. }));
  695. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  696. }, function($ctx1) {$ctx1.fill(self,"withTail:",{aCollection:aCollection},$globals.ASTNode)});
  697. //>>excludeEnd("ctx");
  698. },
  699. //>>excludeStart("ide", pragmas.excludeIdeData);
  700. args: ["aCollection"],
  701. source: "withTail: aCollection\x0a\x09^ aCollection inject: self into: [\x0a\x09\x09:receiver :send | SendNode new\x0a\x09\x09\x09position: send position;\x0a\x09\x09\x09source: send source;\x0a\x09\x09\x09receiver: receiver;\x0a\x09\x09\x09selector: send selector;\x0a\x09\x09\x09arguments: send arguments;\x0a\x09\x09\x09yourself ]",
  702. referencedClasses: ["SendNode"],
  703. //>>excludeEnd("ide");
  704. messageSends: ["inject:into:", "position:", "new", "position", "source:", "source", "receiver:", "selector:", "selector", "arguments:", "arguments", "yourself"]
  705. }),
  706. $globals.ASTNode);
  707. $core.addClass("AssignmentNode", $globals.ASTNode, ["left", "right"], "Compiler-AST");
  708. //>>excludeStart("ide", pragmas.excludeIdeData);
  709. $globals.AssignmentNode.comment="I represent an assignment node.";
  710. //>>excludeEnd("ide");
  711. $core.addMethod(
  712. $core.method({
  713. selector: "acceptDagVisitor:",
  714. protocol: "visiting",
  715. fn: function (aVisitor){
  716. var self=this,$self=this;
  717. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  718. return $core.withContext(function($ctx1) {
  719. //>>excludeEnd("ctx");
  720. return $recv(aVisitor)._visitAssignmentNode_(self);
  721. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  722. }, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.AssignmentNode)});
  723. //>>excludeEnd("ctx");
  724. },
  725. //>>excludeStart("ide", pragmas.excludeIdeData);
  726. args: ["aVisitor"],
  727. source: "acceptDagVisitor: aVisitor\x0a\x09^ aVisitor visitAssignmentNode: self",
  728. referencedClasses: [],
  729. //>>excludeEnd("ide");
  730. messageSends: ["visitAssignmentNode:"]
  731. }),
  732. $globals.AssignmentNode);
  733. $core.addMethod(
  734. $core.method({
  735. selector: "dagChildren",
  736. protocol: "accessing",
  737. fn: function (){
  738. var self=this,$self=this;
  739. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  740. return $core.withContext(function($ctx1) {
  741. //>>excludeEnd("ctx");
  742. return $recv($globals.Array)._with_with_($self._left(),$self._right());
  743. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  744. }, function($ctx1) {$ctx1.fill(self,"dagChildren",{},$globals.AssignmentNode)});
  745. //>>excludeEnd("ctx");
  746. },
  747. //>>excludeStart("ide", pragmas.excludeIdeData);
  748. args: [],
  749. source: "dagChildren\x0a\x09^ Array with: self left with: self right",
  750. referencedClasses: ["Array"],
  751. //>>excludeEnd("ide");
  752. messageSends: ["with:with:", "left", "right"]
  753. }),
  754. $globals.AssignmentNode);
  755. $core.addMethod(
  756. $core.method({
  757. selector: "isAssignmentNode",
  758. protocol: "testing",
  759. fn: function (){
  760. var self=this,$self=this;
  761. return true;
  762. },
  763. //>>excludeStart("ide", pragmas.excludeIdeData);
  764. args: [],
  765. source: "isAssignmentNode\x0a\x09^ true",
  766. referencedClasses: [],
  767. //>>excludeEnd("ide");
  768. messageSends: []
  769. }),
  770. $globals.AssignmentNode);
  771. $core.addMethod(
  772. $core.method({
  773. selector: "left",
  774. protocol: "accessing",
  775. fn: function (){
  776. var self=this,$self=this;
  777. return $self.left;
  778. },
  779. //>>excludeStart("ide", pragmas.excludeIdeData);
  780. args: [],
  781. source: "left\x0a\x09^ left",
  782. referencedClasses: [],
  783. //>>excludeEnd("ide");
  784. messageSends: []
  785. }),
  786. $globals.AssignmentNode);
  787. $core.addMethod(
  788. $core.method({
  789. selector: "left:",
  790. protocol: "accessing",
  791. fn: function (aNode){
  792. var self=this,$self=this;
  793. $self.left=aNode;
  794. return self;
  795. },
  796. //>>excludeStart("ide", pragmas.excludeIdeData);
  797. args: ["aNode"],
  798. source: "left: aNode\x0a\x09left := aNode",
  799. referencedClasses: [],
  800. //>>excludeEnd("ide");
  801. messageSends: []
  802. }),
  803. $globals.AssignmentNode);
  804. $core.addMethod(
  805. $core.method({
  806. selector: "right",
  807. protocol: "accessing",
  808. fn: function (){
  809. var self=this,$self=this;
  810. return $self.right;
  811. },
  812. //>>excludeStart("ide", pragmas.excludeIdeData);
  813. args: [],
  814. source: "right\x0a\x09^ right",
  815. referencedClasses: [],
  816. //>>excludeEnd("ide");
  817. messageSends: []
  818. }),
  819. $globals.AssignmentNode);
  820. $core.addMethod(
  821. $core.method({
  822. selector: "right:",
  823. protocol: "accessing",
  824. fn: function (aNode){
  825. var self=this,$self=this;
  826. $self.right=aNode;
  827. return self;
  828. },
  829. //>>excludeStart("ide", pragmas.excludeIdeData);
  830. args: ["aNode"],
  831. source: "right: aNode\x0a\x09right := aNode",
  832. referencedClasses: [],
  833. //>>excludeEnd("ide");
  834. messageSends: []
  835. }),
  836. $globals.AssignmentNode);
  837. $core.addClass("BlockNode", $globals.ASTNode, ["parameters", "scope"], "Compiler-AST");
  838. //>>excludeStart("ide", pragmas.excludeIdeData);
  839. $globals.BlockNode.comment="I represent an block closure node.";
  840. //>>excludeEnd("ide");
  841. $core.addMethod(
  842. $core.method({
  843. selector: "acceptDagVisitor:",
  844. protocol: "visiting",
  845. fn: function (aVisitor){
  846. var self=this,$self=this;
  847. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  848. return $core.withContext(function($ctx1) {
  849. //>>excludeEnd("ctx");
  850. return $recv(aVisitor)._visitBlockNode_(self);
  851. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  852. }, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.BlockNode)});
  853. //>>excludeEnd("ctx");
  854. },
  855. //>>excludeStart("ide", pragmas.excludeIdeData);
  856. args: ["aVisitor"],
  857. source: "acceptDagVisitor: aVisitor\x0a\x09^ aVisitor visitBlockNode: self",
  858. referencedClasses: [],
  859. //>>excludeEnd("ide");
  860. messageSends: ["visitBlockNode:"]
  861. }),
  862. $globals.BlockNode);
  863. $core.addMethod(
  864. $core.method({
  865. selector: "isBlockNode",
  866. protocol: "testing",
  867. fn: function (){
  868. var self=this,$self=this;
  869. return true;
  870. },
  871. //>>excludeStart("ide", pragmas.excludeIdeData);
  872. args: [],
  873. source: "isBlockNode\x0a\x09^ true",
  874. referencedClasses: [],
  875. //>>excludeEnd("ide");
  876. messageSends: []
  877. }),
  878. $globals.BlockNode);
  879. $core.addMethod(
  880. $core.method({
  881. selector: "parameters",
  882. protocol: "accessing",
  883. fn: function (){
  884. var self=this,$self=this;
  885. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  886. return $core.withContext(function($ctx1) {
  887. //>>excludeEnd("ctx");
  888. var $1,$receiver;
  889. $1=$self.parameters;
  890. if(($receiver = $1) == null || $receiver.a$nil){
  891. $self.parameters=$recv($globals.Array)._new();
  892. return $self.parameters;
  893. } else {
  894. return $1;
  895. }
  896. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  897. }, function($ctx1) {$ctx1.fill(self,"parameters",{},$globals.BlockNode)});
  898. //>>excludeEnd("ctx");
  899. },
  900. //>>excludeStart("ide", pragmas.excludeIdeData);
  901. args: [],
  902. source: "parameters\x0a\x09^ parameters ifNil: [ parameters := Array new ]",
  903. referencedClasses: ["Array"],
  904. //>>excludeEnd("ide");
  905. messageSends: ["ifNil:", "new"]
  906. }),
  907. $globals.BlockNode);
  908. $core.addMethod(
  909. $core.method({
  910. selector: "parameters:",
  911. protocol: "accessing",
  912. fn: function (aCollection){
  913. var self=this,$self=this;
  914. $self.parameters=aCollection;
  915. return self;
  916. },
  917. //>>excludeStart("ide", pragmas.excludeIdeData);
  918. args: ["aCollection"],
  919. source: "parameters: aCollection\x0a\x09parameters := aCollection",
  920. referencedClasses: [],
  921. //>>excludeEnd("ide");
  922. messageSends: []
  923. }),
  924. $globals.BlockNode);
  925. $core.addMethod(
  926. $core.method({
  927. selector: "scope",
  928. protocol: "accessing",
  929. fn: function (){
  930. var self=this,$self=this;
  931. return $self.scope;
  932. },
  933. //>>excludeStart("ide", pragmas.excludeIdeData);
  934. args: [],
  935. source: "scope\x0a\x09^ scope",
  936. referencedClasses: [],
  937. //>>excludeEnd("ide");
  938. messageSends: []
  939. }),
  940. $globals.BlockNode);
  941. $core.addMethod(
  942. $core.method({
  943. selector: "scope:",
  944. protocol: "accessing",
  945. fn: function (aLexicalScope){
  946. var self=this,$self=this;
  947. $self.scope=aLexicalScope;
  948. return self;
  949. },
  950. //>>excludeStart("ide", pragmas.excludeIdeData);
  951. args: ["aLexicalScope"],
  952. source: "scope: aLexicalScope\x0a\x09scope := aLexicalScope",
  953. referencedClasses: [],
  954. //>>excludeEnd("ide");
  955. messageSends: []
  956. }),
  957. $globals.BlockNode);
  958. $core.addClass("CascadeNode", $globals.ASTNode, ["receiver"], "Compiler-AST");
  959. //>>excludeStart("ide", pragmas.excludeIdeData);
  960. $globals.CascadeNode.comment="I represent an cascade node.";
  961. //>>excludeEnd("ide");
  962. $core.addMethod(
  963. $core.method({
  964. selector: "acceptDagVisitor:",
  965. protocol: "visiting",
  966. fn: function (aVisitor){
  967. var self=this,$self=this;
  968. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  969. return $core.withContext(function($ctx1) {
  970. //>>excludeEnd("ctx");
  971. return $recv(aVisitor)._visitCascadeNode_(self);
  972. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  973. }, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.CascadeNode)});
  974. //>>excludeEnd("ctx");
  975. },
  976. //>>excludeStart("ide", pragmas.excludeIdeData);
  977. args: ["aVisitor"],
  978. source: "acceptDagVisitor: aVisitor\x0a\x09^ aVisitor visitCascadeNode: self",
  979. referencedClasses: [],
  980. //>>excludeEnd("ide");
  981. messageSends: ["visitCascadeNode:"]
  982. }),
  983. $globals.CascadeNode);
  984. $core.addMethod(
  985. $core.method({
  986. selector: "isCascadeNode",
  987. protocol: "testing",
  988. fn: function (){
  989. var self=this,$self=this;
  990. return true;
  991. },
  992. //>>excludeStart("ide", pragmas.excludeIdeData);
  993. args: [],
  994. source: "isCascadeNode\x0a\x09^ true",
  995. referencedClasses: [],
  996. //>>excludeEnd("ide");
  997. messageSends: []
  998. }),
  999. $globals.CascadeNode);
  1000. $core.addMethod(
  1001. $core.method({
  1002. selector: "receiver",
  1003. protocol: "accessing",
  1004. fn: function (){
  1005. var self=this,$self=this;
  1006. return $self.receiver;
  1007. },
  1008. //>>excludeStart("ide", pragmas.excludeIdeData);
  1009. args: [],
  1010. source: "receiver\x0a\x09^ receiver",
  1011. referencedClasses: [],
  1012. //>>excludeEnd("ide");
  1013. messageSends: []
  1014. }),
  1015. $globals.CascadeNode);
  1016. $core.addMethod(
  1017. $core.method({
  1018. selector: "receiver:",
  1019. protocol: "accessing",
  1020. fn: function (aNode){
  1021. var self=this,$self=this;
  1022. $self.receiver=aNode;
  1023. return self;
  1024. },
  1025. //>>excludeStart("ide", pragmas.excludeIdeData);
  1026. args: ["aNode"],
  1027. source: "receiver: aNode\x0a\x09receiver := aNode",
  1028. referencedClasses: [],
  1029. //>>excludeEnd("ide");
  1030. messageSends: []
  1031. }),
  1032. $globals.CascadeNode);
  1033. $core.addClass("DynamicArrayNode", $globals.ASTNode, [], "Compiler-AST");
  1034. //>>excludeStart("ide", pragmas.excludeIdeData);
  1035. $globals.DynamicArrayNode.comment="I represent an dynamic array node.";
  1036. //>>excludeEnd("ide");
  1037. $core.addMethod(
  1038. $core.method({
  1039. selector: "acceptDagVisitor:",
  1040. protocol: "visiting",
  1041. fn: function (aVisitor){
  1042. var self=this,$self=this;
  1043. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1044. return $core.withContext(function($ctx1) {
  1045. //>>excludeEnd("ctx");
  1046. return $recv(aVisitor)._visitDynamicArrayNode_(self);
  1047. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1048. }, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.DynamicArrayNode)});
  1049. //>>excludeEnd("ctx");
  1050. },
  1051. //>>excludeStart("ide", pragmas.excludeIdeData);
  1052. args: ["aVisitor"],
  1053. source: "acceptDagVisitor: aVisitor\x0a\x09^ aVisitor visitDynamicArrayNode: self",
  1054. referencedClasses: [],
  1055. //>>excludeEnd("ide");
  1056. messageSends: ["visitDynamicArrayNode:"]
  1057. }),
  1058. $globals.DynamicArrayNode);
  1059. $core.addClass("DynamicDictionaryNode", $globals.ASTNode, [], "Compiler-AST");
  1060. //>>excludeStart("ide", pragmas.excludeIdeData);
  1061. $globals.DynamicDictionaryNode.comment="I represent an dynamic dictionary node.";
  1062. //>>excludeEnd("ide");
  1063. $core.addMethod(
  1064. $core.method({
  1065. selector: "acceptDagVisitor:",
  1066. protocol: "visiting",
  1067. fn: function (aVisitor){
  1068. var self=this,$self=this;
  1069. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1070. return $core.withContext(function($ctx1) {
  1071. //>>excludeEnd("ctx");
  1072. return $recv(aVisitor)._visitDynamicDictionaryNode_(self);
  1073. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1074. }, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.DynamicDictionaryNode)});
  1075. //>>excludeEnd("ctx");
  1076. },
  1077. //>>excludeStart("ide", pragmas.excludeIdeData);
  1078. args: ["aVisitor"],
  1079. source: "acceptDagVisitor: aVisitor\x0a\x09^ aVisitor visitDynamicDictionaryNode: self",
  1080. referencedClasses: [],
  1081. //>>excludeEnd("ide");
  1082. messageSends: ["visitDynamicDictionaryNode:"]
  1083. }),
  1084. $globals.DynamicDictionaryNode);
  1085. $core.addClass("JSStatementNode", $globals.ASTNode, [], "Compiler-AST");
  1086. //>>excludeStart("ide", pragmas.excludeIdeData);
  1087. $globals.JSStatementNode.comment="I represent an JavaScript statement node.";
  1088. //>>excludeEnd("ide");
  1089. $core.addMethod(
  1090. $core.method({
  1091. selector: "acceptDagVisitor:",
  1092. protocol: "visiting",
  1093. fn: function (aVisitor){
  1094. var self=this,$self=this;
  1095. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1096. return $core.withContext(function($ctx1) {
  1097. //>>excludeEnd("ctx");
  1098. return $recv(aVisitor)._visitJSStatementNode_(self);
  1099. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1100. }, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.JSStatementNode)});
  1101. //>>excludeEnd("ctx");
  1102. },
  1103. //>>excludeStart("ide", pragmas.excludeIdeData);
  1104. args: ["aVisitor"],
  1105. source: "acceptDagVisitor: aVisitor\x0a\x09^ aVisitor visitJSStatementNode: self",
  1106. referencedClasses: [],
  1107. //>>excludeEnd("ide");
  1108. messageSends: ["visitJSStatementNode:"]
  1109. }),
  1110. $globals.JSStatementNode);
  1111. $core.addMethod(
  1112. $core.method({
  1113. selector: "isJSStatementNode",
  1114. protocol: "testing",
  1115. fn: function (){
  1116. var self=this,$self=this;
  1117. return true;
  1118. },
  1119. //>>excludeStart("ide", pragmas.excludeIdeData);
  1120. args: [],
  1121. source: "isJSStatementNode\x0a\x09^ true",
  1122. referencedClasses: [],
  1123. //>>excludeEnd("ide");
  1124. messageSends: []
  1125. }),
  1126. $globals.JSStatementNode);
  1127. $core.addMethod(
  1128. $core.method({
  1129. selector: "requiresSmalltalkContext",
  1130. protocol: "testing",
  1131. fn: function (){
  1132. var self=this,$self=this;
  1133. return true;
  1134. },
  1135. //>>excludeStart("ide", pragmas.excludeIdeData);
  1136. args: [],
  1137. source: "requiresSmalltalkContext\x0a\x09^ true",
  1138. referencedClasses: [],
  1139. //>>excludeEnd("ide");
  1140. messageSends: []
  1141. }),
  1142. $globals.JSStatementNode);
  1143. $core.addClass("MethodNode", $globals.ASTNode, ["selector", "arguments", "source", "scope", "classReferences", "sendIndexes"], "Compiler-AST");
  1144. //>>excludeStart("ide", pragmas.excludeIdeData);
  1145. $globals.MethodNode.comment="I represent an method node.\x0a\x0aA method node must be the root and only method node of a valid AST.";
  1146. //>>excludeEnd("ide");
  1147. $core.addMethod(
  1148. $core.method({
  1149. selector: "acceptDagVisitor:",
  1150. protocol: "visiting",
  1151. fn: function (aVisitor){
  1152. var self=this,$self=this;
  1153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1154. return $core.withContext(function($ctx1) {
  1155. //>>excludeEnd("ctx");
  1156. return $recv(aVisitor)._visitMethodNode_(self);
  1157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1158. }, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.MethodNode)});
  1159. //>>excludeEnd("ctx");
  1160. },
  1161. //>>excludeStart("ide", pragmas.excludeIdeData);
  1162. args: ["aVisitor"],
  1163. source: "acceptDagVisitor: aVisitor\x0a\x09^ aVisitor visitMethodNode: self",
  1164. referencedClasses: [],
  1165. //>>excludeEnd("ide");
  1166. messageSends: ["visitMethodNode:"]
  1167. }),
  1168. $globals.MethodNode);
  1169. $core.addMethod(
  1170. $core.method({
  1171. selector: "arguments",
  1172. protocol: "accessing",
  1173. fn: function (){
  1174. var self=this,$self=this;
  1175. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1176. return $core.withContext(function($ctx1) {
  1177. //>>excludeEnd("ctx");
  1178. var $1,$receiver;
  1179. $1=$self.arguments;
  1180. if(($receiver = $1) == null || $receiver.a$nil){
  1181. return [];
  1182. } else {
  1183. return $1;
  1184. }
  1185. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1186. }, function($ctx1) {$ctx1.fill(self,"arguments",{},$globals.MethodNode)});
  1187. //>>excludeEnd("ctx");
  1188. },
  1189. //>>excludeStart("ide", pragmas.excludeIdeData);
  1190. args: [],
  1191. source: "arguments\x0a\x09^ arguments ifNil: [ #() ]",
  1192. referencedClasses: [],
  1193. //>>excludeEnd("ide");
  1194. messageSends: ["ifNil:"]
  1195. }),
  1196. $globals.MethodNode);
  1197. $core.addMethod(
  1198. $core.method({
  1199. selector: "arguments:",
  1200. protocol: "accessing",
  1201. fn: function (aCollection){
  1202. var self=this,$self=this;
  1203. $self.arguments=aCollection;
  1204. return self;
  1205. },
  1206. //>>excludeStart("ide", pragmas.excludeIdeData);
  1207. args: ["aCollection"],
  1208. source: "arguments: aCollection\x0a\x09arguments := aCollection",
  1209. referencedClasses: [],
  1210. //>>excludeEnd("ide");
  1211. messageSends: []
  1212. }),
  1213. $globals.MethodNode);
  1214. $core.addMethod(
  1215. $core.method({
  1216. selector: "classReferences",
  1217. protocol: "accessing",
  1218. fn: function (){
  1219. var self=this,$self=this;
  1220. return $self.classReferences;
  1221. },
  1222. //>>excludeStart("ide", pragmas.excludeIdeData);
  1223. args: [],
  1224. source: "classReferences\x0a\x09^ classReferences",
  1225. referencedClasses: [],
  1226. //>>excludeEnd("ide");
  1227. messageSends: []
  1228. }),
  1229. $globals.MethodNode);
  1230. $core.addMethod(
  1231. $core.method({
  1232. selector: "classReferences:",
  1233. protocol: "accessing",
  1234. fn: function (aCollection){
  1235. var self=this,$self=this;
  1236. $self.classReferences=aCollection;
  1237. return self;
  1238. },
  1239. //>>excludeStart("ide", pragmas.excludeIdeData);
  1240. args: ["aCollection"],
  1241. source: "classReferences: aCollection\x0a\x09classReferences := aCollection",
  1242. referencedClasses: [],
  1243. //>>excludeEnd("ide");
  1244. messageSends: []
  1245. }),
  1246. $globals.MethodNode);
  1247. $core.addMethod(
  1248. $core.method({
  1249. selector: "messageSends",
  1250. protocol: "accessing",
  1251. fn: function (){
  1252. var self=this,$self=this;
  1253. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1254. return $core.withContext(function($ctx1) {
  1255. //>>excludeEnd("ctx");
  1256. return $recv($self._sendIndexes())._keys();
  1257. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1258. }, function($ctx1) {$ctx1.fill(self,"messageSends",{},$globals.MethodNode)});
  1259. //>>excludeEnd("ctx");
  1260. },
  1261. //>>excludeStart("ide", pragmas.excludeIdeData);
  1262. args: [],
  1263. source: "messageSends\x0a\x09^ self sendIndexes keys",
  1264. referencedClasses: [],
  1265. //>>excludeEnd("ide");
  1266. messageSends: ["keys", "sendIndexes"]
  1267. }),
  1268. $globals.MethodNode);
  1269. $core.addMethod(
  1270. $core.method({
  1271. selector: "method",
  1272. protocol: "accessing",
  1273. fn: function (){
  1274. var self=this,$self=this;
  1275. return self;
  1276. },
  1277. //>>excludeStart("ide", pragmas.excludeIdeData);
  1278. args: [],
  1279. source: "method\x0a\x09^ self",
  1280. referencedClasses: [],
  1281. //>>excludeEnd("ide");
  1282. messageSends: []
  1283. }),
  1284. $globals.MethodNode);
  1285. $core.addMethod(
  1286. $core.method({
  1287. selector: "scope",
  1288. protocol: "accessing",
  1289. fn: function (){
  1290. var self=this,$self=this;
  1291. return $self.scope;
  1292. },
  1293. //>>excludeStart("ide", pragmas.excludeIdeData);
  1294. args: [],
  1295. source: "scope\x0a\x09^ scope",
  1296. referencedClasses: [],
  1297. //>>excludeEnd("ide");
  1298. messageSends: []
  1299. }),
  1300. $globals.MethodNode);
  1301. $core.addMethod(
  1302. $core.method({
  1303. selector: "scope:",
  1304. protocol: "accessing",
  1305. fn: function (aMethodScope){
  1306. var self=this,$self=this;
  1307. $self.scope=aMethodScope;
  1308. return self;
  1309. },
  1310. //>>excludeStart("ide", pragmas.excludeIdeData);
  1311. args: ["aMethodScope"],
  1312. source: "scope: aMethodScope\x0a\x09scope := aMethodScope",
  1313. referencedClasses: [],
  1314. //>>excludeEnd("ide");
  1315. messageSends: []
  1316. }),
  1317. $globals.MethodNode);
  1318. $core.addMethod(
  1319. $core.method({
  1320. selector: "selector",
  1321. protocol: "accessing",
  1322. fn: function (){
  1323. var self=this,$self=this;
  1324. return $self.selector;
  1325. },
  1326. //>>excludeStart("ide", pragmas.excludeIdeData);
  1327. args: [],
  1328. source: "selector\x0a\x09^ selector",
  1329. referencedClasses: [],
  1330. //>>excludeEnd("ide");
  1331. messageSends: []
  1332. }),
  1333. $globals.MethodNode);
  1334. $core.addMethod(
  1335. $core.method({
  1336. selector: "selector:",
  1337. protocol: "accessing",
  1338. fn: function (aString){
  1339. var self=this,$self=this;
  1340. $self.selector=aString;
  1341. return self;
  1342. },
  1343. //>>excludeStart("ide", pragmas.excludeIdeData);
  1344. args: ["aString"],
  1345. source: "selector: aString\x0a\x09selector := aString",
  1346. referencedClasses: [],
  1347. //>>excludeEnd("ide");
  1348. messageSends: []
  1349. }),
  1350. $globals.MethodNode);
  1351. $core.addMethod(
  1352. $core.method({
  1353. selector: "sendIndexes",
  1354. protocol: "accessing",
  1355. fn: function (){
  1356. var self=this,$self=this;
  1357. return $self.sendIndexes;
  1358. },
  1359. //>>excludeStart("ide", pragmas.excludeIdeData);
  1360. args: [],
  1361. source: "sendIndexes\x0a\x09^ sendIndexes",
  1362. referencedClasses: [],
  1363. //>>excludeEnd("ide");
  1364. messageSends: []
  1365. }),
  1366. $globals.MethodNode);
  1367. $core.addMethod(
  1368. $core.method({
  1369. selector: "sendIndexes:",
  1370. protocol: "accessing",
  1371. fn: function (aDictionary){
  1372. var self=this,$self=this;
  1373. $self.sendIndexes=aDictionary;
  1374. return self;
  1375. },
  1376. //>>excludeStart("ide", pragmas.excludeIdeData);
  1377. args: ["aDictionary"],
  1378. source: "sendIndexes: aDictionary\x0a\x09sendIndexes := aDictionary",
  1379. referencedClasses: [],
  1380. //>>excludeEnd("ide");
  1381. messageSends: []
  1382. }),
  1383. $globals.MethodNode);
  1384. $core.addMethod(
  1385. $core.method({
  1386. selector: "sequenceNode",
  1387. protocol: "accessing",
  1388. fn: function (){
  1389. var self=this,$self=this;
  1390. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1391. return $core.withContext(function($ctx1) {
  1392. //>>excludeEnd("ctx");
  1393. var $1;
  1394. var $early={};
  1395. try {
  1396. $recv($self._dagChildren())._do_((function(each){
  1397. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1398. return $core.withContext(function($ctx2) {
  1399. //>>excludeEnd("ctx");
  1400. $1=$recv(each)._isSequenceNode();
  1401. if($core.assert($1)){
  1402. throw $early=[each];
  1403. }
  1404. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1405. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
  1406. //>>excludeEnd("ctx");
  1407. }));
  1408. return nil;
  1409. }
  1410. catch(e) {if(e===$early)return e[0]; throw e}
  1411. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1412. }, function($ctx1) {$ctx1.fill(self,"sequenceNode",{},$globals.MethodNode)});
  1413. //>>excludeEnd("ctx");
  1414. },
  1415. //>>excludeStart("ide", pragmas.excludeIdeData);
  1416. args: [],
  1417. source: "sequenceNode\x0a\x09self dagChildren do: [ :each |\x0a\x09\x09each isSequenceNode ifTrue: [ ^ each ] ].\x0a\x09\x09\x0a\x09^ nil",
  1418. referencedClasses: [],
  1419. //>>excludeEnd("ide");
  1420. messageSends: ["do:", "dagChildren", "ifTrue:", "isSequenceNode"]
  1421. }),
  1422. $globals.MethodNode);
  1423. $core.addMethod(
  1424. $core.method({
  1425. selector: "source",
  1426. protocol: "accessing",
  1427. fn: function (){
  1428. var self=this,$self=this;
  1429. return $self.source;
  1430. },
  1431. //>>excludeStart("ide", pragmas.excludeIdeData);
  1432. args: [],
  1433. source: "source\x0a\x09^ source",
  1434. referencedClasses: [],
  1435. //>>excludeEnd("ide");
  1436. messageSends: []
  1437. }),
  1438. $globals.MethodNode);
  1439. $core.addMethod(
  1440. $core.method({
  1441. selector: "source:",
  1442. protocol: "accessing",
  1443. fn: function (aString){
  1444. var self=this,$self=this;
  1445. $self.source=aString;
  1446. return self;
  1447. },
  1448. //>>excludeStart("ide", pragmas.excludeIdeData);
  1449. args: ["aString"],
  1450. source: "source: aString\x0a\x09source := aString",
  1451. referencedClasses: [],
  1452. //>>excludeEnd("ide");
  1453. messageSends: []
  1454. }),
  1455. $globals.MethodNode);
  1456. $core.addClass("ReturnNode", $globals.ASTNode, ["scope"], "Compiler-AST");
  1457. //>>excludeStart("ide", pragmas.excludeIdeData);
  1458. $globals.ReturnNode.comment="I represent an return node. At the AST level, there is not difference between a local return or non-local return.";
  1459. //>>excludeEnd("ide");
  1460. $core.addMethod(
  1461. $core.method({
  1462. selector: "acceptDagVisitor:",
  1463. protocol: "visiting",
  1464. fn: function (aVisitor){
  1465. var self=this,$self=this;
  1466. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1467. return $core.withContext(function($ctx1) {
  1468. //>>excludeEnd("ctx");
  1469. return $recv(aVisitor)._visitReturnNode_(self);
  1470. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1471. }, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.ReturnNode)});
  1472. //>>excludeEnd("ctx");
  1473. },
  1474. //>>excludeStart("ide", pragmas.excludeIdeData);
  1475. args: ["aVisitor"],
  1476. source: "acceptDagVisitor: aVisitor\x0a\x09^ aVisitor visitReturnNode: self",
  1477. referencedClasses: [],
  1478. //>>excludeEnd("ide");
  1479. messageSends: ["visitReturnNode:"]
  1480. }),
  1481. $globals.ReturnNode);
  1482. $core.addMethod(
  1483. $core.method({
  1484. selector: "isReturnNode",
  1485. protocol: "testing",
  1486. fn: function (){
  1487. var self=this,$self=this;
  1488. return true;
  1489. },
  1490. //>>excludeStart("ide", pragmas.excludeIdeData);
  1491. args: [],
  1492. source: "isReturnNode\x0a\x09^ true",
  1493. referencedClasses: [],
  1494. //>>excludeEnd("ide");
  1495. messageSends: []
  1496. }),
  1497. $globals.ReturnNode);
  1498. $core.addMethod(
  1499. $core.method({
  1500. selector: "nonLocalReturn",
  1501. protocol: "testing",
  1502. fn: function (){
  1503. var self=this,$self=this;
  1504. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1505. return $core.withContext(function($ctx1) {
  1506. //>>excludeEnd("ctx");
  1507. return $recv($recv($self._scope())._isMethodScope())._not();
  1508. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1509. }, function($ctx1) {$ctx1.fill(self,"nonLocalReturn",{},$globals.ReturnNode)});
  1510. //>>excludeEnd("ctx");
  1511. },
  1512. //>>excludeStart("ide", pragmas.excludeIdeData);
  1513. args: [],
  1514. source: "nonLocalReturn\x0a\x09^ self scope isMethodScope not",
  1515. referencedClasses: [],
  1516. //>>excludeEnd("ide");
  1517. messageSends: ["not", "isMethodScope", "scope"]
  1518. }),
  1519. $globals.ReturnNode);
  1520. $core.addMethod(
  1521. $core.method({
  1522. selector: "scope",
  1523. protocol: "accessing",
  1524. fn: function (){
  1525. var self=this,$self=this;
  1526. return $self.scope;
  1527. },
  1528. //>>excludeStart("ide", pragmas.excludeIdeData);
  1529. args: [],
  1530. source: "scope\x0a\x09^ scope",
  1531. referencedClasses: [],
  1532. //>>excludeEnd("ide");
  1533. messageSends: []
  1534. }),
  1535. $globals.ReturnNode);
  1536. $core.addMethod(
  1537. $core.method({
  1538. selector: "scope:",
  1539. protocol: "accessing",
  1540. fn: function (aLexicalScope){
  1541. var self=this,$self=this;
  1542. $self.scope=aLexicalScope;
  1543. return self;
  1544. },
  1545. //>>excludeStart("ide", pragmas.excludeIdeData);
  1546. args: ["aLexicalScope"],
  1547. source: "scope: aLexicalScope\x0a\x09scope := aLexicalScope",
  1548. referencedClasses: [],
  1549. //>>excludeEnd("ide");
  1550. messageSends: []
  1551. }),
  1552. $globals.ReturnNode);
  1553. $core.addClass("SendNode", $globals.ASTNode, ["selector", "arguments", "receiver", "index", "shouldBeInlined"], "Compiler-AST");
  1554. //>>excludeStart("ide", pragmas.excludeIdeData);
  1555. $globals.SendNode.comment="I represent an message send node.";
  1556. //>>excludeEnd("ide");
  1557. $core.addMethod(
  1558. $core.method({
  1559. selector: "acceptDagVisitor:",
  1560. protocol: "visiting",
  1561. fn: function (aVisitor){
  1562. var self=this,$self=this;
  1563. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1564. return $core.withContext(function($ctx1) {
  1565. //>>excludeEnd("ctx");
  1566. return $recv(aVisitor)._visitSendNode_(self);
  1567. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1568. }, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.SendNode)});
  1569. //>>excludeEnd("ctx");
  1570. },
  1571. //>>excludeStart("ide", pragmas.excludeIdeData);
  1572. args: ["aVisitor"],
  1573. source: "acceptDagVisitor: aVisitor\x0a\x09^ aVisitor visitSendNode: self",
  1574. referencedClasses: [],
  1575. //>>excludeEnd("ide");
  1576. messageSends: ["visitSendNode:"]
  1577. }),
  1578. $globals.SendNode);
  1579. $core.addMethod(
  1580. $core.method({
  1581. selector: "arguments",
  1582. protocol: "accessing",
  1583. fn: function (){
  1584. var self=this,$self=this;
  1585. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1586. return $core.withContext(function($ctx1) {
  1587. //>>excludeEnd("ctx");
  1588. var $1,$receiver;
  1589. $1=$self.arguments;
  1590. if(($receiver = $1) == null || $receiver.a$nil){
  1591. $self.arguments=[];
  1592. return $self.arguments;
  1593. } else {
  1594. return $1;
  1595. }
  1596. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1597. }, function($ctx1) {$ctx1.fill(self,"arguments",{},$globals.SendNode)});
  1598. //>>excludeEnd("ctx");
  1599. },
  1600. //>>excludeStart("ide", pragmas.excludeIdeData);
  1601. args: [],
  1602. source: "arguments\x0a\x09^ arguments ifNil: [ arguments := #() ]",
  1603. referencedClasses: [],
  1604. //>>excludeEnd("ide");
  1605. messageSends: ["ifNil:"]
  1606. }),
  1607. $globals.SendNode);
  1608. $core.addMethod(
  1609. $core.method({
  1610. selector: "arguments:",
  1611. protocol: "accessing",
  1612. fn: function (aCollection){
  1613. var self=this,$self=this;
  1614. $self.arguments=aCollection;
  1615. return self;
  1616. },
  1617. //>>excludeStart("ide", pragmas.excludeIdeData);
  1618. args: ["aCollection"],
  1619. source: "arguments: aCollection\x0a\x09arguments := aCollection",
  1620. referencedClasses: [],
  1621. //>>excludeEnd("ide");
  1622. messageSends: []
  1623. }),
  1624. $globals.SendNode);
  1625. $core.addMethod(
  1626. $core.method({
  1627. selector: "dagChildren",
  1628. protocol: "accessing",
  1629. fn: function (){
  1630. var self=this,$self=this;
  1631. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1632. return $core.withContext(function($ctx1) {
  1633. //>>excludeEnd("ctx");
  1634. var $1,$2,$3,$receiver;
  1635. $1=$self._receiver();
  1636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1637. $ctx1.sendIdx["receiver"]=1;
  1638. //>>excludeEnd("ctx");
  1639. if(($receiver = $1) == null || $receiver.a$nil){
  1640. $2=$self._arguments();
  1641. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1642. $ctx1.sendIdx["arguments"]=1;
  1643. //>>excludeEnd("ctx");
  1644. return $recv($2)._copy();
  1645. } else {
  1646. $1;
  1647. }
  1648. $3=$recv($globals.Array)._with_($self._receiver());
  1649. $recv($3)._addAll_($self._arguments());
  1650. return $recv($3)._yourself();
  1651. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1652. }, function($ctx1) {$ctx1.fill(self,"dagChildren",{},$globals.SendNode)});
  1653. //>>excludeEnd("ctx");
  1654. },
  1655. //>>excludeStart("ide", pragmas.excludeIdeData);
  1656. args: [],
  1657. source: "dagChildren\x0a\x09self receiver ifNil: [ ^ self arguments copy ].\x0a\x09\x0a\x09^ (Array with: self receiver)\x0a\x09\x09addAll: self arguments;\x0a\x09\x09yourself",
  1658. referencedClasses: ["Array"],
  1659. //>>excludeEnd("ide");
  1660. messageSends: ["ifNil:", "receiver", "copy", "arguments", "addAll:", "with:", "yourself"]
  1661. }),
  1662. $globals.SendNode);
  1663. $core.addMethod(
  1664. $core.method({
  1665. selector: "index",
  1666. protocol: "accessing",
  1667. fn: function (){
  1668. var self=this,$self=this;
  1669. return $self.index;
  1670. },
  1671. //>>excludeStart("ide", pragmas.excludeIdeData);
  1672. args: [],
  1673. source: "index\x0a\x09^ index",
  1674. referencedClasses: [],
  1675. //>>excludeEnd("ide");
  1676. messageSends: []
  1677. }),
  1678. $globals.SendNode);
  1679. $core.addMethod(
  1680. $core.method({
  1681. selector: "index:",
  1682. protocol: "accessing",
  1683. fn: function (anInteger){
  1684. var self=this,$self=this;
  1685. $self.index=anInteger;
  1686. return self;
  1687. },
  1688. //>>excludeStart("ide", pragmas.excludeIdeData);
  1689. args: ["anInteger"],
  1690. source: "index: anInteger\x0a\x09index := anInteger",
  1691. referencedClasses: [],
  1692. //>>excludeEnd("ide");
  1693. messageSends: []
  1694. }),
  1695. $globals.SendNode);
  1696. $core.addMethod(
  1697. $core.method({
  1698. selector: "isNavigationNode",
  1699. protocol: "testing",
  1700. fn: function (){
  1701. var self=this,$self=this;
  1702. return true;
  1703. },
  1704. //>>excludeStart("ide", pragmas.excludeIdeData);
  1705. args: [],
  1706. source: "isNavigationNode\x0a\x09^ true",
  1707. referencedClasses: [],
  1708. //>>excludeEnd("ide");
  1709. messageSends: []
  1710. }),
  1711. $globals.SendNode);
  1712. $core.addMethod(
  1713. $core.method({
  1714. selector: "isSendNode",
  1715. protocol: "testing",
  1716. fn: function (){
  1717. var self=this,$self=this;
  1718. return true;
  1719. },
  1720. //>>excludeStart("ide", pragmas.excludeIdeData);
  1721. args: [],
  1722. source: "isSendNode\x0a\x09^ true",
  1723. referencedClasses: [],
  1724. //>>excludeEnd("ide");
  1725. messageSends: []
  1726. }),
  1727. $globals.SendNode);
  1728. $core.addMethod(
  1729. $core.method({
  1730. selector: "navigationLink",
  1731. protocol: "accessing",
  1732. fn: function (){
  1733. var self=this,$self=this;
  1734. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1735. return $core.withContext(function($ctx1) {
  1736. //>>excludeEnd("ctx");
  1737. return $self._selector();
  1738. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1739. }, function($ctx1) {$ctx1.fill(self,"navigationLink",{},$globals.SendNode)});
  1740. //>>excludeEnd("ctx");
  1741. },
  1742. //>>excludeStart("ide", pragmas.excludeIdeData);
  1743. args: [],
  1744. source: "navigationLink\x0a\x09^ self selector",
  1745. referencedClasses: [],
  1746. //>>excludeEnd("ide");
  1747. messageSends: ["selector"]
  1748. }),
  1749. $globals.SendNode);
  1750. $core.addMethod(
  1751. $core.method({
  1752. selector: "receiver",
  1753. protocol: "accessing",
  1754. fn: function (){
  1755. var self=this,$self=this;
  1756. return $self.receiver;
  1757. },
  1758. //>>excludeStart("ide", pragmas.excludeIdeData);
  1759. args: [],
  1760. source: "receiver\x0a\x09^ receiver",
  1761. referencedClasses: [],
  1762. //>>excludeEnd("ide");
  1763. messageSends: []
  1764. }),
  1765. $globals.SendNode);
  1766. $core.addMethod(
  1767. $core.method({
  1768. selector: "receiver:",
  1769. protocol: "accessing",
  1770. fn: function (aNode){
  1771. var self=this,$self=this;
  1772. $self.receiver=aNode;
  1773. return self;
  1774. },
  1775. //>>excludeStart("ide", pragmas.excludeIdeData);
  1776. args: ["aNode"],
  1777. source: "receiver: aNode\x0a\x09receiver := aNode",
  1778. referencedClasses: [],
  1779. //>>excludeEnd("ide");
  1780. messageSends: []
  1781. }),
  1782. $globals.SendNode);
  1783. $core.addMethod(
  1784. $core.method({
  1785. selector: "requiresSmalltalkContext",
  1786. protocol: "testing",
  1787. fn: function (){
  1788. var self=this,$self=this;
  1789. return true;
  1790. },
  1791. //>>excludeStart("ide", pragmas.excludeIdeData);
  1792. args: [],
  1793. source: "requiresSmalltalkContext\x0a\x09^ true",
  1794. referencedClasses: [],
  1795. //>>excludeEnd("ide");
  1796. messageSends: []
  1797. }),
  1798. $globals.SendNode);
  1799. $core.addMethod(
  1800. $core.method({
  1801. selector: "selector",
  1802. protocol: "accessing",
  1803. fn: function (){
  1804. var self=this,$self=this;
  1805. return $self.selector;
  1806. },
  1807. //>>excludeStart("ide", pragmas.excludeIdeData);
  1808. args: [],
  1809. source: "selector\x0a\x09^ selector",
  1810. referencedClasses: [],
  1811. //>>excludeEnd("ide");
  1812. messageSends: []
  1813. }),
  1814. $globals.SendNode);
  1815. $core.addMethod(
  1816. $core.method({
  1817. selector: "selector:",
  1818. protocol: "accessing",
  1819. fn: function (aString){
  1820. var self=this,$self=this;
  1821. $self.selector=aString;
  1822. return self;
  1823. },
  1824. //>>excludeStart("ide", pragmas.excludeIdeData);
  1825. args: ["aString"],
  1826. source: "selector: aString\x0a\x09selector := aString",
  1827. referencedClasses: [],
  1828. //>>excludeEnd("ide");
  1829. messageSends: []
  1830. }),
  1831. $globals.SendNode);
  1832. $core.addMethod(
  1833. $core.method({
  1834. selector: "shouldBeInlined",
  1835. protocol: "accessing",
  1836. fn: function (){
  1837. var self=this,$self=this;
  1838. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1839. return $core.withContext(function($ctx1) {
  1840. //>>excludeEnd("ctx");
  1841. var $1,$receiver;
  1842. $1=$self.shouldBeInlined;
  1843. if(($receiver = $1) == null || $receiver.a$nil){
  1844. return false;
  1845. } else {
  1846. return $1;
  1847. }
  1848. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1849. }, function($ctx1) {$ctx1.fill(self,"shouldBeInlined",{},$globals.SendNode)});
  1850. //>>excludeEnd("ctx");
  1851. },
  1852. //>>excludeStart("ide", pragmas.excludeIdeData);
  1853. args: [],
  1854. source: "shouldBeInlined\x0a\x09^ shouldBeInlined ifNil: [ false ]",
  1855. referencedClasses: [],
  1856. //>>excludeEnd("ide");
  1857. messageSends: ["ifNil:"]
  1858. }),
  1859. $globals.SendNode);
  1860. $core.addMethod(
  1861. $core.method({
  1862. selector: "shouldBeInlined:",
  1863. protocol: "accessing",
  1864. fn: function (aBoolean){
  1865. var self=this,$self=this;
  1866. $self.shouldBeInlined=aBoolean;
  1867. return self;
  1868. },
  1869. //>>excludeStart("ide", pragmas.excludeIdeData);
  1870. args: ["aBoolean"],
  1871. source: "shouldBeInlined: aBoolean\x0a\x09shouldBeInlined := aBoolean",
  1872. referencedClasses: [],
  1873. //>>excludeEnd("ide");
  1874. messageSends: []
  1875. }),
  1876. $globals.SendNode);
  1877. $core.addMethod(
  1878. $core.method({
  1879. selector: "superSend",
  1880. protocol: "accessing",
  1881. fn: function (){
  1882. var self=this,$self=this;
  1883. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1884. return $core.withContext(function($ctx1) {
  1885. //>>excludeEnd("ctx");
  1886. var $2,$1;
  1887. $2=$self._receiver();
  1888. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1889. $ctx1.sendIdx["receiver"]=1;
  1890. //>>excludeEnd("ctx");
  1891. $1=$recv($2)._notNil();
  1892. return $recv($1)._and_((function(){
  1893. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1894. return $core.withContext(function($ctx2) {
  1895. //>>excludeEnd("ctx");
  1896. return $recv($self._receiver())._isSuperKeyword();
  1897. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1898. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  1899. //>>excludeEnd("ctx");
  1900. }));
  1901. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1902. }, function($ctx1) {$ctx1.fill(self,"superSend",{},$globals.SendNode)});
  1903. //>>excludeEnd("ctx");
  1904. },
  1905. //>>excludeStart("ide", pragmas.excludeIdeData);
  1906. args: [],
  1907. source: "superSend\x0a\x09^ self receiver notNil and: [ self receiver isSuperKeyword ]",
  1908. referencedClasses: [],
  1909. //>>excludeEnd("ide");
  1910. messageSends: ["and:", "notNil", "receiver", "isSuperKeyword"]
  1911. }),
  1912. $globals.SendNode);
  1913. $core.addClass("SequenceNode", $globals.ASTNode, ["temps", "pragmas", "scope"], "Compiler-AST");
  1914. //>>excludeStart("ide", pragmas.excludeIdeData);
  1915. $globals.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).";
  1916. //>>excludeEnd("ide");
  1917. $core.addMethod(
  1918. $core.method({
  1919. selector: "acceptDagVisitor:",
  1920. protocol: "visiting",
  1921. fn: function (aVisitor){
  1922. var self=this,$self=this;
  1923. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1924. return $core.withContext(function($ctx1) {
  1925. //>>excludeEnd("ctx");
  1926. return $recv(aVisitor)._visitSequenceNode_(self);
  1927. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1928. }, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.SequenceNode)});
  1929. //>>excludeEnd("ctx");
  1930. },
  1931. //>>excludeStart("ide", pragmas.excludeIdeData);
  1932. args: ["aVisitor"],
  1933. source: "acceptDagVisitor: aVisitor\x0a\x09^ aVisitor visitSequenceNode: self",
  1934. referencedClasses: [],
  1935. //>>excludeEnd("ide");
  1936. messageSends: ["visitSequenceNode:"]
  1937. }),
  1938. $globals.SequenceNode);
  1939. $core.addMethod(
  1940. $core.method({
  1941. selector: "isSequenceNode",
  1942. protocol: "testing",
  1943. fn: function (){
  1944. var self=this,$self=this;
  1945. return true;
  1946. },
  1947. //>>excludeStart("ide", pragmas.excludeIdeData);
  1948. args: [],
  1949. source: "isSequenceNode\x0a\x09^ true",
  1950. referencedClasses: [],
  1951. //>>excludeEnd("ide");
  1952. messageSends: []
  1953. }),
  1954. $globals.SequenceNode);
  1955. $core.addMethod(
  1956. $core.method({
  1957. selector: "pragmas",
  1958. protocol: "accessing",
  1959. fn: function (){
  1960. var self=this,$self=this;
  1961. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1962. return $core.withContext(function($ctx1) {
  1963. //>>excludeEnd("ctx");
  1964. var $1,$receiver;
  1965. $1=$self.pragmas;
  1966. if(($receiver = $1) == null || $receiver.a$nil){
  1967. return [];
  1968. } else {
  1969. return $1;
  1970. }
  1971. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1972. }, function($ctx1) {$ctx1.fill(self,"pragmas",{},$globals.SequenceNode)});
  1973. //>>excludeEnd("ctx");
  1974. },
  1975. //>>excludeStart("ide", pragmas.excludeIdeData);
  1976. args: [],
  1977. source: "pragmas\x0a\x09^ pragmas ifNil: [ #() ]",
  1978. referencedClasses: [],
  1979. //>>excludeEnd("ide");
  1980. messageSends: ["ifNil:"]
  1981. }),
  1982. $globals.SequenceNode);
  1983. $core.addMethod(
  1984. $core.method({
  1985. selector: "pragmas:",
  1986. protocol: "accessing",
  1987. fn: function (aCollection){
  1988. var self=this,$self=this;
  1989. $self.pragmas=aCollection;
  1990. return self;
  1991. },
  1992. //>>excludeStart("ide", pragmas.excludeIdeData);
  1993. args: ["aCollection"],
  1994. source: "pragmas: aCollection\x0a\x09pragmas := aCollection",
  1995. referencedClasses: [],
  1996. //>>excludeEnd("ide");
  1997. messageSends: []
  1998. }),
  1999. $globals.SequenceNode);
  2000. $core.addMethod(
  2001. $core.method({
  2002. selector: "scope",
  2003. protocol: "accessing",
  2004. fn: function (){
  2005. var self=this,$self=this;
  2006. return $self.scope;
  2007. },
  2008. //>>excludeStart("ide", pragmas.excludeIdeData);
  2009. args: [],
  2010. source: "scope\x0a\x09^ scope",
  2011. referencedClasses: [],
  2012. //>>excludeEnd("ide");
  2013. messageSends: []
  2014. }),
  2015. $globals.SequenceNode);
  2016. $core.addMethod(
  2017. $core.method({
  2018. selector: "scope:",
  2019. protocol: "accessing",
  2020. fn: function (aLexicalScope){
  2021. var self=this,$self=this;
  2022. $self.scope=aLexicalScope;
  2023. return self;
  2024. },
  2025. //>>excludeStart("ide", pragmas.excludeIdeData);
  2026. args: ["aLexicalScope"],
  2027. source: "scope: aLexicalScope\x0a\x09scope := aLexicalScope",
  2028. referencedClasses: [],
  2029. //>>excludeEnd("ide");
  2030. messageSends: []
  2031. }),
  2032. $globals.SequenceNode);
  2033. $core.addMethod(
  2034. $core.method({
  2035. selector: "temps",
  2036. protocol: "accessing",
  2037. fn: function (){
  2038. var self=this,$self=this;
  2039. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2040. return $core.withContext(function($ctx1) {
  2041. //>>excludeEnd("ctx");
  2042. var $1,$receiver;
  2043. $1=$self.temps;
  2044. if(($receiver = $1) == null || $receiver.a$nil){
  2045. return [];
  2046. } else {
  2047. return $1;
  2048. }
  2049. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2050. }, function($ctx1) {$ctx1.fill(self,"temps",{},$globals.SequenceNode)});
  2051. //>>excludeEnd("ctx");
  2052. },
  2053. //>>excludeStart("ide", pragmas.excludeIdeData);
  2054. args: [],
  2055. source: "temps\x0a\x09^ temps ifNil: [ #() ]",
  2056. referencedClasses: [],
  2057. //>>excludeEnd("ide");
  2058. messageSends: ["ifNil:"]
  2059. }),
  2060. $globals.SequenceNode);
  2061. $core.addMethod(
  2062. $core.method({
  2063. selector: "temps:",
  2064. protocol: "accessing",
  2065. fn: function (aCollection){
  2066. var self=this,$self=this;
  2067. $self.temps=aCollection;
  2068. return self;
  2069. },
  2070. //>>excludeStart("ide", pragmas.excludeIdeData);
  2071. args: ["aCollection"],
  2072. source: "temps: aCollection\x0a\x09temps := aCollection",
  2073. referencedClasses: [],
  2074. //>>excludeEnd("ide");
  2075. messageSends: []
  2076. }),
  2077. $globals.SequenceNode);
  2078. $core.addClass("BlockSequenceNode", $globals.SequenceNode, [], "Compiler-AST");
  2079. //>>excludeStart("ide", pragmas.excludeIdeData);
  2080. $globals.BlockSequenceNode.comment="I represent an special sequence node for block scopes.";
  2081. //>>excludeEnd("ide");
  2082. $core.addMethod(
  2083. $core.method({
  2084. selector: "acceptDagVisitor:",
  2085. protocol: "visiting",
  2086. fn: function (aVisitor){
  2087. var self=this,$self=this;
  2088. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2089. return $core.withContext(function($ctx1) {
  2090. //>>excludeEnd("ctx");
  2091. return $recv(aVisitor)._visitBlockSequenceNode_(self);
  2092. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2093. }, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.BlockSequenceNode)});
  2094. //>>excludeEnd("ctx");
  2095. },
  2096. //>>excludeStart("ide", pragmas.excludeIdeData);
  2097. args: ["aVisitor"],
  2098. source: "acceptDagVisitor: aVisitor\x0a\x09^ aVisitor visitBlockSequenceNode: self",
  2099. referencedClasses: [],
  2100. //>>excludeEnd("ide");
  2101. messageSends: ["visitBlockSequenceNode:"]
  2102. }),
  2103. $globals.BlockSequenceNode);
  2104. $core.addMethod(
  2105. $core.method({
  2106. selector: "isBlockSequenceNode",
  2107. protocol: "testing",
  2108. fn: function (){
  2109. var self=this,$self=this;
  2110. return true;
  2111. },
  2112. //>>excludeStart("ide", pragmas.excludeIdeData);
  2113. args: [],
  2114. source: "isBlockSequenceNode\x0a\x09^ true",
  2115. referencedClasses: [],
  2116. //>>excludeEnd("ide");
  2117. messageSends: []
  2118. }),
  2119. $globals.BlockSequenceNode);
  2120. $core.addMethod(
  2121. $core.method({
  2122. selector: "pragmas:",
  2123. protocol: "visiting",
  2124. fn: function (aCollection){
  2125. var self=this,$self=this;
  2126. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2127. return $core.withContext(function($ctx1) {
  2128. //>>excludeEnd("ctx");
  2129. $self._shouldNotImplement();
  2130. return self;
  2131. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2132. }, function($ctx1) {$ctx1.fill(self,"pragmas:",{aCollection:aCollection},$globals.BlockSequenceNode)});
  2133. //>>excludeEnd("ctx");
  2134. },
  2135. //>>excludeStart("ide", pragmas.excludeIdeData);
  2136. args: ["aCollection"],
  2137. source: "pragmas: aCollection\x0a\x09self shouldNotImplement",
  2138. referencedClasses: [],
  2139. //>>excludeEnd("ide");
  2140. messageSends: ["shouldNotImplement"]
  2141. }),
  2142. $globals.BlockSequenceNode);
  2143. $core.addClass("ValueNode", $globals.ASTNode, ["value"], "Compiler-AST");
  2144. //>>excludeStart("ide", pragmas.excludeIdeData);
  2145. $globals.ValueNode.comment="I represent a value node.";
  2146. //>>excludeEnd("ide");
  2147. $core.addMethod(
  2148. $core.method({
  2149. selector: "acceptDagVisitor:",
  2150. protocol: "visiting",
  2151. fn: function (aVisitor){
  2152. var self=this,$self=this;
  2153. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2154. return $core.withContext(function($ctx1) {
  2155. //>>excludeEnd("ctx");
  2156. return $recv(aVisitor)._visitValueNode_(self);
  2157. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2158. }, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.ValueNode)});
  2159. //>>excludeEnd("ctx");
  2160. },
  2161. //>>excludeStart("ide", pragmas.excludeIdeData);
  2162. args: ["aVisitor"],
  2163. source: "acceptDagVisitor: aVisitor\x0a\x09^ aVisitor visitValueNode: self",
  2164. referencedClasses: [],
  2165. //>>excludeEnd("ide");
  2166. messageSends: ["visitValueNode:"]
  2167. }),
  2168. $globals.ValueNode);
  2169. $core.addMethod(
  2170. $core.method({
  2171. selector: "isImmutable",
  2172. protocol: "testing",
  2173. fn: function (){
  2174. var self=this,$self=this;
  2175. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2176. return $core.withContext(function($ctx1) {
  2177. //>>excludeEnd("ctx");
  2178. return $recv($self._value())._isImmutable();
  2179. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2180. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},$globals.ValueNode)});
  2181. //>>excludeEnd("ctx");
  2182. },
  2183. //>>excludeStart("ide", pragmas.excludeIdeData);
  2184. args: [],
  2185. source: "isImmutable\x0a\x09^ self value isImmutable",
  2186. referencedClasses: [],
  2187. //>>excludeEnd("ide");
  2188. messageSends: ["isImmutable", "value"]
  2189. }),
  2190. $globals.ValueNode);
  2191. $core.addMethod(
  2192. $core.method({
  2193. selector: "isValueNode",
  2194. protocol: "testing",
  2195. fn: function (){
  2196. var self=this,$self=this;
  2197. return true;
  2198. },
  2199. //>>excludeStart("ide", pragmas.excludeIdeData);
  2200. args: [],
  2201. source: "isValueNode\x0a\x09^ true",
  2202. referencedClasses: [],
  2203. //>>excludeEnd("ide");
  2204. messageSends: []
  2205. }),
  2206. $globals.ValueNode);
  2207. $core.addMethod(
  2208. $core.method({
  2209. selector: "value",
  2210. protocol: "accessing",
  2211. fn: function (){
  2212. var self=this,$self=this;
  2213. return $self.value;
  2214. },
  2215. //>>excludeStart("ide", pragmas.excludeIdeData);
  2216. args: [],
  2217. source: "value\x0a\x09^ value",
  2218. referencedClasses: [],
  2219. //>>excludeEnd("ide");
  2220. messageSends: []
  2221. }),
  2222. $globals.ValueNode);
  2223. $core.addMethod(
  2224. $core.method({
  2225. selector: "value:",
  2226. protocol: "accessing",
  2227. fn: function (anObject){
  2228. var self=this,$self=this;
  2229. $self.value=anObject;
  2230. return self;
  2231. },
  2232. //>>excludeStart("ide", pragmas.excludeIdeData);
  2233. args: ["anObject"],
  2234. source: "value: anObject\x0a\x09value := anObject",
  2235. referencedClasses: [],
  2236. //>>excludeEnd("ide");
  2237. messageSends: []
  2238. }),
  2239. $globals.ValueNode);
  2240. $core.addClass("VariableNode", $globals.ValueNode, ["assigned", "binding"], "Compiler-AST");
  2241. //>>excludeStart("ide", pragmas.excludeIdeData);
  2242. $globals.VariableNode.comment="I represent an variable node.";
  2243. //>>excludeEnd("ide");
  2244. $core.addMethod(
  2245. $core.method({
  2246. selector: "acceptDagVisitor:",
  2247. protocol: "visiting",
  2248. fn: function (aVisitor){
  2249. var self=this,$self=this;
  2250. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2251. return $core.withContext(function($ctx1) {
  2252. //>>excludeEnd("ctx");
  2253. return $recv(aVisitor)._visitVariableNode_(self);
  2254. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2255. }, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.VariableNode)});
  2256. //>>excludeEnd("ctx");
  2257. },
  2258. //>>excludeStart("ide", pragmas.excludeIdeData);
  2259. args: ["aVisitor"],
  2260. source: "acceptDagVisitor: aVisitor\x0a\x09^ aVisitor visitVariableNode: self",
  2261. referencedClasses: [],
  2262. //>>excludeEnd("ide");
  2263. messageSends: ["visitVariableNode:"]
  2264. }),
  2265. $globals.VariableNode);
  2266. $core.addMethod(
  2267. $core.method({
  2268. selector: "alias",
  2269. protocol: "accessing",
  2270. fn: function (){
  2271. var self=this,$self=this;
  2272. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2273. return $core.withContext(function($ctx1) {
  2274. //>>excludeEnd("ctx");
  2275. return $recv($self._binding())._alias();
  2276. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2277. }, function($ctx1) {$ctx1.fill(self,"alias",{},$globals.VariableNode)});
  2278. //>>excludeEnd("ctx");
  2279. },
  2280. //>>excludeStart("ide", pragmas.excludeIdeData);
  2281. args: [],
  2282. source: "alias\x0a\x09^ self binding alias",
  2283. referencedClasses: [],
  2284. //>>excludeEnd("ide");
  2285. messageSends: ["alias", "binding"]
  2286. }),
  2287. $globals.VariableNode);
  2288. $core.addMethod(
  2289. $core.method({
  2290. selector: "assigned",
  2291. protocol: "accessing",
  2292. fn: function (){
  2293. var self=this,$self=this;
  2294. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2295. return $core.withContext(function($ctx1) {
  2296. //>>excludeEnd("ctx");
  2297. var $1,$receiver;
  2298. $1=$self.assigned;
  2299. if(($receiver = $1) == null || $receiver.a$nil){
  2300. return false;
  2301. } else {
  2302. return $1;
  2303. }
  2304. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2305. }, function($ctx1) {$ctx1.fill(self,"assigned",{},$globals.VariableNode)});
  2306. //>>excludeEnd("ctx");
  2307. },
  2308. //>>excludeStart("ide", pragmas.excludeIdeData);
  2309. args: [],
  2310. source: "assigned\x0a\x09^ assigned ifNil: [ false ]",
  2311. referencedClasses: [],
  2312. //>>excludeEnd("ide");
  2313. messageSends: ["ifNil:"]
  2314. }),
  2315. $globals.VariableNode);
  2316. $core.addMethod(
  2317. $core.method({
  2318. selector: "assigned:",
  2319. protocol: "accessing",
  2320. fn: function (aBoolean){
  2321. var self=this,$self=this;
  2322. $self.assigned=aBoolean;
  2323. return self;
  2324. },
  2325. //>>excludeStart("ide", pragmas.excludeIdeData);
  2326. args: ["aBoolean"],
  2327. source: "assigned: aBoolean\x0a\x09assigned := aBoolean",
  2328. referencedClasses: [],
  2329. //>>excludeEnd("ide");
  2330. messageSends: []
  2331. }),
  2332. $globals.VariableNode);
  2333. $core.addMethod(
  2334. $core.method({
  2335. selector: "beAssigned",
  2336. protocol: "accessing",
  2337. fn: function (){
  2338. var self=this,$self=this;
  2339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2340. return $core.withContext(function($ctx1) {
  2341. //>>excludeEnd("ctx");
  2342. $recv($self._binding())._validateAssignment();
  2343. $self.assigned=true;
  2344. return self;
  2345. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2346. }, function($ctx1) {$ctx1.fill(self,"beAssigned",{},$globals.VariableNode)});
  2347. //>>excludeEnd("ctx");
  2348. },
  2349. //>>excludeStart("ide", pragmas.excludeIdeData);
  2350. args: [],
  2351. source: "beAssigned\x0a\x09self binding validateAssignment.\x0a\x09assigned := true",
  2352. referencedClasses: [],
  2353. //>>excludeEnd("ide");
  2354. messageSends: ["validateAssignment", "binding"]
  2355. }),
  2356. $globals.VariableNode);
  2357. $core.addMethod(
  2358. $core.method({
  2359. selector: "binding",
  2360. protocol: "accessing",
  2361. fn: function (){
  2362. var self=this,$self=this;
  2363. return $self.binding;
  2364. },
  2365. //>>excludeStart("ide", pragmas.excludeIdeData);
  2366. args: [],
  2367. source: "binding\x0a\x09^ binding",
  2368. referencedClasses: [],
  2369. //>>excludeEnd("ide");
  2370. messageSends: []
  2371. }),
  2372. $globals.VariableNode);
  2373. $core.addMethod(
  2374. $core.method({
  2375. selector: "binding:",
  2376. protocol: "accessing",
  2377. fn: function (aScopeVar){
  2378. var self=this,$self=this;
  2379. $self.binding=aScopeVar;
  2380. return self;
  2381. },
  2382. //>>excludeStart("ide", pragmas.excludeIdeData);
  2383. args: ["aScopeVar"],
  2384. source: "binding: aScopeVar\x0a\x09binding := aScopeVar",
  2385. referencedClasses: [],
  2386. //>>excludeEnd("ide");
  2387. messageSends: []
  2388. }),
  2389. $globals.VariableNode);
  2390. $core.addMethod(
  2391. $core.method({
  2392. selector: "isArgument",
  2393. protocol: "testing",
  2394. fn: function (){
  2395. var self=this,$self=this;
  2396. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2397. return $core.withContext(function($ctx1) {
  2398. //>>excludeEnd("ctx");
  2399. return $recv($self._binding())._isArgVar();
  2400. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2401. }, function($ctx1) {$ctx1.fill(self,"isArgument",{},$globals.VariableNode)});
  2402. //>>excludeEnd("ctx");
  2403. },
  2404. //>>excludeStart("ide", pragmas.excludeIdeData);
  2405. args: [],
  2406. source: "isArgument\x0a\x09^ self binding isArgVar",
  2407. referencedClasses: [],
  2408. //>>excludeEnd("ide");
  2409. messageSends: ["isArgVar", "binding"]
  2410. }),
  2411. $globals.VariableNode);
  2412. $core.addMethod(
  2413. $core.method({
  2414. selector: "isImmutable",
  2415. protocol: "testing",
  2416. fn: function (){
  2417. var self=this,$self=this;
  2418. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2419. return $core.withContext(function($ctx1) {
  2420. //>>excludeEnd("ctx");
  2421. return $recv($self._binding())._isImmutable();
  2422. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2423. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},$globals.VariableNode)});
  2424. //>>excludeEnd("ctx");
  2425. },
  2426. //>>excludeStart("ide", pragmas.excludeIdeData);
  2427. args: [],
  2428. source: "isImmutable\x0a\x09^ self binding isImmutable",
  2429. referencedClasses: [],
  2430. //>>excludeEnd("ide");
  2431. messageSends: ["isImmutable", "binding"]
  2432. }),
  2433. $globals.VariableNode);
  2434. $core.addMethod(
  2435. $core.method({
  2436. selector: "isNavigationNode",
  2437. protocol: "testing",
  2438. fn: function (){
  2439. var self=this,$self=this;
  2440. return true;
  2441. },
  2442. //>>excludeStart("ide", pragmas.excludeIdeData);
  2443. args: [],
  2444. source: "isNavigationNode\x0a\x09^ true",
  2445. referencedClasses: [],
  2446. //>>excludeEnd("ide");
  2447. messageSends: []
  2448. }),
  2449. $globals.VariableNode);
  2450. $core.addMethod(
  2451. $core.method({
  2452. selector: "isSuperKeyword",
  2453. protocol: "testing",
  2454. fn: function (){
  2455. var self=this,$self=this;
  2456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2457. return $core.withContext(function($ctx1) {
  2458. //>>excludeEnd("ctx");
  2459. return $recv($self._value()).__eq("super");
  2460. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2461. }, function($ctx1) {$ctx1.fill(self,"isSuperKeyword",{},$globals.VariableNode)});
  2462. //>>excludeEnd("ctx");
  2463. },
  2464. //>>excludeStart("ide", pragmas.excludeIdeData);
  2465. args: [],
  2466. source: "isSuperKeyword\x0a\x09^ self value = 'super'",
  2467. referencedClasses: [],
  2468. //>>excludeEnd("ide");
  2469. messageSends: ["=", "value"]
  2470. }),
  2471. $globals.VariableNode);
  2472. $core.addMethod(
  2473. $core.method({
  2474. selector: "isVariableNode",
  2475. protocol: "testing",
  2476. fn: function (){
  2477. var self=this,$self=this;
  2478. return true;
  2479. },
  2480. //>>excludeStart("ide", pragmas.excludeIdeData);
  2481. args: [],
  2482. source: "isVariableNode\x0a\x09^ true",
  2483. referencedClasses: [],
  2484. //>>excludeEnd("ide");
  2485. messageSends: []
  2486. }),
  2487. $globals.VariableNode);
  2488. $core.addMethod(
  2489. $core.method({
  2490. selector: "navigationLink",
  2491. protocol: "accessing",
  2492. fn: function (){
  2493. var self=this,$self=this;
  2494. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2495. return $core.withContext(function($ctx1) {
  2496. //>>excludeEnd("ctx");
  2497. return $self._value();
  2498. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2499. }, function($ctx1) {$ctx1.fill(self,"navigationLink",{},$globals.VariableNode)});
  2500. //>>excludeEnd("ctx");
  2501. },
  2502. //>>excludeStart("ide", pragmas.excludeIdeData);
  2503. args: [],
  2504. source: "navigationLink\x0a\x09^ self value",
  2505. referencedClasses: [],
  2506. //>>excludeEnd("ide");
  2507. messageSends: ["value"]
  2508. }),
  2509. $globals.VariableNode);
  2510. $core.addClass("CompilerError", $globals.Error, [], "Compiler-AST");
  2511. //>>excludeStart("ide", pragmas.excludeIdeData);
  2512. $globals.CompilerError.comment="I am the common superclass of all compiling errors.";
  2513. //>>excludeEnd("ide");
  2514. $core.addClass("ParentFakingPathDagVisitor", $globals.PathDagVisitor, ["setParentSelector"], "Compiler-AST");
  2515. //>>excludeStart("ide", pragmas.excludeIdeData);
  2516. $globals.ParentFakingPathDagVisitor.comment="I am base class of `DagNode` visitor.\x0a\x0aI hold the path of ancestors up to actual node\x0ain `self path`.";
  2517. //>>excludeEnd("ide");
  2518. $core.addMethod(
  2519. $core.method({
  2520. selector: "visit:",
  2521. protocol: "visiting",
  2522. fn: function (aNode){
  2523. var self=this,$self=this;
  2524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2525. return $core.withContext(function($ctx1) {
  2526. //>>excludeEnd("ctx");
  2527. var $1;
  2528. $recv($self._path())._ifNotEmpty_((function(p){
  2529. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2530. return $core.withContext(function($ctx2) {
  2531. //>>excludeEnd("ctx");
  2532. return $recv(aNode)._parent_($recv(p)._last());
  2533. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2534. }, function($ctx2) {$ctx2.fillBlock({p:p},$ctx1,1)});
  2535. //>>excludeEnd("ctx");
  2536. }));
  2537. $1=(
  2538. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2539. $ctx1.supercall = true,
  2540. //>>excludeEnd("ctx");
  2541. ($globals.ParentFakingPathDagVisitor.superclass||$boot.nilAsClass).fn.prototype._visit_.apply($self, [aNode]));
  2542. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2543. $ctx1.supercall = false;
  2544. //>>excludeEnd("ctx");;
  2545. return $1;
  2546. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2547. }, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode},$globals.ParentFakingPathDagVisitor)});
  2548. //>>excludeEnd("ctx");
  2549. },
  2550. //>>excludeStart("ide", pragmas.excludeIdeData);
  2551. args: ["aNode"],
  2552. source: "visit: aNode\x0a\x09self path ifNotEmpty: [ :p | aNode parent: p last ].\x0a\x09^ super visit: aNode",
  2553. referencedClasses: [],
  2554. //>>excludeEnd("ide");
  2555. messageSends: ["ifNotEmpty:", "path", "parent:", "last", "visit:"]
  2556. }),
  2557. $globals.ParentFakingPathDagVisitor);
  2558. $core.addClass("NodeVisitor", $globals.ParentFakingPathDagVisitor, [], "Compiler-AST");
  2559. //>>excludeStart("ide", pragmas.excludeIdeData);
  2560. $globals.NodeVisitor.comment="I am the abstract super class of all AST node visitors.";
  2561. //>>excludeEnd("ide");
  2562. $core.addMethod(
  2563. $core.method({
  2564. selector: "visitAssignmentNode:",
  2565. protocol: "visiting",
  2566. fn: function (aNode){
  2567. var self=this,$self=this;
  2568. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2569. return $core.withContext(function($ctx1) {
  2570. //>>excludeEnd("ctx");
  2571. return $self._visitDagNode_(aNode);
  2572. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2573. }, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode},$globals.NodeVisitor)});
  2574. //>>excludeEnd("ctx");
  2575. },
  2576. //>>excludeStart("ide", pragmas.excludeIdeData);
  2577. args: ["aNode"],
  2578. source: "visitAssignmentNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2579. referencedClasses: [],
  2580. //>>excludeEnd("ide");
  2581. messageSends: ["visitDagNode:"]
  2582. }),
  2583. $globals.NodeVisitor);
  2584. $core.addMethod(
  2585. $core.method({
  2586. selector: "visitBlockNode:",
  2587. protocol: "visiting",
  2588. fn: function (aNode){
  2589. var self=this,$self=this;
  2590. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2591. return $core.withContext(function($ctx1) {
  2592. //>>excludeEnd("ctx");
  2593. return $self._visitDagNode_(aNode);
  2594. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2595. }, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode},$globals.NodeVisitor)});
  2596. //>>excludeEnd("ctx");
  2597. },
  2598. //>>excludeStart("ide", pragmas.excludeIdeData);
  2599. args: ["aNode"],
  2600. source: "visitBlockNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2601. referencedClasses: [],
  2602. //>>excludeEnd("ide");
  2603. messageSends: ["visitDagNode:"]
  2604. }),
  2605. $globals.NodeVisitor);
  2606. $core.addMethod(
  2607. $core.method({
  2608. selector: "visitBlockSequenceNode:",
  2609. protocol: "visiting",
  2610. fn: function (aNode){
  2611. var self=this,$self=this;
  2612. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2613. return $core.withContext(function($ctx1) {
  2614. //>>excludeEnd("ctx");
  2615. return $self._visitSequenceNode_(aNode);
  2616. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2617. }, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:",{aNode:aNode},$globals.NodeVisitor)});
  2618. //>>excludeEnd("ctx");
  2619. },
  2620. //>>excludeStart("ide", pragmas.excludeIdeData);
  2621. args: ["aNode"],
  2622. source: "visitBlockSequenceNode: aNode\x0a\x09^ self visitSequenceNode: aNode",
  2623. referencedClasses: [],
  2624. //>>excludeEnd("ide");
  2625. messageSends: ["visitSequenceNode:"]
  2626. }),
  2627. $globals.NodeVisitor);
  2628. $core.addMethod(
  2629. $core.method({
  2630. selector: "visitCascadeNode:",
  2631. protocol: "visiting",
  2632. fn: function (aNode){
  2633. var self=this,$self=this;
  2634. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2635. return $core.withContext(function($ctx1) {
  2636. //>>excludeEnd("ctx");
  2637. return $self._visitDagNode_(aNode);
  2638. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2639. }, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode},$globals.NodeVisitor)});
  2640. //>>excludeEnd("ctx");
  2641. },
  2642. //>>excludeStart("ide", pragmas.excludeIdeData);
  2643. args: ["aNode"],
  2644. source: "visitCascadeNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2645. referencedClasses: [],
  2646. //>>excludeEnd("ide");
  2647. messageSends: ["visitDagNode:"]
  2648. }),
  2649. $globals.NodeVisitor);
  2650. $core.addMethod(
  2651. $core.method({
  2652. selector: "visitDagNode:",
  2653. protocol: "visiting",
  2654. fn: function (aNode){
  2655. var self=this,$self=this;
  2656. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2657. return $core.withContext(function($ctx1) {
  2658. //>>excludeEnd("ctx");
  2659. return $self._visitDagNodeVariantSimple_(aNode);
  2660. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2661. }, function($ctx1) {$ctx1.fill(self,"visitDagNode:",{aNode:aNode},$globals.NodeVisitor)});
  2662. //>>excludeEnd("ctx");
  2663. },
  2664. //>>excludeStart("ide", pragmas.excludeIdeData);
  2665. args: ["aNode"],
  2666. source: "visitDagNode: aNode\x0a\x09^ self visitDagNodeVariantSimple: aNode",
  2667. referencedClasses: [],
  2668. //>>excludeEnd("ide");
  2669. messageSends: ["visitDagNodeVariantSimple:"]
  2670. }),
  2671. $globals.NodeVisitor);
  2672. $core.addMethod(
  2673. $core.method({
  2674. selector: "visitDynamicArrayNode:",
  2675. protocol: "visiting",
  2676. fn: function (aNode){
  2677. var self=this,$self=this;
  2678. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2679. return $core.withContext(function($ctx1) {
  2680. //>>excludeEnd("ctx");
  2681. return $self._visitDagNode_(aNode);
  2682. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2683. }, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode},$globals.NodeVisitor)});
  2684. //>>excludeEnd("ctx");
  2685. },
  2686. //>>excludeStart("ide", pragmas.excludeIdeData);
  2687. args: ["aNode"],
  2688. source: "visitDynamicArrayNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2689. referencedClasses: [],
  2690. //>>excludeEnd("ide");
  2691. messageSends: ["visitDagNode:"]
  2692. }),
  2693. $globals.NodeVisitor);
  2694. $core.addMethod(
  2695. $core.method({
  2696. selector: "visitDynamicDictionaryNode:",
  2697. protocol: "visiting",
  2698. fn: function (aNode){
  2699. var self=this,$self=this;
  2700. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2701. return $core.withContext(function($ctx1) {
  2702. //>>excludeEnd("ctx");
  2703. return $self._visitDagNode_(aNode);
  2704. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2705. }, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode},$globals.NodeVisitor)});
  2706. //>>excludeEnd("ctx");
  2707. },
  2708. //>>excludeStart("ide", pragmas.excludeIdeData);
  2709. args: ["aNode"],
  2710. source: "visitDynamicDictionaryNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2711. referencedClasses: [],
  2712. //>>excludeEnd("ide");
  2713. messageSends: ["visitDagNode:"]
  2714. }),
  2715. $globals.NodeVisitor);
  2716. $core.addMethod(
  2717. $core.method({
  2718. selector: "visitJSStatementNode:",
  2719. protocol: "visiting",
  2720. fn: function (aNode){
  2721. var self=this,$self=this;
  2722. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2723. return $core.withContext(function($ctx1) {
  2724. //>>excludeEnd("ctx");
  2725. return $self._visitDagNode_(aNode);
  2726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2727. }, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},$globals.NodeVisitor)});
  2728. //>>excludeEnd("ctx");
  2729. },
  2730. //>>excludeStart("ide", pragmas.excludeIdeData);
  2731. args: ["aNode"],
  2732. source: "visitJSStatementNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2733. referencedClasses: [],
  2734. //>>excludeEnd("ide");
  2735. messageSends: ["visitDagNode:"]
  2736. }),
  2737. $globals.NodeVisitor);
  2738. $core.addMethod(
  2739. $core.method({
  2740. selector: "visitMethodNode:",
  2741. protocol: "visiting",
  2742. fn: function (aNode){
  2743. var self=this,$self=this;
  2744. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2745. return $core.withContext(function($ctx1) {
  2746. //>>excludeEnd("ctx");
  2747. return $self._visitDagNode_(aNode);
  2748. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2749. }, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode},$globals.NodeVisitor)});
  2750. //>>excludeEnd("ctx");
  2751. },
  2752. //>>excludeStart("ide", pragmas.excludeIdeData);
  2753. args: ["aNode"],
  2754. source: "visitMethodNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2755. referencedClasses: [],
  2756. //>>excludeEnd("ide");
  2757. messageSends: ["visitDagNode:"]
  2758. }),
  2759. $globals.NodeVisitor);
  2760. $core.addMethod(
  2761. $core.method({
  2762. selector: "visitReturnNode:",
  2763. protocol: "visiting",
  2764. fn: function (aNode){
  2765. var self=this,$self=this;
  2766. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2767. return $core.withContext(function($ctx1) {
  2768. //>>excludeEnd("ctx");
  2769. return $self._visitDagNode_(aNode);
  2770. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2771. }, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode},$globals.NodeVisitor)});
  2772. //>>excludeEnd("ctx");
  2773. },
  2774. //>>excludeStart("ide", pragmas.excludeIdeData);
  2775. args: ["aNode"],
  2776. source: "visitReturnNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2777. referencedClasses: [],
  2778. //>>excludeEnd("ide");
  2779. messageSends: ["visitDagNode:"]
  2780. }),
  2781. $globals.NodeVisitor);
  2782. $core.addMethod(
  2783. $core.method({
  2784. selector: "visitSendNode:",
  2785. protocol: "visiting",
  2786. fn: function (aNode){
  2787. var self=this,$self=this;
  2788. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2789. return $core.withContext(function($ctx1) {
  2790. //>>excludeEnd("ctx");
  2791. return $self._visitDagNode_(aNode);
  2792. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2793. }, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode},$globals.NodeVisitor)});
  2794. //>>excludeEnd("ctx");
  2795. },
  2796. //>>excludeStart("ide", pragmas.excludeIdeData);
  2797. args: ["aNode"],
  2798. source: "visitSendNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2799. referencedClasses: [],
  2800. //>>excludeEnd("ide");
  2801. messageSends: ["visitDagNode:"]
  2802. }),
  2803. $globals.NodeVisitor);
  2804. $core.addMethod(
  2805. $core.method({
  2806. selector: "visitSequenceNode:",
  2807. protocol: "visiting",
  2808. fn: function (aNode){
  2809. var self=this,$self=this;
  2810. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2811. return $core.withContext(function($ctx1) {
  2812. //>>excludeEnd("ctx");
  2813. return $self._visitDagNode_(aNode);
  2814. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2815. }, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode},$globals.NodeVisitor)});
  2816. //>>excludeEnd("ctx");
  2817. },
  2818. //>>excludeStart("ide", pragmas.excludeIdeData);
  2819. args: ["aNode"],
  2820. source: "visitSequenceNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2821. referencedClasses: [],
  2822. //>>excludeEnd("ide");
  2823. messageSends: ["visitDagNode:"]
  2824. }),
  2825. $globals.NodeVisitor);
  2826. $core.addMethod(
  2827. $core.method({
  2828. selector: "visitValueNode:",
  2829. protocol: "visiting",
  2830. fn: function (aNode){
  2831. var self=this,$self=this;
  2832. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2833. return $core.withContext(function($ctx1) {
  2834. //>>excludeEnd("ctx");
  2835. return $self._visitDagNode_(aNode);
  2836. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2837. }, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode},$globals.NodeVisitor)});
  2838. //>>excludeEnd("ctx");
  2839. },
  2840. //>>excludeStart("ide", pragmas.excludeIdeData);
  2841. args: ["aNode"],
  2842. source: "visitValueNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2843. referencedClasses: [],
  2844. //>>excludeEnd("ide");
  2845. messageSends: ["visitDagNode:"]
  2846. }),
  2847. $globals.NodeVisitor);
  2848. $core.addMethod(
  2849. $core.method({
  2850. selector: "visitVariableNode:",
  2851. protocol: "visiting",
  2852. fn: function (aNode){
  2853. var self=this,$self=this;
  2854. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2855. return $core.withContext(function($ctx1) {
  2856. //>>excludeEnd("ctx");
  2857. return $self._visitDagNode_(aNode);
  2858. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2859. }, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},$globals.NodeVisitor)});
  2860. //>>excludeEnd("ctx");
  2861. },
  2862. //>>excludeStart("ide", pragmas.excludeIdeData);
  2863. args: ["aNode"],
  2864. source: "visitVariableNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2865. referencedClasses: [],
  2866. //>>excludeEnd("ide");
  2867. messageSends: ["visitDagNode:"]
  2868. }),
  2869. $globals.NodeVisitor);
  2870. $core.addMethod(
  2871. $core.method({
  2872. selector: "ast",
  2873. protocol: "*Compiler-AST",
  2874. fn: function (){
  2875. var self=this,$self=this;
  2876. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2877. return $core.withContext(function($ctx1) {
  2878. //>>excludeEnd("ctx");
  2879. var $1;
  2880. $1=$self._source();
  2881. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2882. $ctx1.sendIdx["source"]=1;
  2883. //>>excludeEnd("ctx");
  2884. $recv($1)._ifEmpty_((function(){
  2885. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2886. return $core.withContext(function($ctx2) {
  2887. //>>excludeEnd("ctx");
  2888. return $recv($globals.CompilerError)._signal_("Method source is empty");
  2889. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2890. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2891. //>>excludeEnd("ctx");
  2892. }));
  2893. return $recv($recv($globals.Compiler)._new())._ast_forClass_protocol_($self._source(),$self._methodClass(),$self._protocol());
  2894. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2895. }, function($ctx1) {$ctx1.fill(self,"ast",{},$globals.CompiledMethod)});
  2896. //>>excludeEnd("ctx");
  2897. },
  2898. //>>excludeStart("ide", pragmas.excludeIdeData);
  2899. args: [],
  2900. source: "ast\x0a\x09self source ifEmpty: [ CompilerError signal: 'Method source is empty' ].\x0a\x09\x0a\x09^ Compiler new\x0a\x09\x09ast: self source\x0a\x09\x09forClass: self methodClass\x0a\x09\x09protocol: self protocol",
  2901. referencedClasses: ["CompilerError", "Compiler"],
  2902. //>>excludeEnd("ide");
  2903. messageSends: ["ifEmpty:", "source", "signal:", "ast:forClass:protocol:", "new", "methodClass", "protocol"]
  2904. }),
  2905. $globals.CompiledMethod);
  2906. });