Compiler-Interpreter.deploy.js 47 KB

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