Compiler-Interpreter.js 68 KB

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