Compiler-Interpreter.js 76 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048
  1. define(["smalltalk","nil","_st"], function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Compiler-Interpreter');
  3. smalltalk.addClass('AIContext', smalltalk.NodeVisitor, ['methodContext', 'outerContext', 'pc', 'locals', 'method'], 'Compiler-Interpreter');
  4. 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)";
  5. smalltalk.addMethod(
  6. smalltalk.method({
  7. selector: "asString",
  8. category: 'converting',
  9. fn: function (){
  10. var self=this;
  11. return smalltalk.withContext(function($ctx1) {
  12. var $1;
  13. $1=_st(self["@methodContext"])._asString();
  14. return $1;
  15. }, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.AIContext)})},
  16. args: [],
  17. source: "asString\x0a\x09^ methodContext asString",
  18. messageSends: ["asString"],
  19. referencedClasses: []
  20. }),
  21. smalltalk.AIContext);
  22. smalltalk.addMethod(
  23. smalltalk.method({
  24. selector: "home",
  25. category: 'accessing',
  26. fn: function (){
  27. var self=this;
  28. return smalltalk.withContext(function($ctx1) {
  29. var $2,$1;
  30. $2=self._isBlockContext();
  31. if(smalltalk.assert($2)){
  32. $1=_st(self._outerContext())._methodContext();
  33. } else {
  34. $1=self;
  35. };
  36. return $1;
  37. }, function($ctx1) {$ctx1.fill(self,"home",{},smalltalk.AIContext)})},
  38. args: [],
  39. source: "home\x0a\x09^ self isBlockContext \x0a\x09\x09ifTrue: [ self outerContext methodContext ]\x0a\x09\x09ifFalse: [ self ]",
  40. messageSends: ["ifTrue:ifFalse:", "methodContext", "outerContext", "isBlockContext"],
  41. referencedClasses: []
  42. }),
  43. smalltalk.AIContext);
  44. smalltalk.addMethod(
  45. smalltalk.method({
  46. selector: "initializeFromMethodContext:",
  47. category: 'initialization',
  48. fn: function (aMethodContext){
  49. var self=this;
  50. return smalltalk.withContext(function($ctx1) {
  51. var $1,$2;
  52. self["@methodContext"]=aMethodContext;
  53. self._pc_(_st(aMethodContext)._pc());
  54. self._receiver_(_st(aMethodContext)._receiver());
  55. self._method_(_st(aMethodContext)._method());
  56. $1=_st(aMethodContext)._outerContext();
  57. if(($receiver = $1) == nil || $receiver == undefined){
  58. $1;
  59. } else {
  60. var outer;
  61. outer=$receiver;
  62. $2=_st(outer)._methodContext();
  63. if(($receiver = $2) == nil || $receiver == undefined){
  64. $2;
  65. } else {
  66. self._outerContext_(_st(self._class())._fromMethodContext_(_st(aMethodContext)._outerContext()));
  67. };
  68. _st(_st(aMethodContext)._locals())._keysAndValuesDo_((function(key,value){
  69. return smalltalk.withContext(function($ctx2) {
  70. return _st(self._locals())._at_put_(key,value);
  71. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1)})}));
  72. };
  73. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromMethodContext:",{aMethodContext:aMethodContext},smalltalk.AIContext)})},
  74. args: ["aMethodContext"],
  75. source: "initializeFromMethodContext: aMethodContext\x0a\x09methodContext := aMethodContext.\x0a\x09\x0a\x09self pc: aMethodContext pc.\x0a\x09self receiver: aMethodContext receiver.\x0a\x09self method: aMethodContext method.\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 ] ]",
  76. messageSends: ["pc:", "pc", "receiver:", "receiver", "method:", "method", "ifNotNil:", "outerContext:", "fromMethodContext:", "outerContext", "class", "methodContext", "keysAndValuesDo:", "at:put:", "locals"],
  77. referencedClasses: []
  78. }),
  79. smalltalk.AIContext);
  80. smalltalk.addMethod(
  81. smalltalk.method({
  82. selector: "initializeLocals",
  83. category: 'initialization',
  84. fn: function (){
  85. var self=this;
  86. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  87. return smalltalk.withContext(function($ctx1) {
  88. self["@locals"]=_st($Dictionary())._new();
  89. _st(self["@locals"])._at_put_("thisContext",self);
  90. return self}, function($ctx1) {$ctx1.fill(self,"initializeLocals",{},smalltalk.AIContext)})},
  91. args: [],
  92. source: "initializeLocals\x0a\x09locals := Dictionary new.\x0a\x09locals at: 'thisContext' put: self.",
  93. messageSends: ["new", "at:put:"],
  94. referencedClasses: ["Dictionary"]
  95. }),
  96. smalltalk.AIContext);
  97. smalltalk.addMethod(
  98. smalltalk.method({
  99. selector: "isBlockContext",
  100. category: 'testing',
  101. fn: function (){
  102. var self=this;
  103. return smalltalk.withContext(function($ctx1) {
  104. var $1;
  105. $1=_st(self["@methodContext"])._isBlockContext();
  106. return $1;
  107. }, function($ctx1) {$ctx1.fill(self,"isBlockContext",{},smalltalk.AIContext)})},
  108. args: [],
  109. source: "isBlockContext\x0a\x09^ methodContext isBlockContext",
  110. messageSends: ["isBlockContext"],
  111. referencedClasses: []
  112. }),
  113. smalltalk.AIContext);
  114. smalltalk.addMethod(
  115. smalltalk.method({
  116. selector: "localAt:",
  117. category: 'accessing',
  118. fn: function (aString){
  119. var self=this;
  120. return smalltalk.withContext(function($ctx1) {
  121. var $1;
  122. $1=_st(self._locals())._at_ifAbsent_(aString,(function(){
  123. return smalltalk.withContext(function($ctx2) {
  124. return nil;
  125. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  126. return $1;
  127. }, function($ctx1) {$ctx1.fill(self,"localAt:",{aString:aString},smalltalk.AIContext)})},
  128. args: ["aString"],
  129. source: "localAt: aString\x0a\x09^ self locals at: aString ifAbsent: [ nil ]",
  130. messageSends: ["at:ifAbsent:", "locals"],
  131. referencedClasses: []
  132. }),
  133. smalltalk.AIContext);
  134. smalltalk.addMethod(
  135. smalltalk.method({
  136. selector: "localAt:put:",
  137. category: 'accessing',
  138. fn: function (aString,anObject){
  139. var self=this;
  140. return smalltalk.withContext(function($ctx1) {
  141. _st(self._locals())._at_put_(aString,anObject);
  142. return self}, function($ctx1) {$ctx1.fill(self,"localAt:put:",{aString:aString,anObject:anObject},smalltalk.AIContext)})},
  143. args: ["aString", "anObject"],
  144. source: "localAt: aString put: anObject\x0a\x09self locals at: aString put: anObject",
  145. messageSends: ["at:put:", "locals"],
  146. referencedClasses: []
  147. }),
  148. smalltalk.AIContext);
  149. smalltalk.addMethod(
  150. smalltalk.method({
  151. selector: "locals",
  152. category: 'accessing',
  153. fn: function (){
  154. var self=this;
  155. return smalltalk.withContext(function($ctx1) {
  156. var $1,$2;
  157. $1=self["@locals"];
  158. if(($receiver = $1) == nil || $receiver == undefined){
  159. self._initializeLocals();
  160. } else {
  161. $1;
  162. };
  163. $2=self["@locals"];
  164. return $2;
  165. }, function($ctx1) {$ctx1.fill(self,"locals",{},smalltalk.AIContext)})},
  166. args: [],
  167. source: "locals\x0a\x09locals ifNil: [ self initializeLocals ].\x0a\x09\x0a\x09^ locals",
  168. messageSends: ["ifNil:", "initializeLocals"],
  169. referencedClasses: []
  170. }),
  171. smalltalk.AIContext);
  172. smalltalk.addMethod(
  173. smalltalk.method({
  174. selector: "method",
  175. category: 'accessing',
  176. fn: function (){
  177. var self=this;
  178. return smalltalk.withContext(function($ctx1) {
  179. var $1;
  180. $1=self["@method"];
  181. return $1;
  182. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.AIContext)})},
  183. args: [],
  184. source: "method\x0a\x09^ method",
  185. messageSends: [],
  186. referencedClasses: []
  187. }),
  188. smalltalk.AIContext);
  189. smalltalk.addMethod(
  190. smalltalk.method({
  191. selector: "method:",
  192. category: 'accessing',
  193. fn: function (aCompiledMethod){
  194. var self=this;
  195. return smalltalk.withContext(function($ctx1) {
  196. self["@method"]=aCompiledMethod;
  197. return self}, function($ctx1) {$ctx1.fill(self,"method:",{aCompiledMethod:aCompiledMethod},smalltalk.AIContext)})},
  198. args: ["aCompiledMethod"],
  199. source: "method: aCompiledMethod\x0a\x09method := aCompiledMethod",
  200. messageSends: [],
  201. referencedClasses: []
  202. }),
  203. smalltalk.AIContext);
  204. smalltalk.addMethod(
  205. smalltalk.method({
  206. selector: "outerContext",
  207. category: 'accessing',
  208. fn: function (){
  209. var self=this;
  210. return smalltalk.withContext(function($ctx1) {
  211. var $1;
  212. $1=self["@outerContext"];
  213. return $1;
  214. }, function($ctx1) {$ctx1.fill(self,"outerContext",{},smalltalk.AIContext)})},
  215. args: [],
  216. source: "outerContext\x0a\x09^ outerContext",
  217. messageSends: [],
  218. referencedClasses: []
  219. }),
  220. smalltalk.AIContext);
  221. smalltalk.addMethod(
  222. smalltalk.method({
  223. selector: "outerContext:",
  224. category: 'accessing',
  225. fn: function (anAIContext){
  226. var self=this;
  227. return smalltalk.withContext(function($ctx1) {
  228. self["@outerContext"]=anAIContext;
  229. return self}, function($ctx1) {$ctx1.fill(self,"outerContext:",{anAIContext:anAIContext},smalltalk.AIContext)})},
  230. args: ["anAIContext"],
  231. source: "outerContext: anAIContext\x0a\x09outerContext := anAIContext",
  232. messageSends: [],
  233. referencedClasses: []
  234. }),
  235. smalltalk.AIContext);
  236. smalltalk.addMethod(
  237. smalltalk.method({
  238. selector: "pc",
  239. category: 'accessing',
  240. fn: function (){
  241. var self=this;
  242. return smalltalk.withContext(function($ctx1) {
  243. var $2,$1;
  244. $2=self["@pc"];
  245. if(($receiver = $2) == nil || $receiver == undefined){
  246. self["@pc"]=(0);
  247. $1=self["@pc"];
  248. } else {
  249. $1=$2;
  250. };
  251. return $1;
  252. }, function($ctx1) {$ctx1.fill(self,"pc",{},smalltalk.AIContext)})},
  253. args: [],
  254. source: "pc\x0a\x09^ pc ifNil: [ pc := 0 ]",
  255. messageSends: ["ifNil:"],
  256. referencedClasses: []
  257. }),
  258. smalltalk.AIContext);
  259. smalltalk.addMethod(
  260. smalltalk.method({
  261. selector: "pc:",
  262. category: 'accessing',
  263. fn: function (anInteger){
  264. var self=this;
  265. return smalltalk.withContext(function($ctx1) {
  266. self["@pc"]=anInteger;
  267. return self}, function($ctx1) {$ctx1.fill(self,"pc:",{anInteger:anInteger},smalltalk.AIContext)})},
  268. args: ["anInteger"],
  269. source: "pc: anInteger\x0a\x09pc := anInteger",
  270. messageSends: [],
  271. referencedClasses: []
  272. }),
  273. smalltalk.AIContext);
  274. smalltalk.addMethod(
  275. smalltalk.method({
  276. selector: "receiver",
  277. category: 'accessing',
  278. fn: function (){
  279. var self=this;
  280. return smalltalk.withContext(function($ctx1) {
  281. var $1;
  282. $1=self._localAt_("self");
  283. return $1;
  284. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.AIContext)})},
  285. args: [],
  286. source: "receiver\x0a\x09^ self localAt: 'self'",
  287. messageSends: ["localAt:"],
  288. referencedClasses: []
  289. }),
  290. smalltalk.AIContext);
  291. smalltalk.addMethod(
  292. smalltalk.method({
  293. selector: "receiver:",
  294. category: 'accessing',
  295. fn: function (anObject){
  296. var self=this;
  297. return smalltalk.withContext(function($ctx1) {
  298. self._localAt_put_("self",anObject);
  299. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.AIContext)})},
  300. args: ["anObject"],
  301. source: "receiver: anObject\x0a\x09self localAt: 'self' put: anObject",
  302. messageSends: ["localAt:put:"],
  303. referencedClasses: []
  304. }),
  305. smalltalk.AIContext);
  306. smalltalk.addMethod(
  307. smalltalk.method({
  308. selector: "selector",
  309. category: 'accessing',
  310. fn: function (){
  311. var self=this;
  312. return smalltalk.withContext(function($ctx1) {
  313. var $2,$1;
  314. $2=self._method();
  315. if(($receiver = $2) == nil || $receiver == undefined){
  316. $1=$2;
  317. } else {
  318. $1=_st(self._method())._selector();
  319. };
  320. return $1;
  321. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.AIContext)})},
  322. args: [],
  323. source: "selector\x0a\x09^ self method\x0a\x09\x09ifNotNil: [ self method selector ]",
  324. messageSends: ["ifNotNil:", "selector", "method"],
  325. referencedClasses: []
  326. }),
  327. smalltalk.AIContext);
  328. smalltalk.addMethod(
  329. smalltalk.method({
  330. selector: "fromMethodContext:",
  331. category: 'instance creation',
  332. fn: function (aMethodContext){
  333. var self=this;
  334. return smalltalk.withContext(function($ctx1) {
  335. var $2,$3,$1;
  336. $2=self._new();
  337. _st($2)._initializeFromMethodContext_(aMethodContext);
  338. $3=_st($2)._yourself();
  339. $1=$3;
  340. return $1;
  341. }, function($ctx1) {$ctx1.fill(self,"fromMethodContext:",{aMethodContext:aMethodContext},smalltalk.AIContext.klass)})},
  342. args: ["aMethodContext"],
  343. source: "fromMethodContext: aMethodContext\x0a\x09^ self new\x0a\x09\x09initializeFromMethodContext: aMethodContext;\x0a\x09\x09yourself",
  344. messageSends: ["initializeFromMethodContext:", "new", "yourself"],
  345. referencedClasses: []
  346. }),
  347. smalltalk.AIContext.klass);
  348. smalltalk.addClass('ASTDebugger', smalltalk.Object, ['interpreter', 'context'], 'Compiler-Interpreter');
  349. 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.";
  350. smalltalk.addMethod(
  351. smalltalk.method({
  352. selector: "atEnd",
  353. category: 'testing',
  354. fn: function (){
  355. var self=this;
  356. return smalltalk.withContext(function($ctx1) {
  357. var $1;
  358. $1=_st(self._interpreter())._atEnd();
  359. return $1;
  360. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.ASTDebugger)})},
  361. args: [],
  362. source: "atEnd\x0a\x09^ self interpreter atEnd",
  363. messageSends: ["atEnd", "interpreter"],
  364. referencedClasses: []
  365. }),
  366. smalltalk.ASTDebugger);
  367. smalltalk.addMethod(
  368. smalltalk.method({
  369. selector: "buildAST",
  370. category: 'initialization',
  371. fn: function (){
  372. var self=this;
  373. var ast;
  374. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  375. function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
  376. return smalltalk.withContext(function($ctx1) {
  377. var $1;
  378. ast=_st(_st($Smalltalk())._current())._parse_(_st(self._method())._source());
  379. _st(_st($SemanticAnalyzer())._on_(_st(_st(self._context())._receiver())._class()))._visit_(ast);
  380. $1=ast;
  381. return $1;
  382. }, function($ctx1) {$ctx1.fill(self,"buildAST",{ast:ast},smalltalk.ASTDebugger)})},
  383. args: [],
  384. 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",
  385. messageSends: ["parse:", "source", "method", "current", "visit:", "on:", "class", "receiver", "context"],
  386. referencedClasses: ["Smalltalk", "SemanticAnalyzer"]
  387. }),
  388. smalltalk.ASTDebugger);
  389. smalltalk.addMethod(
  390. smalltalk.method({
  391. selector: "context",
  392. category: 'accessing',
  393. fn: function (){
  394. var self=this;
  395. return smalltalk.withContext(function($ctx1) {
  396. var $1;
  397. $1=self["@context"];
  398. return $1;
  399. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTDebugger)})},
  400. args: [],
  401. source: "context\x0a\x09^ context",
  402. messageSends: [],
  403. referencedClasses: []
  404. }),
  405. smalltalk.ASTDebugger);
  406. smalltalk.addMethod(
  407. smalltalk.method({
  408. selector: "context:",
  409. category: 'accessing',
  410. fn: function (aContext){
  411. var self=this;
  412. return smalltalk.withContext(function($ctx1) {
  413. self["@context"]=aContext;
  414. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTDebugger)})},
  415. args: ["aContext"],
  416. source: "context: aContext\x0a\x09context := aContext",
  417. messageSends: [],
  418. referencedClasses: []
  419. }),
  420. smalltalk.ASTDebugger);
  421. smalltalk.addMethod(
  422. smalltalk.method({
  423. selector: "defaultInterpreterClass",
  424. category: 'defaults',
  425. fn: function (){
  426. var self=this;
  427. function $ASTSteppingInterpreter(){return smalltalk.ASTSteppingInterpreter||(typeof ASTSteppingInterpreter=="undefined"?nil:ASTSteppingInterpreter)}
  428. return smalltalk.withContext(function($ctx1) {
  429. var $1;
  430. $1=$ASTSteppingInterpreter();
  431. return $1;
  432. }, function($ctx1) {$ctx1.fill(self,"defaultInterpreterClass",{},smalltalk.ASTDebugger)})},
  433. args: [],
  434. source: "defaultInterpreterClass\x0a\x09^ ASTSteppingInterpreter",
  435. messageSends: [],
  436. referencedClasses: ["ASTSteppingInterpreter"]
  437. }),
  438. smalltalk.ASTDebugger);
  439. smalltalk.addMethod(
  440. smalltalk.method({
  441. selector: "initializeInterpreter",
  442. category: 'initialization',
  443. fn: function (){
  444. var self=this;
  445. var ast,next;
  446. function $ASTPCNodeVisitor(){return smalltalk.ASTPCNodeVisitor||(typeof ASTPCNodeVisitor=="undefined"?nil:ASTPCNodeVisitor)}
  447. return smalltalk.withContext(function($ctx1) {
  448. var $1,$2;
  449. ast=self._buildAST();
  450. $1=_st($ASTPCNodeVisitor())._new();
  451. _st($1)._context_(self._context());
  452. _st($1)._visit_(ast);
  453. $2=_st($1)._currentNode();
  454. next=$2;
  455. _st(self._interpreter())._interpret_(next);
  456. return self}, function($ctx1) {$ctx1.fill(self,"initializeInterpreter",{ast:ast,next:next},smalltalk.ASTDebugger)})},
  457. args: [],
  458. 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 interpret: next",
  459. messageSends: ["buildAST", "context:", "context", "new", "visit:", "currentNode", "interpret:", "interpreter"],
  460. referencedClasses: ["ASTPCNodeVisitor"]
  461. }),
  462. smalltalk.ASTDebugger);
  463. smalltalk.addMethod(
  464. smalltalk.method({
  465. selector: "initializeWithContext:",
  466. category: 'initialization',
  467. fn: function (aContext){
  468. var self=this;
  469. return smalltalk.withContext(function($ctx1) {
  470. self._context_(aContext);
  471. self._initializeInterpreter();
  472. return self}, function($ctx1) {$ctx1.fill(self,"initializeWithContext:",{aContext:aContext},smalltalk.ASTDebugger)})},
  473. args: ["aContext"],
  474. source: "initializeWithContext: aContext\x0a\x09\x22TODO: do we need to handle block contexts?\x22\x0a\x09\x0a\x09self context: aContext.\x0a\x09self initializeInterpreter",
  475. messageSends: ["context:", "initializeInterpreter"],
  476. referencedClasses: []
  477. }),
  478. smalltalk.ASTDebugger);
  479. smalltalk.addMethod(
  480. smalltalk.method({
  481. selector: "interpreter",
  482. category: 'accessing',
  483. fn: function (){
  484. var self=this;
  485. return smalltalk.withContext(function($ctx1) {
  486. var $2,$1;
  487. $2=self["@interpreter"];
  488. if(($receiver = $2) == nil || $receiver == undefined){
  489. self["@interpreter"]=_st(self._defaultInterpreterClass())._new();
  490. $1=self["@interpreter"];
  491. } else {
  492. $1=$2;
  493. };
  494. return $1;
  495. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.ASTDebugger)})},
  496. args: [],
  497. source: "interpreter\x0a\x09^ interpreter ifNil: [ interpreter := self defaultInterpreterClass new ]",
  498. messageSends: ["ifNil:", "new", "defaultInterpreterClass"],
  499. referencedClasses: []
  500. }),
  501. smalltalk.ASTDebugger);
  502. smalltalk.addMethod(
  503. smalltalk.method({
  504. selector: "interpreter:",
  505. category: 'accessing',
  506. fn: function (anInterpreter){
  507. var self=this;
  508. return smalltalk.withContext(function($ctx1) {
  509. self["@interpreter"]=anInterpreter;
  510. return self}, function($ctx1) {$ctx1.fill(self,"interpreter:",{anInterpreter:anInterpreter},smalltalk.ASTDebugger)})},
  511. args: ["anInterpreter"],
  512. source: "interpreter: anInterpreter\x0a\x09interpreter := anInterpreter",
  513. messageSends: [],
  514. referencedClasses: []
  515. }),
  516. smalltalk.ASTDebugger);
  517. smalltalk.addMethod(
  518. smalltalk.method({
  519. selector: "method",
  520. category: 'accessing',
  521. fn: function (){
  522. var self=this;
  523. return smalltalk.withContext(function($ctx1) {
  524. var $1;
  525. $1=_st(self._context())._method();
  526. return $1;
  527. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.ASTDebugger)})},
  528. args: [],
  529. source: "method\x0a\x09^ self context method",
  530. messageSends: ["method", "context"],
  531. referencedClasses: []
  532. }),
  533. smalltalk.ASTDebugger);
  534. smalltalk.addMethod(
  535. smalltalk.method({
  536. selector: "nextNode",
  537. category: 'accessing',
  538. fn: function (){
  539. var self=this;
  540. return smalltalk.withContext(function($ctx1) {
  541. var $1;
  542. $1=_st(self._interpreter())._nextNode();
  543. return $1;
  544. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.ASTDebugger)})},
  545. args: [],
  546. source: "nextNode\x0a\x09^ self interpreter nextNode",
  547. messageSends: ["nextNode", "interpreter"],
  548. referencedClasses: []
  549. }),
  550. smalltalk.ASTDebugger);
  551. smalltalk.addMethod(
  552. smalltalk.method({
  553. selector: "proceed",
  554. category: 'stepping',
  555. fn: function (){
  556. var self=this;
  557. return smalltalk.withContext(function($ctx1) {
  558. self._shouldBeImplemented();
  559. return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.ASTDebugger)})},
  560. args: [],
  561. source: "proceed\x0a\x09self shouldBeImplemented",
  562. messageSends: ["shouldBeImplemented"],
  563. referencedClasses: []
  564. }),
  565. smalltalk.ASTDebugger);
  566. smalltalk.addMethod(
  567. smalltalk.method({
  568. selector: "restart",
  569. category: 'stepping',
  570. fn: function (){
  571. var self=this;
  572. return smalltalk.withContext(function($ctx1) {
  573. self._shouldBeImplemented();
  574. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.ASTDebugger)})},
  575. args: [],
  576. source: "restart\x0a\x09self shouldBeImplemented",
  577. messageSends: ["shouldBeImplemented"],
  578. referencedClasses: []
  579. }),
  580. smalltalk.ASTDebugger);
  581. smalltalk.addMethod(
  582. smalltalk.method({
  583. selector: "step",
  584. category: 'stepping',
  585. fn: function (){
  586. var self=this;
  587. return smalltalk.withContext(function($ctx1) {
  588. _st((function(){
  589. return smalltalk.withContext(function($ctx2) {
  590. return _st(_st(_st(_st(self._interpreter())._nextNode())._notNil())._and_((function(){
  591. return smalltalk.withContext(function($ctx3) {
  592. return _st(_st(self._interpreter())._nextNode())._stopOnStepping();
  593. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})})))._or_((function(){
  594. return smalltalk.withContext(function($ctx3) {
  595. return _st(_st(self._interpreter())._atEnd())._not();
  596. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  597. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  598. return smalltalk.withContext(function($ctx2) {
  599. _st(self._interpreter())._step();
  600. return self._step();
  601. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  602. return self}, function($ctx1) {$ctx1.fill(self,"step",{},smalltalk.ASTDebugger)})},
  603. args: [],
  604. source: "step\x0a\x09\x22The ASTSteppingInterpreter stops at each node interpretation.\x0a\x09One step will interpret nodes until:\x0a\x09- we get at the end\x0a\x09- the next node is a stepping node (send, assignment, etc.)\x22\x0a\x09\x0a\x09[ (self interpreter nextNode notNil and: [ self interpreter nextNode stopOnStepping ])\x0a\x09\x09or: [ self interpreter atEnd not ] ]\x0a\x09\x09\x09whileFalse: [\x0a\x09\x09\x09\x09self interpreter step.\x0a\x09\x09\x09\x09self step ]",
  605. messageSends: ["whileFalse:", "step", "interpreter", "or:", "not", "atEnd", "and:", "stopOnStepping", "nextNode", "notNil"],
  606. referencedClasses: []
  607. }),
  608. smalltalk.ASTDebugger);
  609. smalltalk.addMethod(
  610. smalltalk.method({
  611. selector: "stepInto",
  612. category: 'stepping',
  613. fn: function (){
  614. var self=this;
  615. return smalltalk.withContext(function($ctx1) {
  616. self._shouldBeImplemented();
  617. return self}, function($ctx1) {$ctx1.fill(self,"stepInto",{},smalltalk.ASTDebugger)})},
  618. args: [],
  619. source: "stepInto\x0a\x09self shouldBeImplemented",
  620. messageSends: ["shouldBeImplemented"],
  621. referencedClasses: []
  622. }),
  623. smalltalk.ASTDebugger);
  624. smalltalk.addMethod(
  625. smalltalk.method({
  626. selector: "stepOver",
  627. category: 'stepping',
  628. fn: function (){
  629. var self=this;
  630. return smalltalk.withContext(function($ctx1) {
  631. self._step();
  632. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.ASTDebugger)})},
  633. args: [],
  634. source: "stepOver\x0a\x09self step",
  635. messageSends: ["step"],
  636. referencedClasses: []
  637. }),
  638. smalltalk.ASTDebugger);
  639. smalltalk.addMethod(
  640. smalltalk.method({
  641. selector: "context:",
  642. category: 'instance creation',
  643. fn: function (aContext){
  644. var self=this;
  645. return smalltalk.withContext(function($ctx1) {
  646. var $2,$3,$1;
  647. $2=self._new();
  648. _st($2)._initializeWithContext_(aContext);
  649. $3=_st($2)._yourself();
  650. $1=$3;
  651. return $1;
  652. }, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTDebugger.klass)})},
  653. args: ["aContext"],
  654. source: "context: aContext\x0a\x09^ self new\x0a\x09\x09initializeWithContext: aContext;\x0a\x09\x09yourself",
  655. messageSends: ["initializeWithContext:", "new", "yourself"],
  656. referencedClasses: []
  657. }),
  658. smalltalk.ASTDebugger.klass);
  659. smalltalk.addClass('ASTInterpreter', smalltalk.Object, ['currentNode', 'context', 'shouldReturn', 'result'], 'Compiler-Interpreter');
  660. smalltalk.ASTInterpreter.comment="I am like a `NodeVisitor`, interpreting nodes one after each other.\x0aI am built using Continuation Passing Style for stepping purposes.\x0a\x0a## Usage example:\x0a\x0a\x09| ast interpreter |\x0a\x09ast := Smalltalk current parse: 'foo 1+2+4'.\x0a\x09(SemanticAnalyzer on: Object) visit: ast.\x0a\x0a\x09ASTInterpreter new\x0a\x09\x09interpret: ast nodes first;\x0a\x09\x09result \x22Answers 7\x22";
  661. smalltalk.addMethod(
  662. smalltalk.method({
  663. selector: "assign:to:",
  664. category: 'private',
  665. fn: function (aNode,anObject){
  666. var self=this;
  667. return smalltalk.withContext(function($ctx1) {
  668. var $2,$1;
  669. $2=_st(_st(aNode)._binding())._isInstanceVar();
  670. if(smalltalk.assert($2)){
  671. $1=_st(_st(self._context())._receiver())._instVarAt_put_(_st(aNode)._value(),anObject);
  672. } else {
  673. $1=_st(self._context())._localAt_put_(_st(aNode)._value(),anObject);
  674. };
  675. return $1;
  676. }, function($ctx1) {$ctx1.fill(self,"assign:to:",{aNode:aNode,anObject:anObject},smalltalk.ASTInterpreter)})},
  677. args: ["aNode", "anObject"],
  678. source: "assign: aNode to: anObject\x0a\x09^ aNode binding isInstanceVar\x0a\x09\x09ifTrue: [ self context receiver instVarAt: aNode value put: anObject ]\x0a\x09\x09ifFalse: [ self context localAt: aNode value put: anObject ]",
  679. messageSends: ["ifTrue:ifFalse:", "instVarAt:put:", "value", "receiver", "context", "localAt:put:", "isInstanceVar", "binding"],
  680. referencedClasses: []
  681. }),
  682. smalltalk.ASTInterpreter);
  683. smalltalk.addMethod(
  684. smalltalk.method({
  685. selector: "context",
  686. category: 'accessing',
  687. fn: function (){
  688. var self=this;
  689. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  690. return smalltalk.withContext(function($ctx1) {
  691. var $2,$1;
  692. $2=self["@context"];
  693. if(($receiver = $2) == nil || $receiver == undefined){
  694. self["@context"]=_st($AIContext())._new();
  695. $1=self["@context"];
  696. } else {
  697. $1=$2;
  698. };
  699. return $1;
  700. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTInterpreter)})},
  701. args: [],
  702. source: "context\x0a\x09^ context ifNil: [ context := AIContext new ]",
  703. messageSends: ["ifNil:", "new"],
  704. referencedClasses: ["AIContext"]
  705. }),
  706. smalltalk.ASTInterpreter);
  707. smalltalk.addMethod(
  708. smalltalk.method({
  709. selector: "context:",
  710. category: 'accessing',
  711. fn: function (anAIContext){
  712. var self=this;
  713. return smalltalk.withContext(function($ctx1) {
  714. self["@context"]=anAIContext;
  715. return self}, function($ctx1) {$ctx1.fill(self,"context:",{anAIContext:anAIContext},smalltalk.ASTInterpreter)})},
  716. args: ["anAIContext"],
  717. source: "context: anAIContext\x0a\x09context := anAIContext",
  718. messageSends: [],
  719. referencedClasses: []
  720. }),
  721. smalltalk.ASTInterpreter);
  722. smalltalk.addMethod(
  723. smalltalk.method({
  724. selector: "continue:value:",
  725. category: 'private',
  726. fn: function (aBlock,anObject){
  727. var self=this;
  728. return smalltalk.withContext(function($ctx1) {
  729. self["@result"]=anObject;
  730. _st(aBlock)._value_(anObject);
  731. return self}, function($ctx1) {$ctx1.fill(self,"continue:value:",{aBlock:aBlock,anObject:anObject},smalltalk.ASTInterpreter)})},
  732. args: ["aBlock", "anObject"],
  733. source: "continue: aBlock value: anObject\x0a\x09result := anObject.\x0a\x09aBlock value: anObject",
  734. messageSends: ["value:"],
  735. referencedClasses: []
  736. }),
  737. smalltalk.ASTInterpreter);
  738. smalltalk.addMethod(
  739. smalltalk.method({
  740. selector: "currentNode",
  741. category: 'accessing',
  742. fn: function (){
  743. var self=this;
  744. return smalltalk.withContext(function($ctx1) {
  745. var $1;
  746. $1=self["@currentNode"];
  747. return $1;
  748. }, function($ctx1) {$ctx1.fill(self,"currentNode",{},smalltalk.ASTInterpreter)})},
  749. args: [],
  750. source: "currentNode\x0a\x09^ currentNode",
  751. messageSends: [],
  752. referencedClasses: []
  753. }),
  754. smalltalk.ASTInterpreter);
  755. smalltalk.addMethod(
  756. smalltalk.method({
  757. selector: "eval:",
  758. category: 'private',
  759. fn: function (aString){
  760. var self=this;
  761. var source,function_;
  762. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  763. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  764. return smalltalk.withContext(function($ctx1) {
  765. var $1,$2,$3;
  766. source=_st($String())._streamContents_((function(str){
  767. return smalltalk.withContext(function($ctx2) {
  768. _st(str)._nextPutAll_("(function(");
  769. _st(_st(_st(self._context())._locals())._keys())._do_separatedBy_((function(each){
  770. return smalltalk.withContext(function($ctx3) {
  771. return _st(str)._nextPutAll_(each);
  772. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}),(function(){
  773. return smalltalk.withContext(function($ctx3) {
  774. return _st(str)._nextPutAll_(",");
  775. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  776. $1=str;
  777. _st($1)._nextPutAll_("){ return (function() {");
  778. _st($1)._nextPutAll_(aString);
  779. $2=_st($1)._nextPutAll_("})() })");
  780. return $2;
  781. }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1)})}));
  782. function_=_st(_st($Compiler())._new())._eval_(source);
  783. $3=_st(function_)._valueWithPossibleArguments_(_st(_st(self._context())._locals())._values());
  784. return $3;
  785. }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString,source:source,function_:function_},smalltalk.ASTInterpreter)})},
  786. args: ["aString"],
  787. 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",
  788. messageSends: ["streamContents:", "nextPutAll:", "do:separatedBy:", "keys", "locals", "context", "eval:", "new", "valueWithPossibleArguments:", "values"],
  789. referencedClasses: ["String", "Compiler"]
  790. }),
  791. smalltalk.ASTInterpreter);
  792. smalltalk.addMethod(
  793. smalltalk.method({
  794. selector: "initialize",
  795. category: 'initialization',
  796. fn: function (){
  797. var self=this;
  798. return smalltalk.withContext(function($ctx1) {
  799. smalltalk.ASTInterpreter.superclass.fn.prototype._initialize.apply(_st(self), []);
  800. self["@shouldReturn"]=false;
  801. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ASTInterpreter)})},
  802. args: [],
  803. source: "initialize\x0a\x09super initialize.\x0a\x09shouldReturn := false",
  804. messageSends: ["initialize"],
  805. referencedClasses: []
  806. }),
  807. smalltalk.ASTInterpreter);
  808. smalltalk.addMethod(
  809. smalltalk.method({
  810. selector: "interpret:",
  811. category: 'interpreting',
  812. fn: function (aNode){
  813. var self=this;
  814. return smalltalk.withContext(function($ctx1) {
  815. self["@shouldReturn"]=false;
  816. self._interpret_continue_(aNode,(function(value){
  817. return smalltalk.withContext(function($ctx2) {
  818. self["@result"]=value;
  819. return self["@result"];
  820. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  821. return self}, function($ctx1) {$ctx1.fill(self,"interpret:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  822. args: ["aNode"],
  823. source: "interpret: aNode\x0a\x09shouldReturn := false.\x0a\x09self interpret: aNode continue: [ :value |\x0a\x09\x09result := value ]",
  824. messageSends: ["interpret:continue:"],
  825. referencedClasses: []
  826. }),
  827. smalltalk.ASTInterpreter);
  828. smalltalk.addMethod(
  829. smalltalk.method({
  830. selector: "interpret:continue:",
  831. category: 'interpreting',
  832. fn: function (aNode,aBlock){
  833. var self=this;
  834. return smalltalk.withContext(function($ctx1) {
  835. var $1,$2,$3;
  836. $1=self["@shouldReturn"];
  837. if(smalltalk.assert($1)){
  838. $2=self;
  839. return $2;
  840. };
  841. $3=_st(aNode)._isNode();
  842. if(smalltalk.assert($3)){
  843. self["@currentNode"]=aNode;
  844. self["@currentNode"];
  845. self._interpretNode_continue_(aNode,(function(value){
  846. return smalltalk.withContext(function($ctx2) {
  847. return self._continue_value_(aBlock,value);
  848. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  849. } else {
  850. self._continue_value_(aBlock,aNode);
  851. };
  852. return self}, function($ctx1) {$ctx1.fill(self,"interpret:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  853. args: ["aNode", "aBlock"],
  854. source: "interpret: aNode continue: aBlock\x0a\x09shouldReturn ifTrue: [ ^ self ].\x0a\x0a\x09aNode isNode\x0a\x09\x09ifTrue: [\x0a\x09\x09\x09currentNode := aNode.\x0a\x09\x09\x09self interpretNode: aNode continue: [ :value |\x0a\x09\x09\x09\x09self continue: aBlock value: value ] ]\x0a\x09\x09ifFalse: [ self continue: aBlock value: aNode ]",
  855. messageSends: ["ifTrue:", "ifTrue:ifFalse:", "interpretNode:continue:", "continue:value:", "isNode"],
  856. referencedClasses: []
  857. }),
  858. smalltalk.ASTInterpreter);
  859. smalltalk.addMethod(
  860. smalltalk.method({
  861. selector: "interpretAll:continue:",
  862. category: 'private',
  863. fn: function (aCollection,aBlock){
  864. var self=this;
  865. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  866. return smalltalk.withContext(function($ctx1) {
  867. self._interpretAll_continue_result_(aCollection,aBlock,_st($OrderedCollection())._new());
  868. return self}, function($ctx1) {$ctx1.fill(self,"interpretAll:continue:",{aCollection:aCollection,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  869. args: ["aCollection", "aBlock"],
  870. source: "interpretAll: aCollection continue: aBlock\x0a\x09self\x0a\x09\x09interpretAll: aCollection\x0a\x09\x09continue: aBlock\x0a\x09\x09result: OrderedCollection new",
  871. messageSends: ["interpretAll:continue:result:", "new"],
  872. referencedClasses: ["OrderedCollection"]
  873. }),
  874. smalltalk.ASTInterpreter);
  875. smalltalk.addMethod(
  876. smalltalk.method({
  877. selector: "interpretAll:continue:result:",
  878. category: 'private',
  879. fn: function (nodes,aBlock,aCollection){
  880. var self=this;
  881. return smalltalk.withContext(function($ctx1) {
  882. var $1;
  883. $1=_st(nodes)._isEmpty();
  884. if(smalltalk.assert($1)){
  885. self._continue_value_(aBlock,aCollection);
  886. } else {
  887. self._interpret_continue_(_st(nodes)._first(),(function(value){
  888. return smalltalk.withContext(function($ctx2) {
  889. return self._interpretAll_continue_result_(_st(nodes)._allButFirst(),aBlock,_st(aCollection).__comma([value]));
  890. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  891. };
  892. return self}, function($ctx1) {$ctx1.fill(self,"interpretAll:continue:result:",{nodes:nodes,aBlock:aBlock,aCollection:aCollection},smalltalk.ASTInterpreter)})},
  893. args: ["nodes", "aBlock", "aCollection"],
  894. source: "interpretAll: nodes continue: aBlock result: aCollection\x0a\x09nodes isEmpty\x0a\x09\x09ifTrue: [ self continue: aBlock value: aCollection ]\x0a\x09\x09ifFalse: [\x0a\x09\x09\x09self interpret: nodes first continue: [:value |\x0a\x09\x09\x09\x09self\x0a\x09\x09\x09\x09\x09interpretAll: nodes allButFirst\x0a\x09\x09\x09\x09\x09continue: aBlock\x0a\x09\x09\x09\x09\x09result: aCollection, { value } ] ]",
  895. messageSends: ["ifTrue:ifFalse:", "continue:value:", "interpret:continue:", "first", "interpretAll:continue:result:", "allButFirst", ",", "isEmpty"],
  896. referencedClasses: []
  897. }),
  898. smalltalk.ASTInterpreter);
  899. smalltalk.addMethod(
  900. smalltalk.method({
  901. selector: "interpretAssignmentNode:continue:",
  902. category: 'interpreting',
  903. fn: function (aNode,aBlock){
  904. var self=this;
  905. return smalltalk.withContext(function($ctx1) {
  906. self._interpret_continue_(_st(aNode)._right(),(function(value){
  907. return smalltalk.withContext(function($ctx2) {
  908. return self._continue_value_(aBlock,self._assign_to_(_st(aNode)._left(),value));
  909. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  910. return self}, function($ctx1) {$ctx1.fill(self,"interpretAssignmentNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  911. args: ["aNode", "aBlock"],
  912. source: "interpretAssignmentNode: aNode continue: aBlock\x0a\x09self interpret: aNode right continue: [ :value |\x0a\x09\x09self\x0a\x09\x09\x09continue: aBlock\x0a\x09\x09\x09value: (self assign: aNode left to: value) ]",
  913. messageSends: ["interpret:continue:", "right", "continue:value:", "assign:to:", "left"],
  914. referencedClasses: []
  915. }),
  916. smalltalk.ASTInterpreter);
  917. smalltalk.addMethod(
  918. smalltalk.method({
  919. selector: "interpretBlockNode:continue:",
  920. category: 'interpreting',
  921. fn: function (aNode,aBlock){
  922. var self=this;
  923. return smalltalk.withContext(function($ctx1) {
  924. var $1,$2;
  925. self._continue_value_(aBlock,(function(){
  926. return smalltalk.withContext(function($ctx2) {
  927. return self._withBlockContext_((function(){
  928. return smalltalk.withContext(function($ctx3) {
  929. $1=self;
  930. _st($1)._interpret_(_st(_st(aNode)._nodes())._first());
  931. $2=_st($1)._result();
  932. return $2;
  933. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  934. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  935. return self}, function($ctx1) {$ctx1.fill(self,"interpretBlockNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  936. args: ["aNode", "aBlock"],
  937. source: "interpretBlockNode: aNode continue: aBlock\x0a\x09self\x0a\x09\x09continue: aBlock\x0a\x09\x09value: [ \x0a\x09\x09\x09self withBlockContext: [ \x0a\x09\x09\x09\x09self interpret: aNode nodes first; result ] ]",
  938. messageSends: ["continue:value:", "withBlockContext:", "interpret:", "first", "nodes", "result"],
  939. referencedClasses: []
  940. }),
  941. smalltalk.ASTInterpreter);
  942. smalltalk.addMethod(
  943. smalltalk.method({
  944. selector: "interpretBlockSequenceNode:continue:",
  945. category: 'interpreting',
  946. fn: function (aNode,aBlock){
  947. var self=this;
  948. return smalltalk.withContext(function($ctx1) {
  949. self._interpretSequenceNode_continue_(aNode,aBlock);
  950. return self}, function($ctx1) {$ctx1.fill(self,"interpretBlockSequenceNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  951. args: ["aNode", "aBlock"],
  952. source: "interpretBlockSequenceNode: aNode continue: aBlock\x0a\x09self interpretSequenceNode: aNode continue: aBlock",
  953. messageSends: ["interpretSequenceNode:continue:"],
  954. referencedClasses: []
  955. }),
  956. smalltalk.ASTInterpreter);
  957. smalltalk.addMethod(
  958. smalltalk.method({
  959. selector: "interpretCascadeNode:continue:",
  960. category: 'interpreting',
  961. fn: function (aNode,aBlock){
  962. var self=this;
  963. return smalltalk.withContext(function($ctx1) {
  964. self._interpret_continue_(_st(aNode)._receiver(),(function(receiver){
  965. return smalltalk.withContext(function($ctx2) {
  966. _st(_st(aNode)._nodes())._do_((function(each){
  967. return smalltalk.withContext(function($ctx3) {
  968. return _st(each)._receiver_(receiver);
  969. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}));
  970. return self._interpretAll_continue_(_st(_st(aNode)._nodes())._allButLast(),(function(){
  971. return smalltalk.withContext(function($ctx3) {
  972. return self._interpret_continue_(_st(_st(aNode)._nodes())._last(),(function(val){
  973. return smalltalk.withContext(function($ctx4) {
  974. return self._continue_value_(aBlock,val);
  975. }, function($ctx4) {$ctx4.fillBlock({val:val},$ctx3)})}));
  976. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  977. }, function($ctx2) {$ctx2.fillBlock({receiver:receiver},$ctx1)})}));
  978. return self}, function($ctx1) {$ctx1.fill(self,"interpretCascadeNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  979. args: ["aNode", "aBlock"],
  980. source: "interpretCascadeNode: aNode continue: aBlock\x0a\x09\x22TODO: Handle super sends\x22\x0a\x09\x0a\x09self interpret: aNode receiver continue: [ :receiver |\x0a\x09\x09\x22Only interpret the receiver once\x22\x0a\x09\x09aNode nodes do: [ :each | each receiver: receiver ].\x0a\x0a\x09\x09self\x0a\x09\x09\x09interpretAll: aNode nodes allButLast\x0a\x09\x09\x09continue: [\x0a\x09\x09\x09\x09self\x0a\x09\x09\x09\x09\x09interpret: aNode nodes last\x0a\x09\x09\x09\x09\x09continue: [ :val | self continue: aBlock value: val ] ] ]",
  981. messageSends: ["interpret:continue:", "receiver", "do:", "receiver:", "nodes", "interpretAll:continue:", "allButLast", "last", "continue:value:"],
  982. referencedClasses: []
  983. }),
  984. smalltalk.ASTInterpreter);
  985. smalltalk.addMethod(
  986. smalltalk.method({
  987. selector: "interpretClassReferenceNode:continue:",
  988. category: 'interpreting',
  989. fn: function (aNode,aBlock){
  990. var self=this;
  991. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  992. return smalltalk.withContext(function($ctx1) {
  993. self._continue_value_(aBlock,_st(_st($Smalltalk())._current())._at_(_st(aNode)._value()));
  994. return self}, function($ctx1) {$ctx1.fill(self,"interpretClassReferenceNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  995. args: ["aNode", "aBlock"],
  996. source: "interpretClassReferenceNode: aNode continue: aBlock\x0a\x09self continue: aBlock value: (Smalltalk current at: aNode value)",
  997. messageSends: ["continue:value:", "at:", "value", "current"],
  998. referencedClasses: ["Smalltalk"]
  999. }),
  1000. smalltalk.ASTInterpreter);
  1001. smalltalk.addMethod(
  1002. smalltalk.method({
  1003. selector: "interpretDynamicArrayNode:continue:",
  1004. category: 'interpreting',
  1005. fn: function (aNode,aBlock){
  1006. var self=this;
  1007. return smalltalk.withContext(function($ctx1) {
  1008. self._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  1009. return smalltalk.withContext(function($ctx2) {
  1010. return self._continue_value_(aBlock,array);
  1011. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  1012. return self}, function($ctx1) {$ctx1.fill(self,"interpretDynamicArrayNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1013. args: ["aNode", "aBlock"],
  1014. source: "interpretDynamicArrayNode: aNode continue: aBlock\x0a\x09self interpretAll: aNode nodes continue: [ :array |\x0a\x09\x09self\x0a\x09\x09\x09continue: aBlock\x0a\x09\x09\x09value: array ]",
  1015. messageSends: ["interpretAll:continue:", "nodes", "continue:value:"],
  1016. referencedClasses: []
  1017. }),
  1018. smalltalk.ASTInterpreter);
  1019. smalltalk.addMethod(
  1020. smalltalk.method({
  1021. selector: "interpretDynamicDictionaryNode:continue:",
  1022. category: 'interpreting',
  1023. fn: function (aNode,aBlock){
  1024. var self=this;
  1025. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  1026. return smalltalk.withContext(function($ctx1) {
  1027. self._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  1028. var hashedCollection;
  1029. return smalltalk.withContext(function($ctx2) {
  1030. hashedCollection=_st($HashedCollection())._new();
  1031. hashedCollection;
  1032. _st(array)._do_((function(each){
  1033. return smalltalk.withContext(function($ctx3) {
  1034. return _st(hashedCollection)._add_(each);
  1035. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}));
  1036. return self._continue_value_(aBlock,hashedCollection);
  1037. }, function($ctx2) {$ctx2.fillBlock({array:array,hashedCollection:hashedCollection},$ctx1)})}));
  1038. return self}, function($ctx1) {$ctx1.fill(self,"interpretDynamicDictionaryNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1039. args: ["aNode", "aBlock"],
  1040. source: "interpretDynamicDictionaryNode: aNode continue: aBlock\x0a\x09self interpretAll: aNode nodes continue: [ :array | | hashedCollection |\x0a\x09\x09hashedCollection := HashedCollection new.\x0a\x09\x09array do: [ :each | hashedCollection add: each ].\x0a\x09\x09self\x0a\x09\x09\x09continue: aBlock\x0a\x09\x09\x09value: hashedCollection ]",
  1041. messageSends: ["interpretAll:continue:", "nodes", "new", "do:", "add:", "continue:value:"],
  1042. referencedClasses: ["HashedCollection"]
  1043. }),
  1044. smalltalk.ASTInterpreter);
  1045. smalltalk.addMethod(
  1046. smalltalk.method({
  1047. selector: "interpretJSStatementNode:continue:",
  1048. category: 'interpreting',
  1049. fn: function (aNode,aBlock){
  1050. var self=this;
  1051. return smalltalk.withContext(function($ctx1) {
  1052. self["@shouldReturn"]=true;
  1053. self._continue_value_(aBlock,self._eval_(_st(aNode)._source()));
  1054. return self}, function($ctx1) {$ctx1.fill(self,"interpretJSStatementNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1055. args: ["aNode", "aBlock"],
  1056. source: "interpretJSStatementNode: aNode continue: aBlock\x0a\x09shouldReturn := true.\x0a\x09self continue: aBlock value: (self eval: aNode source)",
  1057. messageSends: ["continue:value:", "eval:", "source"],
  1058. referencedClasses: []
  1059. }),
  1060. smalltalk.ASTInterpreter);
  1061. smalltalk.addMethod(
  1062. smalltalk.method({
  1063. selector: "interpretMethodNode:continue:",
  1064. category: 'interpreting',
  1065. fn: function (aNode,aBlock){
  1066. var self=this;
  1067. return smalltalk.withContext(function($ctx1) {
  1068. self._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  1069. return smalltalk.withContext(function($ctx2) {
  1070. return self._continue_value_(aBlock,_st(array)._first());
  1071. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  1072. return self}, function($ctx1) {$ctx1.fill(self,"interpretMethodNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1073. args: ["aNode", "aBlock"],
  1074. source: "interpretMethodNode: aNode continue: aBlock\x0a\x09self interpretAll: aNode nodes continue: [ :array |\x0a\x09\x09self continue: aBlock value: array first ]",
  1075. messageSends: ["interpretAll:continue:", "nodes", "continue:value:", "first"],
  1076. referencedClasses: []
  1077. }),
  1078. smalltalk.ASTInterpreter);
  1079. smalltalk.addMethod(
  1080. smalltalk.method({
  1081. selector: "interpretNode:continue:",
  1082. category: 'interpreting',
  1083. fn: function (aNode,aBlock){
  1084. var self=this;
  1085. return smalltalk.withContext(function($ctx1) {
  1086. _st(aNode)._interpreter_continue_(self,aBlock);
  1087. return self}, function($ctx1) {$ctx1.fill(self,"interpretNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1088. args: ["aNode", "aBlock"],
  1089. source: "interpretNode: aNode continue: aBlock\x0a\x09aNode interpreter: self continue: aBlock",
  1090. messageSends: ["interpreter:continue:"],
  1091. referencedClasses: []
  1092. }),
  1093. smalltalk.ASTInterpreter);
  1094. smalltalk.addMethod(
  1095. smalltalk.method({
  1096. selector: "interpretReturnNode:continue:",
  1097. category: 'interpreting',
  1098. fn: function (aNode,aBlock){
  1099. var self=this;
  1100. return smalltalk.withContext(function($ctx1) {
  1101. self._interpret_continue_(_st(_st(aNode)._nodes())._first(),(function(value){
  1102. return smalltalk.withContext(function($ctx2) {
  1103. self["@shouldReturn"]=true;
  1104. self["@shouldReturn"];
  1105. return self._continue_value_(aBlock,value);
  1106. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  1107. return self}, function($ctx1) {$ctx1.fill(self,"interpretReturnNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1108. args: ["aNode", "aBlock"],
  1109. source: "interpretReturnNode: aNode continue: aBlock\x0a\x09self interpret: aNode nodes first continue: [ :value |\x0a\x09\x09shouldReturn := true.\x0a\x09\x09self continue: aBlock value: value ]",
  1110. messageSends: ["interpret:continue:", "first", "nodes", "continue:value:"],
  1111. referencedClasses: []
  1112. }),
  1113. smalltalk.ASTInterpreter);
  1114. smalltalk.addMethod(
  1115. smalltalk.method({
  1116. selector: "interpretSendNode:continue:",
  1117. category: 'interpreting',
  1118. fn: function (aNode,aBlock){
  1119. var self=this;
  1120. return smalltalk.withContext(function($ctx1) {
  1121. self._interpret_continue_(_st(aNode)._receiver(),(function(receiver){
  1122. return smalltalk.withContext(function($ctx2) {
  1123. return self._interpretAll_continue_(_st(aNode)._arguments(),(function(args){
  1124. return smalltalk.withContext(function($ctx3) {
  1125. return self._messageFromSendNode_arguments_do_(aNode,args,(function(message){
  1126. return smalltalk.withContext(function($ctx4) {
  1127. _st(self._context())._pc_(_st(_st(self._context())._pc()).__plus((1)));
  1128. return self._continue_value_(aBlock,self._sendMessage_to_superSend_(message,receiver,_st(aNode)._superSend()));
  1129. }, function($ctx4) {$ctx4.fillBlock({message:message},$ctx3)})}));
  1130. }, function($ctx3) {$ctx3.fillBlock({args:args},$ctx2)})}));
  1131. }, function($ctx2) {$ctx2.fillBlock({receiver:receiver},$ctx1)})}));
  1132. return self}, function($ctx1) {$ctx1.fill(self,"interpretSendNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1133. args: ["aNode", "aBlock"],
  1134. source: "interpretSendNode: aNode continue: aBlock\x0a\x09self interpret: aNode receiver continue: [ :receiver |\x0a\x09\x09self interpretAll: aNode arguments continue: [ :args |\x0a\x09\x09\x09self\x0a\x09\x09\x09\x09messageFromSendNode: aNode\x0a\x09\x09\x09\x09arguments: args\x0a\x09\x09\x09\x09do: [ :message |\x0a\x09\x09\x09\x09\x09self context pc: self context pc + 1.\x0a\x09\x09\x09\x09\x09self\x0a\x09\x09\x09\x09\x09\x09continue: aBlock\x0a\x09\x09\x09\x09\x09\x09value: (self sendMessage: message to: receiver superSend: aNode superSend) ] ] ]",
  1135. messageSends: ["interpret:continue:", "receiver", "interpretAll:continue:", "arguments", "messageFromSendNode:arguments:do:", "pc:", "+", "pc", "context", "continue:value:", "sendMessage:to:superSend:", "superSend"],
  1136. referencedClasses: []
  1137. }),
  1138. smalltalk.ASTInterpreter);
  1139. smalltalk.addMethod(
  1140. smalltalk.method({
  1141. selector: "interpretSequenceNode:continue:",
  1142. category: 'interpreting',
  1143. fn: function (aNode,aBlock){
  1144. var self=this;
  1145. return smalltalk.withContext(function($ctx1) {
  1146. self._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  1147. return smalltalk.withContext(function($ctx2) {
  1148. return self._continue_value_(aBlock,_st(array)._last());
  1149. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  1150. return self}, function($ctx1) {$ctx1.fill(self,"interpretSequenceNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1151. args: ["aNode", "aBlock"],
  1152. source: "interpretSequenceNode: aNode continue: aBlock\x0a\x09self interpretAll: aNode nodes continue: [ :array |\x0a\x09\x09self continue: aBlock value: array last ]",
  1153. messageSends: ["interpretAll:continue:", "nodes", "continue:value:", "last"],
  1154. referencedClasses: []
  1155. }),
  1156. smalltalk.ASTInterpreter);
  1157. smalltalk.addMethod(
  1158. smalltalk.method({
  1159. selector: "interpretValueNode:continue:",
  1160. category: 'interpreting',
  1161. fn: function (aNode,aBlock){
  1162. var self=this;
  1163. return smalltalk.withContext(function($ctx1) {
  1164. self._continue_value_(aBlock,_st(aNode)._value());
  1165. return self}, function($ctx1) {$ctx1.fill(self,"interpretValueNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1166. args: ["aNode", "aBlock"],
  1167. source: "interpretValueNode: aNode continue: aBlock\x0a\x09self continue: aBlock value: aNode value",
  1168. messageSends: ["continue:value:", "value"],
  1169. referencedClasses: []
  1170. }),
  1171. smalltalk.ASTInterpreter);
  1172. smalltalk.addMethod(
  1173. smalltalk.method({
  1174. selector: "interpretVariableNode:continue:",
  1175. category: 'interpreting',
  1176. fn: function (aNode,aBlock){
  1177. var self=this;
  1178. return smalltalk.withContext(function($ctx1) {
  1179. var $1,$2,$4,$3;
  1180. $1=self;
  1181. $2=aBlock;
  1182. $4=_st(_st(aNode)._binding())._isInstanceVar();
  1183. if(smalltalk.assert($4)){
  1184. $3=_st(_st(self._context())._receiver())._instVarAt_(_st(aNode)._value());
  1185. } else {
  1186. $3=_st(self._context())._localAt_(_st(aNode)._value());
  1187. };
  1188. _st($1)._continue_value_($2,$3);
  1189. return self}, function($ctx1) {$ctx1.fill(self,"interpretVariableNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1190. args: ["aNode", "aBlock"],
  1191. source: "interpretVariableNode: aNode continue: aBlock\x0a\x09self\x0a\x09\x09continue: aBlock\x0a\x09\x09value: (aNode binding isInstanceVar\x0a\x09\x09\x09ifTrue: [ self context receiver instVarAt: aNode value ]\x0a\x09\x09\x09ifFalse: [ self context localAt: aNode value ])",
  1192. messageSends: ["continue:value:", "ifTrue:ifFalse:", "instVarAt:", "value", "receiver", "context", "localAt:", "isInstanceVar", "binding"],
  1193. referencedClasses: []
  1194. }),
  1195. smalltalk.ASTInterpreter);
  1196. smalltalk.addMethod(
  1197. smalltalk.method({
  1198. selector: "messageFromSendNode:arguments:do:",
  1199. category: 'private',
  1200. fn: function (aSendNode,aCollection,aBlock){
  1201. var self=this;
  1202. function $Message(){return smalltalk.Message||(typeof Message=="undefined"?nil:Message)}
  1203. return smalltalk.withContext(function($ctx1) {
  1204. var $1,$2;
  1205. $1=_st($Message())._new();
  1206. _st($1)._selector_(_st(aSendNode)._selector());
  1207. _st($1)._arguments_(aCollection);
  1208. $2=_st($1)._yourself();
  1209. self._continue_value_(aBlock,$2);
  1210. return self}, function($ctx1) {$ctx1.fill(self,"messageFromSendNode:arguments:do:",{aSendNode:aSendNode,aCollection:aCollection,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1211. args: ["aSendNode", "aCollection", "aBlock"],
  1212. source: "messageFromSendNode: aSendNode arguments: aCollection do: aBlock\x0a\x09self\x0a\x09\x09continue: aBlock\x0a\x09\x09value: (Message new\x0a\x09\x09\x09selector: aSendNode selector;\x0a\x09\x09\x09arguments: aCollection;\x0a\x09\x09\x09yourself)",
  1213. messageSends: ["continue:value:", "selector:", "selector", "new", "arguments:", "yourself"],
  1214. referencedClasses: ["Message"]
  1215. }),
  1216. smalltalk.ASTInterpreter);
  1217. smalltalk.addMethod(
  1218. smalltalk.method({
  1219. selector: "result",
  1220. category: 'accessing',
  1221. fn: function (){
  1222. var self=this;
  1223. return smalltalk.withContext(function($ctx1) {
  1224. var $1;
  1225. $1=self["@result"];
  1226. return $1;
  1227. }, function($ctx1) {$ctx1.fill(self,"result",{},smalltalk.ASTInterpreter)})},
  1228. args: [],
  1229. source: "result\x0a\x09^ result",
  1230. messageSends: [],
  1231. referencedClasses: []
  1232. }),
  1233. smalltalk.ASTInterpreter);
  1234. smalltalk.addMethod(
  1235. smalltalk.method({
  1236. selector: "sendMessage:to:superSend:",
  1237. category: 'private',
  1238. fn: function (aMessage,anObject,aBoolean){
  1239. var self=this;
  1240. var method;
  1241. return smalltalk.withContext(function($ctx1) {
  1242. var $1,$2,$3,$4,$5,$6;
  1243. var $early={};
  1244. try {
  1245. $1=aBoolean;
  1246. if(! smalltalk.assert($1)){
  1247. $2=_st(aMessage)._sendTo_(anObject);
  1248. return $2;
  1249. };
  1250. $3=_st(_st(anObject)._class())._superclass();
  1251. if(($receiver = $3) == nil || $receiver == undefined){
  1252. $4=self._messageNotUnderstood_receiver_(aMessage,anObject);
  1253. return $4;
  1254. } else {
  1255. $3;
  1256. };
  1257. method=_st(_st(_st(_st(anObject)._class())._superclass())._methodDictionary())._at_ifAbsent_(_st(aMessage)._selector(),(function(){
  1258. return smalltalk.withContext(function($ctx2) {
  1259. $5=self._messageNotUnderstood_receiver_(aMessage,anObject);
  1260. throw $early=[$5];
  1261. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1262. $6=_st(_st(method)._fn())._applyTo_arguments_(anObject,_st(aMessage)._arguments());
  1263. return $6;
  1264. }
  1265. catch(e) {if(e===$early)return e[0]; throw e}
  1266. }, function($ctx1) {$ctx1.fill(self,"sendMessage:to:superSend:",{aMessage:aMessage,anObject:anObject,aBoolean:aBoolean,method:method},smalltalk.ASTInterpreter)})},
  1267. args: ["aMessage", "anObject", "aBoolean"],
  1268. 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 fn applyTo: anObject arguments: aMessage arguments\x0a\x09\x09\x0a\x09\x0a\x09",
  1269. messageSends: ["ifFalse:", "sendTo:", "ifNil:", "messageNotUnderstood:receiver:", "superclass", "class", "at:ifAbsent:", "selector", "methodDictionary", "applyTo:arguments:", "arguments", "fn"],
  1270. referencedClasses: []
  1271. }),
  1272. smalltalk.ASTInterpreter);
  1273. smalltalk.addMethod(
  1274. smalltalk.method({
  1275. selector: "shouldReturn",
  1276. category: 'testing',
  1277. fn: function (){
  1278. var self=this;
  1279. return smalltalk.withContext(function($ctx1) {
  1280. var $2,$1;
  1281. $2=self["@shouldReturn"];
  1282. if(($receiver = $2) == nil || $receiver == undefined){
  1283. $1=false;
  1284. } else {
  1285. $1=$2;
  1286. };
  1287. return $1;
  1288. }, function($ctx1) {$ctx1.fill(self,"shouldReturn",{},smalltalk.ASTInterpreter)})},
  1289. args: [],
  1290. source: "shouldReturn\x0a\x09^ shouldReturn ifNil: [ false ]",
  1291. messageSends: ["ifNil:"],
  1292. referencedClasses: []
  1293. }),
  1294. smalltalk.ASTInterpreter);
  1295. smalltalk.addMethod(
  1296. smalltalk.method({
  1297. selector: "withBlockContext:",
  1298. category: 'private',
  1299. fn: function (aBlock){
  1300. var self=this;
  1301. var blockResult;
  1302. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  1303. return smalltalk.withContext(function($ctx1) {
  1304. var $1,$2,$3;
  1305. $1=_st($AIContext())._new();
  1306. _st($1)._outerContext_(self._context());
  1307. $2=_st($1)._yourself();
  1308. self._context_($2);
  1309. blockResult=_st(aBlock)._value();
  1310. self._context_(_st(self._context())._outerContext());
  1311. $3=blockResult;
  1312. return $3;
  1313. }, function($ctx1) {$ctx1.fill(self,"withBlockContext:",{aBlock:aBlock,blockResult:blockResult},smalltalk.ASTInterpreter)})},
  1314. args: ["aBlock"],
  1315. source: "withBlockContext: aBlock\x0a\x09\x22Evaluate aBlock with a BlockContext:\x0a\x09- a context is pushed before aBlock evaluation.\x0a\x09- the context is poped after aBlock evaluation\x0a\x09- the result of aBlock evaluation is answered\x22\x0a\x09\x0a\x09| blockResult |\x0a\x09\x09\x09\x0a\x09self context: (AIContext new\x0a\x09\x09outerContext: self context;\x0a\x09\x09yourself).\x0a\x09\x0a\x09blockResult := aBlock value.\x0a\x09\x0a\x09self context: self context outerContext.\x0a\x09^ blockResult",
  1316. messageSends: ["context:", "outerContext:", "context", "new", "yourself", "value", "outerContext"],
  1317. referencedClasses: ["AIContext"]
  1318. }),
  1319. smalltalk.ASTInterpreter);
  1320. smalltalk.addClass('ASTSteppingInterpreter', smalltalk.ASTInterpreter, ['continuation', 'nextNode'], 'Compiler-Interpreter');
  1321. smalltalk.ASTSteppingInterpreter.comment="I am an interpreter with stepping capabilities. The higher level `ASTDebugger` class should be used as a debugger model, as it provides convenience methods for debugging.\x0a\x0a## API\x0a\x0aUse `#step` to actually interpret the next node. Interpretation stops at each node evaluation, weither it's a message node or not.\x0a\x0a\x0a## Usage example:\x0a\x0a\x09| ast interpreter |\x0a\x09ast := Smalltalk current parse: 'foo 1+2+4'.\x0a\x09(SemanticAnalyzer on: Object) visit: ast.\x0a\x0a\x09interpreter := ASTSteppingInterpreter new\x0a\x09\x09interpret: ast nodes first;\x0a\x09\x09yourself.\x0a\x09\x09\x0a\x09interpreter step; step.\x0a\x09interpreter step; step.\x0a\x09interpreter result.\x22Answers 1\x22\x0a\x09interpreter step.\x0a\x09interpreter result. \x22Answers 3\x22\x0a\x09interpreter step.\x0a\x09interpreter result. \x22Answers 7\x22";
  1322. smalltalk.addMethod(
  1323. smalltalk.method({
  1324. selector: "atEnd",
  1325. category: 'testing',
  1326. fn: function (){
  1327. var self=this;
  1328. return smalltalk.withContext(function($ctx1) {
  1329. var $1;
  1330. $1=_st(self._shouldReturn())._or_((function(){
  1331. return smalltalk.withContext(function($ctx2) {
  1332. return _st(self._nextNode()).__eq_eq(self._currentNode());
  1333. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1334. return $1;
  1335. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.ASTSteppingInterpreter)})},
  1336. args: [],
  1337. source: "atEnd\x0a\x09^ self shouldReturn or: [ self nextNode == self currentNode ]",
  1338. messageSends: ["or:", "==", "currentNode", "nextNode", "shouldReturn"],
  1339. referencedClasses: []
  1340. }),
  1341. smalltalk.ASTSteppingInterpreter);
  1342. smalltalk.addMethod(
  1343. smalltalk.method({
  1344. selector: "initialize",
  1345. category: 'initialization',
  1346. fn: function (){
  1347. var self=this;
  1348. return smalltalk.withContext(function($ctx1) {
  1349. smalltalk.ASTSteppingInterpreter.superclass.fn.prototype._initialize.apply(_st(self), []);
  1350. self["@continuation"]=(function(){
  1351. return smalltalk.withContext(function($ctx2) {
  1352. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1353. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ASTSteppingInterpreter)})},
  1354. args: [],
  1355. source: "initialize\x0a\x09super initialize.\x0a\x09continuation := []",
  1356. messageSends: ["initialize"],
  1357. referencedClasses: []
  1358. }),
  1359. smalltalk.ASTSteppingInterpreter);
  1360. smalltalk.addMethod(
  1361. smalltalk.method({
  1362. selector: "interpret:continue:",
  1363. category: 'interpreting',
  1364. fn: function (aNode,aBlock){
  1365. var self=this;
  1366. return smalltalk.withContext(function($ctx1) {
  1367. self["@nextNode"]=aNode;
  1368. self["@continuation"]=(function(){
  1369. return smalltalk.withContext(function($ctx2) {
  1370. return smalltalk.ASTSteppingInterpreter.superclass.fn.prototype._interpret_continue_.apply(_st(self), [aNode,aBlock]);
  1371. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1372. return self}, function($ctx1) {$ctx1.fill(self,"interpret:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTSteppingInterpreter)})},
  1373. args: ["aNode", "aBlock"],
  1374. source: "interpret: aNode continue: aBlock\x0a\x09nextNode := aNode.\x0a\x09continuation := [\x0a\x09\x09super interpret: aNode continue: aBlock ]",
  1375. messageSends: ["interpret:continue:"],
  1376. referencedClasses: []
  1377. }),
  1378. smalltalk.ASTSteppingInterpreter);
  1379. smalltalk.addMethod(
  1380. smalltalk.method({
  1381. selector: "nextNode",
  1382. category: 'accessing',
  1383. fn: function (){
  1384. var self=this;
  1385. return smalltalk.withContext(function($ctx1) {
  1386. var $1;
  1387. $1=self["@nextNode"];
  1388. return $1;
  1389. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.ASTSteppingInterpreter)})},
  1390. args: [],
  1391. source: "nextNode\x0a\x09^ nextNode",
  1392. messageSends: [],
  1393. referencedClasses: []
  1394. }),
  1395. smalltalk.ASTSteppingInterpreter);
  1396. smalltalk.addMethod(
  1397. smalltalk.method({
  1398. selector: "step",
  1399. category: 'stepping',
  1400. fn: function (){
  1401. var self=this;
  1402. return smalltalk.withContext(function($ctx1) {
  1403. _st(self["@continuation"])._value();
  1404. return self}, function($ctx1) {$ctx1.fill(self,"step",{},smalltalk.ASTSteppingInterpreter)})},
  1405. args: [],
  1406. source: "step\x0a\x09continuation value",
  1407. messageSends: ["value"],
  1408. referencedClasses: []
  1409. }),
  1410. smalltalk.ASTSteppingInterpreter);
  1411. smalltalk.addClass('ASTPCNodeVisitor', smalltalk.NodeVisitor, ['useInlinings', 'pc', 'context', 'currentNode'], 'Compiler-Interpreter');
  1412. 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`";
  1413. smalltalk.addMethod(
  1414. smalltalk.method({
  1415. selector: "context",
  1416. category: 'accessing',
  1417. fn: function (){
  1418. var self=this;
  1419. return smalltalk.withContext(function($ctx1) {
  1420. var $1;
  1421. $1=self["@context"];
  1422. return $1;
  1423. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTPCNodeVisitor)})},
  1424. args: [],
  1425. source: "context\x0a\x09^ context",
  1426. messageSends: [],
  1427. referencedClasses: []
  1428. }),
  1429. smalltalk.ASTPCNodeVisitor);
  1430. smalltalk.addMethod(
  1431. smalltalk.method({
  1432. selector: "context:",
  1433. category: 'accessing',
  1434. fn: function (aContext){
  1435. var self=this;
  1436. return smalltalk.withContext(function($ctx1) {
  1437. self["@context"]=aContext;
  1438. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTPCNodeVisitor)})},
  1439. args: ["aContext"],
  1440. source: "context: aContext\x0a\x09context := aContext",
  1441. messageSends: [],
  1442. referencedClasses: []
  1443. }),
  1444. smalltalk.ASTPCNodeVisitor);
  1445. smalltalk.addMethod(
  1446. smalltalk.method({
  1447. selector: "currentNode",
  1448. category: 'accessing',
  1449. fn: function (){
  1450. var self=this;
  1451. return smalltalk.withContext(function($ctx1) {
  1452. var $1;
  1453. $1=self["@currentNode"];
  1454. return $1;
  1455. }, function($ctx1) {$ctx1.fill(self,"currentNode",{},smalltalk.ASTPCNodeVisitor)})},
  1456. args: [],
  1457. source: "currentNode\x0a\x09^ currentNode",
  1458. messageSends: [],
  1459. referencedClasses: []
  1460. }),
  1461. smalltalk.ASTPCNodeVisitor);
  1462. smalltalk.addMethod(
  1463. smalltalk.method({
  1464. selector: "pc",
  1465. category: 'accessing',
  1466. fn: function (){
  1467. var self=this;
  1468. return smalltalk.withContext(function($ctx1) {
  1469. var $2,$1;
  1470. $2=self["@pc"];
  1471. if(($receiver = $2) == nil || $receiver == undefined){
  1472. $1=(0);
  1473. } else {
  1474. $1=$2;
  1475. };
  1476. return $1;
  1477. }, function($ctx1) {$ctx1.fill(self,"pc",{},smalltalk.ASTPCNodeVisitor)})},
  1478. args: [],
  1479. source: "pc\x0a\x09^ pc ifNil: [ 0 ]",
  1480. messageSends: ["ifNil:"],
  1481. referencedClasses: []
  1482. }),
  1483. smalltalk.ASTPCNodeVisitor);
  1484. smalltalk.addMethod(
  1485. smalltalk.method({
  1486. selector: "pc:",
  1487. category: 'accessing',
  1488. fn: function (anInteger){
  1489. var self=this;
  1490. return smalltalk.withContext(function($ctx1) {
  1491. self["@pc"]=anInteger;
  1492. return self}, function($ctx1) {$ctx1.fill(self,"pc:",{anInteger:anInteger},smalltalk.ASTPCNodeVisitor)})},
  1493. args: ["anInteger"],
  1494. source: "pc: anInteger\x0a\x09pc := anInteger",
  1495. messageSends: [],
  1496. referencedClasses: []
  1497. }),
  1498. smalltalk.ASTPCNodeVisitor);
  1499. smalltalk.addMethod(
  1500. smalltalk.method({
  1501. selector: "useInlinings",
  1502. category: 'accessing',
  1503. fn: function (){
  1504. var self=this;
  1505. return smalltalk.withContext(function($ctx1) {
  1506. var $2,$1;
  1507. $2=self["@useInlinings"];
  1508. if(($receiver = $2) == nil || $receiver == undefined){
  1509. $1=true;
  1510. } else {
  1511. $1=$2;
  1512. };
  1513. return $1;
  1514. }, function($ctx1) {$ctx1.fill(self,"useInlinings",{},smalltalk.ASTPCNodeVisitor)})},
  1515. args: [],
  1516. source: "useInlinings\x0a\x09^ useInlinings ifNil: [ true ]",
  1517. messageSends: ["ifNil:"],
  1518. referencedClasses: []
  1519. }),
  1520. smalltalk.ASTPCNodeVisitor);
  1521. smalltalk.addMethod(
  1522. smalltalk.method({
  1523. selector: "useInlinings:",
  1524. category: 'accessing',
  1525. fn: function (aBoolean){
  1526. var self=this;
  1527. return smalltalk.withContext(function($ctx1) {
  1528. self["@useInlinings"]=aBoolean;
  1529. return self}, function($ctx1) {$ctx1.fill(self,"useInlinings:",{aBoolean:aBoolean},smalltalk.ASTPCNodeVisitor)})},
  1530. args: ["aBoolean"],
  1531. source: "useInlinings: aBoolean\x0a\x09useInlinings := aBoolean",
  1532. messageSends: [],
  1533. referencedClasses: []
  1534. }),
  1535. smalltalk.ASTPCNodeVisitor);
  1536. smalltalk.addMethod(
  1537. smalltalk.method({
  1538. selector: "visitJSStatementNode:",
  1539. category: 'visiting',
  1540. fn: function (aNode){
  1541. var self=this;
  1542. return smalltalk.withContext(function($ctx1) {
  1543. self["@currentNode"]=aNode;
  1544. return self}, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.ASTPCNodeVisitor)})},
  1545. args: ["aNode"],
  1546. source: "visitJSStatementNode: aNode\x0a\x09currentNode := aNode",
  1547. messageSends: [],
  1548. referencedClasses: []
  1549. }),
  1550. smalltalk.ASTPCNodeVisitor);
  1551. smalltalk.addMethod(
  1552. smalltalk.method({
  1553. selector: "visitSendNode:",
  1554. category: 'visiting',
  1555. fn: function (aNode){
  1556. var self=this;
  1557. return smalltalk.withContext(function($ctx1) {
  1558. var $1,$2;
  1559. smalltalk.ASTPCNodeVisitor.superclass.fn.prototype._visitSendNode_.apply(_st(self), [aNode]);
  1560. $1=_st(self._pc()).__eq(_st(self._context())._pc());
  1561. if(! smalltalk.assert($1)){
  1562. $2=_st(aNode)._shouldBeInlined();
  1563. if(! smalltalk.assert($2)){
  1564. self._pc_(_st(self._pc()).__plus((1)));
  1565. self["@currentNode"]=aNode;
  1566. self["@currentNode"];
  1567. };
  1568. };
  1569. return self}, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode},smalltalk.ASTPCNodeVisitor)})},
  1570. args: ["aNode"],
  1571. 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 pc: self pc + 1.\x0a\x09\x09\x09currentNode := aNode ] ]",
  1572. messageSends: ["visitSendNode:", "ifFalse:", "pc:", "+", "pc", "shouldBeInlined", "=", "context"],
  1573. referencedClasses: []
  1574. }),
  1575. smalltalk.ASTPCNodeVisitor);
  1576. smalltalk.addMethod(
  1577. smalltalk.method({
  1578. selector: "interpreter:continue:",
  1579. category: '*Compiler-Interpreter',
  1580. fn: function (anInterpreter,aBlock){
  1581. var self=this;
  1582. return smalltalk.withContext(function($ctx1) {
  1583. var $1;
  1584. $1=_st(anInterpreter)._interpretNode_continue_(self,aBlock);
  1585. return $1;
  1586. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.Node)})},
  1587. args: ["anInterpreter", "aBlock"],
  1588. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretNode: self continue: aBlock",
  1589. messageSends: ["interpretNode:continue:"],
  1590. referencedClasses: []
  1591. }),
  1592. smalltalk.Node);
  1593. smalltalk.addMethod(
  1594. smalltalk.method({
  1595. selector: "isSteppingNode",
  1596. category: '*Compiler-Interpreter',
  1597. fn: function (){
  1598. var self=this;
  1599. return smalltalk.withContext(function($ctx1) {
  1600. return false;
  1601. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.Node)})},
  1602. args: [],
  1603. source: "isSteppingNode\x0a\x09^ false",
  1604. messageSends: [],
  1605. referencedClasses: []
  1606. }),
  1607. smalltalk.Node);
  1608. smalltalk.addMethod(
  1609. smalltalk.method({
  1610. selector: "interpreter:continue:",
  1611. category: '*Compiler-Interpreter',
  1612. fn: function (anInterpreter,aBlock){
  1613. var self=this;
  1614. return smalltalk.withContext(function($ctx1) {
  1615. var $1;
  1616. $1=_st(anInterpreter)._interpretAssignmentNode_continue_(self,aBlock);
  1617. return $1;
  1618. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.AssignmentNode)})},
  1619. args: ["anInterpreter", "aBlock"],
  1620. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretAssignmentNode: self continue: aBlock",
  1621. messageSends: ["interpretAssignmentNode:continue:"],
  1622. referencedClasses: []
  1623. }),
  1624. smalltalk.AssignmentNode);
  1625. smalltalk.addMethod(
  1626. smalltalk.method({
  1627. selector: "isSteppingNode",
  1628. category: '*Compiler-Interpreter',
  1629. fn: function (){
  1630. var self=this;
  1631. return smalltalk.withContext(function($ctx1) {
  1632. return true;
  1633. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.AssignmentNode)})},
  1634. args: [],
  1635. source: "isSteppingNode\x0a\x09^ true",
  1636. messageSends: [],
  1637. referencedClasses: []
  1638. }),
  1639. smalltalk.AssignmentNode);
  1640. smalltalk.addMethod(
  1641. smalltalk.method({
  1642. selector: "interpreter:continue:",
  1643. category: '*Compiler-Interpreter',
  1644. fn: function (anInterpreter,aBlock){
  1645. var self=this;
  1646. return smalltalk.withContext(function($ctx1) {
  1647. var $1;
  1648. $1=_st(anInterpreter)._interpretBlockNode_continue_(self,aBlock);
  1649. return $1;
  1650. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.BlockNode)})},
  1651. args: ["anInterpreter", "aBlock"],
  1652. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretBlockNode: self continue: aBlock",
  1653. messageSends: ["interpretBlockNode:continue:"],
  1654. referencedClasses: []
  1655. }),
  1656. smalltalk.BlockNode);
  1657. smalltalk.addMethod(
  1658. smalltalk.method({
  1659. selector: "isSteppingNode",
  1660. category: '*Compiler-Interpreter',
  1661. fn: function (){
  1662. var self=this;
  1663. return smalltalk.withContext(function($ctx1) {
  1664. return true;
  1665. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.BlockNode)})},
  1666. args: [],
  1667. source: "isSteppingNode\x0a\x09^ true",
  1668. messageSends: [],
  1669. referencedClasses: []
  1670. }),
  1671. smalltalk.BlockNode);
  1672. smalltalk.addMethod(
  1673. smalltalk.method({
  1674. selector: "interpreter:continue:",
  1675. category: '*Compiler-Interpreter',
  1676. fn: function (anInterpreter,aBlock){
  1677. var self=this;
  1678. return smalltalk.withContext(function($ctx1) {
  1679. var $1;
  1680. $1=_st(anInterpreter)._interpretCascadeNode_continue_(self,aBlock);
  1681. return $1;
  1682. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.CascadeNode)})},
  1683. args: ["anInterpreter", "aBlock"],
  1684. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretCascadeNode: self continue: aBlock",
  1685. messageSends: ["interpretCascadeNode:continue:"],
  1686. referencedClasses: []
  1687. }),
  1688. smalltalk.CascadeNode);
  1689. smalltalk.addMethod(
  1690. smalltalk.method({
  1691. selector: "interpreter:continue:",
  1692. category: '*Compiler-Interpreter',
  1693. fn: function (anInterpreter,aBlock){
  1694. var self=this;
  1695. return smalltalk.withContext(function($ctx1) {
  1696. var $1;
  1697. $1=_st(anInterpreter)._interpretDynamicArrayNode_continue_(self,aBlock);
  1698. return $1;
  1699. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.DynamicArrayNode)})},
  1700. args: ["anInterpreter", "aBlock"],
  1701. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretDynamicArrayNode: self continue: aBlock",
  1702. messageSends: ["interpretDynamicArrayNode:continue:"],
  1703. referencedClasses: []
  1704. }),
  1705. smalltalk.DynamicArrayNode);
  1706. smalltalk.addMethod(
  1707. smalltalk.method({
  1708. selector: "isSteppingNode",
  1709. category: '*Compiler-Interpreter',
  1710. fn: function (){
  1711. var self=this;
  1712. return smalltalk.withContext(function($ctx1) {
  1713. return true;
  1714. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.DynamicArrayNode)})},
  1715. args: [],
  1716. source: "isSteppingNode\x0a\x09^ true",
  1717. messageSends: [],
  1718. referencedClasses: []
  1719. }),
  1720. smalltalk.DynamicArrayNode);
  1721. smalltalk.addMethod(
  1722. smalltalk.method({
  1723. selector: "interpreter:continue:",
  1724. category: '*Compiler-Interpreter',
  1725. fn: function (anInterpreter,aBlock){
  1726. var self=this;
  1727. return smalltalk.withContext(function($ctx1) {
  1728. var $1;
  1729. $1=_st(anInterpreter)._interpretDynamicDictionaryNode_continue_(self,aBlock);
  1730. return $1;
  1731. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.DynamicDictionaryNode)})},
  1732. args: ["anInterpreter", "aBlock"],
  1733. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretDynamicDictionaryNode: self continue: aBlock",
  1734. messageSends: ["interpretDynamicDictionaryNode:continue:"],
  1735. referencedClasses: []
  1736. }),
  1737. smalltalk.DynamicDictionaryNode);
  1738. smalltalk.addMethod(
  1739. smalltalk.method({
  1740. selector: "isSteppingNode",
  1741. category: '*Compiler-Interpreter',
  1742. fn: function (){
  1743. var self=this;
  1744. return smalltalk.withContext(function($ctx1) {
  1745. return true;
  1746. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.DynamicDictionaryNode)})},
  1747. args: [],
  1748. source: "isSteppingNode\x0a\x09^ true",
  1749. messageSends: [],
  1750. referencedClasses: []
  1751. }),
  1752. smalltalk.DynamicDictionaryNode);
  1753. smalltalk.addMethod(
  1754. smalltalk.method({
  1755. selector: "interpreter:continue:",
  1756. category: '*Compiler-Interpreter',
  1757. fn: function (anInterpreter,aBlock){
  1758. var self=this;
  1759. return smalltalk.withContext(function($ctx1) {
  1760. var $1;
  1761. $1=_st(anInterpreter)._interpretJSStatementNode_continue_(self,aBlock);
  1762. return $1;
  1763. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.JSStatementNode)})},
  1764. args: ["anInterpreter", "aBlock"],
  1765. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretJSStatementNode: self continue: aBlock",
  1766. messageSends: ["interpretJSStatementNode:continue:"],
  1767. referencedClasses: []
  1768. }),
  1769. smalltalk.JSStatementNode);
  1770. smalltalk.addMethod(
  1771. smalltalk.method({
  1772. selector: "isSteppingNode",
  1773. category: '*Compiler-Interpreter',
  1774. fn: function (){
  1775. var self=this;
  1776. return smalltalk.withContext(function($ctx1) {
  1777. return true;
  1778. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.JSStatementNode)})},
  1779. args: [],
  1780. source: "isSteppingNode\x0a\x09^ true",
  1781. messageSends: [],
  1782. referencedClasses: []
  1783. }),
  1784. smalltalk.JSStatementNode);
  1785. smalltalk.addMethod(
  1786. smalltalk.method({
  1787. selector: "interpreter:continue:",
  1788. category: '*Compiler-Interpreter',
  1789. fn: function (anInterpreter,aBlock){
  1790. var self=this;
  1791. return smalltalk.withContext(function($ctx1) {
  1792. var $1;
  1793. $1=_st(anInterpreter)._interpretMethodNode_continue_(self,aBlock);
  1794. return $1;
  1795. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.MethodNode)})},
  1796. args: ["anInterpreter", "aBlock"],
  1797. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretMethodNode: self continue: aBlock",
  1798. messageSends: ["interpretMethodNode:continue:"],
  1799. referencedClasses: []
  1800. }),
  1801. smalltalk.MethodNode);
  1802. smalltalk.addMethod(
  1803. smalltalk.method({
  1804. selector: "interpreter:continue:",
  1805. category: '*Compiler-Interpreter',
  1806. fn: function (anInterpreter,aBlock){
  1807. var self=this;
  1808. return smalltalk.withContext(function($ctx1) {
  1809. var $1;
  1810. $1=_st(anInterpreter)._interpretReturnNode_continue_(self,aBlock);
  1811. return $1;
  1812. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.ReturnNode)})},
  1813. args: ["anInterpreter", "aBlock"],
  1814. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretReturnNode: self continue: aBlock",
  1815. messageSends: ["interpretReturnNode:continue:"],
  1816. referencedClasses: []
  1817. }),
  1818. smalltalk.ReturnNode);
  1819. smalltalk.addMethod(
  1820. smalltalk.method({
  1821. selector: "interpreter:continue:",
  1822. category: '*Compiler-Interpreter',
  1823. fn: function (anInterpreter,aBlock){
  1824. var self=this;
  1825. return smalltalk.withContext(function($ctx1) {
  1826. var $1;
  1827. $1=_st(anInterpreter)._interpretSendNode_continue_(self,aBlock);
  1828. return $1;
  1829. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.SendNode)})},
  1830. args: ["anInterpreter", "aBlock"],
  1831. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretSendNode: self continue: aBlock",
  1832. messageSends: ["interpretSendNode:continue:"],
  1833. referencedClasses: []
  1834. }),
  1835. smalltalk.SendNode);
  1836. smalltalk.addMethod(
  1837. smalltalk.method({
  1838. selector: "isSteppingNode",
  1839. category: '*Compiler-Interpreter',
  1840. fn: function (){
  1841. var self=this;
  1842. return smalltalk.withContext(function($ctx1) {
  1843. return true;
  1844. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.SendNode)})},
  1845. args: [],
  1846. source: "isSteppingNode\x0a\x09^ true",
  1847. messageSends: [],
  1848. referencedClasses: []
  1849. }),
  1850. smalltalk.SendNode);
  1851. smalltalk.addMethod(
  1852. smalltalk.method({
  1853. selector: "interpreter:continue:",
  1854. category: '*Compiler-Interpreter',
  1855. fn: function (anInterpreter,aBlock){
  1856. var self=this;
  1857. return smalltalk.withContext(function($ctx1) {
  1858. var $1;
  1859. $1=_st(anInterpreter)._interpretSequenceNode_continue_(self,aBlock);
  1860. return $1;
  1861. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.SequenceNode)})},
  1862. args: ["anInterpreter", "aBlock"],
  1863. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretSequenceNode: self continue: aBlock",
  1864. messageSends: ["interpretSequenceNode:continue:"],
  1865. referencedClasses: []
  1866. }),
  1867. smalltalk.SequenceNode);
  1868. smalltalk.addMethod(
  1869. smalltalk.method({
  1870. selector: "interpreter:continue:",
  1871. category: '*Compiler-Interpreter',
  1872. fn: function (anInterpreter,aBlock){
  1873. var self=this;
  1874. return smalltalk.withContext(function($ctx1) {
  1875. var $1;
  1876. $1=_st(anInterpreter)._interpretBlockSequenceNode_continue_(self,aBlock);
  1877. return $1;
  1878. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.BlockSequenceNode)})},
  1879. args: ["anInterpreter", "aBlock"],
  1880. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretBlockSequenceNode: self continue: aBlock",
  1881. messageSends: ["interpretBlockSequenceNode:continue:"],
  1882. referencedClasses: []
  1883. }),
  1884. smalltalk.BlockSequenceNode);
  1885. smalltalk.addMethod(
  1886. smalltalk.method({
  1887. selector: "interpreter:continue:",
  1888. category: '*Compiler-Interpreter',
  1889. fn: function (anInterpreter,aBlock){
  1890. var self=this;
  1891. return smalltalk.withContext(function($ctx1) {
  1892. var $1;
  1893. $1=_st(anInterpreter)._interpretValueNode_continue_(self,aBlock);
  1894. return $1;
  1895. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.ValueNode)})},
  1896. args: ["anInterpreter", "aBlock"],
  1897. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretValueNode: self continue: aBlock",
  1898. messageSends: ["interpretValueNode:continue:"],
  1899. referencedClasses: []
  1900. }),
  1901. smalltalk.ValueNode);
  1902. smalltalk.addMethod(
  1903. smalltalk.method({
  1904. selector: "interpreter:continue:",
  1905. category: '*Compiler-Interpreter',
  1906. fn: function (anInterpreter,aBlock){
  1907. var self=this;
  1908. return smalltalk.withContext(function($ctx1) {
  1909. var $1;
  1910. $1=_st(anInterpreter)._interpretVariableNode_continue_(self,aBlock);
  1911. return $1;
  1912. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.VariableNode)})},
  1913. args: ["anInterpreter", "aBlock"],
  1914. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretVariableNode: self continue: aBlock",
  1915. messageSends: ["interpretVariableNode:continue:"],
  1916. referencedClasses: []
  1917. }),
  1918. smalltalk.VariableNode);
  1919. smalltalk.addMethod(
  1920. smalltalk.method({
  1921. selector: "interpreter:continue:",
  1922. category: '*Compiler-Interpreter',
  1923. fn: function (anInterpreter,aBlock){
  1924. var self=this;
  1925. return smalltalk.withContext(function($ctx1) {
  1926. var $1;
  1927. $1=_st(anInterpreter)._interpretClassReferenceNode_continue_(self,aBlock);
  1928. return $1;
  1929. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.ClassReferenceNode)})},
  1930. args: ["anInterpreter", "aBlock"],
  1931. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretClassReferenceNode: self continue: aBlock",
  1932. messageSends: ["interpretClassReferenceNode:continue:"],
  1933. referencedClasses: []
  1934. }),
  1935. smalltalk.ClassReferenceNode);
  1936. });