Compiler-Interpreter.deploy.js 48 KB

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