1
0

Compiler-Interpreter.js 83 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375
  1. define("amber_core/Compiler-Interpreter", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Methods", "amber_core/Kernel-Objects", "amber_core/Compiler-Core", "amber_core/Kernel-Exceptions", "amber_core/Compiler-AST"], function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Compiler-Interpreter');
  3. smalltalk.packages["Compiler-Interpreter"].transport = {"type":"amd","amdNamespace":"amber_core"};
  4. smalltalk.addClass('AIBlockClosure', smalltalk.BlockClosure, ['node', 'outerContext'], 'Compiler-Interpreter');
  5. smalltalk.AIBlockClosure.comment="I am a special `BlockClosure` subclass used by an interpreter to interpret a block node.\x0a\x0aWhile I am polymorphic with `BlockClosure`, some methods such as `#new` will raise interpretation errors. Unlike a `BlockClosure`, my instance are not JavaScript functions.\x0a\x0aEvaluating an instance will result in interpreting the `node` instance variable (instance of `BlockNode`).";
  6. smalltalk.addMethod(
  7. smalltalk.method({
  8. selector: "applyTo:arguments:",
  9. category: 'evaluating',
  10. fn: function (anObject,aCollection){
  11. var self=this;
  12. return smalltalk.withContext(function($ctx1) {
  13. self._interpreterError();
  14. return self}, function($ctx1) {$ctx1.fill(self,"applyTo:arguments:",{anObject:anObject,aCollection:aCollection},smalltalk.AIBlockClosure)})},
  15. args: ["anObject", "aCollection"],
  16. source: "applyTo: anObject arguments: aCollection\x0a\x09self interpreterError",
  17. messageSends: ["interpreterError"],
  18. referencedClasses: []
  19. }),
  20. smalltalk.AIBlockClosure);
  21. smalltalk.addMethod(
  22. smalltalk.method({
  23. selector: "compiledSource",
  24. category: 'accessing',
  25. fn: function (){
  26. var self=this;
  27. return smalltalk.withContext(function($ctx1) {
  28. return "[ AST Block closure ]";
  29. }, function($ctx1) {$ctx1.fill(self,"compiledSource",{},smalltalk.AIBlockClosure)})},
  30. args: [],
  31. source: "compiledSource\x0a\x09\x22Unlike blocks, the receiver doesn't represent a JS function\x22\x0a\x09\x0a\x09^ '[ AST Block closure ]'",
  32. messageSends: [],
  33. referencedClasses: []
  34. }),
  35. smalltalk.AIBlockClosure);
  36. smalltalk.addMethod(
  37. smalltalk.method({
  38. selector: "currySelf",
  39. category: 'converting',
  40. fn: function (){
  41. var self=this;
  42. return smalltalk.withContext(function($ctx1) {
  43. self._interpreterError();
  44. return self}, function($ctx1) {$ctx1.fill(self,"currySelf",{},smalltalk.AIBlockClosure)})},
  45. args: [],
  46. source: "currySelf\x0a\x09self interpreterError",
  47. messageSends: ["interpreterError"],
  48. referencedClasses: []
  49. }),
  50. smalltalk.AIBlockClosure);
  51. smalltalk.addMethod(
  52. smalltalk.method({
  53. selector: "initializeWithContext:node:",
  54. category: 'initialization',
  55. fn: function (aContext,aNode){
  56. var self=this;
  57. return smalltalk.withContext(function($ctx1) {
  58. self["@node"]=aNode;
  59. self["@outerContext"]=aContext;
  60. return self}, function($ctx1) {$ctx1.fill(self,"initializeWithContext:node:",{aContext:aContext,aNode:aNode},smalltalk.AIBlockClosure)})},
  61. args: ["aContext", "aNode"],
  62. source: "initializeWithContext: aContext node: aNode\x0a\x09node := aNode.\x0a\x09outerContext := aContext",
  63. messageSends: [],
  64. referencedClasses: []
  65. }),
  66. smalltalk.AIBlockClosure);
  67. smalltalk.addMethod(
  68. smalltalk.method({
  69. selector: "interpreterError",
  70. category: 'error handling',
  71. fn: function (){
  72. var self=this;
  73. function $ASTInterpreterError(){return smalltalk.ASTInterpreterError||(typeof ASTInterpreterError=="undefined"?nil:ASTInterpreterError)}
  74. return smalltalk.withContext(function($ctx1) {
  75. _st($ASTInterpreterError())._signal_("Method cannot be interpreted by the interpreter.");
  76. return self}, function($ctx1) {$ctx1.fill(self,"interpreterError",{},smalltalk.AIBlockClosure)})},
  77. args: [],
  78. source: "interpreterError\x0a\x09ASTInterpreterError signal: 'Method cannot be interpreted by the interpreter.'",
  79. messageSends: ["signal:"],
  80. referencedClasses: ["ASTInterpreterError"]
  81. }),
  82. smalltalk.AIBlockClosure);
  83. smalltalk.addMethod(
  84. smalltalk.method({
  85. selector: "numArgs",
  86. category: 'accessing',
  87. fn: function (){
  88. var self=this;
  89. return smalltalk.withContext(function($ctx1) {
  90. var $1;
  91. $1=_st(_st(self["@node"])._temps())._size();
  92. return $1;
  93. }, function($ctx1) {$ctx1.fill(self,"numArgs",{},smalltalk.AIBlockClosure)})},
  94. args: [],
  95. source: "numArgs\x0a\x09^ node temps size",
  96. messageSends: ["size", "temps"],
  97. referencedClasses: []
  98. }),
  99. smalltalk.AIBlockClosure);
  100. smalltalk.addMethod(
  101. smalltalk.method({
  102. selector: "value",
  103. category: 'evaluating',
  104. fn: function (){
  105. var self=this;
  106. return smalltalk.withContext(function($ctx1) {
  107. var $1;
  108. $1=self._valueWithPossibleArguments_([]);
  109. return $1;
  110. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.AIBlockClosure)})},
  111. args: [],
  112. source: "value\x0a\x09^ self valueWithPossibleArguments: #()",
  113. messageSends: ["valueWithPossibleArguments:"],
  114. referencedClasses: []
  115. }),
  116. smalltalk.AIBlockClosure);
  117. smalltalk.addMethod(
  118. smalltalk.method({
  119. selector: "value:",
  120. category: 'evaluating',
  121. fn: function (anArgument){
  122. var self=this;
  123. return smalltalk.withContext(function($ctx1) {
  124. var $1;
  125. $1=self._valueWithPossibleArguments_([anArgument]);
  126. return $1;
  127. }, function($ctx1) {$ctx1.fill(self,"value:",{anArgument:anArgument},smalltalk.AIBlockClosure)})},
  128. args: ["anArgument"],
  129. source: "value: anArgument\x0a\x09^ self valueWithPossibleArguments: {anArgument}",
  130. messageSends: ["valueWithPossibleArguments:"],
  131. referencedClasses: []
  132. }),
  133. smalltalk.AIBlockClosure);
  134. smalltalk.addMethod(
  135. smalltalk.method({
  136. selector: "value:value:",
  137. category: 'evaluating',
  138. fn: function (firstArgument,secondArgument){
  139. var self=this;
  140. return smalltalk.withContext(function($ctx1) {
  141. var $1;
  142. $1=self._valueWithPossibleArguments_([firstArgument,secondArgument]);
  143. return $1;
  144. }, function($ctx1) {$ctx1.fill(self,"value:value:",{firstArgument:firstArgument,secondArgument:secondArgument},smalltalk.AIBlockClosure)})},
  145. args: ["firstArgument", "secondArgument"],
  146. source: "value: firstArgument value: secondArgument\x0a\x09^ self valueWithPossibleArguments: {firstArgument . secondArgument}",
  147. messageSends: ["valueWithPossibleArguments:"],
  148. referencedClasses: []
  149. }),
  150. smalltalk.AIBlockClosure);
  151. smalltalk.addMethod(
  152. smalltalk.method({
  153. selector: "value:value:value:",
  154. category: 'evaluating',
  155. fn: function (firstArgument,secondArgument,thirdArgument){
  156. var self=this;
  157. return smalltalk.withContext(function($ctx1) {
  158. var $1;
  159. $1=self._valueWithPossibleArguments_([firstArgument,secondArgument,thirdArgument]);
  160. return $1;
  161. }, function($ctx1) {$ctx1.fill(self,"value:value:value:",{firstArgument:firstArgument,secondArgument:secondArgument,thirdArgument:thirdArgument},smalltalk.AIBlockClosure)})},
  162. args: ["firstArgument", "secondArgument", "thirdArgument"],
  163. source: "value: firstArgument value: secondArgument value: thirdArgument\x0a\x09^ self valueWithPossibleArguments: {firstArgument . secondArgument . thirdArgument}",
  164. messageSends: ["valueWithPossibleArguments:"],
  165. referencedClasses: []
  166. }),
  167. smalltalk.AIBlockClosure);
  168. smalltalk.addMethod(
  169. smalltalk.method({
  170. selector: "valueWithPossibleArguments:",
  171. category: 'evaluating',
  172. fn: function (aCollection){
  173. var self=this;
  174. var context,sequenceNode;
  175. return smalltalk.withContext(function($ctx1) {
  176. var $1,$2,$3,$4,$5,$7,$6;
  177. context=_st(self["@outerContext"])._newBlockContext();
  178. $1=_st(_st(_st(self["@node"])._nodes())._first())._copy();
  179. _st($1)._parent_(nil);
  180. $2=_st($1)._yourself();
  181. sequenceNode=$2;
  182. _st(_st(self["@node"])._parameters())._withIndexDo_((function(each,index){
  183. return smalltalk.withContext(function($ctx2) {
  184. return _st(context)._localAt_put_(each,_st(aCollection)._at_ifAbsent_(index,(function(){
  185. return smalltalk.withContext(function($ctx3) {
  186. return nil;
  187. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})})));
  188. }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1,1)})}));
  189. $3=_st(context)._interpreter();
  190. $ctx1.sendIdx["interpreter"]=1;
  191. _st($3)._node_(_st(sequenceNode)._nextChild());
  192. $4=_st($3)._proceed();
  193. $5=_st(self["@outerContext"])._interpreter();
  194. $ctx1.sendIdx["interpreter"]=2;
  195. _st($5)._setNonLocalReturnFromContext_(context);
  196. $7=_st(context)._interpreter();
  197. $6=_st($7)._pop();
  198. return $6;
  199. }, function($ctx1) {$ctx1.fill(self,"valueWithPossibleArguments:",{aCollection:aCollection,context:context,sequenceNode:sequenceNode},smalltalk.AIBlockClosure)})},
  200. args: ["aCollection"],
  201. source: "valueWithPossibleArguments: aCollection\x0a\x09| context sequenceNode |\x0a\x09context := outerContext newBlockContext.\x0a\x0a\x09\x22Interpret a copy of the sequence node to avoid creating a new AIBlockClosure\x22\x0a\x09sequenceNode := node nodes first copy\x0a\x09\x09parent: nil;\x0a\x09\x09yourself.\x0a\x0a\x09\x22Populate the arguments into the context locals\x22\x09\x0a\x09node parameters withIndexDo: [ :each :index |\x0a\x09\x09context localAt: each put: (aCollection at: index ifAbsent: [ nil ]) ].\x0a\x0a\x09\x22Interpret the first node of the BlockSequenceNode\x22\x0a\x09context interpreter\x0a\x09\x09node: sequenceNode nextChild;\x0a\x09\x09proceed.\x0a\x09\x09\x0a\x09outerContext interpreter\x0a\x09\x09setNonLocalReturnFromContext: context.\x0a\x09\x09\x0a\x09^ context interpreter pop",
  202. messageSends: ["newBlockContext", "parent:", "copy", "first", "nodes", "yourself", "withIndexDo:", "parameters", "localAt:put:", "at:ifAbsent:", "node:", "interpreter", "nextChild", "proceed", "setNonLocalReturnFromContext:", "pop"],
  203. referencedClasses: []
  204. }),
  205. smalltalk.AIBlockClosure);
  206. smalltalk.addMethod(
  207. smalltalk.method({
  208. selector: "forContext:node:",
  209. category: 'instance creation',
  210. fn: function (aContext,aNode){
  211. var self=this;
  212. return smalltalk.withContext(function($ctx1) {
  213. var $2,$3,$1;
  214. $2=self._new();
  215. _st($2)._initializeWithContext_node_(aContext,aNode);
  216. $3=_st($2)._yourself();
  217. $1=$3;
  218. return $1;
  219. }, function($ctx1) {$ctx1.fill(self,"forContext:node:",{aContext:aContext,aNode:aNode},smalltalk.AIBlockClosure.klass)})},
  220. args: ["aContext", "aNode"],
  221. source: "forContext: aContext node: aNode\x0a\x09^ self new\x0a\x09\x09initializeWithContext: aContext node: aNode;\x0a\x09\x09yourself",
  222. messageSends: ["initializeWithContext:node:", "new", "yourself"],
  223. referencedClasses: []
  224. }),
  225. smalltalk.AIBlockClosure.klass);
  226. smalltalk.addClass('AIContext', smalltalk.MethodContext, ['outerContext', 'innerContext', 'pc', 'locals', 'selector', 'index', 'sendIndexes', 'ast', 'interpreter'], 'Compiler-Interpreter');
  227. smalltalk.AIContext.comment="I am like a `MethodContext`, used by the `ASTInterpreter`.\x0aUnlike a `MethodContext`, my instances are not read-only.\x0a\x0aWhen debugging, my instances are created by copying the current `MethodContext` (thisContext)";
  228. smalltalk.addMethod(
  229. smalltalk.method({
  230. selector: "arguments",
  231. category: 'interpreting',
  232. fn: function (){
  233. var self=this;
  234. return smalltalk.withContext(function($ctx1) {
  235. var $1;
  236. $1=_st(_st(self._ast())._arguments())._collect_((function(each){
  237. return smalltalk.withContext(function($ctx2) {
  238. return self._localAt_(each);
  239. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  240. return $1;
  241. }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.AIContext)})},
  242. args: [],
  243. source: "arguments\x0a\x09^ self ast arguments collect: [ :each |\x0a\x09\x09self localAt: each ]",
  244. messageSends: ["collect:", "arguments", "ast", "localAt:"],
  245. referencedClasses: []
  246. }),
  247. smalltalk.AIContext);
  248. smalltalk.addMethod(
  249. smalltalk.method({
  250. selector: "ast",
  251. category: 'interpreting',
  252. fn: function (){
  253. var self=this;
  254. return smalltalk.withContext(function($ctx1) {
  255. var $1,$2;
  256. if(smalltalk.assert(self._isBlockContext())){
  257. if(($receiver = self._outerContext()) == nil || $receiver == null){
  258. $1=self._outerContext();
  259. } else {
  260. var context;
  261. context=$receiver;
  262. $1=_st(context)._ast();
  263. };
  264. return $1;
  265. };
  266. if(($receiver = self["@ast"]) == nil || $receiver == null){
  267. self._initializeAST();
  268. } else {
  269. self["@ast"];
  270. };
  271. $2=self["@ast"];
  272. return $2;
  273. }, function($ctx1) {$ctx1.fill(self,"ast",{},smalltalk.AIContext)})},
  274. args: [],
  275. source: "ast\x0a\x09self isBlockContext ifTrue: [ \x0a\x09\x09^ self outerContext ifNotNil: [ :context | context ast ] ].\x0a\x0a\x09ast ifNil: [ self initializeAST ].\x0a\x09^ ast",
  276. messageSends: ["ifTrue:", "isBlockContext", "ifNotNil:", "outerContext", "ast", "ifNil:", "initializeAST"],
  277. referencedClasses: []
  278. }),
  279. smalltalk.AIContext);
  280. smalltalk.addMethod(
  281. smalltalk.method({
  282. selector: "index",
  283. category: 'accessing',
  284. fn: function (){
  285. var self=this;
  286. return smalltalk.withContext(function($ctx1) {
  287. var $1;
  288. if(($receiver = self["@index"]) == nil || $receiver == null){
  289. $1=(0);
  290. } else {
  291. $1=self["@index"];
  292. };
  293. return $1;
  294. }, function($ctx1) {$ctx1.fill(self,"index",{},smalltalk.AIContext)})},
  295. args: [],
  296. source: "index\x0a\x09^ index ifNil: [ 0 ]",
  297. messageSends: ["ifNil:"],
  298. referencedClasses: []
  299. }),
  300. smalltalk.AIContext);
  301. smalltalk.addMethod(
  302. smalltalk.method({
  303. selector: "index:",
  304. category: 'accessing',
  305. fn: function (anInteger){
  306. var self=this;
  307. return smalltalk.withContext(function($ctx1) {
  308. self["@index"]=anInteger;
  309. return self}, function($ctx1) {$ctx1.fill(self,"index:",{anInteger:anInteger},smalltalk.AIContext)})},
  310. args: ["anInteger"],
  311. source: "index: anInteger\x0a\x09index := anInteger",
  312. messageSends: [],
  313. referencedClasses: []
  314. }),
  315. smalltalk.AIContext);
  316. smalltalk.addMethod(
  317. smalltalk.method({
  318. selector: "initializeAST",
  319. category: 'initialization',
  320. fn: function (){
  321. var self=this;
  322. function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
  323. return smalltalk.withContext(function($ctx1) {
  324. var $1,$4,$3,$2;
  325. $1=self._method();
  326. $ctx1.sendIdx["method"]=1;
  327. self["@ast"]=_st($1)._ast();
  328. $4=self._method();
  329. $3=_st($4)._methodClass();
  330. $2=_st($SemanticAnalyzer())._on_($3);
  331. _st($2)._visit_(self["@ast"]);
  332. return self}, function($ctx1) {$ctx1.fill(self,"initializeAST",{},smalltalk.AIContext)})},
  333. args: [],
  334. source: "initializeAST\x0a\x09ast := self method ast.\x0a\x09(SemanticAnalyzer on: self method methodClass)\x0a\x09\x09visit: ast",
  335. messageSends: ["ast", "method", "visit:", "on:", "methodClass"],
  336. referencedClasses: ["SemanticAnalyzer"]
  337. }),
  338. smalltalk.AIContext);
  339. smalltalk.addMethod(
  340. smalltalk.method({
  341. selector: "initializeFromMethodContext:",
  342. category: 'initialization',
  343. fn: function (aMethodContext){
  344. var self=this;
  345. return smalltalk.withContext(function($ctx1) {
  346. var $1,$2,$4,$5,$3,$6,$7;
  347. self._index_(_st(aMethodContext)._index());
  348. self._sendIndexes_(_st(aMethodContext)._sendIndexes());
  349. self._receiver_(_st(aMethodContext)._receiver());
  350. $1=self._selector_(_st(aMethodContext)._selector());
  351. $2=_st(aMethodContext)._outerContext();
  352. $ctx1.sendIdx["outerContext"]=1;
  353. if(($receiver = $2) == nil || $receiver == null){
  354. $2;
  355. } else {
  356. var outer;
  357. outer=$receiver;
  358. if(($receiver = _st(outer)._methodContext()) == nil || $receiver == null){
  359. _st(outer)._methodContext();
  360. } else {
  361. $4=self._class();
  362. $5=_st(aMethodContext)._outerContext();
  363. $3=_st($4)._fromMethodContext_($5);
  364. self._outerContext_($3);
  365. };
  366. $6=_st(aMethodContext)._locals();
  367. $ctx1.sendIdx["locals"]=1;
  368. _st($6)._keysAndValuesDo_((function(key,value){
  369. return smalltalk.withContext(function($ctx2) {
  370. $7=self._locals();
  371. return _st($7)._at_put_(key,value);
  372. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1,3)})}));
  373. };
  374. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromMethodContext:",{aMethodContext:aMethodContext},smalltalk.AIContext)})},
  375. args: ["aMethodContext"],
  376. source: "initializeFromMethodContext: aMethodContext\x0a\x0a\x09self\x0a\x09\x09index: aMethodContext index;\x0a\x09\x09sendIndexes: aMethodContext sendIndexes;\x0a\x09\x09receiver: aMethodContext receiver;\x0a\x09\x09selector: aMethodContext selector.\x0a\x09\x09\x0a\x09aMethodContext outerContext ifNotNil: [ :outer |\x0a\x09\x09\x22If the method context is nil, the block was defined in JS, so ignore it\x22\x0a\x09\x09outer methodContext ifNotNil: [\x0a\x09\x09\x09self outerContext: (self class fromMethodContext: aMethodContext outerContext) ].\x0a\x09\x09\x09aMethodContext locals keysAndValuesDo: [ :key :value |\x0a\x09\x09\x09\x09self locals at: key put: value ] ]",
  377. messageSends: ["index:", "index", "sendIndexes:", "sendIndexes", "receiver:", "receiver", "selector:", "selector", "ifNotNil:", "outerContext", "methodContext", "outerContext:", "fromMethodContext:", "class", "keysAndValuesDo:", "locals", "at:put:"],
  378. referencedClasses: []
  379. }),
  380. smalltalk.AIContext);
  381. smalltalk.addMethod(
  382. smalltalk.method({
  383. selector: "initializeInterpreter",
  384. category: 'initialization',
  385. fn: function (){
  386. var self=this;
  387. function $ASTInterpreter(){return smalltalk.ASTInterpreter||(typeof ASTInterpreter=="undefined"?nil:ASTInterpreter)}
  388. return smalltalk.withContext(function($ctx1) {
  389. var $1,$2,$5,$4,$7,$6,$3;
  390. $1=_st($ASTInterpreter())._new();
  391. _st($1)._context_(self);
  392. $2=_st($1)._yourself();
  393. self["@interpreter"]=$2;
  394. $5=self._innerContext();
  395. $ctx1.sendIdx["innerContext"]=1;
  396. $4=_st($5)._notNil();
  397. $3=_st($4)._and_((function(){
  398. return smalltalk.withContext(function($ctx2) {
  399. $7=self._innerContext();
  400. $6=_st($7)._isBlockContext();
  401. return _st($6)._not();
  402. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  403. if(smalltalk.assert($3)){
  404. self._setupInterpreter_(self["@interpreter"]);
  405. };
  406. return self}, function($ctx1) {$ctx1.fill(self,"initializeInterpreter",{},smalltalk.AIContext)})},
  407. args: [],
  408. source: "initializeInterpreter\x0a\x09interpreter := ASTInterpreter new\x0a\x09\x09context: self;\x0a\x09\x09yourself.\x0a\x09\x0a\x09(self innerContext notNil and: [ \x0a\x09\x09self innerContext isBlockContext not ]) ifTrue: [\x0a\x09\x09\x09self setupInterpreter: interpreter ]",
  409. messageSends: ["context:", "new", "yourself", "ifTrue:", "and:", "notNil", "innerContext", "not", "isBlockContext", "setupInterpreter:"],
  410. referencedClasses: ["ASTInterpreter"]
  411. }),
  412. smalltalk.AIContext);
  413. smalltalk.addMethod(
  414. smalltalk.method({
  415. selector: "initializeLocals",
  416. category: 'initialization',
  417. fn: function (){
  418. var self=this;
  419. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  420. return smalltalk.withContext(function($ctx1) {
  421. self["@locals"]=_st($Dictionary())._new();
  422. _st(self["@locals"])._at_put_("thisContext",self);
  423. return self}, function($ctx1) {$ctx1.fill(self,"initializeLocals",{},smalltalk.AIContext)})},
  424. args: [],
  425. source: "initializeLocals\x0a\x09locals := Dictionary new.\x0a\x09locals at: 'thisContext' put: self.",
  426. messageSends: ["new", "at:put:"],
  427. referencedClasses: ["Dictionary"]
  428. }),
  429. smalltalk.AIContext);
  430. smalltalk.addMethod(
  431. smalltalk.method({
  432. selector: "innerContext",
  433. category: 'accessing',
  434. fn: function (){
  435. var self=this;
  436. return smalltalk.withContext(function($ctx1) {
  437. var $1;
  438. $1=self["@innerContext"];
  439. return $1;
  440. }, function($ctx1) {$ctx1.fill(self,"innerContext",{},smalltalk.AIContext)})},
  441. args: [],
  442. source: "innerContext\x0a\x09^ innerContext",
  443. messageSends: [],
  444. referencedClasses: []
  445. }),
  446. smalltalk.AIContext);
  447. smalltalk.addMethod(
  448. smalltalk.method({
  449. selector: "innerContext:",
  450. category: 'accessing',
  451. fn: function (anAIContext){
  452. var self=this;
  453. return smalltalk.withContext(function($ctx1) {
  454. self["@innerContext"]=anAIContext;
  455. return self}, function($ctx1) {$ctx1.fill(self,"innerContext:",{anAIContext:anAIContext},smalltalk.AIContext)})},
  456. args: ["anAIContext"],
  457. source: "innerContext: anAIContext\x0a\x09innerContext := anAIContext",
  458. messageSends: [],
  459. referencedClasses: []
  460. }),
  461. smalltalk.AIContext);
  462. smalltalk.addMethod(
  463. smalltalk.method({
  464. selector: "interpreter",
  465. category: 'interpreting',
  466. fn: function (){
  467. var self=this;
  468. return smalltalk.withContext(function($ctx1) {
  469. var $1;
  470. if(($receiver = self["@interpreter"]) == nil || $receiver == null){
  471. self._initializeInterpreter();
  472. } else {
  473. self["@interpreter"];
  474. };
  475. $1=self["@interpreter"];
  476. return $1;
  477. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.AIContext)})},
  478. args: [],
  479. source: "interpreter\x0a\x09interpreter ifNil: [ self initializeInterpreter ].\x0a\x09^ interpreter",
  480. messageSends: ["ifNil:", "initializeInterpreter"],
  481. referencedClasses: []
  482. }),
  483. smalltalk.AIContext);
  484. smalltalk.addMethod(
  485. smalltalk.method({
  486. selector: "interpreter:",
  487. category: 'interpreting',
  488. fn: function (anInterpreter){
  489. var self=this;
  490. return smalltalk.withContext(function($ctx1) {
  491. self["@interpreter"]=anInterpreter;
  492. return self}, function($ctx1) {$ctx1.fill(self,"interpreter:",{anInterpreter:anInterpreter},smalltalk.AIContext)})},
  493. args: ["anInterpreter"],
  494. source: "interpreter: anInterpreter\x0a\x09interpreter := anInterpreter",
  495. messageSends: [],
  496. referencedClasses: []
  497. }),
  498. smalltalk.AIContext);
  499. smalltalk.addMethod(
  500. smalltalk.method({
  501. selector: "localAt:",
  502. category: 'accessing',
  503. fn: function (aString){
  504. var self=this;
  505. return smalltalk.withContext(function($ctx1) {
  506. var $1;
  507. $1=_st(self._locals())._at_ifAbsent_(aString,(function(){
  508. return smalltalk.withContext(function($ctx2) {
  509. if(($receiver = self._outerContext()) == nil || $receiver == null){
  510. return self._outerContext();
  511. } else {
  512. var context;
  513. context=$receiver;
  514. return _st(context)._localAt_(aString);
  515. };
  516. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  517. return $1;
  518. }, function($ctx1) {$ctx1.fill(self,"localAt:",{aString:aString},smalltalk.AIContext)})},
  519. args: ["aString"],
  520. source: "localAt: aString\x0a\x09\x22Lookup the local value up to the method context\x22\x0a\x0a\x09^ self locals at: aString ifAbsent: [ \x0a\x09\x09self outerContext ifNotNil: [ :context | \x0a\x09\x09\x09context localAt: aString ] ]",
  521. messageSends: ["at:ifAbsent:", "locals", "ifNotNil:", "outerContext", "localAt:"],
  522. referencedClasses: []
  523. }),
  524. smalltalk.AIContext);
  525. smalltalk.addMethod(
  526. smalltalk.method({
  527. selector: "localAt:ifAbsent:",
  528. category: 'accessing',
  529. fn: function (aString,aBlock){
  530. var self=this;
  531. return smalltalk.withContext(function($ctx1) {
  532. var $1;
  533. $1=_st(self._locals())._at_ifAbsent_(aString,(function(){
  534. return smalltalk.withContext(function($ctx2) {
  535. if(($receiver = self._outerContext()) == nil || $receiver == null){
  536. return _st(aBlock)._value();
  537. } else {
  538. var context;
  539. context=$receiver;
  540. return _st(context)._localAt_ifAbsent_(aString,aBlock);
  541. };
  542. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  543. return $1;
  544. }, function($ctx1) {$ctx1.fill(self,"localAt:ifAbsent:",{aString:aString,aBlock:aBlock},smalltalk.AIContext)})},
  545. args: ["aString", "aBlock"],
  546. source: "localAt: aString ifAbsent: aBlock\x0a\x09\x22Lookup the local value up to the method context\x22\x0a\x0a\x09^ self locals at: aString ifAbsent: [ \x0a\x09\x09self outerContext \x0a\x09\x09\x09ifNotNil: [ :context | context localAt: aString ifAbsent: aBlock ]\x0a\x09\x09\x09ifNil: [aBlock value] ]",
  547. messageSends: ["at:ifAbsent:", "locals", "ifNotNil:ifNil:", "outerContext", "localAt:ifAbsent:", "value"],
  548. referencedClasses: []
  549. }),
  550. smalltalk.AIContext);
  551. smalltalk.addMethod(
  552. smalltalk.method({
  553. selector: "localAt:put:",
  554. category: 'accessing',
  555. fn: function (aString,anObject){
  556. var self=this;
  557. return smalltalk.withContext(function($ctx1) {
  558. _st(self._locals())._at_put_(aString,anObject);
  559. return self}, function($ctx1) {$ctx1.fill(self,"localAt:put:",{aString:aString,anObject:anObject},smalltalk.AIContext)})},
  560. args: ["aString", "anObject"],
  561. source: "localAt: aString put: anObject\x0a\x09self locals at: aString put: anObject",
  562. messageSends: ["at:put:", "locals"],
  563. referencedClasses: []
  564. }),
  565. smalltalk.AIContext);
  566. smalltalk.addMethod(
  567. smalltalk.method({
  568. selector: "locals",
  569. category: 'accessing',
  570. fn: function (){
  571. var self=this;
  572. return smalltalk.withContext(function($ctx1) {
  573. var $1;
  574. if(($receiver = self["@locals"]) == nil || $receiver == null){
  575. self._initializeLocals();
  576. } else {
  577. self["@locals"];
  578. };
  579. $1=self["@locals"];
  580. return $1;
  581. }, function($ctx1) {$ctx1.fill(self,"locals",{},smalltalk.AIContext)})},
  582. args: [],
  583. source: "locals\x0a\x09locals ifNil: [ self initializeLocals ].\x0a\x09\x0a\x09^ locals",
  584. messageSends: ["ifNil:", "initializeLocals"],
  585. referencedClasses: []
  586. }),
  587. smalltalk.AIContext);
  588. smalltalk.addMethod(
  589. smalltalk.method({
  590. selector: "method",
  591. category: 'accessing',
  592. fn: function (){
  593. var self=this;
  594. return smalltalk.withContext(function($ctx1) {
  595. var $2,$5,$4,$3,$7,$6,$1;
  596. $2=self._methodContext();
  597. $ctx1.sendIdx["methodContext"]=1;
  598. if(($receiver = $2) == nil || $receiver == null){
  599. $1=$2;
  600. } else {
  601. $5=self._methodContext();
  602. $ctx1.sendIdx["methodContext"]=2;
  603. $4=_st($5)._receiver();
  604. $3=_st($4)._class();
  605. $7=self._methodContext();
  606. $6=_st($7)._selector();
  607. $1=_st($3)._lookupSelector_($6);
  608. };
  609. return $1;
  610. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.AIContext)})},
  611. args: [],
  612. source: "method\x0a\x09^ self methodContext ifNotNil: [\x0a\x09\x09self methodContext receiver class lookupSelector: self methodContext selector ]",
  613. messageSends: ["ifNotNil:", "methodContext", "lookupSelector:", "class", "receiver", "selector"],
  614. referencedClasses: []
  615. }),
  616. smalltalk.AIContext);
  617. smalltalk.addMethod(
  618. smalltalk.method({
  619. selector: "newBlockContext",
  620. category: 'factory',
  621. fn: function (){
  622. var self=this;
  623. return smalltalk.withContext(function($ctx1) {
  624. var $2,$3,$1;
  625. $2=_st(self._class())._new();
  626. _st($2)._outerContext_(self);
  627. $3=_st($2)._yourself();
  628. $1=$3;
  629. return $1;
  630. }, function($ctx1) {$ctx1.fill(self,"newBlockContext",{},smalltalk.AIContext)})},
  631. args: [],
  632. source: "newBlockContext\x0a\x09^ self class new\x0a\x09\x09outerContext: self;\x0a\x09\x09yourself",
  633. messageSends: ["outerContext:", "new", "class", "yourself"],
  634. referencedClasses: []
  635. }),
  636. smalltalk.AIContext);
  637. smalltalk.addMethod(
  638. smalltalk.method({
  639. selector: "outerContext",
  640. category: 'accessing',
  641. fn: function (){
  642. var self=this;
  643. return smalltalk.withContext(function($ctx1) {
  644. var $1;
  645. $1=self["@outerContext"];
  646. return $1;
  647. }, function($ctx1) {$ctx1.fill(self,"outerContext",{},smalltalk.AIContext)})},
  648. args: [],
  649. source: "outerContext\x0a\x09^ outerContext",
  650. messageSends: [],
  651. referencedClasses: []
  652. }),
  653. smalltalk.AIContext);
  654. smalltalk.addMethod(
  655. smalltalk.method({
  656. selector: "outerContext:",
  657. category: 'accessing',
  658. fn: function (anAIContext){
  659. var self=this;
  660. return smalltalk.withContext(function($ctx1) {
  661. self["@outerContext"]=anAIContext;
  662. _st(self["@outerContext"])._innerContext_(self);
  663. return self}, function($ctx1) {$ctx1.fill(self,"outerContext:",{anAIContext:anAIContext},smalltalk.AIContext)})},
  664. args: ["anAIContext"],
  665. source: "outerContext: anAIContext\x0a\x09outerContext := anAIContext.\x0a\x09outerContext innerContext: self",
  666. messageSends: ["innerContext:"],
  667. referencedClasses: []
  668. }),
  669. smalltalk.AIContext);
  670. smalltalk.addMethod(
  671. smalltalk.method({
  672. selector: "receiver",
  673. category: 'interpreting',
  674. fn: function (){
  675. var self=this;
  676. return smalltalk.withContext(function($ctx1) {
  677. var $1;
  678. $1=self._localAt_("self");
  679. return $1;
  680. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.AIContext)})},
  681. args: [],
  682. source: "receiver\x0a\x09^ self localAt: 'self'",
  683. messageSends: ["localAt:"],
  684. referencedClasses: []
  685. }),
  686. smalltalk.AIContext);
  687. smalltalk.addMethod(
  688. smalltalk.method({
  689. selector: "receiver:",
  690. category: 'interpreting',
  691. fn: function (anObject){
  692. var self=this;
  693. return smalltalk.withContext(function($ctx1) {
  694. self._localAt_put_("self",anObject);
  695. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.AIContext)})},
  696. args: ["anObject"],
  697. source: "receiver: anObject\x0a\x09self localAt: 'self' put: anObject",
  698. messageSends: ["localAt:put:"],
  699. referencedClasses: []
  700. }),
  701. smalltalk.AIContext);
  702. smalltalk.addMethod(
  703. smalltalk.method({
  704. selector: "selector",
  705. category: 'accessing',
  706. fn: function (){
  707. var self=this;
  708. return smalltalk.withContext(function($ctx1) {
  709. var $1;
  710. $1=self["@selector"];
  711. return $1;
  712. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.AIContext)})},
  713. args: [],
  714. source: "selector\x0a\x09^ selector",
  715. messageSends: [],
  716. referencedClasses: []
  717. }),
  718. smalltalk.AIContext);
  719. smalltalk.addMethod(
  720. smalltalk.method({
  721. selector: "selector:",
  722. category: 'accessing',
  723. fn: function (aString){
  724. var self=this;
  725. return smalltalk.withContext(function($ctx1) {
  726. self["@selector"]=aString;
  727. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.AIContext)})},
  728. args: ["aString"],
  729. source: "selector: aString\x0a\x09selector := aString",
  730. messageSends: [],
  731. referencedClasses: []
  732. }),
  733. smalltalk.AIContext);
  734. smalltalk.addMethod(
  735. smalltalk.method({
  736. selector: "sendIndexAt:",
  737. category: 'accessing',
  738. fn: function (aString){
  739. var self=this;
  740. return smalltalk.withContext(function($ctx1) {
  741. var $1;
  742. $1=_st(self._sendIndexes())._at_ifAbsent_(aString,(function(){
  743. return smalltalk.withContext(function($ctx2) {
  744. return (0);
  745. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  746. return $1;
  747. }, function($ctx1) {$ctx1.fill(self,"sendIndexAt:",{aString:aString},smalltalk.AIContext)})},
  748. args: ["aString"],
  749. source: "sendIndexAt: aString\x0a\x09^ self sendIndexes at: aString ifAbsent: [ 0 ]",
  750. messageSends: ["at:ifAbsent:", "sendIndexes"],
  751. referencedClasses: []
  752. }),
  753. smalltalk.AIContext);
  754. smalltalk.addMethod(
  755. smalltalk.method({
  756. selector: "sendIndexes",
  757. category: 'accessing',
  758. fn: function (){
  759. var self=this;
  760. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  761. return smalltalk.withContext(function($ctx1) {
  762. var $1;
  763. if(($receiver = self["@sendIndexes"]) == nil || $receiver == null){
  764. $1=_st($Dictionary())._new();
  765. } else {
  766. $1=self["@sendIndexes"];
  767. };
  768. return $1;
  769. }, function($ctx1) {$ctx1.fill(self,"sendIndexes",{},smalltalk.AIContext)})},
  770. args: [],
  771. source: "sendIndexes\x0a\x09^ sendIndexes ifNil: [ Dictionary new ]",
  772. messageSends: ["ifNil:", "new"],
  773. referencedClasses: ["Dictionary"]
  774. }),
  775. smalltalk.AIContext);
  776. smalltalk.addMethod(
  777. smalltalk.method({
  778. selector: "sendIndexes:",
  779. category: 'accessing',
  780. fn: function (aDictionary){
  781. var self=this;
  782. return smalltalk.withContext(function($ctx1) {
  783. self["@sendIndexes"]=aDictionary;
  784. return self}, function($ctx1) {$ctx1.fill(self,"sendIndexes:",{aDictionary:aDictionary},smalltalk.AIContext)})},
  785. args: ["aDictionary"],
  786. source: "sendIndexes: aDictionary\x0a\x09sendIndexes := aDictionary",
  787. messageSends: [],
  788. referencedClasses: []
  789. }),
  790. smalltalk.AIContext);
  791. smalltalk.addMethod(
  792. smalltalk.method({
  793. selector: "setupInterpreter:",
  794. category: 'interpreting',
  795. fn: function (anInterpreter){
  796. var self=this;
  797. var currentNode;
  798. function $ASTPCNodeVisitor(){return smalltalk.ASTPCNodeVisitor||(typeof ASTPCNodeVisitor=="undefined"?nil:ASTPCNodeVisitor)}
  799. return smalltalk.withContext(function($ctx1) {
  800. var $1,$2,$4,$3,$5,$8,$7,$6,$10,$9;
  801. $1=_st($ASTPCNodeVisitor())._new();
  802. $2=$1;
  803. $4=self._innerContext();
  804. $ctx1.sendIdx["innerContext"]=1;
  805. $3=_st($4)._selector();
  806. _st($2)._selector_($3);
  807. _st($1)._context_(self);
  808. _st($1)._visit_(self._ast());
  809. $5=_st($1)._currentNode();
  810. currentNode=$5;
  811. _st(anInterpreter)._node_(currentNode);
  812. $8=self._innerContext();
  813. $ctx1.sendIdx["innerContext"]=2;
  814. $7=_st($8)._arguments();
  815. $6=_st($7)._reversed();
  816. _st($6)._do_((function(each){
  817. return smalltalk.withContext(function($ctx2) {
  818. return _st(anInterpreter)._push_(each);
  819. $ctx2.sendIdx["push:"]=1;
  820. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  821. $10=self._innerContext();
  822. $9=_st($10)._receiver();
  823. _st(anInterpreter)._push_($9);
  824. return self}, function($ctx1) {$ctx1.fill(self,"setupInterpreter:",{anInterpreter:anInterpreter,currentNode:currentNode},smalltalk.AIContext)})},
  825. args: ["anInterpreter"],
  826. source: "setupInterpreter: anInterpreter\x0a\x09| currentNode |\x0a\x09\x0a\x09\x22Retrieve the current node\x22\x0a\x09currentNode := ASTPCNodeVisitor new\x0a\x09\x09\x09selector: self innerContext selector;\x0a\x09\x09\x09context: self;\x0a\x09\x09\x09visit: self ast;\x0a\x09\x09\x09currentNode.\x0a\x09\x0a\x09anInterpreter node: currentNode.\x0a\x0a\x09\x22Push the send args and receiver to the interpreter stack\x22\x09\x0a\x09self innerContext arguments reversed do: [ :each | \x0a\x09\x09anInterpreter push: each ].\x0a\x09\x09\x0a\x09anInterpreter push: (self innerContext receiver)",
  827. messageSends: ["selector:", "new", "selector", "innerContext", "context:", "visit:", "ast", "currentNode", "node:", "do:", "reversed", "arguments", "push:", "receiver"],
  828. referencedClasses: ["ASTPCNodeVisitor"]
  829. }),
  830. smalltalk.AIContext);
  831. smalltalk.addMethod(
  832. smalltalk.method({
  833. selector: "fromMethodContext:",
  834. category: 'instance creation',
  835. fn: function (aMethodContext){
  836. var self=this;
  837. return smalltalk.withContext(function($ctx1) {
  838. var $2,$3,$1;
  839. $2=self._new();
  840. _st($2)._initializeFromMethodContext_(aMethodContext);
  841. $3=_st($2)._yourself();
  842. $1=$3;
  843. return $1;
  844. }, function($ctx1) {$ctx1.fill(self,"fromMethodContext:",{aMethodContext:aMethodContext},smalltalk.AIContext.klass)})},
  845. args: ["aMethodContext"],
  846. source: "fromMethodContext: aMethodContext\x0a\x09^ self new\x0a\x09\x09initializeFromMethodContext: aMethodContext;\x0a\x09\x09yourself",
  847. messageSends: ["initializeFromMethodContext:", "new", "yourself"],
  848. referencedClasses: []
  849. }),
  850. smalltalk.AIContext.klass);
  851. smalltalk.addClass('ASTDebugger', smalltalk.Object, ['interpreter', 'context'], 'Compiler-Interpreter');
  852. smalltalk.ASTDebugger.comment="I am a stepping debugger interface for Amber code.\x0aI internally use an instance of `ASTSteppingInterpreter` to actually step through node and interpret them.\x0a\x0aMy instances are created from a `MethodContext` with `ASTDebugger class >> context:`.\x0aThey hold an `AIContext` instance internally, recursive copy of the `MethodContext`.\x0a\x0a## API\x0a\x0aUse the methods of the `'stepping'` protocol to do stepping.";
  853. smalltalk.addMethod(
  854. smalltalk.method({
  855. selector: "atEnd",
  856. category: 'testing',
  857. fn: function (){
  858. var self=this;
  859. return smalltalk.withContext(function($ctx1) {
  860. var $1;
  861. $1=_st(self._interpreter())._atEnd();
  862. return $1;
  863. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.ASTDebugger)})},
  864. args: [],
  865. source: "atEnd\x0a\x09^ self interpreter atEnd",
  866. messageSends: ["atEnd", "interpreter"],
  867. referencedClasses: []
  868. }),
  869. smalltalk.ASTDebugger);
  870. smalltalk.addMethod(
  871. smalltalk.method({
  872. selector: "buildAST",
  873. category: 'initialization',
  874. fn: function (){
  875. var self=this;
  876. var ast;
  877. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  878. function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
  879. return smalltalk.withContext(function($ctx1) {
  880. var $1;
  881. ast=_st(_st($Smalltalk())._current())._parse_(_st(self._method())._source());
  882. _st(_st($SemanticAnalyzer())._on_(_st(_st(self._context())._receiver())._class()))._visit_(ast);
  883. $1=ast;
  884. return $1;
  885. }, function($ctx1) {$ctx1.fill(self,"buildAST",{ast:ast},smalltalk.ASTDebugger)})},
  886. args: [],
  887. source: "buildAST\x0a\x09\x22Build the AST tree from the method source code.\x0a\x09The AST is annotated with a SemanticAnalyzer,\x0a\x09to know the semantics and bindings of each node needed for later debugging\x22\x0a\x09\x0a\x09| ast |\x0a\x09\x0a\x09ast := Smalltalk current parse: self method source.\x0a\x09(SemanticAnalyzer on: self context receiver class)\x0a\x09\x09visit: ast.\x0a\x09\x0a\x09^ ast",
  888. messageSends: ["parse:", "current", "source", "method", "visit:", "on:", "class", "receiver", "context"],
  889. referencedClasses: ["Smalltalk", "SemanticAnalyzer"]
  890. }),
  891. smalltalk.ASTDebugger);
  892. smalltalk.addMethod(
  893. smalltalk.method({
  894. selector: "context",
  895. category: 'accessing',
  896. fn: function (){
  897. var self=this;
  898. return smalltalk.withContext(function($ctx1) {
  899. var $1;
  900. $1=self["@context"];
  901. return $1;
  902. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTDebugger)})},
  903. args: [],
  904. source: "context\x0a\x09^ context",
  905. messageSends: [],
  906. referencedClasses: []
  907. }),
  908. smalltalk.ASTDebugger);
  909. smalltalk.addMethod(
  910. smalltalk.method({
  911. selector: "context:",
  912. category: 'accessing',
  913. fn: function (aContext){
  914. var self=this;
  915. return smalltalk.withContext(function($ctx1) {
  916. self["@context"]=aContext;
  917. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTDebugger)})},
  918. args: ["aContext"],
  919. source: "context: aContext\x0a\x09context := aContext",
  920. messageSends: [],
  921. referencedClasses: []
  922. }),
  923. smalltalk.ASTDebugger);
  924. smalltalk.addMethod(
  925. smalltalk.method({
  926. selector: "defaultInterpreterClass",
  927. category: 'defaults',
  928. fn: function (){
  929. var self=this;
  930. function $ASTInterpreter(){return smalltalk.ASTInterpreter||(typeof ASTInterpreter=="undefined"?nil:ASTInterpreter)}
  931. return smalltalk.withContext(function($ctx1) {
  932. return $ASTInterpreter();
  933. }, function($ctx1) {$ctx1.fill(self,"defaultInterpreterClass",{},smalltalk.ASTDebugger)})},
  934. args: [],
  935. source: "defaultInterpreterClass\x0a\x09^ ASTInterpreter",
  936. messageSends: [],
  937. referencedClasses: ["ASTInterpreter"]
  938. }),
  939. smalltalk.ASTDebugger);
  940. smalltalk.addMethod(
  941. smalltalk.method({
  942. selector: "initializeInterpreter",
  943. category: 'initialization',
  944. fn: function (){
  945. var self=this;
  946. var ast,next;
  947. function $ASTPCNodeVisitor(){return smalltalk.ASTPCNodeVisitor||(typeof ASTPCNodeVisitor=="undefined"?nil:ASTPCNodeVisitor)}
  948. return smalltalk.withContext(function($ctx1) {
  949. var $1,$2;
  950. ast=self._buildAST();
  951. $1=_st($ASTPCNodeVisitor())._new();
  952. _st($1)._context_(self._context());
  953. _st($1)._visit_(ast);
  954. $2=_st($1)._currentNode();
  955. next=$2;
  956. _st(self._interpreter())._node_(next);
  957. return self}, function($ctx1) {$ctx1.fill(self,"initializeInterpreter",{ast:ast,next:next},smalltalk.ASTDebugger)})},
  958. args: [],
  959. source: "initializeInterpreter\x0a\x09| ast next |\x0a\x09ast := self buildAST.\x0a\x09next := ASTPCNodeVisitor new\x0a\x09\x09context: self context;\x0a\x09\x09visit: ast;\x0a\x09\x09currentNode.\x0a\x09self interpreter node: next",
  960. messageSends: ["buildAST", "context:", "new", "context", "visit:", "currentNode", "node:", "interpreter"],
  961. referencedClasses: ["ASTPCNodeVisitor"]
  962. }),
  963. smalltalk.ASTDebugger);
  964. smalltalk.addMethod(
  965. smalltalk.method({
  966. selector: "initializeWithContext:",
  967. category: 'initialization',
  968. fn: function (aContext){
  969. var self=this;
  970. return smalltalk.withContext(function($ctx1) {
  971. self._context_(aContext);
  972. self._initializeInterpreter();
  973. return self}, function($ctx1) {$ctx1.fill(self,"initializeWithContext:",{aContext:aContext},smalltalk.ASTDebugger)})},
  974. args: ["aContext"],
  975. source: "initializeWithContext: aContext\x0a\x09\x22TODO: do we need to handle block contexts?\x22\x0a\x09\x0a\x09self context: aContext.\x0a\x09self initializeInterpreter",
  976. messageSends: ["context:", "initializeInterpreter"],
  977. referencedClasses: []
  978. }),
  979. smalltalk.ASTDebugger);
  980. smalltalk.addMethod(
  981. smalltalk.method({
  982. selector: "interpreter",
  983. category: 'accessing',
  984. fn: function (){
  985. var self=this;
  986. return smalltalk.withContext(function($ctx1) {
  987. var $1;
  988. if(($receiver = self["@interpreter"]) == nil || $receiver == null){
  989. self["@interpreter"]=_st(self._defaultInterpreterClass())._new();
  990. $1=self["@interpreter"];
  991. } else {
  992. $1=self["@interpreter"];
  993. };
  994. return $1;
  995. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.ASTDebugger)})},
  996. args: [],
  997. source: "interpreter\x0a\x09^ interpreter ifNil: [ interpreter := self defaultInterpreterClass new ]",
  998. messageSends: ["ifNil:", "new", "defaultInterpreterClass"],
  999. referencedClasses: []
  1000. }),
  1001. smalltalk.ASTDebugger);
  1002. smalltalk.addMethod(
  1003. smalltalk.method({
  1004. selector: "interpreter:",
  1005. category: 'accessing',
  1006. fn: function (anInterpreter){
  1007. var self=this;
  1008. return smalltalk.withContext(function($ctx1) {
  1009. self["@interpreter"]=anInterpreter;
  1010. return self}, function($ctx1) {$ctx1.fill(self,"interpreter:",{anInterpreter:anInterpreter},smalltalk.ASTDebugger)})},
  1011. args: ["anInterpreter"],
  1012. source: "interpreter: anInterpreter\x0a\x09interpreter := anInterpreter",
  1013. messageSends: [],
  1014. referencedClasses: []
  1015. }),
  1016. smalltalk.ASTDebugger);
  1017. smalltalk.addMethod(
  1018. smalltalk.method({
  1019. selector: "method",
  1020. category: 'accessing',
  1021. fn: function (){
  1022. var self=this;
  1023. return smalltalk.withContext(function($ctx1) {
  1024. var $1;
  1025. $1=_st(self._context())._method();
  1026. return $1;
  1027. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.ASTDebugger)})},
  1028. args: [],
  1029. source: "method\x0a\x09^ self context method",
  1030. messageSends: ["method", "context"],
  1031. referencedClasses: []
  1032. }),
  1033. smalltalk.ASTDebugger);
  1034. smalltalk.addMethod(
  1035. smalltalk.method({
  1036. selector: "nextNode",
  1037. category: 'accessing',
  1038. fn: function (){
  1039. var self=this;
  1040. return smalltalk.withContext(function($ctx1) {
  1041. var $1;
  1042. $1=_st(self._interpreter())._nextNode();
  1043. return $1;
  1044. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.ASTDebugger)})},
  1045. args: [],
  1046. source: "nextNode\x0a\x09^ self interpreter nextNode",
  1047. messageSends: ["nextNode", "interpreter"],
  1048. referencedClasses: []
  1049. }),
  1050. smalltalk.ASTDebugger);
  1051. smalltalk.addMethod(
  1052. smalltalk.method({
  1053. selector: "proceed",
  1054. category: 'stepping',
  1055. fn: function (){
  1056. var self=this;
  1057. return smalltalk.withContext(function($ctx1) {
  1058. self._shouldBeImplemented();
  1059. return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.ASTDebugger)})},
  1060. args: [],
  1061. source: "proceed\x0a\x09self shouldBeImplemented",
  1062. messageSends: ["shouldBeImplemented"],
  1063. referencedClasses: []
  1064. }),
  1065. smalltalk.ASTDebugger);
  1066. smalltalk.addMethod(
  1067. smalltalk.method({
  1068. selector: "restart",
  1069. category: 'stepping',
  1070. fn: function (){
  1071. var self=this;
  1072. return smalltalk.withContext(function($ctx1) {
  1073. _st(self._interpreter())._restart();
  1074. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.ASTDebugger)})},
  1075. args: [],
  1076. source: "restart\x0a\x09self interpreter restart",
  1077. messageSends: ["restart", "interpreter"],
  1078. referencedClasses: []
  1079. }),
  1080. smalltalk.ASTDebugger);
  1081. smalltalk.addMethod(
  1082. smalltalk.method({
  1083. selector: "stepInto",
  1084. category: 'stepping',
  1085. fn: function (){
  1086. var self=this;
  1087. return smalltalk.withContext(function($ctx1) {
  1088. self._shouldBeImplemented();
  1089. return self}, function($ctx1) {$ctx1.fill(self,"stepInto",{},smalltalk.ASTDebugger)})},
  1090. args: [],
  1091. source: "stepInto\x0a\x09self shouldBeImplemented",
  1092. messageSends: ["shouldBeImplemented"],
  1093. referencedClasses: []
  1094. }),
  1095. smalltalk.ASTDebugger);
  1096. smalltalk.addMethod(
  1097. smalltalk.method({
  1098. selector: "stepOver",
  1099. category: 'stepping',
  1100. fn: function (){
  1101. var self=this;
  1102. return smalltalk.withContext(function($ctx1) {
  1103. _st(self._interpreter())._stepOver();
  1104. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.ASTDebugger)})},
  1105. args: [],
  1106. source: "stepOver\x0a\x09self interpreter stepOver",
  1107. messageSends: ["stepOver", "interpreter"],
  1108. referencedClasses: []
  1109. }),
  1110. smalltalk.ASTDebugger);
  1111. smalltalk.addMethod(
  1112. smalltalk.method({
  1113. selector: "context:",
  1114. category: 'instance creation',
  1115. fn: function (aContext){
  1116. var self=this;
  1117. return smalltalk.withContext(function($ctx1) {
  1118. var $2,$3,$1;
  1119. $2=self._new();
  1120. _st($2)._initializeWithContext_(aContext);
  1121. $3=_st($2)._yourself();
  1122. $1=$3;
  1123. return $1;
  1124. }, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTDebugger.klass)})},
  1125. args: ["aContext"],
  1126. source: "context: aContext\x0a\x09^ self new\x0a\x09\x09initializeWithContext: aContext;\x0a\x09\x09yourself",
  1127. messageSends: ["initializeWithContext:", "new", "yourself"],
  1128. referencedClasses: []
  1129. }),
  1130. smalltalk.ASTDebugger.klass);
  1131. smalltalk.addClass('ASTInterpreter', smalltalk.NodeVisitor, ['node', 'context', 'stack', 'returnValue', 'returned'], 'Compiler-Interpreter');
  1132. smalltalk.ASTInterpreter.comment="I visit an AST, interpreting (evaluating) nodes one after the other, using a small stack machine.\x0a\x0a## API\x0a\x0aWhile my instances should be used from within an `ASTDebugger`, which provides a more high level interface,\x0ayou can use methods from the `interpreting` protocol:\x0a\x0a- `#step` evaluates the current `node` only\x0a- `#stepOver` evaluates the AST from the current `node` up to the next stepping node (most likely the next send node)\x0a- `#proceed` evaluates eagerly the AST\x0a- `#restart` select the first node of the AST\x0a- `#skip` skips the current node, moving to the next one if any";
  1133. smalltalk.addMethod(
  1134. smalltalk.method({
  1135. selector: "assign:to:",
  1136. category: 'private',
  1137. fn: function (aNode,anObject){
  1138. var self=this;
  1139. return smalltalk.withContext(function($ctx1) {
  1140. var $2,$1,$3,$4,$5;
  1141. if(smalltalk.assert(_st(_st(aNode)._binding())._isInstanceVar())){
  1142. $2=self._context();
  1143. $ctx1.sendIdx["context"]=1;
  1144. $1=_st($2)._receiver();
  1145. $3=_st(aNode)._value();
  1146. $ctx1.sendIdx["value"]=1;
  1147. _st($1)._instVarAt_put_($3,anObject);
  1148. } else {
  1149. $4=self._context();
  1150. $5=_st(aNode)._value();
  1151. _st($4)._localAt_put_($5,anObject);
  1152. };
  1153. return self}, function($ctx1) {$ctx1.fill(self,"assign:to:",{aNode:aNode,anObject:anObject},smalltalk.ASTInterpreter)})},
  1154. args: ["aNode", "anObject"],
  1155. source: "assign: aNode to: anObject\x0a\x09aNode binding isInstanceVar\x0a\x09\x09ifTrue: [ self context receiver instVarAt: aNode value put: anObject ]\x0a\x09\x09ifFalse: [ self context localAt: aNode value put: anObject ]",
  1156. messageSends: ["ifTrue:ifFalse:", "isInstanceVar", "binding", "instVarAt:put:", "receiver", "context", "value", "localAt:put:"],
  1157. referencedClasses: []
  1158. }),
  1159. smalltalk.ASTInterpreter);
  1160. smalltalk.addMethod(
  1161. smalltalk.method({
  1162. selector: "atEnd",
  1163. category: 'testing',
  1164. fn: function (){
  1165. var self=this;
  1166. return smalltalk.withContext(function($ctx1) {
  1167. var $1;
  1168. $1=_st(self._hasReturned())._or_((function(){
  1169. return smalltalk.withContext(function($ctx2) {
  1170. return _st(self._node())._isNil();
  1171. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1172. return $1;
  1173. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.ASTInterpreter)})},
  1174. args: [],
  1175. source: "atEnd\x0a\x09^ self hasReturned or: [ self node isNil ]",
  1176. messageSends: ["or:", "hasReturned", "isNil", "node"],
  1177. referencedClasses: []
  1178. }),
  1179. smalltalk.ASTInterpreter);
  1180. smalltalk.addMethod(
  1181. smalltalk.method({
  1182. selector: "context",
  1183. category: 'accessing',
  1184. fn: function (){
  1185. var self=this;
  1186. return smalltalk.withContext(function($ctx1) {
  1187. var $1;
  1188. $1=self["@context"];
  1189. return $1;
  1190. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTInterpreter)})},
  1191. args: [],
  1192. source: "context\x0a\x09^ context",
  1193. messageSends: [],
  1194. referencedClasses: []
  1195. }),
  1196. smalltalk.ASTInterpreter);
  1197. smalltalk.addMethod(
  1198. smalltalk.method({
  1199. selector: "context:",
  1200. category: 'accessing',
  1201. fn: function (aContext){
  1202. var self=this;
  1203. return smalltalk.withContext(function($ctx1) {
  1204. self["@context"]=aContext;
  1205. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTInterpreter)})},
  1206. args: ["aContext"],
  1207. source: "context: aContext\x0a\x09context := aContext",
  1208. messageSends: [],
  1209. referencedClasses: []
  1210. }),
  1211. smalltalk.ASTInterpreter);
  1212. smalltalk.addMethod(
  1213. smalltalk.method({
  1214. selector: "eval:",
  1215. category: 'private',
  1216. fn: function (aString){
  1217. var self=this;
  1218. var source,function_;
  1219. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1220. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  1221. return smalltalk.withContext(function($ctx1) {
  1222. var $3,$2,$1,$4,$6,$9,$8,$7,$5;
  1223. source=_st($String())._streamContents_((function(str){
  1224. return smalltalk.withContext(function($ctx2) {
  1225. _st(str)._nextPutAll_("(function(");
  1226. $ctx2.sendIdx["nextPutAll:"]=1;
  1227. $3=self._context();
  1228. $ctx2.sendIdx["context"]=1;
  1229. $2=_st($3)._locals();
  1230. $ctx2.sendIdx["locals"]=1;
  1231. $1=_st($2)._keys();
  1232. _st($1)._do_separatedBy_((function(each){
  1233. return smalltalk.withContext(function($ctx3) {
  1234. return _st(str)._nextPutAll_(each);
  1235. $ctx3.sendIdx["nextPutAll:"]=2;
  1236. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}),(function(){
  1237. return smalltalk.withContext(function($ctx3) {
  1238. return _st(str)._nextPutAll_(",");
  1239. $ctx3.sendIdx["nextPutAll:"]=3;
  1240. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  1241. _st(str)._nextPutAll_("){ return (function() {");
  1242. $ctx2.sendIdx["nextPutAll:"]=4;
  1243. _st(str)._nextPutAll_(aString);
  1244. $ctx2.sendIdx["nextPutAll:"]=5;
  1245. $4=_st(str)._nextPutAll_("})() })");
  1246. return $4;
  1247. }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)})}));
  1248. function_=_st(_st($Compiler())._new())._eval_(source);
  1249. $6=function_;
  1250. $9=self._context();
  1251. $8=_st($9)._locals();
  1252. $7=_st($8)._values();
  1253. $5=_st($6)._valueWithPossibleArguments_($7);
  1254. return $5;
  1255. }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString,source:source,function_:function_},smalltalk.ASTInterpreter)})},
  1256. args: ["aString"],
  1257. source: "eval: aString\x0a\x09\x22Evaluate aString as JS source inside an JS function.\x0a\x09aString is not sandboxed.\x22\x0a\x09\x0a\x09| source function |\x0a\x09\x0a\x09source := String streamContents: [ :str |\x0a\x09\x09str nextPutAll: '(function('.\x0a\x09\x09self context locals keys\x0a\x09\x09\x09do: [ :each | str nextPutAll: each ]\x0a\x09\x09\x09separatedBy: [ str nextPutAll: ',' ].\x0a\x09\x09str\x0a\x09\x09\x09nextPutAll: '){ return (function() {';\x0a\x09\x09\x09nextPutAll: aString;\x0a\x09\x09\x09nextPutAll: '})() })' ].\x0a\x09\x09\x09\x0a\x09function := Compiler new eval: source.\x0a\x09\x0a\x09^ function valueWithPossibleArguments: self context locals values",
  1258. messageSends: ["streamContents:", "nextPutAll:", "do:separatedBy:", "keys", "locals", "context", "eval:", "new", "valueWithPossibleArguments:", "values"],
  1259. referencedClasses: ["String", "Compiler"]
  1260. }),
  1261. smalltalk.ASTInterpreter);
  1262. smalltalk.addMethod(
  1263. smalltalk.method({
  1264. selector: "hasReturned",
  1265. category: 'testing',
  1266. fn: function (){
  1267. var self=this;
  1268. return smalltalk.withContext(function($ctx1) {
  1269. var $1;
  1270. if(($receiver = self["@returned"]) == nil || $receiver == null){
  1271. $1=false;
  1272. } else {
  1273. $1=self["@returned"];
  1274. };
  1275. return $1;
  1276. }, function($ctx1) {$ctx1.fill(self,"hasReturned",{},smalltalk.ASTInterpreter)})},
  1277. args: [],
  1278. source: "hasReturned\x0a\x09^ returned ifNil: [ false ]",
  1279. messageSends: ["ifNil:"],
  1280. referencedClasses: []
  1281. }),
  1282. smalltalk.ASTInterpreter);
  1283. smalltalk.addMethod(
  1284. smalltalk.method({
  1285. selector: "interpret",
  1286. category: 'interpreting',
  1287. fn: function (){
  1288. var self=this;
  1289. return smalltalk.withContext(function($ctx1) {
  1290. self._visit_(self._node());
  1291. return self}, function($ctx1) {$ctx1.fill(self,"interpret",{},smalltalk.ASTInterpreter)})},
  1292. args: [],
  1293. source: "interpret\x0a\x09\x22Interpret the next node to be evaluated\x22\x0a\x09\x0a\x09self visit: self node",
  1294. messageSends: ["visit:", "node"],
  1295. referencedClasses: []
  1296. }),
  1297. smalltalk.ASTInterpreter);
  1298. smalltalk.addMethod(
  1299. smalltalk.method({
  1300. selector: "interpret:",
  1301. category: 'interpreting',
  1302. fn: function (aNode){
  1303. var self=this;
  1304. return smalltalk.withContext(function($ctx1) {
  1305. self._node_(aNode);
  1306. self._interpret();
  1307. return self}, function($ctx1) {$ctx1.fill(self,"interpret:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1308. args: ["aNode"],
  1309. source: "interpret: aNode\x0a\x09self node: aNode.\x0a\x09self interpret",
  1310. messageSends: ["node:", "interpret"],
  1311. referencedClasses: []
  1312. }),
  1313. smalltalk.ASTInterpreter);
  1314. smalltalk.addMethod(
  1315. smalltalk.method({
  1316. selector: "messageFromSendNode:arguments:",
  1317. category: 'private',
  1318. fn: function (aSendNode,aCollection){
  1319. var self=this;
  1320. function $Message(){return smalltalk.Message||(typeof Message=="undefined"?nil:Message)}
  1321. return smalltalk.withContext(function($ctx1) {
  1322. var $2,$3,$1;
  1323. $2=_st($Message())._new();
  1324. _st($2)._selector_(_st(aSendNode)._selector());
  1325. _st($2)._arguments_(aCollection);
  1326. $3=_st($2)._yourself();
  1327. $1=$3;
  1328. return $1;
  1329. }, function($ctx1) {$ctx1.fill(self,"messageFromSendNode:arguments:",{aSendNode:aSendNode,aCollection:aCollection},smalltalk.ASTInterpreter)})},
  1330. args: ["aSendNode", "aCollection"],
  1331. source: "messageFromSendNode: aSendNode arguments: aCollection\x0a\x09^ Message new\x0a\x09\x09selector: aSendNode selector;\x0a\x09\x09arguments: aCollection;\x0a\x09\x09yourself",
  1332. messageSends: ["selector:", "new", "selector", "arguments:", "yourself"],
  1333. referencedClasses: ["Message"]
  1334. }),
  1335. smalltalk.ASTInterpreter);
  1336. smalltalk.addMethod(
  1337. smalltalk.method({
  1338. selector: "messageNotUnderstood:receiver:",
  1339. category: 'private',
  1340. fn: function (aMessage,anObject){
  1341. var self=this;
  1342. function $MessageNotUnderstood(){return smalltalk.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  1343. return smalltalk.withContext(function($ctx1) {
  1344. var $1,$2;
  1345. $1=_st($MessageNotUnderstood())._new();
  1346. _st($1)._meesage_(aMessage);
  1347. _st($1)._receiver_(anObject);
  1348. $2=_st($1)._signal();
  1349. return self}, function($ctx1) {$ctx1.fill(self,"messageNotUnderstood:receiver:",{aMessage:aMessage,anObject:anObject},smalltalk.ASTInterpreter)})},
  1350. args: ["aMessage", "anObject"],
  1351. source: "messageNotUnderstood: aMessage receiver: anObject\x0a\x09MessageNotUnderstood new\x0a\x09\x09meesage: aMessage;\x0a\x09\x09receiver: anObject;\x0a\x09\x09signal",
  1352. messageSends: ["meesage:", "new", "receiver:", "signal"],
  1353. referencedClasses: ["MessageNotUnderstood"]
  1354. }),
  1355. smalltalk.ASTInterpreter);
  1356. smalltalk.addMethod(
  1357. smalltalk.method({
  1358. selector: "next",
  1359. category: 'interpreting',
  1360. fn: function (){
  1361. var self=this;
  1362. return smalltalk.withContext(function($ctx1) {
  1363. self._node_(_st(self._node())._nextNode());
  1364. return self}, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.ASTInterpreter)})},
  1365. args: [],
  1366. source: "next\x0a\x09self node: self node nextNode",
  1367. messageSends: ["node:", "nextNode", "node"],
  1368. referencedClasses: []
  1369. }),
  1370. smalltalk.ASTInterpreter);
  1371. smalltalk.addMethod(
  1372. smalltalk.method({
  1373. selector: "node",
  1374. category: 'accessing',
  1375. fn: function (){
  1376. var self=this;
  1377. return smalltalk.withContext(function($ctx1) {
  1378. var $1;
  1379. $1=self["@node"];
  1380. return $1;
  1381. }, function($ctx1) {$ctx1.fill(self,"node",{},smalltalk.ASTInterpreter)})},
  1382. args: [],
  1383. source: "node\x0a\x09\x22Answer the next node, ie the node to be evaluated in the next step\x22\x0a\x09\x0a\x09^ node",
  1384. messageSends: [],
  1385. referencedClasses: []
  1386. }),
  1387. smalltalk.ASTInterpreter);
  1388. smalltalk.addMethod(
  1389. smalltalk.method({
  1390. selector: "node:",
  1391. category: 'accessing',
  1392. fn: function (aNode){
  1393. var self=this;
  1394. return smalltalk.withContext(function($ctx1) {
  1395. self["@node"]=aNode;
  1396. return self}, function($ctx1) {$ctx1.fill(self,"node:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1397. args: ["aNode"],
  1398. source: "node: aNode\x0a\x09node := aNode",
  1399. messageSends: [],
  1400. referencedClasses: []
  1401. }),
  1402. smalltalk.ASTInterpreter);
  1403. smalltalk.addMethod(
  1404. smalltalk.method({
  1405. selector: "peek",
  1406. category: 'stack',
  1407. fn: function (){
  1408. var self=this;
  1409. return smalltalk.withContext(function($ctx1) {
  1410. var $1,$3,$2;
  1411. var $early={};
  1412. try {
  1413. $1=self._stack();
  1414. $ctx1.sendIdx["stack"]=1;
  1415. _st($1)._ifEmpty_((function(){
  1416. return smalltalk.withContext(function($ctx2) {
  1417. throw $early=[nil];
  1418. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1419. $3=self._stack();
  1420. $2=_st($3)._last();
  1421. return $2;
  1422. }
  1423. catch(e) {if(e===$early)return e[0]; throw e}
  1424. }, function($ctx1) {$ctx1.fill(self,"peek",{},smalltalk.ASTInterpreter)})},
  1425. args: [],
  1426. source: "peek\x0a\x09\x22Peek the top object of the context stack\x22\x0a\x09\x0a\x09self stack ifEmpty: [ ^ nil ].\x0a\x09\x0a\x09^ self stack last",
  1427. messageSends: ["ifEmpty:", "stack", "last"],
  1428. referencedClasses: []
  1429. }),
  1430. smalltalk.ASTInterpreter);
  1431. smalltalk.addMethod(
  1432. smalltalk.method({
  1433. selector: "pop",
  1434. category: 'stack',
  1435. fn: function (){
  1436. var self=this;
  1437. var peekedValue;
  1438. return smalltalk.withContext(function($ctx1) {
  1439. var $1;
  1440. peekedValue=self._peek();
  1441. _st(self._stack())._removeLast();
  1442. $1=peekedValue;
  1443. return $1;
  1444. }, function($ctx1) {$ctx1.fill(self,"pop",{peekedValue:peekedValue},smalltalk.ASTInterpreter)})},
  1445. args: [],
  1446. source: "pop\x0a\x09\x22Pop an object from the context stack\x22\x0a\x09\x0a\x09| peekedValue |\x0a\x09\x0a\x09peekedValue := self peek.\x0a\x09self stack removeLast.\x0a\x09^ peekedValue",
  1447. messageSends: ["peek", "removeLast", "stack"],
  1448. referencedClasses: []
  1449. }),
  1450. smalltalk.ASTInterpreter);
  1451. smalltalk.addMethod(
  1452. smalltalk.method({
  1453. selector: "proceed",
  1454. category: 'interpreting',
  1455. fn: function (){
  1456. var self=this;
  1457. return smalltalk.withContext(function($ctx1) {
  1458. _st((function(){
  1459. return smalltalk.withContext(function($ctx2) {
  1460. return self._atEnd();
  1461. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileFalse_((function(){
  1462. return smalltalk.withContext(function($ctx2) {
  1463. return self._step();
  1464. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1465. return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.ASTInterpreter)})},
  1466. args: [],
  1467. source: "proceed\x0a\x09\x22Eagerly evaluate the ast\x22\x0a\x09\x0a\x09[ self atEnd ] whileFalse: [ \x0a\x09\x09self step ]",
  1468. messageSends: ["whileFalse:", "atEnd", "step"],
  1469. referencedClasses: []
  1470. }),
  1471. smalltalk.ASTInterpreter);
  1472. smalltalk.addMethod(
  1473. smalltalk.method({
  1474. selector: "push:",
  1475. category: 'stack',
  1476. fn: function (anObject){
  1477. var self=this;
  1478. return smalltalk.withContext(function($ctx1) {
  1479. var $1;
  1480. $1=_st(self._stack())._add_(anObject);
  1481. return $1;
  1482. }, function($ctx1) {$ctx1.fill(self,"push:",{anObject:anObject},smalltalk.ASTInterpreter)})},
  1483. args: ["anObject"],
  1484. source: "push: anObject\x0a\x09\x22Push an object to the context stack\x22\x0a\x09\x0a\x09^ self stack add: anObject",
  1485. messageSends: ["add:", "stack"],
  1486. referencedClasses: []
  1487. }),
  1488. smalltalk.ASTInterpreter);
  1489. smalltalk.addMethod(
  1490. smalltalk.method({
  1491. selector: "restart",
  1492. category: 'interpreting',
  1493. fn: function (){
  1494. var self=this;
  1495. return smalltalk.withContext(function($ctx1) {
  1496. self._node_(_st(_st(self._context())._ast())._nextChild());
  1497. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.ASTInterpreter)})},
  1498. args: [],
  1499. source: "restart\x0a\x09self node: self context ast nextChild",
  1500. messageSends: ["node:", "nextChild", "ast", "context"],
  1501. referencedClasses: []
  1502. }),
  1503. smalltalk.ASTInterpreter);
  1504. smalltalk.addMethod(
  1505. smalltalk.method({
  1506. selector: "result",
  1507. category: 'accessing',
  1508. fn: function (){
  1509. var self=this;
  1510. return smalltalk.withContext(function($ctx1) {
  1511. var $1;
  1512. if(smalltalk.assert(self._hasReturned())){
  1513. $1=self._returnValue();
  1514. } else {
  1515. $1=_st(self._context())._receiver();
  1516. };
  1517. return $1;
  1518. }, function($ctx1) {$ctx1.fill(self,"result",{},smalltalk.ASTInterpreter)})},
  1519. args: [],
  1520. source: "result\x0a\x09^ self hasReturned \x0a\x09\x09ifTrue: [ self returnValue ] \x0a\x09\x09ifFalse: [ self context receiver ]",
  1521. messageSends: ["ifTrue:ifFalse:", "hasReturned", "returnValue", "receiver", "context"],
  1522. referencedClasses: []
  1523. }),
  1524. smalltalk.ASTInterpreter);
  1525. smalltalk.addMethod(
  1526. smalltalk.method({
  1527. selector: "returnValue",
  1528. category: 'accessing',
  1529. fn: function (){
  1530. var self=this;
  1531. return smalltalk.withContext(function($ctx1) {
  1532. var $1;
  1533. $1=self["@returnValue"];
  1534. return $1;
  1535. }, function($ctx1) {$ctx1.fill(self,"returnValue",{},smalltalk.ASTInterpreter)})},
  1536. args: [],
  1537. source: "returnValue\x0a\x09^ returnValue",
  1538. messageSends: [],
  1539. referencedClasses: []
  1540. }),
  1541. smalltalk.ASTInterpreter);
  1542. smalltalk.addMethod(
  1543. smalltalk.method({
  1544. selector: "returnValue:",
  1545. category: 'accessing',
  1546. fn: function (anObject){
  1547. var self=this;
  1548. return smalltalk.withContext(function($ctx1) {
  1549. self["@returnValue"]=anObject;
  1550. return self}, function($ctx1) {$ctx1.fill(self,"returnValue:",{anObject:anObject},smalltalk.ASTInterpreter)})},
  1551. args: ["anObject"],
  1552. source: "returnValue: anObject\x0a\x09returnValue := anObject",
  1553. messageSends: [],
  1554. referencedClasses: []
  1555. }),
  1556. smalltalk.ASTInterpreter);
  1557. smalltalk.addMethod(
  1558. smalltalk.method({
  1559. selector: "sendMessage:to:superSend:",
  1560. category: 'private',
  1561. fn: function (aMessage,anObject,aBoolean){
  1562. var self=this;
  1563. var method;
  1564. return smalltalk.withContext(function($ctx1) {
  1565. var $1,$3,$2,$4,$7,$6,$5,$8,$9;
  1566. var $early={};
  1567. try {
  1568. if(! smalltalk.assert(aBoolean)){
  1569. $1=_st(aMessage)._sendTo_(anObject);
  1570. return $1;
  1571. };
  1572. $3=_st(anObject)._class();
  1573. $ctx1.sendIdx["class"]=1;
  1574. $2=_st($3)._superclass();
  1575. $ctx1.sendIdx["superclass"]=1;
  1576. if(($receiver = $2) == nil || $receiver == null){
  1577. $4=self._messageNotUnderstood_receiver_(aMessage,anObject);
  1578. $ctx1.sendIdx["messageNotUnderstood:receiver:"]=1;
  1579. return $4;
  1580. } else {
  1581. $2;
  1582. };
  1583. $7=_st(anObject)._class();
  1584. $6=_st($7)._superclass();
  1585. $5=_st($6)._methodDictionary();
  1586. method=_st($5)._at_ifAbsent_(_st(aMessage)._selector(),(function(){
  1587. return smalltalk.withContext(function($ctx2) {
  1588. $8=self._messageNotUnderstood_receiver_(aMessage,anObject);
  1589. throw $early=[$8];
  1590. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  1591. $9=_st(method)._sendTo_arguments_(anObject,_st(aMessage)._arguments());
  1592. return $9;
  1593. }
  1594. catch(e) {if(e===$early)return e[0]; throw e}
  1595. }, function($ctx1) {$ctx1.fill(self,"sendMessage:to:superSend:",{aMessage:aMessage,anObject:anObject,aBoolean:aBoolean,method:method},smalltalk.ASTInterpreter)})},
  1596. args: ["aMessage", "anObject", "aBoolean"],
  1597. source: "sendMessage: aMessage to: anObject superSend: aBoolean\x0a\x09| method |\x0a\x09\x0a\x09aBoolean ifFalse: [ ^ aMessage sendTo: anObject ].\x0a\x09anObject class superclass ifNil: [ ^ self messageNotUnderstood: aMessage receiver: anObject ].\x0a\x09\x0a\x09method := anObject class superclass methodDictionary\x0a\x09\x09at: aMessage selector\x0a\x09\x09ifAbsent: [ ^ self messageNotUnderstood: aMessage receiver: anObject ].\x0a\x09\x09\x0a\x09^ method sendTo: anObject arguments: aMessage arguments",
  1598. messageSends: ["ifFalse:", "sendTo:", "ifNil:", "superclass", "class", "messageNotUnderstood:receiver:", "at:ifAbsent:", "methodDictionary", "selector", "sendTo:arguments:", "arguments"],
  1599. referencedClasses: []
  1600. }),
  1601. smalltalk.ASTInterpreter);
  1602. smalltalk.addMethod(
  1603. smalltalk.method({
  1604. selector: "setNonLocalReturnFromContext:",
  1605. category: 'interpreting',
  1606. fn: function (aContext){
  1607. var self=this;
  1608. return smalltalk.withContext(function($ctx1) {
  1609. var $2,$1,$4,$3;
  1610. $2=_st(aContext)._interpreter();
  1611. $ctx1.sendIdx["interpreter"]=1;
  1612. $1=_st($2)._hasReturned();
  1613. if(smalltalk.assert($1)){
  1614. self["@returned"]=true;
  1615. self["@returned"];
  1616. $4=_st(aContext)._interpreter();
  1617. $3=_st($4)._returnValue();
  1618. self._returnValue_($3);
  1619. };
  1620. return self}, function($ctx1) {$ctx1.fill(self,"setNonLocalReturnFromContext:",{aContext:aContext},smalltalk.ASTInterpreter)})},
  1621. args: ["aContext"],
  1622. source: "setNonLocalReturnFromContext: aContext\x0a\x09aContext interpreter hasReturned ifTrue: [\x0a\x09\x09returned := true.\x0a\x09\x09self returnValue: aContext interpreter returnValue ]",
  1623. messageSends: ["ifTrue:", "hasReturned", "interpreter", "returnValue:", "returnValue"],
  1624. referencedClasses: []
  1625. }),
  1626. smalltalk.ASTInterpreter);
  1627. smalltalk.addMethod(
  1628. smalltalk.method({
  1629. selector: "skip",
  1630. category: 'interpreting',
  1631. fn: function (){
  1632. var self=this;
  1633. return smalltalk.withContext(function($ctx1) {
  1634. self._next();
  1635. return self}, function($ctx1) {$ctx1.fill(self,"skip",{},smalltalk.ASTInterpreter)})},
  1636. args: [],
  1637. source: "skip\x0a\x09self next",
  1638. messageSends: ["next"],
  1639. referencedClasses: []
  1640. }),
  1641. smalltalk.ASTInterpreter);
  1642. smalltalk.addMethod(
  1643. smalltalk.method({
  1644. selector: "stack",
  1645. category: 'accessing',
  1646. fn: function (){
  1647. var self=this;
  1648. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  1649. return smalltalk.withContext(function($ctx1) {
  1650. var $1;
  1651. if(($receiver = self["@stack"]) == nil || $receiver == null){
  1652. self["@stack"]=_st($OrderedCollection())._new();
  1653. $1=self["@stack"];
  1654. } else {
  1655. $1=self["@stack"];
  1656. };
  1657. return $1;
  1658. }, function($ctx1) {$ctx1.fill(self,"stack",{},smalltalk.ASTInterpreter)})},
  1659. args: [],
  1660. source: "stack\x0a\x09^ stack ifNil: [ stack := OrderedCollection new ]",
  1661. messageSends: ["ifNil:", "new"],
  1662. referencedClasses: ["OrderedCollection"]
  1663. }),
  1664. smalltalk.ASTInterpreter);
  1665. smalltalk.addMethod(
  1666. smalltalk.method({
  1667. selector: "step",
  1668. category: 'interpreting',
  1669. fn: function (){
  1670. var self=this;
  1671. return smalltalk.withContext(function($ctx1) {
  1672. var $1;
  1673. self._interpret();
  1674. $1=self._next();
  1675. return self}, function($ctx1) {$ctx1.fill(self,"step",{},smalltalk.ASTInterpreter)})},
  1676. args: [],
  1677. source: "step\x0a\x09self \x0a\x09\x09interpret; \x0a\x09\x09next",
  1678. messageSends: ["interpret", "next"],
  1679. referencedClasses: []
  1680. }),
  1681. smalltalk.ASTInterpreter);
  1682. smalltalk.addMethod(
  1683. smalltalk.method({
  1684. selector: "stepOver",
  1685. category: 'interpreting',
  1686. fn: function (){
  1687. var self=this;
  1688. return smalltalk.withContext(function($ctx1) {
  1689. self._step();
  1690. $ctx1.sendIdx["step"]=1;
  1691. _st((function(){
  1692. return smalltalk.withContext(function($ctx2) {
  1693. return _st(self._node())._isSteppingNode();
  1694. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileFalse_((function(){
  1695. return smalltalk.withContext(function($ctx2) {
  1696. return self._step();
  1697. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1698. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.ASTInterpreter)})},
  1699. args: [],
  1700. source: "stepOver\x0a\x09self step.\x0a\x09\x0a\x09[ self node isSteppingNode ] whileFalse: [ \x0a\x09\x09self step ]",
  1701. messageSends: ["step", "whileFalse:", "isSteppingNode", "node"],
  1702. referencedClasses: []
  1703. }),
  1704. smalltalk.ASTInterpreter);
  1705. smalltalk.addMethod(
  1706. smalltalk.method({
  1707. selector: "visit:",
  1708. category: 'visiting',
  1709. fn: function (aNode){
  1710. var self=this;
  1711. return smalltalk.withContext(function($ctx1) {
  1712. if(! smalltalk.assert(self._hasReturned())){
  1713. smalltalk.ASTInterpreter.superclass.fn.prototype._visit_.apply(_st(self), [aNode]);
  1714. };
  1715. return self}, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1716. args: ["aNode"],
  1717. source: "visit: aNode\x0a\x09self hasReturned ifFalse: [ super visit: aNode ]",
  1718. messageSends: ["ifFalse:", "hasReturned", "visit:"],
  1719. referencedClasses: []
  1720. }),
  1721. smalltalk.ASTInterpreter);
  1722. smalltalk.addMethod(
  1723. smalltalk.method({
  1724. selector: "visitAssignmentNode:",
  1725. category: 'visiting',
  1726. fn: function (aNode){
  1727. var self=this;
  1728. var poppedValue;
  1729. return smalltalk.withContext(function($ctx1) {
  1730. poppedValue=self._pop();
  1731. $ctx1.sendIdx["pop"]=1;
  1732. self._pop();
  1733. self._push_(poppedValue);
  1734. self._assign_to_(_st(aNode)._left(),poppedValue);
  1735. return self}, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode,poppedValue:poppedValue},smalltalk.ASTInterpreter)})},
  1736. args: ["aNode"],
  1737. source: "visitAssignmentNode: aNode\x0a\x09| poppedValue |\x0a\x09\x0a\x09poppedValue := self pop.\x0a\x09\x0a\x09\x22Pop the left side of the assignment.\x0a\x09It already has been visited, and we don't need its value.\x22\x0a\x09self pop.\x0a\x09\x0a\x09self push: poppedValue.\x0a\x09self assign: aNode left to: poppedValue",
  1738. messageSends: ["pop", "push:", "assign:to:", "left"],
  1739. referencedClasses: []
  1740. }),
  1741. smalltalk.ASTInterpreter);
  1742. smalltalk.addMethod(
  1743. smalltalk.method({
  1744. selector: "visitBlockNode:",
  1745. category: 'visiting',
  1746. fn: function (aNode){
  1747. var self=this;
  1748. var block;
  1749. function $AIBlockClosure(){return smalltalk.AIBlockClosure||(typeof AIBlockClosure=="undefined"?nil:AIBlockClosure)}
  1750. return smalltalk.withContext(function($ctx1) {
  1751. block=_st($AIBlockClosure())._forContext_node_(self._context(),aNode);
  1752. self._push_(block);
  1753. return self}, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode,block:block},smalltalk.ASTInterpreter)})},
  1754. args: ["aNode"],
  1755. source: "visitBlockNode: aNode\x0a\x09\x22Do not evaluate the block node.\x0a\x09Instead, put all instructions into a block that we push to the stack for later evaluation\x22\x0a\x09\x0a\x09| block |\x0a\x09\x0a\x09block := AIBlockClosure forContext: self context node: aNode.\x0a\x09\x0a\x09self push: block",
  1756. messageSends: ["forContext:node:", "context", "push:"],
  1757. referencedClasses: ["AIBlockClosure"]
  1758. }),
  1759. smalltalk.ASTInterpreter);
  1760. smalltalk.addMethod(
  1761. smalltalk.method({
  1762. selector: "visitDynamicArrayNode:",
  1763. category: 'visiting',
  1764. fn: function (aNode){
  1765. var self=this;
  1766. var array;
  1767. return smalltalk.withContext(function($ctx1) {
  1768. array=[];
  1769. _st(_st(aNode)._nodes())._do_((function(each){
  1770. return smalltalk.withContext(function($ctx2) {
  1771. return _st(array)._addFirst_(self._pop());
  1772. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1773. self._push_(array);
  1774. return self}, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode,array:array},smalltalk.ASTInterpreter)})},
  1775. args: ["aNode"],
  1776. source: "visitDynamicArrayNode: aNode\x0a\x09| array |\x0a\x09\x0a\x09array := #().\x0a\x09aNode nodes do: [ :each |\x0a\x09\x09array addFirst: self pop ].\x0a\x09\x0a\x09self push: array",
  1777. messageSends: ["do:", "nodes", "addFirst:", "pop", "push:"],
  1778. referencedClasses: []
  1779. }),
  1780. smalltalk.ASTInterpreter);
  1781. smalltalk.addMethod(
  1782. smalltalk.method({
  1783. selector: "visitDynamicDictionaryNode:",
  1784. category: 'visiting',
  1785. fn: function (aNode){
  1786. var self=this;
  1787. var associations,hashedCollection;
  1788. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  1789. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  1790. return smalltalk.withContext(function($ctx1) {
  1791. associations=_st($OrderedCollection())._new();
  1792. $ctx1.sendIdx["new"]=1;
  1793. hashedCollection=_st($HashedCollection())._new();
  1794. _st(_st(aNode)._nodes())._do_((function(each){
  1795. return smalltalk.withContext(function($ctx2) {
  1796. return _st(associations)._add_(self._pop());
  1797. $ctx2.sendIdx["add:"]=1;
  1798. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1799. $ctx1.sendIdx["do:"]=1;
  1800. _st(_st(associations)._reversed())._do_((function(each){
  1801. return smalltalk.withContext(function($ctx2) {
  1802. return _st(hashedCollection)._add_(each);
  1803. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
  1804. self._push_(hashedCollection);
  1805. return self}, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode,associations:associations,hashedCollection:hashedCollection},smalltalk.ASTInterpreter)})},
  1806. args: ["aNode"],
  1807. source: "visitDynamicDictionaryNode: aNode\x0a\x09| associations hashedCollection |\x0a\x09\x0a\x09associations := OrderedCollection new.\x0a\x09hashedCollection := HashedCollection new.\x0a\x09\x0a\x09aNode nodes do: [ :each | \x0a\x09\x09associations add: self pop ].\x0a\x09\x0a\x09associations reversed do: [ :each |\x0a\x09\x09hashedCollection add: each ].\x0a\x09\x0a\x09self push: hashedCollection",
  1808. messageSends: ["new", "do:", "nodes", "add:", "pop", "reversed", "push:"],
  1809. referencedClasses: ["OrderedCollection", "HashedCollection"]
  1810. }),
  1811. smalltalk.ASTInterpreter);
  1812. smalltalk.addMethod(
  1813. smalltalk.method({
  1814. selector: "visitJSStatementNode:",
  1815. category: 'visiting',
  1816. fn: function (aNode){
  1817. var self=this;
  1818. return smalltalk.withContext(function($ctx1) {
  1819. self["@returned"]=true;
  1820. self._returnValue_(self._eval_(_st(aNode)._source()));
  1821. return self}, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1822. args: ["aNode"],
  1823. source: "visitJSStatementNode: aNode\x0a\x09returned := true.\x0a\x09self returnValue: (self eval: aNode source)",
  1824. messageSends: ["returnValue:", "eval:", "source"],
  1825. referencedClasses: []
  1826. }),
  1827. smalltalk.ASTInterpreter);
  1828. smalltalk.addMethod(
  1829. smalltalk.method({
  1830. selector: "visitNode:",
  1831. category: 'visiting',
  1832. fn: function (aNode){
  1833. var self=this;
  1834. return smalltalk.withContext(function($ctx1) {
  1835. return self}, function($ctx1) {$ctx1.fill(self,"visitNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1836. args: ["aNode"],
  1837. source: "visitNode: aNode\x0a\x09\x22Do nothing by default. Especially, do not visit children recursively.\x22",
  1838. messageSends: [],
  1839. referencedClasses: []
  1840. }),
  1841. smalltalk.ASTInterpreter);
  1842. smalltalk.addMethod(
  1843. smalltalk.method({
  1844. selector: "visitReturnNode:",
  1845. category: 'visiting',
  1846. fn: function (aNode){
  1847. var self=this;
  1848. return smalltalk.withContext(function($ctx1) {
  1849. self["@returned"]=true;
  1850. self._returnValue_(self._pop());
  1851. return self}, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1852. args: ["aNode"],
  1853. source: "visitReturnNode: aNode\x0a\x09returned := true.\x0a\x09self returnValue: self pop",
  1854. messageSends: ["returnValue:", "pop"],
  1855. referencedClasses: []
  1856. }),
  1857. smalltalk.ASTInterpreter);
  1858. smalltalk.addMethod(
  1859. smalltalk.method({
  1860. selector: "visitSendNode:",
  1861. category: 'visiting',
  1862. fn: function (aNode){
  1863. var self=this;
  1864. var receiver,args,message,result;
  1865. return smalltalk.withContext(function($ctx1) {
  1866. args=_st(_st(aNode)._arguments())._collect_((function(each){
  1867. return smalltalk.withContext(function($ctx2) {
  1868. return self._pop();
  1869. $ctx2.sendIdx["pop"]=1;
  1870. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1871. receiver=self._pop();
  1872. message=self._messageFromSendNode_arguments_(aNode,_st(args)._reversed());
  1873. result=self._sendMessage_to_superSend_(message,receiver,_st(aNode)._superSend());
  1874. if(smalltalk.assert(_st(_st(aNode)._isCascadeSendNode())._and_((function(){
  1875. return smalltalk.withContext(function($ctx2) {
  1876. return _st(_st(aNode)._isLastChild())._not();
  1877. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})})))){
  1878. self._push_(receiver);
  1879. $ctx1.sendIdx["push:"]=1;
  1880. } else {
  1881. self._push_(result);
  1882. };
  1883. return self}, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode,receiver:receiver,args:args,message:message,result:result},smalltalk.ASTInterpreter)})},
  1884. args: ["aNode"],
  1885. source: "visitSendNode: aNode\x0a\x09| receiver args message result |\x0a\x09\x0a\x09args := aNode arguments collect: [ :each | self pop ].\x0a\x09receiver := self pop.\x0a\x09\x0a\x09message := self\x0a\x09\x09messageFromSendNode: aNode\x0a\x09\x09arguments: args reversed.\x0a\x09\x0a\x09result := self sendMessage: message to: receiver superSend: aNode superSend.\x0a\x09\x0a\x09\x22For cascade sends, push the reciever if the send is not the last one\x22\x0a\x09(aNode isCascadeSendNode and: [ aNode isLastChild not ])\x0a\x09\x09ifTrue: [ self push: receiver ]\x0a\x09\x09ifFalse: [ self push: result ]",
  1886. messageSends: ["collect:", "arguments", "pop", "messageFromSendNode:arguments:", "reversed", "sendMessage:to:superSend:", "superSend", "ifTrue:ifFalse:", "and:", "isCascadeSendNode", "not", "isLastChild", "push:"],
  1887. referencedClasses: []
  1888. }),
  1889. smalltalk.ASTInterpreter);
  1890. smalltalk.addMethod(
  1891. smalltalk.method({
  1892. selector: "visitValueNode:",
  1893. category: 'visiting',
  1894. fn: function (aNode){
  1895. var self=this;
  1896. return smalltalk.withContext(function($ctx1) {
  1897. self._push_(_st(aNode)._value());
  1898. return self}, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1899. args: ["aNode"],
  1900. source: "visitValueNode: aNode\x0a\x09self push: aNode value",
  1901. messageSends: ["push:", "value"],
  1902. referencedClasses: []
  1903. }),
  1904. smalltalk.ASTInterpreter);
  1905. smalltalk.addMethod(
  1906. smalltalk.method({
  1907. selector: "visitVariableNode:",
  1908. category: 'visiting',
  1909. fn: function (aNode){
  1910. var self=this;
  1911. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  1912. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1913. return smalltalk.withContext(function($ctx1) {
  1914. var $2,$1,$5,$6,$4,$3,$9,$8,$11,$10,$12,$13,$14,$16,$15,$17,$18,$19,$20,$7;
  1915. $2=_st(aNode)._binding();
  1916. $ctx1.sendIdx["binding"]=1;
  1917. $1=_st($2)._isUnknownVar();
  1918. if(smalltalk.assert($1)){
  1919. $5=_st($PlatformInterface())._globals();
  1920. $ctx1.sendIdx["globals"]=1;
  1921. $6=_st(aNode)._value();
  1922. $ctx1.sendIdx["value"]=1;
  1923. $4=_st($5)._at_ifAbsent_($6,(function(){
  1924. return smalltalk.withContext(function($ctx2) {
  1925. return self._error_("Unknown variable");
  1926. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1927. $ctx1.sendIdx["at:ifAbsent:"]=1;
  1928. $3=self._push_($4);
  1929. $ctx1.sendIdx["push:"]=1;
  1930. return $3;
  1931. };
  1932. $9=_st(aNode)._binding();
  1933. $8=_st($9)._isInstanceVar();
  1934. if(smalltalk.assert($8)){
  1935. $11=self._context();
  1936. $ctx1.sendIdx["context"]=1;
  1937. $10=_st($11)._receiver();
  1938. $12=_st(aNode)._value();
  1939. $ctx1.sendIdx["value"]=2;
  1940. $7=_st($10)._instVarAt_($12);
  1941. } else {
  1942. $13=self._context();
  1943. $14=_st(aNode)._value();
  1944. $ctx1.sendIdx["value"]=3;
  1945. $7=_st($13)._localAt_ifAbsent_($14,(function(){
  1946. return smalltalk.withContext(function($ctx2) {
  1947. $16=_st(aNode)._value();
  1948. $ctx2.sendIdx["value"]=4;
  1949. $15=_st($16)._isCapitalized();
  1950. if(smalltalk.assert($15)){
  1951. $17=_st($Smalltalk())._current();
  1952. $18=_st(aNode)._value();
  1953. $ctx2.sendIdx["value"]=5;
  1954. return _st($17)._at_ifAbsent_($18,(function(){
  1955. return smalltalk.withContext(function($ctx3) {
  1956. $19=_st($PlatformInterface())._globals();
  1957. $20=_st(aNode)._value();
  1958. return _st($19)._at_($20);
  1959. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,7)})}));
  1960. };
  1961. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)})}));
  1962. };
  1963. self._push_($7);
  1964. return self}, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1965. args: ["aNode"],
  1966. source: "visitVariableNode: aNode\x0a\x09aNode binding isUnknownVar ifTrue: [\x0a\x09\x09^ self push: (PlatformInterface globals at: aNode value ifAbsent: [ self error: 'Unknown variable' ]) ].\x0a\x09\x09\x0a\x09self push: (aNode binding isInstanceVar\x0a\x09\x09ifTrue: [ self context receiver instVarAt: aNode value ]\x0a\x09\x09ifFalse: [ self context \x0a\x09\x09\x09localAt: aNode value\x0a\x09\x09\x09ifAbsent: [\x0a\x09\x09\x09\x09aNode value isCapitalized\x0a\x09\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x09Smalltalk current \x0a\x09\x09\x09\x09\x09\x09\x09at: aNode value \x0a\x09\x09\x09\x09\x09\x09\x09ifAbsent: [ PlatformInterface globals at: aNode value ]]]])",
  1967. messageSends: ["ifTrue:", "isUnknownVar", "binding", "push:", "at:ifAbsent:", "globals", "value", "error:", "ifTrue:ifFalse:", "isInstanceVar", "instVarAt:", "receiver", "context", "localAt:ifAbsent:", "isCapitalized", "current", "at:"],
  1968. referencedClasses: ["PlatformInterface", "Smalltalk"]
  1969. }),
  1970. smalltalk.ASTInterpreter);
  1971. smalltalk.addClass('ASTInterpreterError', smalltalk.Error, [], 'Compiler-Interpreter');
  1972. smalltalk.ASTInterpreterError.comment="I get signaled when an AST interpreter is unable to interpret a node.";
  1973. smalltalk.addClass('ASTPCNodeVisitor', smalltalk.NodeVisitor, ['context', 'index', 'selector', 'currentNode'], 'Compiler-Interpreter');
  1974. smalltalk.ASTPCNodeVisitor.comment="I visit an AST until I get to the current node for the `context` and answer it.\x0a\x0a## API\x0a\x0aMy instances must be filled with a context object using `#context:`.\x0a\x0aAfter visiting the AST the current node is answered by `#currentNode`";
  1975. smalltalk.addMethod(
  1976. smalltalk.method({
  1977. selector: "context",
  1978. category: 'accessing',
  1979. fn: function (){
  1980. var self=this;
  1981. return smalltalk.withContext(function($ctx1) {
  1982. var $1;
  1983. $1=self["@context"];
  1984. return $1;
  1985. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTPCNodeVisitor)})},
  1986. args: [],
  1987. source: "context\x0a\x09^ context",
  1988. messageSends: [],
  1989. referencedClasses: []
  1990. }),
  1991. smalltalk.ASTPCNodeVisitor);
  1992. smalltalk.addMethod(
  1993. smalltalk.method({
  1994. selector: "context:",
  1995. category: 'accessing',
  1996. fn: function (aContext){
  1997. var self=this;
  1998. return smalltalk.withContext(function($ctx1) {
  1999. self["@context"]=aContext;
  2000. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTPCNodeVisitor)})},
  2001. args: ["aContext"],
  2002. source: "context: aContext\x0a\x09context := aContext",
  2003. messageSends: [],
  2004. referencedClasses: []
  2005. }),
  2006. smalltalk.ASTPCNodeVisitor);
  2007. smalltalk.addMethod(
  2008. smalltalk.method({
  2009. selector: "currentNode",
  2010. category: 'accessing',
  2011. fn: function (){
  2012. var self=this;
  2013. return smalltalk.withContext(function($ctx1) {
  2014. var $1;
  2015. $1=self["@currentNode"];
  2016. return $1;
  2017. }, function($ctx1) {$ctx1.fill(self,"currentNode",{},smalltalk.ASTPCNodeVisitor)})},
  2018. args: [],
  2019. source: "currentNode\x0a\x09^ currentNode",
  2020. messageSends: [],
  2021. referencedClasses: []
  2022. }),
  2023. smalltalk.ASTPCNodeVisitor);
  2024. smalltalk.addMethod(
  2025. smalltalk.method({
  2026. selector: "increaseIndex",
  2027. category: 'accessing',
  2028. fn: function (){
  2029. var self=this;
  2030. return smalltalk.withContext(function($ctx1) {
  2031. self["@index"]=_st(self._index()).__plus((1));
  2032. return self}, function($ctx1) {$ctx1.fill(self,"increaseIndex",{},smalltalk.ASTPCNodeVisitor)})},
  2033. args: [],
  2034. source: "increaseIndex\x0a\x09index := self index + 1",
  2035. messageSends: ["+", "index"],
  2036. referencedClasses: []
  2037. }),
  2038. smalltalk.ASTPCNodeVisitor);
  2039. smalltalk.addMethod(
  2040. smalltalk.method({
  2041. selector: "index",
  2042. category: 'accessing',
  2043. fn: function (){
  2044. var self=this;
  2045. return smalltalk.withContext(function($ctx1) {
  2046. var $1;
  2047. if(($receiver = self["@index"]) == nil || $receiver == null){
  2048. self["@index"]=(0);
  2049. $1=self["@index"];
  2050. } else {
  2051. $1=self["@index"];
  2052. };
  2053. return $1;
  2054. }, function($ctx1) {$ctx1.fill(self,"index",{},smalltalk.ASTPCNodeVisitor)})},
  2055. args: [],
  2056. source: "index\x0a\x09^ index ifNil: [ index := 0 ]",
  2057. messageSends: ["ifNil:"],
  2058. referencedClasses: []
  2059. }),
  2060. smalltalk.ASTPCNodeVisitor);
  2061. smalltalk.addMethod(
  2062. smalltalk.method({
  2063. selector: "selector",
  2064. category: 'accessing',
  2065. fn: function (){
  2066. var self=this;
  2067. return smalltalk.withContext(function($ctx1) {
  2068. var $1;
  2069. $1=self["@selector"];
  2070. return $1;
  2071. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.ASTPCNodeVisitor)})},
  2072. args: [],
  2073. source: "selector\x0a\x09^ selector",
  2074. messageSends: [],
  2075. referencedClasses: []
  2076. }),
  2077. smalltalk.ASTPCNodeVisitor);
  2078. smalltalk.addMethod(
  2079. smalltalk.method({
  2080. selector: "selector:",
  2081. category: 'accessing',
  2082. fn: function (aString){
  2083. var self=this;
  2084. return smalltalk.withContext(function($ctx1) {
  2085. self["@selector"]=aString;
  2086. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.ASTPCNodeVisitor)})},
  2087. args: ["aString"],
  2088. source: "selector: aString\x0a\x09selector := aString",
  2089. messageSends: [],
  2090. referencedClasses: []
  2091. }),
  2092. smalltalk.ASTPCNodeVisitor);
  2093. smalltalk.addMethod(
  2094. smalltalk.method({
  2095. selector: "visitJSStatementNode:",
  2096. category: 'visiting',
  2097. fn: function (aNode){
  2098. var self=this;
  2099. return smalltalk.withContext(function($ctx1) {
  2100. self["@currentNode"]=aNode;
  2101. return self}, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.ASTPCNodeVisitor)})},
  2102. args: ["aNode"],
  2103. source: "visitJSStatementNode: aNode\x0a\x09\x22If a JSStatementNode is encountered, it always is the current node.\x0a\x09Stop visiting the AST there\x22\x0a\x09\x0a\x09currentNode := aNode",
  2104. messageSends: [],
  2105. referencedClasses: []
  2106. }),
  2107. smalltalk.ASTPCNodeVisitor);
  2108. smalltalk.addMethod(
  2109. smalltalk.method({
  2110. selector: "visitSendNode:",
  2111. category: 'visiting',
  2112. fn: function (aNode){
  2113. var self=this;
  2114. var sendIndex;
  2115. return smalltalk.withContext(function($ctx1) {
  2116. var $1,$2,$4,$5,$3,$7,$6,$9,$8;
  2117. $1=self._context();
  2118. $2=self._selector();
  2119. $ctx1.sendIdx["selector"]=1;
  2120. sendIndex=_st($1)._sendIndexAt_($2);
  2121. smalltalk.ASTPCNodeVisitor.superclass.fn.prototype._visitSendNode_.apply(_st(self), [aNode]);
  2122. $4=self._selector();
  2123. $ctx1.sendIdx["selector"]=2;
  2124. $5=_st(aNode)._selector();
  2125. $3=_st($4).__eq($5);
  2126. if(smalltalk.assert($3)){
  2127. $7=self._index();
  2128. $ctx1.sendIdx["index"]=1;
  2129. $6=_st($7).__lt(sendIndex);
  2130. if(! smalltalk.assert($6)){
  2131. $9=self._index();
  2132. $8=_st($9).__gt(sendIndex);
  2133. if(! smalltalk.assert($8)){
  2134. self["@currentNode"]=aNode;
  2135. self["@currentNode"];
  2136. };
  2137. };
  2138. self._increaseIndex();
  2139. };
  2140. return self}, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode,sendIndex:sendIndex},smalltalk.ASTPCNodeVisitor)})},
  2141. args: ["aNode"],
  2142. source: "visitSendNode: aNode\x0a\x09| sendIndex |\x0a\x09sendIndex := self context sendIndexAt: self selector.\x0a\x09\x0a\x09super visitSendNode: aNode.\x0a\x09\x0a\x09self selector = aNode selector ifTrue: [\x0a\x09\x09self index < sendIndex ifFalse: [ \x0a\x09\x09\x09self index > sendIndex ifFalse: [ currentNode := aNode ] ].\x0a\x09\x09self increaseIndex ]",
  2143. messageSends: ["sendIndexAt:", "context", "selector", "visitSendNode:", "ifTrue:", "=", "ifFalse:", "<", "index", ">", "increaseIndex"],
  2144. referencedClasses: []
  2145. }),
  2146. smalltalk.ASTPCNodeVisitor);
  2147. smalltalk.addMethod(
  2148. smalltalk.method({
  2149. selector: "isSteppingNode",
  2150. category: '*Compiler-Interpreter',
  2151. fn: function (){
  2152. var self=this;
  2153. return smalltalk.withContext(function($ctx1) {
  2154. return false;
  2155. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.Node)})},
  2156. args: [],
  2157. source: "isSteppingNode\x0a\x09^ false",
  2158. messageSends: [],
  2159. referencedClasses: []
  2160. }),
  2161. smalltalk.Node);
  2162. smalltalk.addMethod(
  2163. smalltalk.method({
  2164. selector: "isSteppingNode",
  2165. category: '*Compiler-Interpreter',
  2166. fn: function (){
  2167. var self=this;
  2168. return smalltalk.withContext(function($ctx1) {
  2169. return true;
  2170. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.AssignmentNode)})},
  2171. args: [],
  2172. source: "isSteppingNode\x0a\x09^ true",
  2173. messageSends: [],
  2174. referencedClasses: []
  2175. }),
  2176. smalltalk.AssignmentNode);
  2177. smalltalk.addMethod(
  2178. smalltalk.method({
  2179. selector: "isSteppingNode",
  2180. category: '*Compiler-Interpreter',
  2181. fn: function (){
  2182. var self=this;
  2183. return smalltalk.withContext(function($ctx1) {
  2184. return true;
  2185. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.BlockNode)})},
  2186. args: [],
  2187. source: "isSteppingNode\x0a\x09^ true",
  2188. messageSends: [],
  2189. referencedClasses: []
  2190. }),
  2191. smalltalk.BlockNode);
  2192. smalltalk.addMethod(
  2193. smalltalk.method({
  2194. selector: "isSteppingNode",
  2195. category: '*Compiler-Interpreter',
  2196. fn: function (){
  2197. var self=this;
  2198. return smalltalk.withContext(function($ctx1) {
  2199. return true;
  2200. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.DynamicArrayNode)})},
  2201. args: [],
  2202. source: "isSteppingNode\x0a\x09^ true",
  2203. messageSends: [],
  2204. referencedClasses: []
  2205. }),
  2206. smalltalk.DynamicArrayNode);
  2207. smalltalk.addMethod(
  2208. smalltalk.method({
  2209. selector: "isSteppingNode",
  2210. category: '*Compiler-Interpreter',
  2211. fn: function (){
  2212. var self=this;
  2213. return smalltalk.withContext(function($ctx1) {
  2214. return true;
  2215. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.DynamicDictionaryNode)})},
  2216. args: [],
  2217. source: "isSteppingNode\x0a\x09^ true",
  2218. messageSends: [],
  2219. referencedClasses: []
  2220. }),
  2221. smalltalk.DynamicDictionaryNode);
  2222. smalltalk.addMethod(
  2223. smalltalk.method({
  2224. selector: "isSteppingNode",
  2225. category: '*Compiler-Interpreter',
  2226. fn: function (){
  2227. var self=this;
  2228. return smalltalk.withContext(function($ctx1) {
  2229. return true;
  2230. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.JSStatementNode)})},
  2231. args: [],
  2232. source: "isSteppingNode\x0a\x09^ true",
  2233. messageSends: [],
  2234. referencedClasses: []
  2235. }),
  2236. smalltalk.JSStatementNode);
  2237. smalltalk.addMethod(
  2238. smalltalk.method({
  2239. selector: "isSteppingNode",
  2240. category: '*Compiler-Interpreter',
  2241. fn: function (){
  2242. var self=this;
  2243. return smalltalk.withContext(function($ctx1) {
  2244. return true;
  2245. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.SendNode)})},
  2246. args: [],
  2247. source: "isSteppingNode\x0a\x09^ true",
  2248. messageSends: [],
  2249. referencedClasses: []
  2250. }),
  2251. smalltalk.SendNode);
  2252. });