1
0

Compiler-Interpreter.js 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376
  1. smalltalk.addPackage('Compiler-Interpreter', {});
  2. smalltalk.addClass('AIContext', smalltalk.NodeVisitor, ['outerContext', 'pc', 'locals', 'method'], 'Compiler-Interpreter');
  3. smalltalk.AIContext.comment="AIContext is like a `MethodContext`, used by the `ASTInterpreter`.\x0aUnlike a `MethodContext`, it is not read-only.\x0a\x0aWhen debugging, `AIContext` instances are created by copying the current `MethodContext` (thisContext)"
  4. smalltalk.addMethod(
  5. "_initializeFromMethodContext_",
  6. smalltalk.method({
  7. selector: "initializeFromMethodContext:",
  8. category: 'initialization',
  9. fn: function (aMethodContext){
  10. var self=this;
  11. return smalltalk.withContext(function($ctx1) { var $1;
  12. _st(self)._pc_(_st(aMethodContext)._pc());
  13. _st(self)._receiver_(_st(aMethodContext)._receiver());
  14. _st(self)._method_(_st(aMethodContext)._method());
  15. $1=_st(aMethodContext)._outerContext();
  16. if(($receiver = $1) == nil || $receiver == undefined){
  17. $1;
  18. } else {
  19. _st(self)._outerContext_(_st(_st(self)._class())._fromMethodContext_(_st(aMethodContext)._outerContext()));
  20. };
  21. _st(_st(aMethodContext)._locals())._keysAndValuesDo_((function(key,value){
  22. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._locals())._at_put_(key,value);
  23. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1)})}));
  24. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromMethodContext:",{aMethodContext:aMethodContext}, smalltalk.AIContext)})},
  25. args: ["aMethodContext"],
  26. source: "initializeFromMethodContext: aMethodContext\x0a\x09self pc: aMethodContext pc.\x0a self receiver: aMethodContext receiver.\x0a self method: aMethodContext method.\x0a aMethodContext outerContext ifNotNil: [\x0a\x09\x09self outerContext: (self class fromMethodContext: aMethodContext outerContext) ].\x0a aMethodContext locals keysAndValuesDo: [ :key :value |\x0a \x09self locals at: key put: value ]\x0a ",
  27. messageSends: ["pc:", "pc", "receiver:", "receiver", "method:", "method", "ifNotNil:", "outerContext:", "fromMethodContext:", "outerContext", "class", "keysAndValuesDo:", "at:put:", "locals"],
  28. referencedClasses: []
  29. }),
  30. smalltalk.AIContext);
  31. smalltalk.addMethod(
  32. "_localAt_",
  33. smalltalk.method({
  34. selector: "localAt:",
  35. category: 'accessing',
  36. fn: function (aString){
  37. var self=this;
  38. return smalltalk.withContext(function($ctx1) { var $1;
  39. $1=_st(_st(self)._locals())._at_ifAbsent_(aString,(function(){
  40. return smalltalk.withContext(function($ctx2) { return nil;
  41. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  42. return $1;
  43. }, function($ctx1) {$ctx1.fill(self,"localAt:",{aString:aString}, smalltalk.AIContext)})},
  44. args: ["aString"],
  45. source: "localAt: aString\x0a\x09^ self locals at: aString ifAbsent: [ nil ]",
  46. messageSends: ["at:ifAbsent:", "locals"],
  47. referencedClasses: []
  48. }),
  49. smalltalk.AIContext);
  50. smalltalk.addMethod(
  51. "_localAt_put_",
  52. smalltalk.method({
  53. selector: "localAt:put:",
  54. category: 'accessing',
  55. fn: function (aString,anObject){
  56. var self=this;
  57. return smalltalk.withContext(function($ctx1) { _st(_st(self)._locals())._at_put_(aString,anObject);
  58. return self}, function($ctx1) {$ctx1.fill(self,"localAt:put:",{aString:aString,anObject:anObject}, smalltalk.AIContext)})},
  59. args: ["aString", "anObject"],
  60. source: "localAt: aString put: anObject\x0a\x09self locals at: aString put: anObject",
  61. messageSends: ["at:put:", "locals"],
  62. referencedClasses: []
  63. }),
  64. smalltalk.AIContext);
  65. smalltalk.addMethod(
  66. "_locals",
  67. smalltalk.method({
  68. selector: "locals",
  69. category: 'accessing',
  70. fn: function (){
  71. var self=this;
  72. return smalltalk.withContext(function($ctx1) { var $2,$1;
  73. $2=self["@locals"];
  74. if(($receiver = $2) == nil || $receiver == undefined){
  75. self["@locals"]=_st((smalltalk.Dictionary || Dictionary))._new();
  76. $1=self["@locals"];
  77. } else {
  78. $1=$2;
  79. };
  80. return $1;
  81. }, function($ctx1) {$ctx1.fill(self,"locals",{}, smalltalk.AIContext)})},
  82. args: [],
  83. source: "locals\x0a\x09^ locals ifNil: [ locals := Dictionary new ]",
  84. messageSends: ["ifNil:", "new"],
  85. referencedClasses: ["Dictionary"]
  86. }),
  87. smalltalk.AIContext);
  88. smalltalk.addMethod(
  89. "_method",
  90. smalltalk.method({
  91. selector: "method",
  92. category: 'accessing',
  93. fn: function (){
  94. var self=this;
  95. return smalltalk.withContext(function($ctx1) { var $1;
  96. $1=self["@method"];
  97. return $1;
  98. }, function($ctx1) {$ctx1.fill(self,"method",{}, smalltalk.AIContext)})},
  99. args: [],
  100. source: "method\x0a\x09^ method",
  101. messageSends: [],
  102. referencedClasses: []
  103. }),
  104. smalltalk.AIContext);
  105. smalltalk.addMethod(
  106. "_method_",
  107. smalltalk.method({
  108. selector: "method:",
  109. category: 'accessing',
  110. fn: function (aCompiledMethod){
  111. var self=this;
  112. return smalltalk.withContext(function($ctx1) { self["@method"]=aCompiledMethod;
  113. return self}, function($ctx1) {$ctx1.fill(self,"method:",{aCompiledMethod:aCompiledMethod}, smalltalk.AIContext)})},
  114. args: ["aCompiledMethod"],
  115. source: "method: aCompiledMethod\x0a\x09method := aCompiledMethod",
  116. messageSends: [],
  117. referencedClasses: []
  118. }),
  119. smalltalk.AIContext);
  120. smalltalk.addMethod(
  121. "_outerContext",
  122. smalltalk.method({
  123. selector: "outerContext",
  124. category: 'accessing',
  125. fn: function (){
  126. var self=this;
  127. return smalltalk.withContext(function($ctx1) { var $1;
  128. $1=self["@outerContext"];
  129. return $1;
  130. }, function($ctx1) {$ctx1.fill(self,"outerContext",{}, smalltalk.AIContext)})},
  131. args: [],
  132. source: "outerContext\x0a\x09^ outerContext",
  133. messageSends: [],
  134. referencedClasses: []
  135. }),
  136. smalltalk.AIContext);
  137. smalltalk.addMethod(
  138. "_outerContext_",
  139. smalltalk.method({
  140. selector: "outerContext:",
  141. category: 'accessing',
  142. fn: function (anAIContext){
  143. var self=this;
  144. return smalltalk.withContext(function($ctx1) { self["@outerContext"]=anAIContext;
  145. return self}, function($ctx1) {$ctx1.fill(self,"outerContext:",{anAIContext:anAIContext}, smalltalk.AIContext)})},
  146. args: ["anAIContext"],
  147. source: "outerContext: anAIContext\x0a\x09outerContext := anAIContext",
  148. messageSends: [],
  149. referencedClasses: []
  150. }),
  151. smalltalk.AIContext);
  152. smalltalk.addMethod(
  153. "_pc",
  154. smalltalk.method({
  155. selector: "pc",
  156. category: 'accessing',
  157. fn: function (){
  158. var self=this;
  159. return smalltalk.withContext(function($ctx1) { var $2,$1;
  160. $2=self["@pc"];
  161. if(($receiver = $2) == nil || $receiver == undefined){
  162. self["@pc"]=(0);
  163. $1=self["@pc"];
  164. } else {
  165. $1=$2;
  166. };
  167. return $1;
  168. }, function($ctx1) {$ctx1.fill(self,"pc",{}, smalltalk.AIContext)})},
  169. args: [],
  170. source: "pc\x0a\x09^ pc ifNil: [ pc := 0 ]",
  171. messageSends: ["ifNil:"],
  172. referencedClasses: []
  173. }),
  174. smalltalk.AIContext);
  175. smalltalk.addMethod(
  176. "_pc_",
  177. smalltalk.method({
  178. selector: "pc:",
  179. category: 'accessing',
  180. fn: function (anInteger){
  181. var self=this;
  182. return smalltalk.withContext(function($ctx1) { self["@pc"]=anInteger;
  183. return self}, function($ctx1) {$ctx1.fill(self,"pc:",{anInteger:anInteger}, smalltalk.AIContext)})},
  184. args: ["anInteger"],
  185. source: "pc: anInteger\x0a\x09pc := anInteger",
  186. messageSends: [],
  187. referencedClasses: []
  188. }),
  189. smalltalk.AIContext);
  190. smalltalk.addMethod(
  191. "_receiver",
  192. smalltalk.method({
  193. selector: "receiver",
  194. category: 'accessing',
  195. fn: function (){
  196. var self=this;
  197. return smalltalk.withContext(function($ctx1) { var $1;
  198. $1=_st(self)._localAt_("self");
  199. return $1;
  200. }, function($ctx1) {$ctx1.fill(self,"receiver",{}, smalltalk.AIContext)})},
  201. args: [],
  202. source: "receiver\x0a\x09^ self localAt: 'self'",
  203. messageSends: ["localAt:"],
  204. referencedClasses: []
  205. }),
  206. smalltalk.AIContext);
  207. smalltalk.addMethod(
  208. "_receiver_",
  209. smalltalk.method({
  210. selector: "receiver:",
  211. category: 'accessing',
  212. fn: function (anObject){
  213. var self=this;
  214. return smalltalk.withContext(function($ctx1) { _st(self)._localAt_put_("self",anObject);
  215. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject}, smalltalk.AIContext)})},
  216. args: ["anObject"],
  217. source: "receiver: anObject\x0a\x09self localAt: 'self' put: anObject",
  218. messageSends: ["localAt:put:"],
  219. referencedClasses: []
  220. }),
  221. smalltalk.AIContext);
  222. smalltalk.addMethod(
  223. "_selector",
  224. smalltalk.method({
  225. selector: "selector",
  226. category: 'accessing',
  227. fn: function (){
  228. var self=this;
  229. return smalltalk.withContext(function($ctx1) { var $2,$1;
  230. $2=_st(self)._metod();
  231. if(($receiver = $2) == nil || $receiver == undefined){
  232. $1=$2;
  233. } else {
  234. $1=_st(_st(self)._method())._selector();
  235. };
  236. return $1;
  237. }, function($ctx1) {$ctx1.fill(self,"selector",{}, smalltalk.AIContext)})},
  238. args: [],
  239. source: "selector\x0a\x09^ self metod\x0a \x09ifNotNil: [ self method selector ]",
  240. messageSends: ["ifNotNil:", "selector", "method", "metod"],
  241. referencedClasses: []
  242. }),
  243. smalltalk.AIContext);
  244. smalltalk.addMethod(
  245. "_fromMethodContext_",
  246. smalltalk.method({
  247. selector: "fromMethodContext:",
  248. category: 'instance creation',
  249. fn: function (aMethodContext){
  250. var self=this;
  251. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  252. $2=_st(self)._new();
  253. _st($2)._initializeFromMethodContext_(aMethodContext);
  254. $3=_st($2)._yourself();
  255. $1=$3;
  256. return $1;
  257. }, function($ctx1) {$ctx1.fill(self,"fromMethodContext:",{aMethodContext:aMethodContext}, smalltalk.AIContext.klass)})},
  258. args: ["aMethodContext"],
  259. source: "fromMethodContext: aMethodContext\x0a\x09^ self new\x0a \x09initializeFromMethodContext: aMethodContext;\x0a yourself",
  260. messageSends: ["initializeFromMethodContext:", "new", "yourself"],
  261. referencedClasses: []
  262. }),
  263. smalltalk.AIContext.klass);
  264. smalltalk.addClass('ASTDebugger', smalltalk.Object, ['interpreter', 'context'], 'Compiler-Interpreter');
  265. smalltalk.ASTDebugger.comment="ASTDebugger is a debugger to Amber.\x0aIt uses an AST interpreter to step through the code.\x0a\x0aASTDebugger instances are created from a `MethodContext` with `ASTDebugger class >> context:`.\x0aThey hold an `AIContext` instance internally, recursive copy of the `MethodContext`.\x0a\x0aUse the methods of the 'stepping' protocol to do stepping."
  266. smalltalk.addMethod(
  267. "_context_",
  268. smalltalk.method({
  269. selector: "context:",
  270. category: 'accessing',
  271. fn: function (aContext){
  272. var self=this;
  273. return smalltalk.withContext(function($ctx1) { self["@context"]=_st((smalltalk.AIContext || AIContext))._new();
  274. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext}, smalltalk.ASTDebugger)})},
  275. args: ["aContext"],
  276. source: "context: aContext\x0a\x09context := AIContext new.",
  277. messageSends: ["new"],
  278. referencedClasses: ["AIContext"]
  279. }),
  280. smalltalk.ASTDebugger);
  281. smalltalk.addMethod(
  282. "_defaultInterpreter",
  283. smalltalk.method({
  284. selector: "defaultInterpreter",
  285. category: 'defaults',
  286. fn: function (){
  287. var self=this;
  288. return smalltalk.withContext(function($ctx1) { var $1;
  289. $1=_st((smalltalk.ASTSteppingInterpreter || ASTSteppingInterpreter))._new();
  290. return $1;
  291. }, function($ctx1) {$ctx1.fill(self,"defaultInterpreter",{}, smalltalk.ASTDebugger)})},
  292. args: [],
  293. source: "defaultInterpreter\x0a\x09^ ASTSteppingInterpreter new",
  294. messageSends: ["new"],
  295. referencedClasses: ["ASTSteppingInterpreter"]
  296. }),
  297. smalltalk.ASTDebugger);
  298. smalltalk.addMethod(
  299. "_initializeWithContext_",
  300. smalltalk.method({
  301. selector: "initializeWithContext:",
  302. category: 'initialization',
  303. fn: function (aMethodContext){
  304. var self=this;
  305. return smalltalk.withContext(function($ctx1) { _st(self)._context_fromMethodContext_((smalltalk.IAContext || IAContext),aMethodContext);
  306. return self}, function($ctx1) {$ctx1.fill(self,"initializeWithContext:",{aMethodContext:aMethodContext}, smalltalk.ASTDebugger)})},
  307. args: ["aMethodContext"],
  308. source: "initializeWithContext: aMethodContext\x0a\x09\x22TODO: do we need to handle block contexts?\x22\x0a self context: IAContext fromMethodContext: aMethodContext",
  309. messageSends: ["context:fromMethodContext:"],
  310. referencedClasses: ["IAContext"]
  311. }),
  312. smalltalk.ASTDebugger);
  313. smalltalk.addMethod(
  314. "_interpreter",
  315. smalltalk.method({
  316. selector: "interpreter",
  317. category: 'accessing',
  318. fn: function (){
  319. var self=this;
  320. return smalltalk.withContext(function($ctx1) { var $2,$1;
  321. $2=self["@interpreter"];
  322. if(($receiver = $2) == nil || $receiver == undefined){
  323. self["@interpreter"]=_st(self)._defaultInterpreter();
  324. $1=self["@interpreter"];
  325. } else {
  326. $1=$2;
  327. };
  328. return $1;
  329. }, function($ctx1) {$ctx1.fill(self,"interpreter",{}, smalltalk.ASTDebugger)})},
  330. args: [],
  331. source: "interpreter\x0a\x09^ interpreter ifNil: [ interpreter := self defaultInterpreter ]",
  332. messageSends: ["ifNil:", "defaultInterpreter"],
  333. referencedClasses: []
  334. }),
  335. smalltalk.ASTDebugger);
  336. smalltalk.addMethod(
  337. "_interpreter_",
  338. smalltalk.method({
  339. selector: "interpreter:",
  340. category: 'accessing',
  341. fn: function (anInterpreter){
  342. var self=this;
  343. return smalltalk.withContext(function($ctx1) { self["@interpreter"]=anInterpreter;
  344. return self}, function($ctx1) {$ctx1.fill(self,"interpreter:",{anInterpreter:anInterpreter}, smalltalk.ASTDebugger)})},
  345. args: ["anInterpreter"],
  346. source: "interpreter: anInterpreter\x0a\x09interpreter := anInterpreter",
  347. messageSends: [],
  348. referencedClasses: []
  349. }),
  350. smalltalk.ASTDebugger);
  351. smalltalk.addMethod(
  352. "_method",
  353. smalltalk.method({
  354. selector: "method",
  355. category: 'accessing',
  356. fn: function (){
  357. var self=this;
  358. return smalltalk.withContext(function($ctx1) { var $1;
  359. $1=_st(_st(self)._context())._method();
  360. return $1;
  361. }, function($ctx1) {$ctx1.fill(self,"method",{}, smalltalk.ASTDebugger)})},
  362. args: [],
  363. source: "method\x0a\x09^ self context method",
  364. messageSends: ["method", "context"],
  365. referencedClasses: []
  366. }),
  367. smalltalk.ASTDebugger);
  368. smalltalk.addMethod(
  369. "_restart",
  370. smalltalk.method({
  371. selector: "restart",
  372. category: 'stepping',
  373. fn: function (){
  374. var self=this;
  375. return smalltalk.withContext(function($ctx1) { _st(self)._shouldBeImplemented();
  376. return self}, function($ctx1) {$ctx1.fill(self,"restart",{}, smalltalk.ASTDebugger)})},
  377. args: [],
  378. source: "restart\x0a\x09self shouldBeImplemented",
  379. messageSends: ["shouldBeImplemented"],
  380. referencedClasses: []
  381. }),
  382. smalltalk.ASTDebugger);
  383. smalltalk.addMethod(
  384. "_resume",
  385. smalltalk.method({
  386. selector: "resume",
  387. category: 'stepping',
  388. fn: function (){
  389. var self=this;
  390. return smalltalk.withContext(function($ctx1) { _st(self)._shouldBeImplemented();
  391. return self}, function($ctx1) {$ctx1.fill(self,"resume",{}, smalltalk.ASTDebugger)})},
  392. args: [],
  393. source: "resume\x0a\x09self shouldBeImplemented",
  394. messageSends: ["shouldBeImplemented"],
  395. referencedClasses: []
  396. }),
  397. smalltalk.ASTDebugger);
  398. smalltalk.addMethod(
  399. "_stepInto",
  400. smalltalk.method({
  401. selector: "stepInto",
  402. category: 'stepping',
  403. fn: function (){
  404. var self=this;
  405. return smalltalk.withContext(function($ctx1) { _st(self)._shouldBeImplemented();
  406. return self}, function($ctx1) {$ctx1.fill(self,"stepInto",{}, smalltalk.ASTDebugger)})},
  407. args: [],
  408. source: "stepInto\x0a\x09self shouldBeImplemented",
  409. messageSends: ["shouldBeImplemented"],
  410. referencedClasses: []
  411. }),
  412. smalltalk.ASTDebugger);
  413. smalltalk.addMethod(
  414. "_stepOver",
  415. smalltalk.method({
  416. selector: "stepOver",
  417. category: 'stepping',
  418. fn: function (){
  419. var self=this;
  420. return smalltalk.withContext(function($ctx1) { _st(self)._shouldBeImplemented();
  421. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{}, smalltalk.ASTDebugger)})},
  422. args: [],
  423. source: "stepOver\x0a\x09self shouldBeImplemented",
  424. messageSends: ["shouldBeImplemented"],
  425. referencedClasses: []
  426. }),
  427. smalltalk.ASTDebugger);
  428. smalltalk.addMethod(
  429. "_context_",
  430. smalltalk.method({
  431. selector: "context:",
  432. category: 'instance creation',
  433. fn: function (aMethodContext){
  434. var self=this;
  435. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  436. $2=_st(self)._new();
  437. _st($2)._initializeWithContext_(aMethodContext);
  438. $3=_st($2)._yourself();
  439. $1=$3;
  440. return $1;
  441. }, function($ctx1) {$ctx1.fill(self,"context:",{aMethodContext:aMethodContext}, smalltalk.ASTDebugger.klass)})},
  442. args: ["aMethodContext"],
  443. source: "context: aMethodContext\x0a\x09^ self new\x0a \x09initializeWithContext: aMethodContext;\x0a yourself",
  444. messageSends: ["initializeWithContext:", "new", "yourself"],
  445. referencedClasses: []
  446. }),
  447. smalltalk.ASTDebugger.klass);
  448. smalltalk.addClass('ASTInterpreter', smalltalk.Object, ['currentNode', 'context', 'shouldReturn', 'result'], 'Compiler-Interpreter');
  449. smalltalk.ASTInterpreter.comment="ASTIntepreter is like a `NodeVisitor`, interpreting nodes one after each other.\x0aIt is built using Continuation Passing Style for stepping purposes.\x0a\x0aUsage example:\x0a\x0a | ast interpreter |\x0a ast := Smalltalk current parse: 'foo 1+2+4'.\x0a (SemanticAnalyzer on: Object) visit: ast.\x0a\x0a ASTInterpreter new\x0a interpret: ast nodes first;\x0a result \x22Answers 7\x22"
  450. smalltalk.addMethod(
  451. "_assign_to_",
  452. smalltalk.method({
  453. selector: "assign:to:",
  454. category: 'private',
  455. fn: function (aNode,anObject){
  456. var self=this;
  457. return smalltalk.withContext(function($ctx1) { var $2,$1;
  458. $2=_st(_st(aNode)._binding())._isInstanceVar();
  459. if(smalltalk.assert($2)){
  460. $1=_st(_st(_st(self)._context())._receiver())._instVarAt_put_(_st(aNode)._value(),anObject);
  461. } else {
  462. $1=_st(_st(self)._context())._localAt_put_(_st(aNode)._value(),anObject);
  463. };
  464. return $1;
  465. }, function($ctx1) {$ctx1.fill(self,"assign:to:",{aNode:aNode,anObject:anObject}, smalltalk.ASTInterpreter)})},
  466. args: ["aNode", "anObject"],
  467. source: "assign: aNode to: anObject\x0a\x09^ aNode binding isInstanceVar \x0a \x09ifTrue: [ self context receiver instVarAt: aNode value put: anObject ]\x0a \x09ifFalse: [ self context localAt: aNode value put: anObject ]",
  468. messageSends: ["ifTrue:ifFalse:", "instVarAt:put:", "value", "receiver", "context", "localAt:put:", "isInstanceVar", "binding"],
  469. referencedClasses: []
  470. }),
  471. smalltalk.ASTInterpreter);
  472. smalltalk.addMethod(
  473. "_context",
  474. smalltalk.method({
  475. selector: "context",
  476. category: 'accessing',
  477. fn: function (){
  478. var self=this;
  479. return smalltalk.withContext(function($ctx1) { var $2,$1;
  480. $2=self["@context"];
  481. if(($receiver = $2) == nil || $receiver == undefined){
  482. self["@context"]=_st((smalltalk.AIContext || AIContext))._new();
  483. $1=self["@context"];
  484. } else {
  485. $1=$2;
  486. };
  487. return $1;
  488. }, function($ctx1) {$ctx1.fill(self,"context",{}, smalltalk.ASTInterpreter)})},
  489. args: [],
  490. source: "context\x0a\x09^ context ifNil: [ context := AIContext new ]",
  491. messageSends: ["ifNil:", "new"],
  492. referencedClasses: ["AIContext"]
  493. }),
  494. smalltalk.ASTInterpreter);
  495. smalltalk.addMethod(
  496. "_context_",
  497. smalltalk.method({
  498. selector: "context:",
  499. category: 'accessing',
  500. fn: function (anAIContext){
  501. var self=this;
  502. return smalltalk.withContext(function($ctx1) { self["@context"]=anAIContext;
  503. return self}, function($ctx1) {$ctx1.fill(self,"context:",{anAIContext:anAIContext}, smalltalk.ASTInterpreter)})},
  504. args: ["anAIContext"],
  505. source: "context: anAIContext\x0a\x09context := anAIContext",
  506. messageSends: [],
  507. referencedClasses: []
  508. }),
  509. smalltalk.ASTInterpreter);
  510. smalltalk.addMethod(
  511. "_continue_value_",
  512. smalltalk.method({
  513. selector: "continue:value:",
  514. category: 'private',
  515. fn: function (aBlock,anObject){
  516. var self=this;
  517. return smalltalk.withContext(function($ctx1) { self["@result"]=anObject;
  518. _st(aBlock)._value_(anObject);
  519. return self}, function($ctx1) {$ctx1.fill(self,"continue:value:",{aBlock:aBlock,anObject:anObject}, smalltalk.ASTInterpreter)})},
  520. args: ["aBlock", "anObject"],
  521. source: "continue: aBlock value: anObject\x0a\x09result := anObject.\x0a aBlock value: anObject",
  522. messageSends: ["value:"],
  523. referencedClasses: []
  524. }),
  525. smalltalk.ASTInterpreter);
  526. smalltalk.addMethod(
  527. "_currentNode",
  528. smalltalk.method({
  529. selector: "currentNode",
  530. category: 'accessing',
  531. fn: function (){
  532. var self=this;
  533. return smalltalk.withContext(function($ctx1) { var $1;
  534. $1=self["@currentNode"];
  535. return $1;
  536. }, function($ctx1) {$ctx1.fill(self,"currentNode",{}, smalltalk.ASTInterpreter)})},
  537. args: [],
  538. source: "currentNode\x0a\x09^ currentNode",
  539. messageSends: [],
  540. referencedClasses: []
  541. }),
  542. smalltalk.ASTInterpreter);
  543. smalltalk.addMethod(
  544. "_eval_",
  545. smalltalk.method({
  546. selector: "eval:",
  547. category: 'private',
  548. fn: function (aString){
  549. var self=this;
  550. var source,function_;
  551. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  552. source=_st((smalltalk.String || String))._streamContents_((function(str){
  553. return smalltalk.withContext(function($ctx2) { _st(str)._nextPutAll_("(function(");
  554. _st(_st(_st(_st(self)._context())._locals())._keys())._do_separatedBy_((function(each){
  555. return smalltalk.withContext(function($ctx3) { return _st(str)._nextPutAll_(each);
  556. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  557. return smalltalk.withContext(function($ctx3) { return _st(str)._nextPutAll_(",");
  558. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  559. $1=str;
  560. _st($1)._nextPutAll_("){ return (function() {");
  561. _st($1)._nextPutAll_(aString);
  562. $2=_st($1)._nextPutAll_("})() })");
  563. return $2;
  564. }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1)})}));
  565. function_=_st(_st((smalltalk.Compiler || Compiler))._new())._eval_(source);
  566. $3=_st(function_)._valueWithPossibleArguments_(_st(_st(_st(self)._context())._locals())._values());
  567. return $3;
  568. }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString,source:source,function_:function_}, smalltalk.ASTInterpreter)})},
  569. args: ["aString"],
  570. source: "eval: aString\x0a\x09\x22Evaluate aString as JS source inside an JS function. \x0a aString is not sandboxed.\x22\x0a \x0a | source function |\x0a \x0a source := String streamContents: [ :str |\x0a \x09str nextPutAll: '(function('.\x0a self context locals keys \x0a \x09do: [ :each | str nextPutAll: each ]\x0a \x09separatedBy: [ str nextPutAll: ',' ].\x0a str \x0a \x09nextPutAll: '){ return (function() {';\x0a \x09nextPutAll: aString;\x0a nextPutAll: '})() })' ].\x0a \x0a\x09function := Compiler new eval: source.\x0a \x0a\x09^ function valueWithPossibleArguments: self context locals values",
  571. messageSends: ["streamContents:", "nextPutAll:", "do:separatedBy:", "keys", "locals", "context", "eval:", "new", "valueWithPossibleArguments:", "values"],
  572. referencedClasses: ["String", "Compiler"]
  573. }),
  574. smalltalk.ASTInterpreter);
  575. smalltalk.addMethod(
  576. "_initialize",
  577. smalltalk.method({
  578. selector: "initialize",
  579. category: 'initialization',
  580. fn: function (){
  581. var self=this;
  582. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  583. self["@shouldReturn"]=false;
  584. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.ASTInterpreter)})},
  585. args: [],
  586. source: "initialize\x0a\x09super initialize.\x0a shouldReturn := false",
  587. messageSends: ["initialize"],
  588. referencedClasses: []
  589. }),
  590. smalltalk.ASTInterpreter);
  591. smalltalk.addMethod(
  592. "_interpret_",
  593. smalltalk.method({
  594. selector: "interpret:",
  595. category: 'interpreting',
  596. fn: function (aNode){
  597. var self=this;
  598. return smalltalk.withContext(function($ctx1) { self["@shouldReturn"]=false;
  599. _st(self)._interpret_continue_(aNode,(function(value){
  600. return smalltalk.withContext(function($ctx2) { self["@result"]=value;
  601. return self["@result"];
  602. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  603. return self}, function($ctx1) {$ctx1.fill(self,"interpret:",{aNode:aNode}, smalltalk.ASTInterpreter)})},
  604. args: ["aNode"],
  605. source: "interpret: aNode\x0a\x09shouldReturn := false.\x0a self interpret: aNode continue: [ :value |\x0a \x09result := value ]",
  606. messageSends: ["interpret:continue:"],
  607. referencedClasses: []
  608. }),
  609. smalltalk.ASTInterpreter);
  610. smalltalk.addMethod(
  611. "_interpret_continue_",
  612. smalltalk.method({
  613. selector: "interpret:continue:",
  614. category: 'interpreting',
  615. fn: function (aNode,aBlock){
  616. var self=this;
  617. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  618. $1=self["@shouldReturn"];
  619. if(smalltalk.assert($1)){
  620. $2=self;
  621. return $2;
  622. };
  623. $3=_st(aNode)._isNode();
  624. if(smalltalk.assert($3)){
  625. self["@currentNode"]=aNode;
  626. self["@currentNode"];
  627. _st(self)._interpretNode_continue_(aNode,(function(value){
  628. return smalltalk.withContext(function($ctx2) { return _st(self)._continue_value_(aBlock,value);
  629. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  630. } else {
  631. _st(self)._continue_value_(aBlock,aNode);
  632. };
  633. return self}, function($ctx1) {$ctx1.fill(self,"interpret:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  634. args: ["aNode", "aBlock"],
  635. source: "interpret: aNode continue: aBlock\x0a\x09shouldReturn ifTrue: [ ^ self ].\x0a\x0a\x09aNode isNode \x0a \x09ifTrue: [ \x09\x0a \x09currentNode := aNode.\x0a self interpretNode: aNode continue: [ :value |\x0a \x09\x09\x09\x09self continue: aBlock value: value] ]\x0a ifFalse: [ self continue: aBlock value: aNode ]",
  636. messageSends: ["ifTrue:", "ifTrue:ifFalse:", "interpretNode:continue:", "continue:value:", "isNode"],
  637. referencedClasses: []
  638. }),
  639. smalltalk.ASTInterpreter);
  640. smalltalk.addMethod(
  641. "_interpretAll_continue_",
  642. smalltalk.method({
  643. selector: "interpretAll:continue:",
  644. category: 'private',
  645. fn: function (aCollection,aBlock){
  646. var self=this;
  647. return smalltalk.withContext(function($ctx1) { _st(self)._interpretAll_continue_result_(aCollection,aBlock,_st((smalltalk.OrderedCollection || OrderedCollection))._new());
  648. return self}, function($ctx1) {$ctx1.fill(self,"interpretAll:continue:",{aCollection:aCollection,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  649. args: ["aCollection", "aBlock"],
  650. source: "interpretAll: aCollection continue: aBlock\x0a\x09self \x0a \x09interpretAll: aCollection \x0a continue: aBlock \x0a result: OrderedCollection new",
  651. messageSends: ["interpretAll:continue:result:", "new"],
  652. referencedClasses: ["OrderedCollection"]
  653. }),
  654. smalltalk.ASTInterpreter);
  655. smalltalk.addMethod(
  656. "_interpretAll_continue_result_",
  657. smalltalk.method({
  658. selector: "interpretAll:continue:result:",
  659. category: 'private',
  660. fn: function (nodes,aBlock,aCollection){
  661. var self=this;
  662. return smalltalk.withContext(function($ctx1) { var $1;
  663. $1=_st(nodes)._isEmpty();
  664. if(smalltalk.assert($1)){
  665. _st(self)._continue_value_(aBlock,aCollection);
  666. } else {
  667. _st(self)._interpret_continue_(_st(nodes)._first(),(function(value){
  668. return smalltalk.withContext(function($ctx2) { return _st(self)._interpretAll_continue_result_(_st(nodes)._allButFirst(),aBlock,_st(aCollection).__comma([value]));
  669. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  670. };
  671. return self}, function($ctx1) {$ctx1.fill(self,"interpretAll:continue:result:",{nodes:nodes,aBlock:aBlock,aCollection:aCollection}, smalltalk.ASTInterpreter)})},
  672. args: ["nodes", "aBlock", "aCollection"],
  673. source: "interpretAll: nodes continue: aBlock result: aCollection\x0a\x09nodes isEmpty \x0a \x09ifTrue: [ self continue: aBlock value: aCollection ]\x0a \x09ifFalse: [\x0a \x09\x09self interpret: nodes first continue: [:value |\x0a \x09\x09\x09self \x0a \x09interpretAll: nodes allButFirst \x0a continue: aBlock\x0a \x09\x09\x09\x09\x09result: aCollection, { value } ] ]",
  674. messageSends: ["ifTrue:ifFalse:", "continue:value:", "interpret:continue:", "first", "interpretAll:continue:result:", "allButFirst", ",", "isEmpty"],
  675. referencedClasses: []
  676. }),
  677. smalltalk.ASTInterpreter);
  678. smalltalk.addMethod(
  679. "_interpretAssignmentNode_continue_",
  680. smalltalk.method({
  681. selector: "interpretAssignmentNode:continue:",
  682. category: 'interpreting',
  683. fn: function (aNode,aBlock){
  684. var self=this;
  685. return smalltalk.withContext(function($ctx1) { _st(self)._interpret_continue_(_st(aNode)._right(),(function(value){
  686. return smalltalk.withContext(function($ctx2) { return _st(self)._continue_value_(aBlock,_st(self)._assign_to_(_st(aNode)._left(),value));
  687. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  688. return self}, function($ctx1) {$ctx1.fill(self,"interpretAssignmentNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  689. args: ["aNode", "aBlock"],
  690. source: "interpretAssignmentNode: aNode continue: aBlock\x0a\x09self interpret: aNode right continue: [ :value |\x0a \x09self \x0a \x09continue: aBlock\x0a value: (self assign: aNode left to: value) ]",
  691. messageSends: ["interpret:continue:", "right", "continue:value:", "assign:to:", "left"],
  692. referencedClasses: []
  693. }),
  694. smalltalk.ASTInterpreter);
  695. smalltalk.addMethod(
  696. "_interpretBlockNode_continue_",
  697. smalltalk.method({
  698. selector: "interpretBlockNode:continue:",
  699. category: 'interpreting',
  700. fn: function (aNode,aBlock){
  701. var self=this;
  702. return smalltalk.withContext(function($ctx1) { var $1,$2;
  703. _st(self)._continue_value_(aBlock,(function(){
  704. return smalltalk.withContext(function($ctx2) { $1=self;
  705. _st($1)._interpret_(_st(_st(aNode)._nodes())._first());
  706. $2=_st($1)._result();
  707. return $2;
  708. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  709. return self}, function($ctx1) {$ctx1.fill(self,"interpretBlockNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  710. args: ["aNode", "aBlock"],
  711. source: "interpretBlockNode: aNode continue: aBlock\x0a\x09\x22TODO: Context should be set\x22\x0a \x0a self \x0a \x09continue: aBlock \x0a value: [ self interpret: aNode nodes first; result ]",
  712. messageSends: ["continue:value:", "interpret:", "first", "nodes", "result"],
  713. referencedClasses: []
  714. }),
  715. smalltalk.ASTInterpreter);
  716. smalltalk.addMethod(
  717. "_interpretBlockSequenceNode_continue_",
  718. smalltalk.method({
  719. selector: "interpretBlockSequenceNode:continue:",
  720. category: 'interpreting',
  721. fn: function (aNode,aBlock){
  722. var self=this;
  723. return smalltalk.withContext(function($ctx1) { _st(self)._interpretSequenceNode_continue_(aNode,aBlock);
  724. return self}, function($ctx1) {$ctx1.fill(self,"interpretBlockSequenceNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  725. args: ["aNode", "aBlock"],
  726. source: "interpretBlockSequenceNode: aNode continue: aBlock\x0a\x09self interpretSequenceNode: aNode continue: aBlock",
  727. messageSends: ["interpretSequenceNode:continue:"],
  728. referencedClasses: []
  729. }),
  730. smalltalk.ASTInterpreter);
  731. smalltalk.addMethod(
  732. "_interpretCascadeNode_continue_",
  733. smalltalk.method({
  734. selector: "interpretCascadeNode:continue:",
  735. category: 'interpreting',
  736. fn: function (aNode,aBlock){
  737. var self=this;
  738. return smalltalk.withContext(function($ctx1) { _st(self)._interpret_continue_(_st(aNode)._receiver(),(function(receiver){
  739. return smalltalk.withContext(function($ctx2) { _st(_st(aNode)._nodes())._do_((function(each){
  740. return smalltalk.withContext(function($ctx3) { return _st(each)._receiver_(receiver);
  741. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  742. return _st(self)._interpretAll_continue_(_st(_st(aNode)._nodes())._allButLast(),(function(){
  743. return smalltalk.withContext(function($ctx3) { return _st(self)._interpret_continue_(_st(_st(aNode)._nodes())._last(),(function(val){
  744. return smalltalk.withContext(function($ctx4) { return _st(self)._continue_value_(aBlock,val);
  745. }, function($ctx4) {$ctx4.fillBlock({val:val},$ctx1)})}));
  746. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  747. }, function($ctx2) {$ctx2.fillBlock({receiver:receiver},$ctx1)})}));
  748. return self}, function($ctx1) {$ctx1.fill(self,"interpretCascadeNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  749. args: ["aNode", "aBlock"],
  750. source: "interpretCascadeNode: aNode continue: aBlock\x0a\x09\x22TODO: Handle super sends\x22\x0a\x09\x0a self interpret: aNode receiver continue: [ :receiver |\x0a\x09\x09\x22Only interpret the receiver once\x22\x0a aNode nodes do: [ :each | each receiver: receiver ].\x0a \x0a \x09self \x0a \x09interpretAll: aNode nodes allButLast\x0a \x09\x09continue: [\x0a \x09self \x0a \x09interpret: aNode nodes last\x0a \x09continue: [ :val | self continue: aBlock value: val ] ] ]",
  751. messageSends: ["interpret:continue:", "receiver", "do:", "receiver:", "nodes", "interpretAll:continue:", "allButLast", "last", "continue:value:"],
  752. referencedClasses: []
  753. }),
  754. smalltalk.ASTInterpreter);
  755. smalltalk.addMethod(
  756. "_interpretClassReferenceNode_continue_",
  757. smalltalk.method({
  758. selector: "interpretClassReferenceNode:continue:",
  759. category: 'interpreting',
  760. fn: function (aNode,aBlock){
  761. var self=this;
  762. return smalltalk.withContext(function($ctx1) { _st(self)._continue_value_(aBlock,_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(_st(aNode)._value()));
  763. return self}, function($ctx1) {$ctx1.fill(self,"interpretClassReferenceNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  764. args: ["aNode", "aBlock"],
  765. source: "interpretClassReferenceNode: aNode continue: aBlock\x0a\x09self continue: aBlock value: (Smalltalk current at: aNode value)",
  766. messageSends: ["continue:value:", "at:", "value", "current"],
  767. referencedClasses: ["Smalltalk"]
  768. }),
  769. smalltalk.ASTInterpreter);
  770. smalltalk.addMethod(
  771. "_interpretDynamicArrayNode_continue_",
  772. smalltalk.method({
  773. selector: "interpretDynamicArrayNode:continue:",
  774. category: 'interpreting',
  775. fn: function (aNode,aBlock){
  776. var self=this;
  777. return smalltalk.withContext(function($ctx1) { _st(self)._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  778. return smalltalk.withContext(function($ctx2) { return _st(self)._continue_value_(aBlock,array);
  779. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  780. return self}, function($ctx1) {$ctx1.fill(self,"interpretDynamicArrayNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  781. args: ["aNode", "aBlock"],
  782. source: "interpretDynamicArrayNode: aNode continue: aBlock\x0a\x09self interpretAll: aNode nodes continue: [ :array |\x0a \x09self \x0a \x09continue: aBlock\x0a\x09\x09\x09value: array ]",
  783. messageSends: ["interpretAll:continue:", "nodes", "continue:value:"],
  784. referencedClasses: []
  785. }),
  786. smalltalk.ASTInterpreter);
  787. smalltalk.addMethod(
  788. "_interpretDynamicDictionaryNode_continue_",
  789. smalltalk.method({
  790. selector: "interpretDynamicDictionaryNode:continue:",
  791. category: 'interpreting',
  792. fn: function (aNode,aBlock){
  793. var self=this;
  794. return smalltalk.withContext(function($ctx1) { _st(self)._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  795. var hashedCollection;
  796. return smalltalk.withContext(function($ctx2) { hashedCollection=_st((smalltalk.HashedCollection || HashedCollection))._new();
  797. hashedCollection;
  798. _st(array)._do_((function(each){
  799. return smalltalk.withContext(function($ctx3) { return _st(hashedCollection)._add_(each);
  800. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  801. return _st(self)._continue_value_(aBlock,hashedCollection);
  802. }, function($ctx2) {$ctx2.fillBlock({array:array,hashedCollection:hashedCollection},$ctx1)})}));
  803. return self}, function($ctx1) {$ctx1.fill(self,"interpretDynamicDictionaryNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  804. args: ["aNode", "aBlock"],
  805. source: "interpretDynamicDictionaryNode: aNode continue: aBlock\x0a self interpretAll: aNode nodes continue: [ :array | | hashedCollection |\x0a \x09hashedCollection := HashedCollection new.\x0a array do: [ :each | hashedCollection add: each ].\x0a self \x09\x0a \x09continue: aBlock\x0a value: hashedCollection ]",
  806. messageSends: ["interpretAll:continue:", "nodes", "new", "do:", "add:", "continue:value:"],
  807. referencedClasses: ["HashedCollection"]
  808. }),
  809. smalltalk.ASTInterpreter);
  810. smalltalk.addMethod(
  811. "_interpretJSStatementNode_continue_",
  812. smalltalk.method({
  813. selector: "interpretJSStatementNode:continue:",
  814. category: 'interpreting',
  815. fn: function (aNode,aBlock){
  816. var self=this;
  817. return smalltalk.withContext(function($ctx1) { self["@shouldReturn"]=true;
  818. _st(self)._continue_value_(aBlock,_st(self)._eval_(_st(aNode)._source()));
  819. return self}, function($ctx1) {$ctx1.fill(self,"interpretJSStatementNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  820. args: ["aNode", "aBlock"],
  821. source: "interpretJSStatementNode: aNode continue: aBlock\x0a\x09shouldReturn := true.\x0a\x09self continue: aBlock value: (self eval: aNode source)",
  822. messageSends: ["continue:value:", "eval:", "source"],
  823. referencedClasses: []
  824. }),
  825. smalltalk.ASTInterpreter);
  826. smalltalk.addMethod(
  827. "_interpretMethodNode_continue_",
  828. smalltalk.method({
  829. selector: "interpretMethodNode:continue:",
  830. category: 'interpreting',
  831. fn: function (aNode,aBlock){
  832. var self=this;
  833. return smalltalk.withContext(function($ctx1) { _st(self)._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  834. return smalltalk.withContext(function($ctx2) { return _st(self)._continue_value_(aBlock,_st(array)._first());
  835. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  836. return self}, function($ctx1) {$ctx1.fill(self,"interpretMethodNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  837. args: ["aNode", "aBlock"],
  838. source: "interpretMethodNode: aNode continue: aBlock\x0a\x09self interpretAll: aNode nodes continue: [ :array |\x0a \x09self continue: aBlock value: array first ]",
  839. messageSends: ["interpretAll:continue:", "nodes", "continue:value:", "first"],
  840. referencedClasses: []
  841. }),
  842. smalltalk.ASTInterpreter);
  843. smalltalk.addMethod(
  844. "_interpretNode_continue_",
  845. smalltalk.method({
  846. selector: "interpretNode:continue:",
  847. category: 'interpreting',
  848. fn: function (aNode,aBlock){
  849. var self=this;
  850. return smalltalk.withContext(function($ctx1) { _st(aNode)._interpreter_continue_(self,aBlock);
  851. return self}, function($ctx1) {$ctx1.fill(self,"interpretNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  852. args: ["aNode", "aBlock"],
  853. source: "interpretNode: aNode continue: aBlock\x0a aNode interpreter: self continue: aBlock",
  854. messageSends: ["interpreter:continue:"],
  855. referencedClasses: []
  856. }),
  857. smalltalk.ASTInterpreter);
  858. smalltalk.addMethod(
  859. "_interpretReturnNode_continue_",
  860. smalltalk.method({
  861. selector: "interpretReturnNode:continue:",
  862. category: 'interpreting',
  863. fn: function (aNode,aBlock){
  864. var self=this;
  865. return smalltalk.withContext(function($ctx1) { _st(self)._interpret_continue_(_st(_st(aNode)._nodes())._first(),(function(value){
  866. return smalltalk.withContext(function($ctx2) { self["@shouldReturn"]=true;
  867. self["@shouldReturn"];
  868. return _st(self)._continue_value_(aBlock,value);
  869. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  870. return self}, function($ctx1) {$ctx1.fill(self,"interpretReturnNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  871. args: ["aNode", "aBlock"],
  872. source: "interpretReturnNode: aNode continue: aBlock\x0a self interpret: aNode nodes first continue: [ :value |\x0a \x09shouldReturn := true.\x0a\x09\x09self continue: aBlock value: value ]",
  873. messageSends: ["interpret:continue:", "first", "nodes", "continue:value:"],
  874. referencedClasses: []
  875. }),
  876. smalltalk.ASTInterpreter);
  877. smalltalk.addMethod(
  878. "_interpretSendNode_continue_",
  879. smalltalk.method({
  880. selector: "interpretSendNode:continue:",
  881. category: 'interpreting',
  882. fn: function (aNode,aBlock){
  883. var self=this;
  884. return smalltalk.withContext(function($ctx1) { _st(self)._interpret_continue_(_st(aNode)._receiver(),(function(receiver){
  885. return smalltalk.withContext(function($ctx2) { return _st(self)._interpretAll_continue_(_st(aNode)._arguments(),(function(args){
  886. return smalltalk.withContext(function($ctx3) { return _st(self)._messageFromSendNode_arguments_do_(aNode,args,(function(message){
  887. return smalltalk.withContext(function($ctx4) { _st(_st(self)._context())._pc_(_st(_st(_st(self)._context())._pc()).__plus((1)));
  888. return _st(self)._continue_value_(aBlock,_st(message)._sendTo_(receiver));
  889. }, function($ctx4) {$ctx4.fillBlock({message:message},$ctx1)})}));
  890. }, function($ctx3) {$ctx3.fillBlock({args:args},$ctx1)})}));
  891. }, function($ctx2) {$ctx2.fillBlock({receiver:receiver},$ctx1)})}));
  892. return self}, function($ctx1) {$ctx1.fill(self,"interpretSendNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  893. args: ["aNode", "aBlock"],
  894. source: "interpretSendNode: aNode continue: aBlock\x0a\x09\x22TODO: Handle super sends\x22\x0a \x0a self interpret: aNode receiver continue: [ :receiver |\x0a \x09self interpretAll: aNode arguments continue: [ :args |\x0a \x09\x09self \x0a \x09messageFromSendNode: aNode \x0a arguments: args\x0a do: [ :message |\x0a \x09\x09\x09self context pc: self context pc + 1.\x0a \x09\x09\x09self \x0a \x09\x09\x09continue: aBlock \x0a \x09\x09value: (message sendTo: receiver) ] ] ]",
  895. messageSends: ["interpret:continue:", "receiver", "interpretAll:continue:", "arguments", "messageFromSendNode:arguments:do:", "pc:", "+", "pc", "context", "continue:value:", "sendTo:"],
  896. referencedClasses: []
  897. }),
  898. smalltalk.ASTInterpreter);
  899. smalltalk.addMethod(
  900. "_interpretSequenceNode_continue_",
  901. smalltalk.method({
  902. selector: "interpretSequenceNode:continue:",
  903. category: 'interpreting',
  904. fn: function (aNode,aBlock){
  905. var self=this;
  906. return smalltalk.withContext(function($ctx1) { _st(self)._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  907. return smalltalk.withContext(function($ctx2) { return _st(self)._continue_value_(aBlock,_st(array)._last());
  908. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  909. return self}, function($ctx1) {$ctx1.fill(self,"interpretSequenceNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  910. args: ["aNode", "aBlock"],
  911. source: "interpretSequenceNode: aNode continue: aBlock\x0a\x09self interpretAll: aNode nodes continue: [ :array |\x0a \x09self continue: aBlock value: array last ]",
  912. messageSends: ["interpretAll:continue:", "nodes", "continue:value:", "last"],
  913. referencedClasses: []
  914. }),
  915. smalltalk.ASTInterpreter);
  916. smalltalk.addMethod(
  917. "_interpretValueNode_continue_",
  918. smalltalk.method({
  919. selector: "interpretValueNode:continue:",
  920. category: 'interpreting',
  921. fn: function (aNode,aBlock){
  922. var self=this;
  923. return smalltalk.withContext(function($ctx1) { _st(self)._continue_value_(aBlock,_st(aNode)._value());
  924. return self}, function($ctx1) {$ctx1.fill(self,"interpretValueNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  925. args: ["aNode", "aBlock"],
  926. source: "interpretValueNode: aNode continue: aBlock\x0a\x09self continue: aBlock value: aNode value",
  927. messageSends: ["continue:value:", "value"],
  928. referencedClasses: []
  929. }),
  930. smalltalk.ASTInterpreter);
  931. smalltalk.addMethod(
  932. "_interpretVariableNode_continue_",
  933. smalltalk.method({
  934. selector: "interpretVariableNode:continue:",
  935. category: 'interpreting',
  936. fn: function (aNode,aBlock){
  937. var self=this;
  938. return smalltalk.withContext(function($ctx1) { var $1,$2,$4,$3;
  939. $1=self;
  940. $2=aBlock;
  941. $4=_st(_st(aNode)._binding())._isInstanceVar();
  942. if(smalltalk.assert($4)){
  943. $3=_st(_st(_st(self)._context())._receiver())._instVarAt_(_st(aNode)._value());
  944. } else {
  945. $3=_st(_st(self)._context())._localAt_(_st(aNode)._value());
  946. };
  947. _st($1)._continue_value_($2,$3);
  948. return self}, function($ctx1) {$ctx1.fill(self,"interpretVariableNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  949. args: ["aNode", "aBlock"],
  950. source: "interpretVariableNode: aNode continue: aBlock\x0a self \x0a \x09continue: aBlock\x0a value: (aNode binding isInstanceVar\x0a\x09\x09\x09ifTrue: [ self context receiver instVarAt: aNode value ]\x0a\x09\x09\x09ifFalse: [ self context localAt: aNode value ])",
  951. messageSends: ["continue:value:", "ifTrue:ifFalse:", "instVarAt:", "value", "receiver", "context", "localAt:", "isInstanceVar", "binding"],
  952. referencedClasses: []
  953. }),
  954. smalltalk.ASTInterpreter);
  955. smalltalk.addMethod(
  956. "_messageFromSendNode_arguments_do_",
  957. smalltalk.method({
  958. selector: "messageFromSendNode:arguments:do:",
  959. category: 'private',
  960. fn: function (aSendNode,aCollection,aBlock){
  961. var self=this;
  962. return smalltalk.withContext(function($ctx1) { var $1,$2;
  963. $1=_st((smalltalk.Message || Message))._new();
  964. _st($1)._selector_(_st(aSendNode)._selector());
  965. _st($1)._arguments_(aCollection);
  966. $2=_st($1)._yourself();
  967. _st(self)._continue_value_(aBlock,$2);
  968. return self}, function($ctx1) {$ctx1.fill(self,"messageFromSendNode:arguments:do:",{aSendNode:aSendNode,aCollection:aCollection,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  969. args: ["aSendNode", "aCollection", "aBlock"],
  970. source: "messageFromSendNode: aSendNode arguments: aCollection do: aBlock\x0a self \x0a continue: aBlock\x0a value: (Message new\x0a \x09\x09selector: aSendNode selector;\x0a \x09arguments: aCollection;\x0a \x09yourself)",
  971. messageSends: ["continue:value:", "selector:", "selector", "new", "arguments:", "yourself"],
  972. referencedClasses: ["Message"]
  973. }),
  974. smalltalk.ASTInterpreter);
  975. smalltalk.addMethod(
  976. "_result",
  977. smalltalk.method({
  978. selector: "result",
  979. category: 'accessing',
  980. fn: function (){
  981. var self=this;
  982. return smalltalk.withContext(function($ctx1) { var $1;
  983. $1=self["@result"];
  984. return $1;
  985. }, function($ctx1) {$ctx1.fill(self,"result",{}, smalltalk.ASTInterpreter)})},
  986. args: [],
  987. source: "result\x0a\x09^ result",
  988. messageSends: [],
  989. referencedClasses: []
  990. }),
  991. smalltalk.ASTInterpreter);
  992. smalltalk.addClass('ASTSteppingInterpreter', smalltalk.ASTInterpreter, ['continuation'], 'Compiler-Interpreter');
  993. smalltalk.ASTSteppingInterpreter.comment="ASTSteppingInterpreter is an interpreter with stepping capabilities.\x0aUse `#step` to actually interpret the next node.\x0a\x0aUsage example:\x0a\x0a | ast interpreter |\x0a ast := Smalltalk current parse: 'foo 1+2+4'.\x0a (SemanticAnalyzer on: Object) visit: ast.\x0a\x0a interpreter := ASTSteppingInterpreter new\x0a interpret: ast nodes first;\x0a yourself.\x0a \x0a debugger step; step.\x0a debugger step; step.\x0a debugger result.\x22Answers 1\x22\x0a debugger step.\x0a debugger result. \x22Answers 3\x22\x0a debugger step.\x0a debugger result. \x22Answers 7\x22\x0a "
  994. smalltalk.addMethod(
  995. "_initialize",
  996. smalltalk.method({
  997. selector: "initialize",
  998. category: 'initialization',
  999. fn: function (){
  1000. var self=this;
  1001. return smalltalk.withContext(function($ctx1) { smalltalk.ASTInterpreter.fn.prototype._initialize.apply(_st(self), []);
  1002. self["@continuation"]=(function(){
  1003. return smalltalk.withContext(function($ctx2) { }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1004. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.ASTDebugger)})},
  1005. args: [],
  1006. source: "initialize\x0a\x09super initialize.\x0a continuation := [ ]",
  1007. messageSends: ["initialize"],
  1008. referencedClasses: []
  1009. }),
  1010. smalltalk.ASTSteppingInterpreter);
  1011. smalltalk.addMethod(
  1012. "_interpret_continue_",
  1013. smalltalk.method({
  1014. selector: "interpret:continue:",
  1015. category: 'interpreting',
  1016. fn: function (aNode,aBlock){
  1017. var self=this;
  1018. return smalltalk.withContext(function($ctx1) { self["@continuation"]=(function(){
  1019. return smalltalk.withContext(function($ctx2) { return smalltalk.ASTInterpreter.fn.prototype._interpret_continue_.apply(_st(self), [aNode,aBlock]);
  1020. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1021. return self}, function($ctx1) {$ctx1.fill(self,"interpret:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTDebugger)})},
  1022. args: ["aNode", "aBlock"],
  1023. source: "interpret: aNode continue: aBlock\x0a\x09continuation := [ super interpret: aNode continue: aBlock ]",
  1024. messageSends: ["interpret:continue:"],
  1025. referencedClasses: []
  1026. }),
  1027. smalltalk.ASTSteppingInterpreter);
  1028. smalltalk.addMethod(
  1029. "_step",
  1030. smalltalk.method({
  1031. selector: "step",
  1032. category: 'stepping',
  1033. fn: function (){
  1034. var self=this;
  1035. return smalltalk.withContext(function($ctx1) { _st(self["@continuation"])._value();
  1036. return self}, function($ctx1) {$ctx1.fill(self,"step",{}, smalltalk.ASTDebugger)})},
  1037. args: [],
  1038. source: "step\x0a\x09continuation value",
  1039. messageSends: ["value"],
  1040. referencedClasses: []
  1041. }),
  1042. smalltalk.ASTSteppingInterpreter);
  1043. smalltalk.addMethod(
  1044. "_interpreter_continue_",
  1045. smalltalk.method({
  1046. selector: "interpreter:continue:",
  1047. category: '*Compiler-Interpreter',
  1048. fn: function (anInterpreter,aBlock){
  1049. var self=this;
  1050. return smalltalk.withContext(function($ctx1) { var $1;
  1051. $1=_st(anInterpreter)._interpretNode_continue_(self,aBlock);
  1052. return $1;
  1053. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.Node)})},
  1054. args: ["anInterpreter", "aBlock"],
  1055. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretNode: self continue: aBlock",
  1056. messageSends: ["interpretNode:continue:"],
  1057. referencedClasses: []
  1058. }),
  1059. smalltalk.Node);
  1060. smalltalk.addMethod(
  1061. "_interpreter_continue_",
  1062. smalltalk.method({
  1063. selector: "interpreter:continue:",
  1064. category: '*Compiler-Interpreter',
  1065. fn: function (anInterpreter,aBlock){
  1066. var self=this;
  1067. return smalltalk.withContext(function($ctx1) { var $1;
  1068. $1=_st(anInterpreter)._interpretAssignmentNode_continue_(self,aBlock);
  1069. return $1;
  1070. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.AssignmentNode)})},
  1071. args: ["anInterpreter", "aBlock"],
  1072. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretAssignmentNode: self continue: aBlock",
  1073. messageSends: ["interpretAssignmentNode:continue:"],
  1074. referencedClasses: []
  1075. }),
  1076. smalltalk.AssignmentNode);
  1077. smalltalk.addMethod(
  1078. "_interpreter_continue_",
  1079. smalltalk.method({
  1080. selector: "interpreter:continue:",
  1081. category: '*Compiler-Interpreter',
  1082. fn: function (anInterpreter,aBlock){
  1083. var self=this;
  1084. return smalltalk.withContext(function($ctx1) { var $1;
  1085. $1=_st(anInterpreter)._interpretBlockNode_continue_(self,aBlock);
  1086. return $1;
  1087. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.BlockNode)})},
  1088. args: ["anInterpreter", "aBlock"],
  1089. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretBlockNode: self continue: aBlock",
  1090. messageSends: ["interpretBlockNode:continue:"],
  1091. referencedClasses: []
  1092. }),
  1093. smalltalk.BlockNode);
  1094. smalltalk.addMethod(
  1095. "_interpreter_continue_",
  1096. smalltalk.method({
  1097. selector: "interpreter:continue:",
  1098. category: '*Compiler-Interpreter',
  1099. fn: function (anInterpreter,aBlock){
  1100. var self=this;
  1101. return smalltalk.withContext(function($ctx1) { var $1;
  1102. $1=_st(anInterpreter)._interpretCascadeNode_continue_(self,aBlock);
  1103. return $1;
  1104. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.CascadeNode)})},
  1105. args: ["anInterpreter", "aBlock"],
  1106. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretCascadeNode: self continue: aBlock",
  1107. messageSends: ["interpretCascadeNode:continue:"],
  1108. referencedClasses: []
  1109. }),
  1110. smalltalk.CascadeNode);
  1111. smalltalk.addMethod(
  1112. "_interpreter_continue_",
  1113. smalltalk.method({
  1114. selector: "interpreter:continue:",
  1115. category: '*Compiler-Interpreter',
  1116. fn: function (anInterpreter,aBlock){
  1117. var self=this;
  1118. return smalltalk.withContext(function($ctx1) { var $1;
  1119. $1=_st(anInterpreter)._interpretDynamicArrayNode_continue_(self,aBlock);
  1120. return $1;
  1121. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.DynamicArrayNode)})},
  1122. args: ["anInterpreter", "aBlock"],
  1123. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretDynamicArrayNode: self continue: aBlock",
  1124. messageSends: ["interpretDynamicArrayNode:continue:"],
  1125. referencedClasses: []
  1126. }),
  1127. smalltalk.DynamicArrayNode);
  1128. smalltalk.addMethod(
  1129. "_interpreter_continue_",
  1130. smalltalk.method({
  1131. selector: "interpreter:continue:",
  1132. category: '*Compiler-Interpreter',
  1133. fn: function (anInterpreter,aBlock){
  1134. var self=this;
  1135. return smalltalk.withContext(function($ctx1) { var $1;
  1136. $1=_st(anInterpreter)._interpretDynamicDictionaryNode_continue_(self,aBlock);
  1137. return $1;
  1138. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.DynamicDictionaryNode)})},
  1139. args: ["anInterpreter", "aBlock"],
  1140. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretDynamicDictionaryNode: self continue: aBlock",
  1141. messageSends: ["interpretDynamicDictionaryNode:continue:"],
  1142. referencedClasses: []
  1143. }),
  1144. smalltalk.DynamicDictionaryNode);
  1145. smalltalk.addMethod(
  1146. "_interpreter_continue_",
  1147. smalltalk.method({
  1148. selector: "interpreter:continue:",
  1149. category: '*Compiler-Interpreter',
  1150. fn: function (anInterpreter,aBlock){
  1151. var self=this;
  1152. return smalltalk.withContext(function($ctx1) { var $1;
  1153. $1=_st(anInterpreter)._interpretJSStatementNode_continue_(self,aBlock);
  1154. return $1;
  1155. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.JSStatementNode)})},
  1156. args: ["anInterpreter", "aBlock"],
  1157. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretJSStatementNode: self continue: aBlock",
  1158. messageSends: ["interpretJSStatementNode:continue:"],
  1159. referencedClasses: []
  1160. }),
  1161. smalltalk.JSStatementNode);
  1162. smalltalk.addMethod(
  1163. "_interpreter_continue_",
  1164. smalltalk.method({
  1165. selector: "interpreter:continue:",
  1166. category: '*Compiler-Interpreter',
  1167. fn: function (anInterpreter,aBlock){
  1168. var self=this;
  1169. return smalltalk.withContext(function($ctx1) { var $1;
  1170. $1=_st(anInterpreter)._interpretMethodNode_continue_(self,aBlock);
  1171. return $1;
  1172. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.MethodNode)})},
  1173. args: ["anInterpreter", "aBlock"],
  1174. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretMethodNode: self continue: aBlock",
  1175. messageSends: ["interpretMethodNode:continue:"],
  1176. referencedClasses: []
  1177. }),
  1178. smalltalk.MethodNode);
  1179. smalltalk.addMethod(
  1180. "_interpreter_continue_",
  1181. smalltalk.method({
  1182. selector: "interpreter:continue:",
  1183. category: '*Compiler-Interpreter',
  1184. fn: function (anInterpreter,aBlock){
  1185. var self=this;
  1186. return smalltalk.withContext(function($ctx1) { var $1;
  1187. $1=_st(anInterpreter)._interpretReturnNode_continue_(self,aBlock);
  1188. return $1;
  1189. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.ReturnNode)})},
  1190. args: ["anInterpreter", "aBlock"],
  1191. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretReturnNode: self continue: aBlock",
  1192. messageSends: ["interpretReturnNode:continue:"],
  1193. referencedClasses: []
  1194. }),
  1195. smalltalk.ReturnNode);
  1196. smalltalk.addMethod(
  1197. "_interpreter_continue_",
  1198. smalltalk.method({
  1199. selector: "interpreter:continue:",
  1200. category: '*Compiler-Interpreter',
  1201. fn: function (anInterpreter,aBlock){
  1202. var self=this;
  1203. return smalltalk.withContext(function($ctx1) { var $1;
  1204. $1=_st(anInterpreter)._interpretSendNode_continue_(self,aBlock);
  1205. return $1;
  1206. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.SendNode)})},
  1207. args: ["anInterpreter", "aBlock"],
  1208. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretSendNode: self continue: aBlock",
  1209. messageSends: ["interpretSendNode:continue:"],
  1210. referencedClasses: []
  1211. }),
  1212. smalltalk.SendNode);
  1213. smalltalk.addMethod(
  1214. "_interpreter_continue_",
  1215. smalltalk.method({
  1216. selector: "interpreter:continue:",
  1217. category: '*Compiler-Interpreter',
  1218. fn: function (anInterpreter,aBlock){
  1219. var self=this;
  1220. return smalltalk.withContext(function($ctx1) { var $1;
  1221. $1=_st(anInterpreter)._interpretSequenceNode_continue_(self,aBlock);
  1222. return $1;
  1223. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.SequenceNode)})},
  1224. args: ["anInterpreter", "aBlock"],
  1225. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretSequenceNode: self continue: aBlock",
  1226. messageSends: ["interpretSequenceNode:continue:"],
  1227. referencedClasses: []
  1228. }),
  1229. smalltalk.SequenceNode);
  1230. smalltalk.addMethod(
  1231. "_interpreter_continue_",
  1232. smalltalk.method({
  1233. selector: "interpreter:continue:",
  1234. category: '*Compiler-Interpreter',
  1235. fn: function (anInterpreter,aBlock){
  1236. var self=this;
  1237. return smalltalk.withContext(function($ctx1) { var $1;
  1238. $1=_st(anInterpreter)._interpretBlockSequenceNode_continue_(self,aBlock);
  1239. return $1;
  1240. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.BlockSequenceNode)})},
  1241. args: ["anInterpreter", "aBlock"],
  1242. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretBlockSequenceNode: self continue: aBlock",
  1243. messageSends: ["interpretBlockSequenceNode:continue:"],
  1244. referencedClasses: []
  1245. }),
  1246. smalltalk.BlockSequenceNode);
  1247. smalltalk.addMethod(
  1248. "_interpreter_continue_",
  1249. smalltalk.method({
  1250. selector: "interpreter:continue:",
  1251. category: '*Compiler-Interpreter',
  1252. fn: function (anInterpreter,aBlock){
  1253. var self=this;
  1254. return smalltalk.withContext(function($ctx1) { var $1;
  1255. $1=_st(anInterpreter)._interpretValueNode_continue_(self,aBlock);
  1256. return $1;
  1257. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.ValueNode)})},
  1258. args: ["anInterpreter", "aBlock"],
  1259. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretValueNode: self continue: aBlock",
  1260. messageSends: ["interpretValueNode:continue:"],
  1261. referencedClasses: []
  1262. }),
  1263. smalltalk.ValueNode);
  1264. smalltalk.addMethod(
  1265. "_interpreter_continue_",
  1266. smalltalk.method({
  1267. selector: "interpreter:continue:",
  1268. category: '*Compiler-Interpreter',
  1269. fn: function (anInterpreter,aBlock){
  1270. var self=this;
  1271. return smalltalk.withContext(function($ctx1) { var $1;
  1272. $1=_st(anInterpreter)._interpretVariableNode_continue_(self,aBlock);
  1273. return $1;
  1274. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.VariableNode)})},
  1275. args: ["anInterpreter", "aBlock"],
  1276. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretVariableNode: self continue: aBlock",
  1277. messageSends: ["interpretVariableNode:continue:"],
  1278. referencedClasses: []
  1279. }),
  1280. smalltalk.VariableNode);
  1281. smalltalk.addMethod(
  1282. "_interpreter_continue_",
  1283. smalltalk.method({
  1284. selector: "interpreter:continue:",
  1285. category: '*Compiler-Interpreter',
  1286. fn: function (anInterpreter,aBlock){
  1287. var self=this;
  1288. return smalltalk.withContext(function($ctx1) { var $1;
  1289. $1=_st(anInterpreter)._interpretClassReferenceNode_continue_(self,aBlock);
  1290. return $1;
  1291. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.ClassReferenceNode)})},
  1292. args: ["anInterpreter", "aBlock"],
  1293. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretClassReferenceNode: self continue: aBlock",
  1294. messageSends: ["interpretClassReferenceNode:continue:"],
  1295. referencedClasses: []
  1296. }),
  1297. smalltalk.ClassReferenceNode);