Compiler-Interpreter.js 76 KB

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