12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480 |
- define("amber_core/Compiler-AST", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Objects", "amber_core/Kernel-Methods"], function(smalltalk,nil,_st, globals){
- smalltalk.addPackage('Compiler-AST');
- smalltalk.packages["Compiler-AST"].transport = {"type":"amd","amdNamespace":"amber_core"};
- smalltalk.addClass('Node', globals.Object, ['parent', 'position', 'source', 'nodes', 'shouldBeInlined', 'shouldBeAliased'], 'Compiler-AST');
- globals.Node.comment="I am the abstract root class of the abstract syntax tree.\x0a\x0aConcrete classes should implement `#accept:` to allow visiting.\x0a\x0a`position` holds a point containing line and column number of the symbol location in the original source file.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "accept:",
- protocol: 'visiting',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(aVisitor)._visitNode_(self);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},globals.Node)})},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitNode: self",
- messageSends: ["visitNode:"],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "addNode:",
- protocol: 'accessing',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self._nodes())._add_(aNode);
- _st(aNode)._parent_(self);
- return self}, function($ctx1) {$ctx1.fill(self,"addNode:",{aNode:aNode},globals.Node)})},
- args: ["aNode"],
- source: "addNode: aNode\x0a\x09self nodes add: aNode.\x0a\x09aNode parent: self",
- messageSends: ["add:", "nodes", "parent:"],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isAssignmentNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return false;
- },
- args: [],
- source: "isAssignmentNode\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isBlockNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return false;
- },
- args: [],
- source: "isBlockNode\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isBlockSequenceNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return false;
- },
- args: [],
- source: "isBlockSequenceNode\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isCascadeNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return false;
- },
- args: [],
- source: "isCascadeNode\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isImmutable",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return false;
- },
- args: [],
- source: "isImmutable\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isJSStatementNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return false;
- },
- args: [],
- source: "isJSStatementNode\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isLastChild",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(_st(self._parent())._nodes())._last()).__eq(self);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"isLastChild",{},globals.Node)})},
- args: [],
- source: "isLastChild\x0a\x09^ self parent nodes last = self",
- messageSends: ["=", "last", "nodes", "parent"],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return true;
- },
- args: [],
- source: "isNode\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isReferenced",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $4,$3,$2,$1;
- $4=self._parent();
- $ctx1.sendIdx["parent"]=1;
- $3=_st($4)._isSequenceNode();
- $2=_st($3)._or_((function(){
- return smalltalk.withContext(function($ctx2) {
- return _st(self._parent())._isAssignmentNode();
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
- $1=_st($2)._not();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"isReferenced",{},globals.Node)})},
- args: [],
- source: "isReferenced\x0a\x09\x22Answer true if the receiver is referenced by other nodes.\x0a\x09Do not take sequences or assignments into account\x22\x0a\x09\x0a\x09^ (self parent isSequenceNode or: [\x0a\x09\x09self parent isAssignmentNode ]) not",
- messageSends: ["not", "or:", "isSequenceNode", "parent", "isAssignmentNode"],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isReturnNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return false;
- },
- args: [],
- source: "isReturnNode\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isSendNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return false;
- },
- args: [],
- source: "isSendNode\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isSequenceNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return false;
- },
- args: [],
- source: "isSequenceNode\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isValueNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return false;
- },
- args: [],
- source: "isValueNode\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isVariableNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return false;
- },
- args: [],
- source: "isVariableNode\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "method",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self._parent();
- if(($receiver = $2) == nil || $receiver == null){
- $1=$2;
- } else {
- var node;
- node=$receiver;
- $1=_st(node)._method();
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"method",{},globals.Node)})},
- args: [],
- source: "method\x0a\x09^ self parent ifNotNil: [ :node | node method ]",
- messageSends: ["ifNotNil:", "parent", "method"],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "nextChild",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $3,$2,$1;
- $3=self._nodes();
- $ctx1.sendIdx["nodes"]=1;
- $2=_st($3)._isEmpty();
- if(smalltalk.assert($2)){
- $1=self;
- } else {
- $1=_st(_st(self._nodes())._first())._nextChild();
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"nextChild",{},globals.Node)})},
- args: [],
- source: "nextChild\x0a\x09\x22Answer the next node after aNode.\x0a\x09Recurse into the possible children of the receiver to answer the next node to be evaluated\x22\x0a\x09\x0a\x09^ self nodes isEmpty\x0a\x09\x09ifTrue: [ self ]\x0a\x09\x09ifFalse: [ self nodes first nextChild ]",
- messageSends: ["ifTrue:ifFalse:", "isEmpty", "nodes", "nextChild", "first"],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "nextNode",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self._parent();
- if(($receiver = $2) == nil || $receiver == null){
- $1=$2;
- } else {
- var node;
- node=$receiver;
- $1=_st(node)._nextNode_(self);
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"nextNode",{},globals.Node)})},
- args: [],
- source: "nextNode\x0a\x09^ self parent ifNotNil: [ :node |\x0a\x09\x09node nextNode: self ]",
- messageSends: ["ifNotNil:", "parent", "nextNode:"],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "nextNode:",
- protocol: 'accessing',
- fn: function (aNode){
- var self=this;
- var next;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- var $early={};
- try {
- $1=self._nodes();
- $ctx1.sendIdx["nodes"]=1;
- next=_st($1)._at_ifAbsent_(_st(_st(self._nodes())._indexOf_(aNode)).__plus((1)),(function(){
- return smalltalk.withContext(function($ctx2) {
- throw $early=[self];
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
- $2=_st(next)._nextChild();
- return $2;
- }
- catch(e) {if(e===$early)return e[0]; throw e}
- }, function($ctx1) {$ctx1.fill(self,"nextNode:",{aNode:aNode,next:next},globals.Node)})},
- args: ["aNode"],
- source: "nextNode: aNode\x0a\x09\x22Answer the next node after aNode.\x0a\x09Recurse into the possible children of the next node to answer the next node to be evaluated\x22\x0a\x09\x0a\x09| next |\x0a\x09\x0a\x09next := self nodes \x0a\x09\x09at: (self nodes indexOf: aNode) + 1\x0a\x09\x09ifAbsent: [ ^ self ].\x0a\x09\x0a\x09^ next nextChild",
- messageSends: ["at:ifAbsent:", "nodes", "+", "indexOf:", "nextChild"],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "nodes",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- function $Array(){return globals.Array||(typeof Array=="undefined"?nil:Array)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@nodes"];
- if(($receiver = $2) == nil || $receiver == null){
- self["@nodes"]=_st($Array())._new();
- $1=self["@nodes"];
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"nodes",{},globals.Node)})},
- args: [],
- source: "nodes\x0a\x09^ nodes ifNil: [ nodes := Array new ]",
- messageSends: ["ifNil:", "new"],
- referencedClasses: ["Array"]
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "nodes:",
- protocol: 'building',
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@nodes"]=aCollection;
- _st(aCollection)._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
- return _st(each)._parent_(self);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
- return self}, function($ctx1) {$ctx1.fill(self,"nodes:",{aCollection:aCollection},globals.Node)})},
- args: ["aCollection"],
- source: "nodes: aCollection\x0a\x09nodes := aCollection.\x0a\x09aCollection do: [ :each | each parent: self ]",
- messageSends: ["do:", "parent:"],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "parent",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@parent"];
- return $1;
- },
- args: [],
- source: "parent\x0a\x09^ parent",
- messageSends: [],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "parent:",
- protocol: 'accessing',
- fn: function (aNode){
- var self=this;
- self["@parent"]=aNode;
- return self},
- args: ["aNode"],
- source: "parent: aNode\x0a\x09parent := aNode",
- messageSends: [],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "position",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=self["@position"];
- if(($receiver = $2) == nil || $receiver == null){
- $3=self._parent();
- if(($receiver = $3) == nil || $receiver == null){
- $1=$3;
- } else {
- var node;
- node=$receiver;
- $1=_st(node)._position();
- };
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"position",{},globals.Node)})},
- args: [],
- 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 ] ]",
- messageSends: ["ifNil:", "ifNotNil:", "parent", "position"],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "position:",
- protocol: 'accessing',
- fn: function (aPosition){
- var self=this;
- self["@position"]=aPosition;
- return self},
- args: ["aPosition"],
- source: "position: aPosition\x0a\x09position := aPosition",
- messageSends: [],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "positionEnd",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$7,$6,$5,$4,$3,$1;
- $2=self._positionStart();
- $7=self._source();
- $ctx1.sendIdx["source"]=1;
- $6=_st($7)._lines();
- $ctx1.sendIdx["lines"]=1;
- $5=_st($6)._size();
- $ctx1.sendIdx["size"]=1;
- $4=_st($5).__minus((1));
- $ctx1.sendIdx["-"]=1;
- $3=_st($4).__at(_st(_st(_st(_st(self._source())._lines())._last())._size()).__minus((1)));
- $1=_st($2).__plus($3);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"positionEnd",{},globals.Node)})},
- args: [],
- source: "positionEnd\x0a\x09^ self positionStart + ((self source lines size - 1) @ (self source lines last size - 1))",
- messageSends: ["+", "positionStart", "@", "-", "size", "lines", "source", "last"],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "positionStart",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self._position();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"positionStart",{},globals.Node)})},
- args: [],
- source: "positionStart\x0a\x09^ self position",
- messageSends: ["position"],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "postCopy",
- protocol: 'copying',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- globals.Node.superclass.fn.prototype._postCopy.apply(_st(self), []);
- _st(self._nodes())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
- return _st(each)._parent_(self);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
- return self}, function($ctx1) {$ctx1.fill(self,"postCopy",{},globals.Node)})},
- args: [],
- source: "postCopy\x0a\x09super postCopy.\x0a\x09self nodes do: [ :each | each parent: self ]",
- messageSends: ["postCopy", "do:", "nodes", "parent:"],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "requiresSmalltalkContext",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(self._nodes())._detect_ifNone_((function(each){
- return smalltalk.withContext(function($ctx2) {
- return _st(each)._requiresSmalltalkContext();
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
- return smalltalk.withContext(function($ctx2) {
- return nil;
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})})))._notNil();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"requiresSmalltalkContext",{},globals.Node)})},
- args: [],
- source: "requiresSmalltalkContext\x0a\x09\x22Answer true if the receiver requires a smalltalk context.\x0a\x09Only send nodes require a context.\x0a\x09\x0a\x09If no node requires a context, the method will be compiled without one.\x0a\x09See `IRJSTranslator` and `JSStream` for context creation\x22\x0a\x09\x0a\x09^ (self nodes \x0a\x09\x09detect: [ :each | each requiresSmalltalkContext ]\x0a\x09\x09ifNone: [ nil ]) notNil",
- messageSends: ["notNil", "detect:ifNone:", "nodes", "requiresSmalltalkContext"],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "shouldBeAliased",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@shouldBeAliased"];
- if(($receiver = $2) == nil || $receiver == null){
- $1=false;
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"shouldBeAliased",{},globals.Node)})},
- args: [],
- source: "shouldBeAliased\x0a\x09^ shouldBeAliased ifNil: [ false ]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "shouldBeAliased:",
- protocol: 'accessing',
- fn: function (aBoolean){
- var self=this;
- self["@shouldBeAliased"]=aBoolean;
- return self},
- args: ["aBoolean"],
- source: "shouldBeAliased: aBoolean\x0a\x09shouldBeAliased := aBoolean",
- messageSends: [],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "shouldBeInlined",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@shouldBeInlined"];
- if(($receiver = $2) == nil || $receiver == null){
- $1=false;
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"shouldBeInlined",{},globals.Node)})},
- args: [],
- source: "shouldBeInlined\x0a\x09^ shouldBeInlined ifNil: [ false ]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "shouldBeInlined:",
- protocol: 'accessing',
- fn: function (aBoolean){
- var self=this;
- self["@shouldBeInlined"]=aBoolean;
- return self},
- args: ["aBoolean"],
- source: "shouldBeInlined: aBoolean\x0a\x09shouldBeInlined := aBoolean",
- messageSends: [],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "size",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self._source())._size();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"size",{},globals.Node)})},
- args: [],
- source: "size\x0a\x09^ self source size",
- messageSends: ["size", "source"],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "source",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@source"];
- if(($receiver = $2) == nil || $receiver == null){
- $1="";
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"source",{},globals.Node)})},
- args: [],
- source: "source\x0a\x09^ source ifNil: [ '' ]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "source:",
- protocol: 'accessing',
- fn: function (aString){
- var self=this;
- self["@source"]=aString;
- return self},
- args: ["aString"],
- source: "source: aString\x0a\x09source := aString",
- messageSends: [],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "stopOnStepping",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return false;
- },
- args: [],
- source: "stopOnStepping\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "subtreeNeedsAliasing",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(self._shouldBeAliased())._or_((function(){
- return smalltalk.withContext(function($ctx2) {
- return self._shouldBeInlined();
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})})))._or_((function(){
- return smalltalk.withContext(function($ctx2) {
- return _st(self._nodes())._anySatisfy_((function(each){
- return smalltalk.withContext(function($ctx3) {
- return _st(each)._subtreeNeedsAliasing();
- }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,3)})}));
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
- $ctx1.sendIdx["or:"]=1;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"subtreeNeedsAliasing",{},globals.Node)})},
- args: [],
- source: "subtreeNeedsAliasing\x0a\x09^ (self shouldBeAliased or: [ self shouldBeInlined ]) or: [\x0a\x09\x09self nodes anySatisfy: [ :each | each subtreeNeedsAliasing ] ]",
- messageSends: ["or:", "shouldBeAliased", "shouldBeInlined", "anySatisfy:", "nodes", "subtreeNeedsAliasing"],
- referencedClasses: []
- }),
- globals.Node);
- smalltalk.addClass('AssignmentNode', globals.Node, ['left', 'right'], 'Compiler-AST');
- globals.AssignmentNode.comment="I represent an assignment node.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "accept:",
- protocol: 'visiting',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(aVisitor)._visitAssignmentNode_(self);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},globals.AssignmentNode)})},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitAssignmentNode: self",
- messageSends: ["visitAssignmentNode:"],
- referencedClasses: []
- }),
- globals.AssignmentNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isAssignmentNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return true;
- },
- args: [],
- source: "isAssignmentNode\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- globals.AssignmentNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "left",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@left"];
- return $1;
- },
- args: [],
- source: "left\x0a\x09^ left",
- messageSends: [],
- referencedClasses: []
- }),
- globals.AssignmentNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "left:",
- protocol: 'accessing',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@left"]=aNode;
- _st(aNode)._parent_(self);
- return self}, function($ctx1) {$ctx1.fill(self,"left:",{aNode:aNode},globals.AssignmentNode)})},
- args: ["aNode"],
- source: "left: aNode\x0a\x09left := aNode.\x0a\x09aNode parent: self",
- messageSends: ["parent:"],
- referencedClasses: []
- }),
- globals.AssignmentNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "nodes",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- function $Array(){return globals.Array||(typeof Array=="undefined"?nil:Array)}
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st($Array())._with_with_(self._left(),self._right());
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"nodes",{},globals.AssignmentNode)})},
- args: [],
- source: "nodes\x0a\x09^ Array with: self left with: self right",
- messageSends: ["with:with:", "left", "right"],
- referencedClasses: ["Array"]
- }),
- globals.AssignmentNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "right",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@right"];
- return $1;
- },
- args: [],
- source: "right\x0a\x09^ right",
- messageSends: [],
- referencedClasses: []
- }),
- globals.AssignmentNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "right:",
- protocol: 'accessing',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@right"]=aNode;
- _st(aNode)._parent_(self);
- return self}, function($ctx1) {$ctx1.fill(self,"right:",{aNode:aNode},globals.AssignmentNode)})},
- args: ["aNode"],
- source: "right: aNode\x0a\x09right := aNode.\x0a\x09aNode parent: self",
- messageSends: ["parent:"],
- referencedClasses: []
- }),
- globals.AssignmentNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "shouldBeAliased",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(globals.AssignmentNode.superclass.fn.prototype._shouldBeAliased.apply(_st(self), []))._or_((function(){
- return smalltalk.withContext(function($ctx2) {
- return self._isReferenced();
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"shouldBeAliased",{},globals.AssignmentNode)})},
- args: [],
- source: "shouldBeAliased\x0a\x09^ super shouldBeAliased or: [ self isReferenced ]",
- messageSends: ["or:", "shouldBeAliased", "isReferenced"],
- referencedClasses: []
- }),
- globals.AssignmentNode);
- smalltalk.addClass('BlockNode', globals.Node, ['parameters', 'scope'], 'Compiler-AST');
- globals.BlockNode.comment="I represent an block closure node.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "accept:",
- protocol: 'visiting',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(aVisitor)._visitBlockNode_(self);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},globals.BlockNode)})},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitBlockNode: self",
- messageSends: ["visitBlockNode:"],
- referencedClasses: []
- }),
- globals.BlockNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isBlockNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return true;
- },
- args: [],
- source: "isBlockNode\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- globals.BlockNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "nextChild",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return self;
- },
- args: [],
- source: "nextChild\x0a\x09\x22Answer the receiver as we want to avoid eager evaluation\x22\x0a\x09\x0a\x09^ self",
- messageSends: [],
- referencedClasses: []
- }),
- globals.BlockNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "nextNode:",
- protocol: 'accessing',
- fn: function (aNode){
- var self=this;
- return self;
- },
- args: ["aNode"],
- source: "nextNode: aNode\x0a\x09\x22Answer the receiver as we want to avoid eager evaluation\x22\x0a\x09\x0a\x09^ self",
- messageSends: [],
- referencedClasses: []
- }),
- globals.BlockNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "parameters",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- function $Array(){return globals.Array||(typeof Array=="undefined"?nil:Array)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@parameters"];
- if(($receiver = $2) == nil || $receiver == null){
- self["@parameters"]=_st($Array())._new();
- $1=self["@parameters"];
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"parameters",{},globals.BlockNode)})},
- args: [],
- source: "parameters\x0a\x09^ parameters ifNil: [ parameters := Array new ]",
- messageSends: ["ifNil:", "new"],
- referencedClasses: ["Array"]
- }),
- globals.BlockNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "parameters:",
- protocol: 'accessing',
- fn: function (aCollection){
- var self=this;
- self["@parameters"]=aCollection;
- return self},
- args: ["aCollection"],
- source: "parameters: aCollection\x0a\x09parameters := aCollection",
- messageSends: [],
- referencedClasses: []
- }),
- globals.BlockNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "scope",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@scope"];
- return $1;
- },
- args: [],
- source: "scope\x0a\x09^ scope",
- messageSends: [],
- referencedClasses: []
- }),
- globals.BlockNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "scope:",
- protocol: 'accessing',
- fn: function (aLexicalScope){
- var self=this;
- self["@scope"]=aLexicalScope;
- return self},
- args: ["aLexicalScope"],
- source: "scope: aLexicalScope\x0a\x09scope := aLexicalScope",
- messageSends: [],
- referencedClasses: []
- }),
- globals.BlockNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "subtreeNeedsAliasing",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self._shouldBeAliased())._or_((function(){
- return smalltalk.withContext(function($ctx2) {
- return self._shouldBeInlined();
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"subtreeNeedsAliasing",{},globals.BlockNode)})},
- args: [],
- source: "subtreeNeedsAliasing\x0a\x09^ self shouldBeAliased or: [ self shouldBeInlined ]",
- messageSends: ["or:", "shouldBeAliased", "shouldBeInlined"],
- referencedClasses: []
- }),
- globals.BlockNode);
- smalltalk.addClass('CascadeNode', globals.Node, ['receiver'], 'Compiler-AST');
- globals.CascadeNode.comment="I represent an cascade node.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "accept:",
- protocol: 'visiting',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(aVisitor)._visitCascadeNode_(self);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},globals.CascadeNode)})},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitCascadeNode: self",
- messageSends: ["visitCascadeNode:"],
- referencedClasses: []
- }),
- globals.CascadeNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isCascadeNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return true;
- },
- args: [],
- source: "isCascadeNode\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- globals.CascadeNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "receiver",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@receiver"];
- return $1;
- },
- args: [],
- source: "receiver\x0a\x09^ receiver",
- messageSends: [],
- referencedClasses: []
- }),
- globals.CascadeNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "receiver:",
- protocol: 'accessing',
- fn: function (aNode){
- var self=this;
- self["@receiver"]=aNode;
- return self},
- args: ["aNode"],
- source: "receiver: aNode\x0a\x09receiver := aNode",
- messageSends: [],
- referencedClasses: []
- }),
- globals.CascadeNode);
- smalltalk.addClass('DynamicArrayNode', globals.Node, [], 'Compiler-AST');
- globals.DynamicArrayNode.comment="I represent an dynamic array node.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "accept:",
- protocol: 'visiting',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(aVisitor)._visitDynamicArrayNode_(self);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},globals.DynamicArrayNode)})},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitDynamicArrayNode: self",
- messageSends: ["visitDynamicArrayNode:"],
- referencedClasses: []
- }),
- globals.DynamicArrayNode);
- smalltalk.addClass('DynamicDictionaryNode', globals.Node, [], 'Compiler-AST');
- globals.DynamicDictionaryNode.comment="I represent an dynamic dictionary node.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "accept:",
- protocol: 'visiting',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(aVisitor)._visitDynamicDictionaryNode_(self);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},globals.DynamicDictionaryNode)})},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitDynamicDictionaryNode: self",
- messageSends: ["visitDynamicDictionaryNode:"],
- referencedClasses: []
- }),
- globals.DynamicDictionaryNode);
- smalltalk.addClass('JSStatementNode', globals.Node, [], 'Compiler-AST');
- globals.JSStatementNode.comment="I represent an JavaScript statement node.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "accept:",
- protocol: 'visiting',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(aVisitor)._visitJSStatementNode_(self);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},globals.JSStatementNode)})},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitJSStatementNode: self",
- messageSends: ["visitJSStatementNode:"],
- referencedClasses: []
- }),
- globals.JSStatementNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isJSStatementNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return true;
- },
- args: [],
- source: "isJSStatementNode\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- globals.JSStatementNode);
- smalltalk.addClass('MethodNode', globals.Node, ['selector', 'arguments', 'source', 'scope', 'classReferences', 'sendIndexes', 'superSends'], 'Compiler-AST');
- globals.MethodNode.comment="I represent an method node.\x0a\x0aA method node must be the root and only method node of a valid AST.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "accept:",
- protocol: 'visiting',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(aVisitor)._visitMethodNode_(self);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},globals.MethodNode)})},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitMethodNode: self",
- messageSends: ["visitMethodNode:"],
- referencedClasses: []
- }),
- globals.MethodNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "arguments",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@arguments"];
- if(($receiver = $2) == nil || $receiver == null){
- $1=[];
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"arguments",{},globals.MethodNode)})},
- args: [],
- source: "arguments\x0a\x09^ arguments ifNil: [ #() ]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- globals.MethodNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "arguments:",
- protocol: 'accessing',
- fn: function (aCollection){
- var self=this;
- self["@arguments"]=aCollection;
- return self},
- args: ["aCollection"],
- source: "arguments: aCollection\x0a\x09arguments := aCollection",
- messageSends: [],
- referencedClasses: []
- }),
- globals.MethodNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "classReferences",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@classReferences"];
- return $1;
- },
- args: [],
- source: "classReferences\x0a\x09^ classReferences",
- messageSends: [],
- referencedClasses: []
- }),
- globals.MethodNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "classReferences:",
- protocol: 'accessing',
- fn: function (aCollection){
- var self=this;
- self["@classReferences"]=aCollection;
- return self},
- args: ["aCollection"],
- source: "classReferences: aCollection\x0a\x09classReferences := aCollection",
- messageSends: [],
- referencedClasses: []
- }),
- globals.MethodNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "extent",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $4,$3,$2,$1;
- $4=self._source();
- $ctx1.sendIdx["source"]=1;
- $3=_st($4)._lines();
- $ctx1.sendIdx["lines"]=1;
- $2=_st($3)._size();
- $ctx1.sendIdx["size"]=1;
- $1=_st($2).__at(_st(_st(_st(_st(self._source())._lines())._last())._size()).__plus((1)));
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"extent",{},globals.MethodNode)})},
- args: [],
- source: "extent\x0a\x09^ self source lines size @ (self source lines last size + 1)",
- messageSends: ["@", "size", "lines", "source", "+", "last"],
- referencedClasses: []
- }),
- globals.MethodNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "messageSends",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self._sendIndexes())._keys();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"messageSends",{},globals.MethodNode)})},
- args: [],
- source: "messageSends\x0a\x09^ self sendIndexes keys",
- messageSends: ["keys", "sendIndexes"],
- referencedClasses: []
- }),
- globals.MethodNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "method",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return self;
- },
- args: [],
- source: "method\x0a\x09^ self",
- messageSends: [],
- referencedClasses: []
- }),
- globals.MethodNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "scope",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@scope"];
- return $1;
- },
- args: [],
- source: "scope\x0a\x09^ scope",
- messageSends: [],
- referencedClasses: []
- }),
- globals.MethodNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "scope:",
- protocol: 'accessing',
- fn: function (aMethodScope){
- var self=this;
- self["@scope"]=aMethodScope;
- return self},
- args: ["aMethodScope"],
- source: "scope: aMethodScope\x0a\x09scope := aMethodScope",
- messageSends: [],
- referencedClasses: []
- }),
- globals.MethodNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "selector",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@selector"];
- return $1;
- },
- args: [],
- source: "selector\x0a\x09^ selector",
- messageSends: [],
- referencedClasses: []
- }),
- globals.MethodNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "selector:",
- protocol: 'accessing',
- fn: function (aString){
- var self=this;
- self["@selector"]=aString;
- return self},
- args: ["aString"],
- source: "selector: aString\x0a\x09selector := aString",
- messageSends: [],
- referencedClasses: []
- }),
- globals.MethodNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "sendIndexes",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@sendIndexes"];
- return $1;
- },
- args: [],
- source: "sendIndexes\x0a\x09^ sendIndexes",
- messageSends: [],
- referencedClasses: []
- }),
- globals.MethodNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "sendIndexes:",
- protocol: 'accessing',
- fn: function (aDictionary){
- var self=this;
- self["@sendIndexes"]=aDictionary;
- return self},
- args: ["aDictionary"],
- source: "sendIndexes: aDictionary\x0a\x09sendIndexes := aDictionary",
- messageSends: [],
- referencedClasses: []
- }),
- globals.MethodNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "source",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@source"];
- return $1;
- },
- args: [],
- source: "source\x0a\x09^ source",
- messageSends: [],
- referencedClasses: []
- }),
- globals.MethodNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "source:",
- protocol: 'accessing',
- fn: function (aString){
- var self=this;
- self["@source"]=aString;
- return self},
- args: ["aString"],
- source: "source: aString\x0a\x09source := aString",
- messageSends: [],
- referencedClasses: []
- }),
- globals.MethodNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "superSends",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@superSends"];
- return $1;
- },
- args: [],
- source: "superSends\x0a\x09^ superSends",
- messageSends: [],
- referencedClasses: []
- }),
- globals.MethodNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "superSends:",
- protocol: 'accessing',
- fn: function (aCollection){
- var self=this;
- self["@superSends"]=aCollection;
- return self},
- args: ["aCollection"],
- source: "superSends: aCollection\x0a\x09superSends := aCollection",
- messageSends: [],
- referencedClasses: []
- }),
- globals.MethodNode);
- smalltalk.addClass('ReturnNode', globals.Node, ['scope'], 'Compiler-AST');
- globals.ReturnNode.comment="I represent an return node. At the AST level, there is not difference between a local return or non-local return.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "accept:",
- protocol: 'visiting',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(aVisitor)._visitReturnNode_(self);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},globals.ReturnNode)})},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitReturnNode: self",
- messageSends: ["visitReturnNode:"],
- referencedClasses: []
- }),
- globals.ReturnNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isReturnNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return true;
- },
- args: [],
- source: "isReturnNode\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- globals.ReturnNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "nonLocalReturn",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(self._scope())._isMethodScope())._not();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"nonLocalReturn",{},globals.ReturnNode)})},
- args: [],
- source: "nonLocalReturn\x0a\x09^ self scope isMethodScope not",
- messageSends: ["not", "isMethodScope", "scope"],
- referencedClasses: []
- }),
- globals.ReturnNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "scope",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@scope"];
- return $1;
- },
- args: [],
- source: "scope\x0a\x09^ scope",
- messageSends: [],
- referencedClasses: []
- }),
- globals.ReturnNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "scope:",
- protocol: 'accessing',
- fn: function (aLexicalScope){
- var self=this;
- self["@scope"]=aLexicalScope;
- return self},
- args: ["aLexicalScope"],
- source: "scope: aLexicalScope\x0a\x09scope := aLexicalScope",
- messageSends: [],
- referencedClasses: []
- }),
- globals.ReturnNode);
- smalltalk.addClass('SendNode', globals.Node, ['selector', 'arguments', 'receiver', 'superSend', 'index'], 'Compiler-AST');
- globals.SendNode.comment="I represent an message send node.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "accept:",
- protocol: 'visiting',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(aVisitor)._visitSendNode_(self);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},globals.SendNode)})},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitSendNode: self",
- messageSends: ["visitSendNode:"],
- referencedClasses: []
- }),
- globals.SendNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "arguments",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@arguments"];
- if(($receiver = $2) == nil || $receiver == null){
- self["@arguments"]=[];
- $1=self["@arguments"];
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"arguments",{},globals.SendNode)})},
- args: [],
- source: "arguments\x0a\x09^ arguments ifNil: [ arguments := #() ]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- globals.SendNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "arguments:",
- protocol: 'accessing',
- fn: function (aCollection){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@arguments"]=aCollection;
- _st(aCollection)._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
- return _st(each)._parent_(self);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
- return self}, function($ctx1) {$ctx1.fill(self,"arguments:",{aCollection:aCollection},globals.SendNode)})},
- args: ["aCollection"],
- source: "arguments: aCollection\x0a\x09arguments := aCollection.\x0a\x09aCollection do: [ :each | each parent: self ]",
- messageSends: ["do:", "parent:"],
- referencedClasses: []
- }),
- globals.SendNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "cascadeNodeWithMessages:",
- protocol: 'accessing',
- fn: function (aCollection){
- var self=this;
- var first;
- function $SendNode(){return globals.SendNode||(typeof SendNode=="undefined"?nil:SendNode)}
- function $CascadeNode(){return globals.CascadeNode||(typeof CascadeNode=="undefined"?nil:CascadeNode)}
- function $Array(){return globals.Array||(typeof Array=="undefined"?nil:Array)}
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$4,$5,$3;
- $1=_st($SendNode())._new();
- $ctx1.sendIdx["new"]=1;
- _st($1)._selector_(self._selector());
- _st($1)._arguments_(self._arguments());
- $2=_st($1)._yourself();
- $ctx1.sendIdx["yourself"]=1;
- first=$2;
- $4=_st($CascadeNode())._new();
- _st($4)._receiver_(self._receiver());
- _st($4)._nodes_(_st(_st($Array())._with_(first)).__comma(aCollection));
- $5=_st($4)._yourself();
- $3=$5;
- return $3;
- }, function($ctx1) {$ctx1.fill(self,"cascadeNodeWithMessages:",{aCollection:aCollection,first:first},globals.SendNode)})},
- args: ["aCollection"],
- source: "cascadeNodeWithMessages: aCollection\x0a\x09| first |\x0a\x09first := SendNode new\x0a\x09\x09selector: self selector;\x0a\x09\x09arguments: self arguments;\x0a\x09\x09yourself.\x0a\x09^ CascadeNode new\x0a\x09\x09receiver: self receiver;\x0a\x09\x09nodes: (Array with: first), aCollection;\x0a\x09\x09yourself",
- messageSends: ["selector:", "new", "selector", "arguments:", "arguments", "yourself", "receiver:", "receiver", "nodes:", ",", "with:"],
- referencedClasses: ["SendNode", "CascadeNode", "Array"]
- }),
- globals.SendNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "index",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@index"];
- return $1;
- },
- args: [],
- source: "index\x0a\x09^ index",
- messageSends: [],
- referencedClasses: []
- }),
- globals.SendNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "index:",
- protocol: 'accessing',
- fn: function (anInteger){
- var self=this;
- self["@index"]=anInteger;
- return self},
- args: ["anInteger"],
- source: "index: anInteger\x0a\x09index := anInteger",
- messageSends: [],
- referencedClasses: []
- }),
- globals.SendNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isCascadeSendNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self._parent())._isCascadeNode();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"isCascadeSendNode",{},globals.SendNode)})},
- args: [],
- source: "isCascadeSendNode\x0a\x09^ self parent isCascadeNode",
- messageSends: ["isCascadeNode", "parent"],
- referencedClasses: []
- }),
- globals.SendNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isSendNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return true;
- },
- args: [],
- source: "isSendNode\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- globals.SendNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "nodes",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- function $Array(){return globals.Array||(typeof Array=="undefined"?nil:Array)}
- return smalltalk.withContext(function($ctx1) {
- var $1,$3,$2,$5,$6,$4;
- $1=self._receiver();
- $ctx1.sendIdx["receiver"]=1;
- if(($receiver = $1) == nil || $receiver == null){
- $3=self._arguments();
- $ctx1.sendIdx["arguments"]=1;
- $2=_st($3)._copy();
- return $2;
- } else {
- $1;
- };
- $5=_st($Array())._with_(self._receiver());
- _st($5)._addAll_(self._arguments());
- $6=_st($5)._yourself();
- $4=$6;
- return $4;
- }, function($ctx1) {$ctx1.fill(self,"nodes",{},globals.SendNode)})},
- args: [],
- source: "nodes\x0a\x09self receiver ifNil: [ ^ self arguments copy ].\x0a\x09\x0a\x09^ (Array with: self receiver)\x0a\x09\x09addAll: self arguments;\x0a\x09\x09yourself",
- messageSends: ["ifNil:", "receiver", "copy", "arguments", "addAll:", "with:", "yourself"],
- referencedClasses: ["Array"]
- }),
- globals.SendNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "receiver",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@receiver"];
- return $1;
- },
- args: [],
- source: "receiver\x0a\x09^ receiver",
- messageSends: [],
- referencedClasses: []
- }),
- globals.SendNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "receiver:",
- protocol: 'accessing',
- fn: function (aNode){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- self["@receiver"]=aNode;
- $1=_st(aNode)._isNode();
- if(smalltalk.assert($1)){
- _st(aNode)._parent_(self);
- };
- return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{aNode:aNode},globals.SendNode)})},
- args: ["aNode"],
- source: "receiver: aNode\x0a\x09receiver := aNode.\x0a\x09aNode isNode ifTrue: [\x0a\x09\x09aNode parent: self ]",
- messageSends: ["ifTrue:", "isNode", "parent:"],
- referencedClasses: []
- }),
- globals.SendNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "requiresSmalltalkContext",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return true;
- },
- args: [],
- source: "requiresSmalltalkContext\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- globals.SendNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "selector",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@selector"];
- return $1;
- },
- args: [],
- source: "selector\x0a\x09^ selector",
- messageSends: [],
- referencedClasses: []
- }),
- globals.SendNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "selector:",
- protocol: 'accessing',
- fn: function (aString){
- var self=this;
- self["@selector"]=aString;
- return self},
- args: ["aString"],
- source: "selector: aString\x0a\x09selector := aString",
- messageSends: [],
- referencedClasses: []
- }),
- globals.SendNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "shouldBeAliased",
- protocol: 'testing',
- fn: function (){
- var self=this;
- var sends;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- sends=_st(_st(_st(self._method())._sendIndexes())._at_(self._selector()))._size();
- $1=_st(globals.SendNode.superclass.fn.prototype._shouldBeAliased.apply(_st(self), []))._or_((function(){
- return smalltalk.withContext(function($ctx2) {
- return _st(_st(_st(sends).__gt((1)))._and_((function(){
- return smalltalk.withContext(function($ctx3) {
- return _st(self._index()).__lt(sends);
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})})))._and_((function(){
- return smalltalk.withContext(function($ctx3) {
- return self._isReferenced();
- }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
- $ctx2.sendIdx["and:"]=1;
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"shouldBeAliased",{sends:sends},globals.SendNode)})},
- args: [],
- source: "shouldBeAliased\x0a\x09\x22Because we keep track of send indexes, some send nodes need additional care for aliasing. \x0a\x09See IRJSVisitor >> visitIRSend:\x22\x0a\x09\x0a\x09| sends |\x0a\x09\x0a\x09sends := (self method sendIndexes at: self selector) size.\x0a\x09\x0a\x09^ super shouldBeAliased or: [\x0a\x09\x09(sends > 1 and: [ self index < sends ]) and: [ self isReferenced ] ]",
- messageSends: ["size", "at:", "sendIndexes", "method", "selector", "or:", "shouldBeAliased", "and:", ">", "<", "index", "isReferenced"],
- referencedClasses: []
- }),
- globals.SendNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "stopOnStepping",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return true;
- },
- args: [],
- source: "stopOnStepping\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- globals.SendNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "superSend",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@superSend"];
- if(($receiver = $2) == nil || $receiver == null){
- $1=false;
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"superSend",{},globals.SendNode)})},
- args: [],
- source: "superSend\x0a\x09^ superSend ifNil: [ false ]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- globals.SendNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "superSend:",
- protocol: 'accessing',
- fn: function (aBoolean){
- var self=this;
- self["@superSend"]=aBoolean;
- return self},
- args: ["aBoolean"],
- source: "superSend: aBoolean\x0a\x09superSend := aBoolean",
- messageSends: [],
- referencedClasses: []
- }),
- globals.SendNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "valueForReceiver:",
- protocol: 'accessing',
- fn: function (anObject){
- var self=this;
- function $SendNode(){return globals.SendNode||(typeof SendNode=="undefined"?nil:SendNode)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$5,$4,$6,$1;
- $2=_st($SendNode())._new();
- _st($2)._position_(self._position());
- _st($2)._source_(self._source());
- $3=$2;
- $5=self._receiver();
- $ctx1.sendIdx["receiver"]=1;
- if(($receiver = $5) == nil || $receiver == null){
- $4=anObject;
- } else {
- $4=_st(self._receiver())._valueForReceiver_(anObject);
- };
- _st($3)._receiver_($4);
- _st($2)._selector_(self._selector());
- _st($2)._arguments_(self._arguments());
- $6=_st($2)._yourself();
- $1=$6;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"valueForReceiver:",{anObject:anObject},globals.SendNode)})},
- args: ["anObject"],
- source: "valueForReceiver: anObject\x0a\x09^ SendNode new\x0a\x09\x09position: self position;\x0a\x09\x09source: self source;\x0a\x09\x09receiver: (self receiver\x0a\x09\x09ifNil: [ anObject ] \x0a\x09\x09ifNotNil: [ self receiver valueForReceiver: anObject ]);\x0a\x09\x09selector: self selector;\x0a\x09\x09arguments: self arguments;\x0a\x09\x09yourself",
- messageSends: ["position:", "new", "position", "source:", "source", "receiver:", "ifNil:ifNotNil:", "receiver", "valueForReceiver:", "selector:", "selector", "arguments:", "arguments", "yourself"],
- referencedClasses: ["SendNode"]
- }),
- globals.SendNode);
- smalltalk.addClass('SequenceNode', globals.Node, ['temps', 'scope'], 'Compiler-AST');
- 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).";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "accept:",
- protocol: 'visiting',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(aVisitor)._visitSequenceNode_(self);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},globals.SequenceNode)})},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitSequenceNode: self",
- messageSends: ["visitSequenceNode:"],
- referencedClasses: []
- }),
- globals.SequenceNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "asBlockSequenceNode",
- protocol: 'converting',
- fn: function (){
- var self=this;
- function $BlockSequenceNode(){return globals.BlockSequenceNode||(typeof BlockSequenceNode=="undefined"?nil:BlockSequenceNode)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=_st($BlockSequenceNode())._new();
- _st($2)._position_(self._position());
- _st($2)._source_(self._source());
- _st($2)._nodes_(self._nodes());
- _st($2)._temps_(self._temps());
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"asBlockSequenceNode",{},globals.SequenceNode)})},
- args: [],
- source: "asBlockSequenceNode\x0a\x09^ BlockSequenceNode new\x0a\x09\x09position: self position;\x0a\x09\x09source: self source;\x0a\x09\x09nodes: self nodes;\x0a\x09\x09temps: self temps;\x0a\x09\x09yourself",
- messageSends: ["position:", "new", "position", "source:", "source", "nodes:", "nodes", "temps:", "temps", "yourself"],
- referencedClasses: ["BlockSequenceNode"]
- }),
- globals.SequenceNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isSequenceNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return true;
- },
- args: [],
- source: "isSequenceNode\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- globals.SequenceNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "scope",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@scope"];
- return $1;
- },
- args: [],
- source: "scope\x0a\x09^ scope",
- messageSends: [],
- referencedClasses: []
- }),
- globals.SequenceNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "scope:",
- protocol: 'accessing',
- fn: function (aLexicalScope){
- var self=this;
- self["@scope"]=aLexicalScope;
- return self},
- args: ["aLexicalScope"],
- source: "scope: aLexicalScope\x0a\x09scope := aLexicalScope",
- messageSends: [],
- referencedClasses: []
- }),
- globals.SequenceNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "temps",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@temps"];
- if(($receiver = $2) == nil || $receiver == null){
- $1=[];
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"temps",{},globals.SequenceNode)})},
- args: [],
- source: "temps\x0a\x09^ temps ifNil: [ #() ]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- globals.SequenceNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "temps:",
- protocol: 'accessing',
- fn: function (aCollection){
- var self=this;
- self["@temps"]=aCollection;
- return self},
- args: ["aCollection"],
- source: "temps: aCollection\x0a\x09temps := aCollection",
- messageSends: [],
- referencedClasses: []
- }),
- globals.SequenceNode);
- smalltalk.addClass('BlockSequenceNode', globals.SequenceNode, [], 'Compiler-AST');
- globals.BlockSequenceNode.comment="I represent an special sequence node for block scopes.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "accept:",
- protocol: 'visiting',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(aVisitor)._visitBlockSequenceNode_(self);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},globals.BlockSequenceNode)})},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitBlockSequenceNode: self",
- messageSends: ["visitBlockSequenceNode:"],
- referencedClasses: []
- }),
- globals.BlockSequenceNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isBlockSequenceNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return true;
- },
- args: [],
- source: "isBlockSequenceNode\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- globals.BlockSequenceNode);
- smalltalk.addClass('ValueNode', globals.Node, ['value'], 'Compiler-AST');
- globals.ValueNode.comment="I represent a value node.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "accept:",
- protocol: 'visiting',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(aVisitor)._visitValueNode_(self);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},globals.ValueNode)})},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitValueNode: self",
- messageSends: ["visitValueNode:"],
- referencedClasses: []
- }),
- globals.ValueNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isImmutable",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self._value())._isImmutable();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},globals.ValueNode)})},
- args: [],
- source: "isImmutable\x0a\x09^ self value isImmutable",
- messageSends: ["isImmutable", "value"],
- referencedClasses: []
- }),
- globals.ValueNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isValueNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return true;
- },
- args: [],
- source: "isValueNode\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- globals.ValueNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "value",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@value"];
- return $1;
- },
- args: [],
- source: "value\x0a\x09^ value",
- messageSends: [],
- referencedClasses: []
- }),
- globals.ValueNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "value:",
- protocol: 'accessing',
- fn: function (anObject){
- var self=this;
- self["@value"]=anObject;
- return self},
- args: ["anObject"],
- source: "value: anObject\x0a\x09value := anObject",
- messageSends: [],
- referencedClasses: []
- }),
- globals.ValueNode);
- smalltalk.addClass('VariableNode', globals.ValueNode, ['assigned', 'binding'], 'Compiler-AST');
- globals.VariableNode.comment="I represent an variable node.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "accept:",
- protocol: 'visiting',
- fn: function (aVisitor){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(aVisitor)._visitVariableNode_(self);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"accept:",{aVisitor:aVisitor},globals.VariableNode)})},
- args: ["aVisitor"],
- source: "accept: aVisitor\x0a\x09^ aVisitor visitVariableNode: self",
- messageSends: ["visitVariableNode:"],
- referencedClasses: []
- }),
- globals.VariableNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "alias",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self._binding())._alias();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"alias",{},globals.VariableNode)})},
- args: [],
- source: "alias\x0a\x09^ self binding alias",
- messageSends: ["alias", "binding"],
- referencedClasses: []
- }),
- globals.VariableNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "assigned",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@assigned"];
- if(($receiver = $2) == nil || $receiver == null){
- $1=false;
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"assigned",{},globals.VariableNode)})},
- args: [],
- source: "assigned\x0a\x09^ assigned ifNil: [ false ]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- globals.VariableNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "assigned:",
- protocol: 'accessing',
- fn: function (aBoolean){
- var self=this;
- self["@assigned"]=aBoolean;
- return self},
- args: ["aBoolean"],
- source: "assigned: aBoolean\x0a\x09assigned := aBoolean",
- messageSends: [],
- referencedClasses: []
- }),
- globals.VariableNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "beAssigned",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self._binding())._validateAssignment();
- self["@assigned"]=true;
- return self}, function($ctx1) {$ctx1.fill(self,"beAssigned",{},globals.VariableNode)})},
- args: [],
- source: "beAssigned\x0a\x09self binding validateAssignment.\x0a\x09assigned := true",
- messageSends: ["validateAssignment", "binding"],
- referencedClasses: []
- }),
- globals.VariableNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "binding",
- protocol: 'accessing',
- fn: function (){
- var self=this;
- var $1;
- $1=self["@binding"];
- return $1;
- },
- args: [],
- source: "binding\x0a\x09^ binding",
- messageSends: [],
- referencedClasses: []
- }),
- globals.VariableNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "binding:",
- protocol: 'accessing',
- fn: function (aScopeVar){
- var self=this;
- self["@binding"]=aScopeVar;
- return self},
- args: ["aScopeVar"],
- source: "binding: aScopeVar\x0a\x09binding := aScopeVar",
- messageSends: [],
- referencedClasses: []
- }),
- globals.VariableNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isArgument",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self._binding())._isArgVar();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"isArgument",{},globals.VariableNode)})},
- args: [],
- source: "isArgument\x0a\x09^ self binding isArgVar",
- messageSends: ["isArgVar", "binding"],
- referencedClasses: []
- }),
- globals.VariableNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isImmutable",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self._binding())._isImmutable();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},globals.VariableNode)})},
- args: [],
- source: "isImmutable\x0a\x09^ self binding isImmutable",
- messageSends: ["isImmutable", "binding"],
- referencedClasses: []
- }),
- globals.VariableNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isVariableNode",
- protocol: 'testing',
- fn: function (){
- var self=this;
- return true;
- },
- args: [],
- source: "isVariableNode\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- globals.VariableNode);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isNode",
- protocol: '*Compiler-AST',
- fn: function (){
- var self=this;
- return false;
- },
- args: [],
- source: "isNode\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- globals.Object);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "ast",
- protocol: '*Compiler-AST',
- fn: function (){
- var self=this;
- function $Smalltalk(){return globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- $1=self._source();
- $ctx1.sendIdx["source"]=1;
- _st($1)._ifEmpty_((function(){
- return smalltalk.withContext(function($ctx2) {
- return self._error_("Method source is empty");
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
- $2=_st($Smalltalk())._parse_(self._source());
- return $2;
- }, function($ctx1) {$ctx1.fill(self,"ast",{},globals.CompiledMethod)})},
- args: [],
- source: "ast\x0a\x09self source ifEmpty: [ self error: 'Method source is empty' ].\x0a\x09\x0a\x09^ Smalltalk parse: self source",
- messageSends: ["ifEmpty:", "source", "error:", "parse:"],
- referencedClasses: ["Smalltalk"]
- }),
- globals.CompiledMethod);
- });
|