Compiler-Interpreter.deploy.js 46 KB

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