1
0

Compiler-AST.js 89 KB

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