Compiler-Interpreter.js 82 KB

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