Compiler-AST.js 85 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195
  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: "asBlockSequenceNode",
  1942. protocol: "building",
  1943. fn: function (){
  1944. var self=this,$self=this;
  1945. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1946. return $core.withContext(function($ctx1) {
  1947. //>>excludeEnd("ctx");
  1948. var $1;
  1949. $1=$recv($globals.BlockSequenceNode)._new();
  1950. $recv($1)._position_($self._position());
  1951. $recv($1)._source_($self._source());
  1952. $recv($1)._dagChildren_($self._dagChildren());
  1953. $recv($1)._temps_($self._temps());
  1954. $recv($1)._pragmas_($self._pragmas());
  1955. return $recv($1)._yourself();
  1956. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1957. }, function($ctx1) {$ctx1.fill(self,"asBlockSequenceNode",{},$globals.SequenceNode)});
  1958. //>>excludeEnd("ctx");
  1959. },
  1960. //>>excludeStart("ide", pragmas.excludeIdeData);
  1961. args: [],
  1962. source: "asBlockSequenceNode\x0a\x09^ BlockSequenceNode new\x0a\x09\x09position: self position;\x0a\x09\x09source: self source;\x0a\x09\x09dagChildren: self dagChildren;\x0a\x09\x09temps: self temps;\x0a\x09\x09pragmas: self pragmas;\x0a\x09\x09yourself",
  1963. referencedClasses: ["BlockSequenceNode"],
  1964. //>>excludeEnd("ide");
  1965. messageSends: ["position:", "new", "position", "source:", "source", "dagChildren:", "dagChildren", "temps:", "temps", "pragmas:", "pragmas", "yourself"]
  1966. }),
  1967. $globals.SequenceNode);
  1968. $core.addMethod(
  1969. $core.method({
  1970. selector: "isSequenceNode",
  1971. protocol: "testing",
  1972. fn: function (){
  1973. var self=this,$self=this;
  1974. return true;
  1975. },
  1976. //>>excludeStart("ide", pragmas.excludeIdeData);
  1977. args: [],
  1978. source: "isSequenceNode\x0a\x09^ true",
  1979. referencedClasses: [],
  1980. //>>excludeEnd("ide");
  1981. messageSends: []
  1982. }),
  1983. $globals.SequenceNode);
  1984. $core.addMethod(
  1985. $core.method({
  1986. selector: "pragmas",
  1987. protocol: "accessing",
  1988. fn: function (){
  1989. var self=this,$self=this;
  1990. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  1991. return $core.withContext(function($ctx1) {
  1992. //>>excludeEnd("ctx");
  1993. var $1,$receiver;
  1994. $1=$self.pragmas;
  1995. if(($receiver = $1) == null || $receiver.a$nil){
  1996. return [];
  1997. } else {
  1998. return $1;
  1999. }
  2000. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2001. }, function($ctx1) {$ctx1.fill(self,"pragmas",{},$globals.SequenceNode)});
  2002. //>>excludeEnd("ctx");
  2003. },
  2004. //>>excludeStart("ide", pragmas.excludeIdeData);
  2005. args: [],
  2006. source: "pragmas\x0a\x09^ pragmas ifNil: [ #() ]",
  2007. referencedClasses: [],
  2008. //>>excludeEnd("ide");
  2009. messageSends: ["ifNil:"]
  2010. }),
  2011. $globals.SequenceNode);
  2012. $core.addMethod(
  2013. $core.method({
  2014. selector: "pragmas:",
  2015. protocol: "accessing",
  2016. fn: function (aCollection){
  2017. var self=this,$self=this;
  2018. $self.pragmas=aCollection;
  2019. return self;
  2020. },
  2021. //>>excludeStart("ide", pragmas.excludeIdeData);
  2022. args: ["aCollection"],
  2023. source: "pragmas: aCollection\x0a\x09pragmas := aCollection",
  2024. referencedClasses: [],
  2025. //>>excludeEnd("ide");
  2026. messageSends: []
  2027. }),
  2028. $globals.SequenceNode);
  2029. $core.addMethod(
  2030. $core.method({
  2031. selector: "scope",
  2032. protocol: "accessing",
  2033. fn: function (){
  2034. var self=this,$self=this;
  2035. return $self.scope;
  2036. },
  2037. //>>excludeStart("ide", pragmas.excludeIdeData);
  2038. args: [],
  2039. source: "scope\x0a\x09^ scope",
  2040. referencedClasses: [],
  2041. //>>excludeEnd("ide");
  2042. messageSends: []
  2043. }),
  2044. $globals.SequenceNode);
  2045. $core.addMethod(
  2046. $core.method({
  2047. selector: "scope:",
  2048. protocol: "accessing",
  2049. fn: function (aLexicalScope){
  2050. var self=this,$self=this;
  2051. $self.scope=aLexicalScope;
  2052. return self;
  2053. },
  2054. //>>excludeStart("ide", pragmas.excludeIdeData);
  2055. args: ["aLexicalScope"],
  2056. source: "scope: aLexicalScope\x0a\x09scope := aLexicalScope",
  2057. referencedClasses: [],
  2058. //>>excludeEnd("ide");
  2059. messageSends: []
  2060. }),
  2061. $globals.SequenceNode);
  2062. $core.addMethod(
  2063. $core.method({
  2064. selector: "temps",
  2065. protocol: "accessing",
  2066. fn: function (){
  2067. var self=this,$self=this;
  2068. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2069. return $core.withContext(function($ctx1) {
  2070. //>>excludeEnd("ctx");
  2071. var $1,$receiver;
  2072. $1=$self.temps;
  2073. if(($receiver = $1) == null || $receiver.a$nil){
  2074. return [];
  2075. } else {
  2076. return $1;
  2077. }
  2078. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2079. }, function($ctx1) {$ctx1.fill(self,"temps",{},$globals.SequenceNode)});
  2080. //>>excludeEnd("ctx");
  2081. },
  2082. //>>excludeStart("ide", pragmas.excludeIdeData);
  2083. args: [],
  2084. source: "temps\x0a\x09^ temps ifNil: [ #() ]",
  2085. referencedClasses: [],
  2086. //>>excludeEnd("ide");
  2087. messageSends: ["ifNil:"]
  2088. }),
  2089. $globals.SequenceNode);
  2090. $core.addMethod(
  2091. $core.method({
  2092. selector: "temps:",
  2093. protocol: "accessing",
  2094. fn: function (aCollection){
  2095. var self=this,$self=this;
  2096. $self.temps=aCollection;
  2097. return self;
  2098. },
  2099. //>>excludeStart("ide", pragmas.excludeIdeData);
  2100. args: ["aCollection"],
  2101. source: "temps: aCollection\x0a\x09temps := aCollection",
  2102. referencedClasses: [],
  2103. //>>excludeEnd("ide");
  2104. messageSends: []
  2105. }),
  2106. $globals.SequenceNode);
  2107. $core.addClass("BlockSequenceNode", $globals.SequenceNode, [], "Compiler-AST");
  2108. //>>excludeStart("ide", pragmas.excludeIdeData);
  2109. $globals.BlockSequenceNode.comment="I represent an special sequence node for block scopes.";
  2110. //>>excludeEnd("ide");
  2111. $core.addMethod(
  2112. $core.method({
  2113. selector: "acceptDagVisitor:",
  2114. protocol: "visiting",
  2115. fn: function (aVisitor){
  2116. var self=this,$self=this;
  2117. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2118. return $core.withContext(function($ctx1) {
  2119. //>>excludeEnd("ctx");
  2120. return $recv(aVisitor)._visitBlockSequenceNode_(self);
  2121. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2122. }, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.BlockSequenceNode)});
  2123. //>>excludeEnd("ctx");
  2124. },
  2125. //>>excludeStart("ide", pragmas.excludeIdeData);
  2126. args: ["aVisitor"],
  2127. source: "acceptDagVisitor: aVisitor\x0a\x09^ aVisitor visitBlockSequenceNode: self",
  2128. referencedClasses: [],
  2129. //>>excludeEnd("ide");
  2130. messageSends: ["visitBlockSequenceNode:"]
  2131. }),
  2132. $globals.BlockSequenceNode);
  2133. $core.addMethod(
  2134. $core.method({
  2135. selector: "isBlockSequenceNode",
  2136. protocol: "testing",
  2137. fn: function (){
  2138. var self=this,$self=this;
  2139. return true;
  2140. },
  2141. //>>excludeStart("ide", pragmas.excludeIdeData);
  2142. args: [],
  2143. source: "isBlockSequenceNode\x0a\x09^ true",
  2144. referencedClasses: [],
  2145. //>>excludeEnd("ide");
  2146. messageSends: []
  2147. }),
  2148. $globals.BlockSequenceNode);
  2149. $core.addMethod(
  2150. $core.method({
  2151. selector: "pragmas:",
  2152. protocol: "visiting",
  2153. fn: function (aCollection){
  2154. var self=this,$self=this;
  2155. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2156. return $core.withContext(function($ctx1) {
  2157. //>>excludeEnd("ctx");
  2158. var $1;
  2159. $recv(aCollection)._ifNotEmpty_((function(){
  2160. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2161. return $core.withContext(function($ctx2) {
  2162. //>>excludeEnd("ctx");
  2163. return $recv($globals.CompilerError)._signal_("Block must have no pragmas.");
  2164. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2165. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2166. //>>excludeEnd("ctx");
  2167. }));
  2168. $1=(
  2169. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2170. $ctx1.supercall = true,
  2171. //>>excludeEnd("ctx");
  2172. ($globals.BlockSequenceNode.superclass||$boot.nilAsClass).fn.prototype._pragmas_.apply($self, [aCollection]));
  2173. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2174. $ctx1.supercall = false;
  2175. //>>excludeEnd("ctx");;
  2176. return $1;
  2177. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2178. }, function($ctx1) {$ctx1.fill(self,"pragmas:",{aCollection:aCollection},$globals.BlockSequenceNode)});
  2179. //>>excludeEnd("ctx");
  2180. },
  2181. //>>excludeStart("ide", pragmas.excludeIdeData);
  2182. args: ["aCollection"],
  2183. source: "pragmas: aCollection\x0a\x09aCollection ifNotEmpty: [\x0a\x09\x09CompilerError signal: 'Block must have no pragmas.' ].\x0a\x09^ super pragmas: aCollection",
  2184. referencedClasses: ["CompilerError"],
  2185. //>>excludeEnd("ide");
  2186. messageSends: ["ifNotEmpty:", "signal:", "pragmas:"]
  2187. }),
  2188. $globals.BlockSequenceNode);
  2189. $core.addClass("ValueNode", $globals.ASTNode, ["value"], "Compiler-AST");
  2190. //>>excludeStart("ide", pragmas.excludeIdeData);
  2191. $globals.ValueNode.comment="I represent a value node.";
  2192. //>>excludeEnd("ide");
  2193. $core.addMethod(
  2194. $core.method({
  2195. selector: "acceptDagVisitor:",
  2196. protocol: "visiting",
  2197. fn: function (aVisitor){
  2198. var self=this,$self=this;
  2199. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2200. return $core.withContext(function($ctx1) {
  2201. //>>excludeEnd("ctx");
  2202. return $recv(aVisitor)._visitValueNode_(self);
  2203. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2204. }, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.ValueNode)});
  2205. //>>excludeEnd("ctx");
  2206. },
  2207. //>>excludeStart("ide", pragmas.excludeIdeData);
  2208. args: ["aVisitor"],
  2209. source: "acceptDagVisitor: aVisitor\x0a\x09^ aVisitor visitValueNode: self",
  2210. referencedClasses: [],
  2211. //>>excludeEnd("ide");
  2212. messageSends: ["visitValueNode:"]
  2213. }),
  2214. $globals.ValueNode);
  2215. $core.addMethod(
  2216. $core.method({
  2217. selector: "isImmutable",
  2218. protocol: "testing",
  2219. fn: function (){
  2220. var self=this,$self=this;
  2221. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2222. return $core.withContext(function($ctx1) {
  2223. //>>excludeEnd("ctx");
  2224. return $recv($self._value())._isImmutable();
  2225. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2226. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},$globals.ValueNode)});
  2227. //>>excludeEnd("ctx");
  2228. },
  2229. //>>excludeStart("ide", pragmas.excludeIdeData);
  2230. args: [],
  2231. source: "isImmutable\x0a\x09^ self value isImmutable",
  2232. referencedClasses: [],
  2233. //>>excludeEnd("ide");
  2234. messageSends: ["isImmutable", "value"]
  2235. }),
  2236. $globals.ValueNode);
  2237. $core.addMethod(
  2238. $core.method({
  2239. selector: "isValueNode",
  2240. protocol: "testing",
  2241. fn: function (){
  2242. var self=this,$self=this;
  2243. return true;
  2244. },
  2245. //>>excludeStart("ide", pragmas.excludeIdeData);
  2246. args: [],
  2247. source: "isValueNode\x0a\x09^ true",
  2248. referencedClasses: [],
  2249. //>>excludeEnd("ide");
  2250. messageSends: []
  2251. }),
  2252. $globals.ValueNode);
  2253. $core.addMethod(
  2254. $core.method({
  2255. selector: "value",
  2256. protocol: "accessing",
  2257. fn: function (){
  2258. var self=this,$self=this;
  2259. return $self.value;
  2260. },
  2261. //>>excludeStart("ide", pragmas.excludeIdeData);
  2262. args: [],
  2263. source: "value\x0a\x09^ value",
  2264. referencedClasses: [],
  2265. //>>excludeEnd("ide");
  2266. messageSends: []
  2267. }),
  2268. $globals.ValueNode);
  2269. $core.addMethod(
  2270. $core.method({
  2271. selector: "value:",
  2272. protocol: "accessing",
  2273. fn: function (anObject){
  2274. var self=this,$self=this;
  2275. $self.value=anObject;
  2276. return self;
  2277. },
  2278. //>>excludeStart("ide", pragmas.excludeIdeData);
  2279. args: ["anObject"],
  2280. source: "value: anObject\x0a\x09value := anObject",
  2281. referencedClasses: [],
  2282. //>>excludeEnd("ide");
  2283. messageSends: []
  2284. }),
  2285. $globals.ValueNode);
  2286. $core.addClass("VariableNode", $globals.ValueNode, ["assigned", "binding"], "Compiler-AST");
  2287. //>>excludeStart("ide", pragmas.excludeIdeData);
  2288. $globals.VariableNode.comment="I represent an variable node.";
  2289. //>>excludeEnd("ide");
  2290. $core.addMethod(
  2291. $core.method({
  2292. selector: "acceptDagVisitor:",
  2293. protocol: "visiting",
  2294. fn: function (aVisitor){
  2295. var self=this,$self=this;
  2296. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2297. return $core.withContext(function($ctx1) {
  2298. //>>excludeEnd("ctx");
  2299. return $recv(aVisitor)._visitVariableNode_(self);
  2300. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2301. }, function($ctx1) {$ctx1.fill(self,"acceptDagVisitor:",{aVisitor:aVisitor},$globals.VariableNode)});
  2302. //>>excludeEnd("ctx");
  2303. },
  2304. //>>excludeStart("ide", pragmas.excludeIdeData);
  2305. args: ["aVisitor"],
  2306. source: "acceptDagVisitor: aVisitor\x0a\x09^ aVisitor visitVariableNode: self",
  2307. referencedClasses: [],
  2308. //>>excludeEnd("ide");
  2309. messageSends: ["visitVariableNode:"]
  2310. }),
  2311. $globals.VariableNode);
  2312. $core.addMethod(
  2313. $core.method({
  2314. selector: "alias",
  2315. protocol: "accessing",
  2316. fn: function (){
  2317. var self=this,$self=this;
  2318. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2319. return $core.withContext(function($ctx1) {
  2320. //>>excludeEnd("ctx");
  2321. return $recv($self._binding())._alias();
  2322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2323. }, function($ctx1) {$ctx1.fill(self,"alias",{},$globals.VariableNode)});
  2324. //>>excludeEnd("ctx");
  2325. },
  2326. //>>excludeStart("ide", pragmas.excludeIdeData);
  2327. args: [],
  2328. source: "alias\x0a\x09^ self binding alias",
  2329. referencedClasses: [],
  2330. //>>excludeEnd("ide");
  2331. messageSends: ["alias", "binding"]
  2332. }),
  2333. $globals.VariableNode);
  2334. $core.addMethod(
  2335. $core.method({
  2336. selector: "assigned",
  2337. protocol: "accessing",
  2338. fn: function (){
  2339. var self=this,$self=this;
  2340. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2341. return $core.withContext(function($ctx1) {
  2342. //>>excludeEnd("ctx");
  2343. var $1,$receiver;
  2344. $1=$self.assigned;
  2345. if(($receiver = $1) == null || $receiver.a$nil){
  2346. return false;
  2347. } else {
  2348. return $1;
  2349. }
  2350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2351. }, function($ctx1) {$ctx1.fill(self,"assigned",{},$globals.VariableNode)});
  2352. //>>excludeEnd("ctx");
  2353. },
  2354. //>>excludeStart("ide", pragmas.excludeIdeData);
  2355. args: [],
  2356. source: "assigned\x0a\x09^ assigned ifNil: [ false ]",
  2357. referencedClasses: [],
  2358. //>>excludeEnd("ide");
  2359. messageSends: ["ifNil:"]
  2360. }),
  2361. $globals.VariableNode);
  2362. $core.addMethod(
  2363. $core.method({
  2364. selector: "assigned:",
  2365. protocol: "accessing",
  2366. fn: function (aBoolean){
  2367. var self=this,$self=this;
  2368. $self.assigned=aBoolean;
  2369. return self;
  2370. },
  2371. //>>excludeStart("ide", pragmas.excludeIdeData);
  2372. args: ["aBoolean"],
  2373. source: "assigned: aBoolean\x0a\x09assigned := aBoolean",
  2374. referencedClasses: [],
  2375. //>>excludeEnd("ide");
  2376. messageSends: []
  2377. }),
  2378. $globals.VariableNode);
  2379. $core.addMethod(
  2380. $core.method({
  2381. selector: "beAssigned",
  2382. protocol: "accessing",
  2383. fn: function (){
  2384. var self=this,$self=this;
  2385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2386. return $core.withContext(function($ctx1) {
  2387. //>>excludeEnd("ctx");
  2388. $recv($self._binding())._validateAssignment();
  2389. $self.assigned=true;
  2390. return self;
  2391. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2392. }, function($ctx1) {$ctx1.fill(self,"beAssigned",{},$globals.VariableNode)});
  2393. //>>excludeEnd("ctx");
  2394. },
  2395. //>>excludeStart("ide", pragmas.excludeIdeData);
  2396. args: [],
  2397. source: "beAssigned\x0a\x09self binding validateAssignment.\x0a\x09assigned := true",
  2398. referencedClasses: [],
  2399. //>>excludeEnd("ide");
  2400. messageSends: ["validateAssignment", "binding"]
  2401. }),
  2402. $globals.VariableNode);
  2403. $core.addMethod(
  2404. $core.method({
  2405. selector: "binding",
  2406. protocol: "accessing",
  2407. fn: function (){
  2408. var self=this,$self=this;
  2409. return $self.binding;
  2410. },
  2411. //>>excludeStart("ide", pragmas.excludeIdeData);
  2412. args: [],
  2413. source: "binding\x0a\x09^ binding",
  2414. referencedClasses: [],
  2415. //>>excludeEnd("ide");
  2416. messageSends: []
  2417. }),
  2418. $globals.VariableNode);
  2419. $core.addMethod(
  2420. $core.method({
  2421. selector: "binding:",
  2422. protocol: "accessing",
  2423. fn: function (aScopeVar){
  2424. var self=this,$self=this;
  2425. $self.binding=aScopeVar;
  2426. return self;
  2427. },
  2428. //>>excludeStart("ide", pragmas.excludeIdeData);
  2429. args: ["aScopeVar"],
  2430. source: "binding: aScopeVar\x0a\x09binding := aScopeVar",
  2431. referencedClasses: [],
  2432. //>>excludeEnd("ide");
  2433. messageSends: []
  2434. }),
  2435. $globals.VariableNode);
  2436. $core.addMethod(
  2437. $core.method({
  2438. selector: "isArgument",
  2439. protocol: "testing",
  2440. fn: function (){
  2441. var self=this,$self=this;
  2442. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2443. return $core.withContext(function($ctx1) {
  2444. //>>excludeEnd("ctx");
  2445. return $recv($self._binding())._isArgVar();
  2446. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2447. }, function($ctx1) {$ctx1.fill(self,"isArgument",{},$globals.VariableNode)});
  2448. //>>excludeEnd("ctx");
  2449. },
  2450. //>>excludeStart("ide", pragmas.excludeIdeData);
  2451. args: [],
  2452. source: "isArgument\x0a\x09^ self binding isArgVar",
  2453. referencedClasses: [],
  2454. //>>excludeEnd("ide");
  2455. messageSends: ["isArgVar", "binding"]
  2456. }),
  2457. $globals.VariableNode);
  2458. $core.addMethod(
  2459. $core.method({
  2460. selector: "isImmutable",
  2461. protocol: "testing",
  2462. fn: function (){
  2463. var self=this,$self=this;
  2464. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2465. return $core.withContext(function($ctx1) {
  2466. //>>excludeEnd("ctx");
  2467. return $recv($self._binding())._isImmutable();
  2468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2469. }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},$globals.VariableNode)});
  2470. //>>excludeEnd("ctx");
  2471. },
  2472. //>>excludeStart("ide", pragmas.excludeIdeData);
  2473. args: [],
  2474. source: "isImmutable\x0a\x09^ self binding isImmutable",
  2475. referencedClasses: [],
  2476. //>>excludeEnd("ide");
  2477. messageSends: ["isImmutable", "binding"]
  2478. }),
  2479. $globals.VariableNode);
  2480. $core.addMethod(
  2481. $core.method({
  2482. selector: "isNavigationNode",
  2483. protocol: "testing",
  2484. fn: function (){
  2485. var self=this,$self=this;
  2486. return true;
  2487. },
  2488. //>>excludeStart("ide", pragmas.excludeIdeData);
  2489. args: [],
  2490. source: "isNavigationNode\x0a\x09^ true",
  2491. referencedClasses: [],
  2492. //>>excludeEnd("ide");
  2493. messageSends: []
  2494. }),
  2495. $globals.VariableNode);
  2496. $core.addMethod(
  2497. $core.method({
  2498. selector: "isSuperKeyword",
  2499. protocol: "testing",
  2500. fn: function (){
  2501. var self=this,$self=this;
  2502. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2503. return $core.withContext(function($ctx1) {
  2504. //>>excludeEnd("ctx");
  2505. return $recv($self._value()).__eq("super");
  2506. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2507. }, function($ctx1) {$ctx1.fill(self,"isSuperKeyword",{},$globals.VariableNode)});
  2508. //>>excludeEnd("ctx");
  2509. },
  2510. //>>excludeStart("ide", pragmas.excludeIdeData);
  2511. args: [],
  2512. source: "isSuperKeyword\x0a\x09^ self value = 'super'",
  2513. referencedClasses: [],
  2514. //>>excludeEnd("ide");
  2515. messageSends: ["=", "value"]
  2516. }),
  2517. $globals.VariableNode);
  2518. $core.addMethod(
  2519. $core.method({
  2520. selector: "isVariableNode",
  2521. protocol: "testing",
  2522. fn: function (){
  2523. var self=this,$self=this;
  2524. return true;
  2525. },
  2526. //>>excludeStart("ide", pragmas.excludeIdeData);
  2527. args: [],
  2528. source: "isVariableNode\x0a\x09^ true",
  2529. referencedClasses: [],
  2530. //>>excludeEnd("ide");
  2531. messageSends: []
  2532. }),
  2533. $globals.VariableNode);
  2534. $core.addMethod(
  2535. $core.method({
  2536. selector: "navigationLink",
  2537. protocol: "accessing",
  2538. fn: function (){
  2539. var self=this,$self=this;
  2540. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2541. return $core.withContext(function($ctx1) {
  2542. //>>excludeEnd("ctx");
  2543. return $self._value();
  2544. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2545. }, function($ctx1) {$ctx1.fill(self,"navigationLink",{},$globals.VariableNode)});
  2546. //>>excludeEnd("ctx");
  2547. },
  2548. //>>excludeStart("ide", pragmas.excludeIdeData);
  2549. args: [],
  2550. source: "navigationLink\x0a\x09^ self value",
  2551. referencedClasses: [],
  2552. //>>excludeEnd("ide");
  2553. messageSends: ["value"]
  2554. }),
  2555. $globals.VariableNode);
  2556. $core.addClass("CompilerError", $globals.Error, [], "Compiler-AST");
  2557. //>>excludeStart("ide", pragmas.excludeIdeData);
  2558. $globals.CompilerError.comment="I am the common superclass of all compiling errors.";
  2559. //>>excludeEnd("ide");
  2560. $core.addClass("ParentFakingPathDagVisitor", $globals.PathDagVisitor, ["setParentSelector"], "Compiler-AST");
  2561. //>>excludeStart("ide", pragmas.excludeIdeData);
  2562. $globals.ParentFakingPathDagVisitor.comment="I am base class of `DagNode` visitor.\x0a\x0aI hold the path of ancestors up to actual node\x0ain `self path`.";
  2563. //>>excludeEnd("ide");
  2564. $core.addMethod(
  2565. $core.method({
  2566. selector: "visit:",
  2567. protocol: "visiting",
  2568. fn: function (aNode){
  2569. var self=this,$self=this;
  2570. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2571. return $core.withContext(function($ctx1) {
  2572. //>>excludeEnd("ctx");
  2573. var $1;
  2574. $recv($self._path())._ifNotEmpty_((function(p){
  2575. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2576. return $core.withContext(function($ctx2) {
  2577. //>>excludeEnd("ctx");
  2578. return $recv(aNode)._parent_($recv(p)._last());
  2579. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2580. }, function($ctx2) {$ctx2.fillBlock({p:p},$ctx1,1)});
  2581. //>>excludeEnd("ctx");
  2582. }));
  2583. $1=(
  2584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2585. $ctx1.supercall = true,
  2586. //>>excludeEnd("ctx");
  2587. ($globals.ParentFakingPathDagVisitor.superclass||$boot.nilAsClass).fn.prototype._visit_.apply($self, [aNode]));
  2588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2589. $ctx1.supercall = false;
  2590. //>>excludeEnd("ctx");;
  2591. return $1;
  2592. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2593. }, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode},$globals.ParentFakingPathDagVisitor)});
  2594. //>>excludeEnd("ctx");
  2595. },
  2596. //>>excludeStart("ide", pragmas.excludeIdeData);
  2597. args: ["aNode"],
  2598. source: "visit: aNode\x0a\x09self path ifNotEmpty: [ :p | aNode parent: p last ].\x0a\x09^ super visit: aNode",
  2599. referencedClasses: [],
  2600. //>>excludeEnd("ide");
  2601. messageSends: ["ifNotEmpty:", "path", "parent:", "last", "visit:"]
  2602. }),
  2603. $globals.ParentFakingPathDagVisitor);
  2604. $core.addClass("NodeVisitor", $globals.ParentFakingPathDagVisitor, [], "Compiler-AST");
  2605. //>>excludeStart("ide", pragmas.excludeIdeData);
  2606. $globals.NodeVisitor.comment="I am the abstract super class of all AST node visitors.";
  2607. //>>excludeEnd("ide");
  2608. $core.addMethod(
  2609. $core.method({
  2610. selector: "visitAssignmentNode:",
  2611. protocol: "visiting",
  2612. fn: function (aNode){
  2613. var self=this,$self=this;
  2614. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2615. return $core.withContext(function($ctx1) {
  2616. //>>excludeEnd("ctx");
  2617. return $self._visitDagNode_(aNode);
  2618. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2619. }, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode},$globals.NodeVisitor)});
  2620. //>>excludeEnd("ctx");
  2621. },
  2622. //>>excludeStart("ide", pragmas.excludeIdeData);
  2623. args: ["aNode"],
  2624. source: "visitAssignmentNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2625. referencedClasses: [],
  2626. //>>excludeEnd("ide");
  2627. messageSends: ["visitDagNode:"]
  2628. }),
  2629. $globals.NodeVisitor);
  2630. $core.addMethod(
  2631. $core.method({
  2632. selector: "visitBlockNode:",
  2633. protocol: "visiting",
  2634. fn: function (aNode){
  2635. var self=this,$self=this;
  2636. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2637. return $core.withContext(function($ctx1) {
  2638. //>>excludeEnd("ctx");
  2639. return $self._visitDagNode_(aNode);
  2640. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2641. }, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode},$globals.NodeVisitor)});
  2642. //>>excludeEnd("ctx");
  2643. },
  2644. //>>excludeStart("ide", pragmas.excludeIdeData);
  2645. args: ["aNode"],
  2646. source: "visitBlockNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2647. referencedClasses: [],
  2648. //>>excludeEnd("ide");
  2649. messageSends: ["visitDagNode:"]
  2650. }),
  2651. $globals.NodeVisitor);
  2652. $core.addMethod(
  2653. $core.method({
  2654. selector: "visitBlockSequenceNode:",
  2655. protocol: "visiting",
  2656. fn: function (aNode){
  2657. var self=this,$self=this;
  2658. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2659. return $core.withContext(function($ctx1) {
  2660. //>>excludeEnd("ctx");
  2661. return $self._visitSequenceNode_(aNode);
  2662. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2663. }, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:",{aNode:aNode},$globals.NodeVisitor)});
  2664. //>>excludeEnd("ctx");
  2665. },
  2666. //>>excludeStart("ide", pragmas.excludeIdeData);
  2667. args: ["aNode"],
  2668. source: "visitBlockSequenceNode: aNode\x0a\x09^ self visitSequenceNode: aNode",
  2669. referencedClasses: [],
  2670. //>>excludeEnd("ide");
  2671. messageSends: ["visitSequenceNode:"]
  2672. }),
  2673. $globals.NodeVisitor);
  2674. $core.addMethod(
  2675. $core.method({
  2676. selector: "visitCascadeNode:",
  2677. protocol: "visiting",
  2678. fn: function (aNode){
  2679. var self=this,$self=this;
  2680. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2681. return $core.withContext(function($ctx1) {
  2682. //>>excludeEnd("ctx");
  2683. return $self._visitDagNode_(aNode);
  2684. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2685. }, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode},$globals.NodeVisitor)});
  2686. //>>excludeEnd("ctx");
  2687. },
  2688. //>>excludeStart("ide", pragmas.excludeIdeData);
  2689. args: ["aNode"],
  2690. source: "visitCascadeNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2691. referencedClasses: [],
  2692. //>>excludeEnd("ide");
  2693. messageSends: ["visitDagNode:"]
  2694. }),
  2695. $globals.NodeVisitor);
  2696. $core.addMethod(
  2697. $core.method({
  2698. selector: "visitDagNode:",
  2699. protocol: "visiting",
  2700. fn: function (aNode){
  2701. var self=this,$self=this;
  2702. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2703. return $core.withContext(function($ctx1) {
  2704. //>>excludeEnd("ctx");
  2705. return $self._visitDagNodeVariantSimple_(aNode);
  2706. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2707. }, function($ctx1) {$ctx1.fill(self,"visitDagNode:",{aNode:aNode},$globals.NodeVisitor)});
  2708. //>>excludeEnd("ctx");
  2709. },
  2710. //>>excludeStart("ide", pragmas.excludeIdeData);
  2711. args: ["aNode"],
  2712. source: "visitDagNode: aNode\x0a\x09^ self visitDagNodeVariantSimple: aNode",
  2713. referencedClasses: [],
  2714. //>>excludeEnd("ide");
  2715. messageSends: ["visitDagNodeVariantSimple:"]
  2716. }),
  2717. $globals.NodeVisitor);
  2718. $core.addMethod(
  2719. $core.method({
  2720. selector: "visitDynamicArrayNode:",
  2721. protocol: "visiting",
  2722. fn: function (aNode){
  2723. var self=this,$self=this;
  2724. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2725. return $core.withContext(function($ctx1) {
  2726. //>>excludeEnd("ctx");
  2727. return $self._visitDagNode_(aNode);
  2728. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2729. }, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode},$globals.NodeVisitor)});
  2730. //>>excludeEnd("ctx");
  2731. },
  2732. //>>excludeStart("ide", pragmas.excludeIdeData);
  2733. args: ["aNode"],
  2734. source: "visitDynamicArrayNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2735. referencedClasses: [],
  2736. //>>excludeEnd("ide");
  2737. messageSends: ["visitDagNode:"]
  2738. }),
  2739. $globals.NodeVisitor);
  2740. $core.addMethod(
  2741. $core.method({
  2742. selector: "visitDynamicDictionaryNode:",
  2743. protocol: "visiting",
  2744. fn: function (aNode){
  2745. var self=this,$self=this;
  2746. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2747. return $core.withContext(function($ctx1) {
  2748. //>>excludeEnd("ctx");
  2749. return $self._visitDagNode_(aNode);
  2750. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2751. }, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode},$globals.NodeVisitor)});
  2752. //>>excludeEnd("ctx");
  2753. },
  2754. //>>excludeStart("ide", pragmas.excludeIdeData);
  2755. args: ["aNode"],
  2756. source: "visitDynamicDictionaryNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2757. referencedClasses: [],
  2758. //>>excludeEnd("ide");
  2759. messageSends: ["visitDagNode:"]
  2760. }),
  2761. $globals.NodeVisitor);
  2762. $core.addMethod(
  2763. $core.method({
  2764. selector: "visitJSStatementNode:",
  2765. protocol: "visiting",
  2766. fn: function (aNode){
  2767. var self=this,$self=this;
  2768. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2769. return $core.withContext(function($ctx1) {
  2770. //>>excludeEnd("ctx");
  2771. return $self._visitDagNode_(aNode);
  2772. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2773. }, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},$globals.NodeVisitor)});
  2774. //>>excludeEnd("ctx");
  2775. },
  2776. //>>excludeStart("ide", pragmas.excludeIdeData);
  2777. args: ["aNode"],
  2778. source: "visitJSStatementNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2779. referencedClasses: [],
  2780. //>>excludeEnd("ide");
  2781. messageSends: ["visitDagNode:"]
  2782. }),
  2783. $globals.NodeVisitor);
  2784. $core.addMethod(
  2785. $core.method({
  2786. selector: "visitMethodNode:",
  2787. protocol: "visiting",
  2788. fn: function (aNode){
  2789. var self=this,$self=this;
  2790. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2791. return $core.withContext(function($ctx1) {
  2792. //>>excludeEnd("ctx");
  2793. return $self._visitDagNode_(aNode);
  2794. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2795. }, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode},$globals.NodeVisitor)});
  2796. //>>excludeEnd("ctx");
  2797. },
  2798. //>>excludeStart("ide", pragmas.excludeIdeData);
  2799. args: ["aNode"],
  2800. source: "visitMethodNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2801. referencedClasses: [],
  2802. //>>excludeEnd("ide");
  2803. messageSends: ["visitDagNode:"]
  2804. }),
  2805. $globals.NodeVisitor);
  2806. $core.addMethod(
  2807. $core.method({
  2808. selector: "visitReturnNode:",
  2809. protocol: "visiting",
  2810. fn: function (aNode){
  2811. var self=this,$self=this;
  2812. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2813. return $core.withContext(function($ctx1) {
  2814. //>>excludeEnd("ctx");
  2815. return $self._visitDagNode_(aNode);
  2816. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2817. }, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode},$globals.NodeVisitor)});
  2818. //>>excludeEnd("ctx");
  2819. },
  2820. //>>excludeStart("ide", pragmas.excludeIdeData);
  2821. args: ["aNode"],
  2822. source: "visitReturnNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2823. referencedClasses: [],
  2824. //>>excludeEnd("ide");
  2825. messageSends: ["visitDagNode:"]
  2826. }),
  2827. $globals.NodeVisitor);
  2828. $core.addMethod(
  2829. $core.method({
  2830. selector: "visitSendNode:",
  2831. protocol: "visiting",
  2832. fn: function (aNode){
  2833. var self=this,$self=this;
  2834. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2835. return $core.withContext(function($ctx1) {
  2836. //>>excludeEnd("ctx");
  2837. return $self._visitDagNode_(aNode);
  2838. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2839. }, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode},$globals.NodeVisitor)});
  2840. //>>excludeEnd("ctx");
  2841. },
  2842. //>>excludeStart("ide", pragmas.excludeIdeData);
  2843. args: ["aNode"],
  2844. source: "visitSendNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2845. referencedClasses: [],
  2846. //>>excludeEnd("ide");
  2847. messageSends: ["visitDagNode:"]
  2848. }),
  2849. $globals.NodeVisitor);
  2850. $core.addMethod(
  2851. $core.method({
  2852. selector: "visitSequenceNode:",
  2853. protocol: "visiting",
  2854. fn: function (aNode){
  2855. var self=this,$self=this;
  2856. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2857. return $core.withContext(function($ctx1) {
  2858. //>>excludeEnd("ctx");
  2859. return $self._visitDagNode_(aNode);
  2860. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2861. }, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode},$globals.NodeVisitor)});
  2862. //>>excludeEnd("ctx");
  2863. },
  2864. //>>excludeStart("ide", pragmas.excludeIdeData);
  2865. args: ["aNode"],
  2866. source: "visitSequenceNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2867. referencedClasses: [],
  2868. //>>excludeEnd("ide");
  2869. messageSends: ["visitDagNode:"]
  2870. }),
  2871. $globals.NodeVisitor);
  2872. $core.addMethod(
  2873. $core.method({
  2874. selector: "visitValueNode:",
  2875. protocol: "visiting",
  2876. fn: function (aNode){
  2877. var self=this,$self=this;
  2878. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2879. return $core.withContext(function($ctx1) {
  2880. //>>excludeEnd("ctx");
  2881. return $self._visitDagNode_(aNode);
  2882. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2883. }, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode},$globals.NodeVisitor)});
  2884. //>>excludeEnd("ctx");
  2885. },
  2886. //>>excludeStart("ide", pragmas.excludeIdeData);
  2887. args: ["aNode"],
  2888. source: "visitValueNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2889. referencedClasses: [],
  2890. //>>excludeEnd("ide");
  2891. messageSends: ["visitDagNode:"]
  2892. }),
  2893. $globals.NodeVisitor);
  2894. $core.addMethod(
  2895. $core.method({
  2896. selector: "visitVariableNode:",
  2897. protocol: "visiting",
  2898. fn: function (aNode){
  2899. var self=this,$self=this;
  2900. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2901. return $core.withContext(function($ctx1) {
  2902. //>>excludeEnd("ctx");
  2903. return $self._visitDagNode_(aNode);
  2904. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2905. }, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},$globals.NodeVisitor)});
  2906. //>>excludeEnd("ctx");
  2907. },
  2908. //>>excludeStart("ide", pragmas.excludeIdeData);
  2909. args: ["aNode"],
  2910. source: "visitVariableNode: aNode\x0a\x09^ self visitDagNode: aNode",
  2911. referencedClasses: [],
  2912. //>>excludeEnd("ide");
  2913. messageSends: ["visitDagNode:"]
  2914. }),
  2915. $globals.NodeVisitor);
  2916. $core.addMethod(
  2917. $core.method({
  2918. selector: "ast",
  2919. protocol: "*Compiler-AST",
  2920. fn: function (){
  2921. var self=this,$self=this;
  2922. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2923. return $core.withContext(function($ctx1) {
  2924. //>>excludeEnd("ctx");
  2925. var $1;
  2926. $1=$self._source();
  2927. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2928. $ctx1.sendIdx["source"]=1;
  2929. //>>excludeEnd("ctx");
  2930. $recv($1)._ifEmpty_((function(){
  2931. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2932. return $core.withContext(function($ctx2) {
  2933. //>>excludeEnd("ctx");
  2934. return $recv($globals.CompilerError)._signal_("Method source is empty");
  2935. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2936. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  2937. //>>excludeEnd("ctx");
  2938. }));
  2939. return $recv($recv($globals.Compiler)._new())._ast_forClass_protocol_($self._source(),$self._methodClass(),$self._protocol());
  2940. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  2941. }, function($ctx1) {$ctx1.fill(self,"ast",{},$globals.CompiledMethod)});
  2942. //>>excludeEnd("ctx");
  2943. },
  2944. //>>excludeStart("ide", pragmas.excludeIdeData);
  2945. args: [],
  2946. 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",
  2947. referencedClasses: ["CompilerError", "Compiler"],
  2948. //>>excludeEnd("ide");
  2949. messageSends: ["ifEmpty:", "source", "signal:", "ast:forClass:protocol:", "new", "methodClass", "protocol"]
  2950. }),
  2951. $globals.CompiledMethod);
  2952. });