Compiler-Interpreter.deploy.js 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316
  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: "buildAST",
  211. fn: function (){
  212. var self=this;
  213. var ast;
  214. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  215. function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
  216. return smalltalk.withContext(function($ctx1) {
  217. var $1;
  218. ast=_st(_st($Smalltalk())._current())._parse_(_st(_st(self)._method())._source());
  219. _st(_st($SemanticAnalyzer())._on_(_st(_st(_st(self)._context())._receiver())._class()))._visit_(ast);
  220. $1=ast;
  221. return $1;
  222. }, function($ctx1) {$ctx1.fill(self,"buildAST",{ast:ast},smalltalk.ASTDebugger)})},
  223. messageSends: ["parse:", "source", "method", "current", "visit:", "on:", "class", "receiver", "context"]}),
  224. smalltalk.ASTDebugger);
  225. smalltalk.addMethod(
  226. smalltalk.method({
  227. selector: "context",
  228. fn: function (){
  229. var self=this;
  230. return smalltalk.withContext(function($ctx1) {
  231. var $1;
  232. $1=self["@context"];
  233. return $1;
  234. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTDebugger)})},
  235. messageSends: []}),
  236. smalltalk.ASTDebugger);
  237. smalltalk.addMethod(
  238. smalltalk.method({
  239. selector: "context:",
  240. fn: function (aContext){
  241. var self=this;
  242. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  243. return smalltalk.withContext(function($ctx1) {
  244. self["@context"]=_st($AIContext())._new();
  245. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTDebugger)})},
  246. messageSends: ["new"]}),
  247. smalltalk.ASTDebugger);
  248. smalltalk.addMethod(
  249. smalltalk.method({
  250. selector: "defaultInterpreterClass",
  251. fn: function (){
  252. var self=this;
  253. function $ASTSteppingInterpreter(){return smalltalk.ASTSteppingInterpreter||(typeof ASTSteppingInterpreter=="undefined"?nil:ASTSteppingInterpreter)}
  254. return smalltalk.withContext(function($ctx1) {
  255. var $1;
  256. $1=$ASTSteppingInterpreter();
  257. return $1;
  258. }, function($ctx1) {$ctx1.fill(self,"defaultInterpreterClass",{},smalltalk.ASTDebugger)})},
  259. messageSends: []}),
  260. smalltalk.ASTDebugger);
  261. smalltalk.addMethod(
  262. smalltalk.method({
  263. selector: "initializeInterpreter",
  264. fn: function (){
  265. var self=this;
  266. return smalltalk.withContext(function($ctx1) {
  267. _st(_st(self)._interpreter())._interpret_(_st(_st(_st(self)._buildAST())._nodes())._first());
  268. return self}, function($ctx1) {$ctx1.fill(self,"initializeInterpreter",{},smalltalk.ASTDebugger)})},
  269. messageSends: ["interpret:", "first", "nodes", "buildAST", "interpreter"]}),
  270. smalltalk.ASTDebugger);
  271. smalltalk.addMethod(
  272. smalltalk.method({
  273. selector: "initializeWithContext:",
  274. fn: function (aMethodContext){
  275. var self=this;
  276. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  277. return smalltalk.withContext(function($ctx1) {
  278. _st(self)._context_(_st($AIContext())._fromMethodContext_(aMethodContext));
  279. _st(self)._initializeInterpreter();
  280. return self}, function($ctx1) {$ctx1.fill(self,"initializeWithContext:",{aMethodContext:aMethodContext},smalltalk.ASTDebugger)})},
  281. messageSends: ["context:", "fromMethodContext:", "initializeInterpreter"]}),
  282. smalltalk.ASTDebugger);
  283. smalltalk.addMethod(
  284. smalltalk.method({
  285. selector: "interpreter",
  286. fn: function (){
  287. var self=this;
  288. return smalltalk.withContext(function($ctx1) {
  289. var $2,$1;
  290. $2=self["@interpreter"];
  291. if(($receiver = $2) == nil || $receiver == undefined){
  292. self["@interpreter"]=_st(_st(self)._defaultInterpreterClass())._new();
  293. $1=self["@interpreter"];
  294. } else {
  295. $1=$2;
  296. };
  297. return $1;
  298. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.ASTDebugger)})},
  299. messageSends: ["ifNil:", "new", "defaultInterpreterClass"]}),
  300. smalltalk.ASTDebugger);
  301. smalltalk.addMethod(
  302. smalltalk.method({
  303. selector: "interpreter:",
  304. fn: function (anInterpreter){
  305. var self=this;
  306. return smalltalk.withContext(function($ctx1) {
  307. self["@interpreter"]=anInterpreter;
  308. return self}, function($ctx1) {$ctx1.fill(self,"interpreter:",{anInterpreter:anInterpreter},smalltalk.ASTDebugger)})},
  309. messageSends: []}),
  310. smalltalk.ASTDebugger);
  311. smalltalk.addMethod(
  312. smalltalk.method({
  313. selector: "method",
  314. fn: function (){
  315. var self=this;
  316. return smalltalk.withContext(function($ctx1) {
  317. var $1;
  318. $1=_st(_st(self)._context())._method();
  319. return $1;
  320. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.ASTDebugger)})},
  321. messageSends: ["method", "context"]}),
  322. smalltalk.ASTDebugger);
  323. smalltalk.addMethod(
  324. smalltalk.method({
  325. selector: "restart",
  326. fn: function (){
  327. var self=this;
  328. return smalltalk.withContext(function($ctx1) {
  329. _st(self)._shouldBeImplemented();
  330. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.ASTDebugger)})},
  331. messageSends: ["shouldBeImplemented"]}),
  332. smalltalk.ASTDebugger);
  333. smalltalk.addMethod(
  334. smalltalk.method({
  335. selector: "resume",
  336. fn: function (){
  337. var self=this;
  338. return smalltalk.withContext(function($ctx1) {
  339. _st(self)._shouldBeImplemented();
  340. return self}, function($ctx1) {$ctx1.fill(self,"resume",{},smalltalk.ASTDebugger)})},
  341. messageSends: ["shouldBeImplemented"]}),
  342. smalltalk.ASTDebugger);
  343. smalltalk.addMethod(
  344. smalltalk.method({
  345. selector: "step",
  346. fn: function (){
  347. var self=this;
  348. return smalltalk.withContext(function($ctx1) {
  349. _st((function(){
  350. return smalltalk.withContext(function($ctx2) {
  351. return _st(_st(_st(_st(_st(self)._interpreter())._nextNode())._notNil())._and_((function(){
  352. return smalltalk.withContext(function($ctx3) {
  353. return _st(_st(_st(self)._interpreter())._nextNode())._stopOnStepping();
  354. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})))._or_((function(){
  355. return smalltalk.withContext(function($ctx3) {
  356. return _st(_st(_st(self)._interpreter())._atEnd())._not();
  357. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  358. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  359. return smalltalk.withContext(function($ctx2) {
  360. _st(_st(self)._interpreter())._step();
  361. return _st(self)._step();
  362. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  363. return self}, function($ctx1) {$ctx1.fill(self,"step",{},smalltalk.ASTDebugger)})},
  364. messageSends: ["whileFalse:", "step", "interpreter", "or:", "not", "atEnd", "and:", "stopOnStepping", "nextNode", "notNil"]}),
  365. smalltalk.ASTDebugger);
  366. smalltalk.addMethod(
  367. smalltalk.method({
  368. selector: "stepInto",
  369. fn: function (){
  370. var self=this;
  371. return smalltalk.withContext(function($ctx1) {
  372. _st(self)._shouldBeImplemented();
  373. return self}, function($ctx1) {$ctx1.fill(self,"stepInto",{},smalltalk.ASTDebugger)})},
  374. messageSends: ["shouldBeImplemented"]}),
  375. smalltalk.ASTDebugger);
  376. smalltalk.addMethod(
  377. smalltalk.method({
  378. selector: "stepOver",
  379. fn: function (){
  380. var self=this;
  381. return smalltalk.withContext(function($ctx1) {
  382. _st(self)._step();
  383. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.ASTDebugger)})},
  384. messageSends: ["step"]}),
  385. smalltalk.ASTDebugger);
  386. smalltalk.addMethod(
  387. smalltalk.method({
  388. selector: "context:",
  389. fn: function (aMethodContext){
  390. var self=this;
  391. return smalltalk.withContext(function($ctx1) {
  392. var $2,$3,$1;
  393. $2=_st(self)._new();
  394. _st($2)._initializeWithContext_(aMethodContext);
  395. $3=_st($2)._yourself();
  396. $1=$3;
  397. return $1;
  398. }, function($ctx1) {$ctx1.fill(self,"context:",{aMethodContext:aMethodContext},smalltalk.ASTDebugger.klass)})},
  399. messageSends: ["initializeWithContext:", "new", "yourself"]}),
  400. smalltalk.ASTDebugger.klass);
  401. smalltalk.addClass('ASTInterpreter', smalltalk.Object, ['currentNode', 'context', 'shouldReturn', 'result'], 'Compiler-Interpreter');
  402. smalltalk.addMethod(
  403. smalltalk.method({
  404. selector: "assign:to:",
  405. fn: function (aNode,anObject){
  406. var self=this;
  407. return smalltalk.withContext(function($ctx1) {
  408. var $2,$1;
  409. $2=_st(_st(aNode)._binding())._isInstanceVar();
  410. if(smalltalk.assert($2)){
  411. $1=_st(_st(_st(self)._context())._receiver())._instVarAt_put_(_st(aNode)._value(),anObject);
  412. } else {
  413. $1=_st(_st(self)._context())._localAt_put_(_st(aNode)._value(),anObject);
  414. };
  415. return $1;
  416. }, function($ctx1) {$ctx1.fill(self,"assign:to:",{aNode:aNode,anObject:anObject},smalltalk.ASTInterpreter)})},
  417. messageSends: ["ifTrue:ifFalse:", "instVarAt:put:", "value", "receiver", "context", "localAt:put:", "isInstanceVar", "binding"]}),
  418. smalltalk.ASTInterpreter);
  419. smalltalk.addMethod(
  420. smalltalk.method({
  421. selector: "context",
  422. fn: function (){
  423. var self=this;
  424. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  425. return smalltalk.withContext(function($ctx1) {
  426. var $2,$1;
  427. $2=self["@context"];
  428. if(($receiver = $2) == nil || $receiver == undefined){
  429. self["@context"]=_st($AIContext())._new();
  430. $1=self["@context"];
  431. } else {
  432. $1=$2;
  433. };
  434. return $1;
  435. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTInterpreter)})},
  436. messageSends: ["ifNil:", "new"]}),
  437. smalltalk.ASTInterpreter);
  438. smalltalk.addMethod(
  439. smalltalk.method({
  440. selector: "context:",
  441. fn: function (anAIContext){
  442. var self=this;
  443. return smalltalk.withContext(function($ctx1) {
  444. self["@context"]=anAIContext;
  445. return self}, function($ctx1) {$ctx1.fill(self,"context:",{anAIContext:anAIContext},smalltalk.ASTInterpreter)})},
  446. messageSends: []}),
  447. smalltalk.ASTInterpreter);
  448. smalltalk.addMethod(
  449. smalltalk.method({
  450. selector: "continue:value:",
  451. fn: function (aBlock,anObject){
  452. var self=this;
  453. return smalltalk.withContext(function($ctx1) {
  454. self["@result"]=anObject;
  455. _st(aBlock)._value_(anObject);
  456. return self}, function($ctx1) {$ctx1.fill(self,"continue:value:",{aBlock:aBlock,anObject:anObject},smalltalk.ASTInterpreter)})},
  457. messageSends: ["value:"]}),
  458. smalltalk.ASTInterpreter);
  459. smalltalk.addMethod(
  460. smalltalk.method({
  461. selector: "currentNode",
  462. fn: function (){
  463. var self=this;
  464. return smalltalk.withContext(function($ctx1) {
  465. var $1;
  466. $1=self["@currentNode"];
  467. return $1;
  468. }, function($ctx1) {$ctx1.fill(self,"currentNode",{},smalltalk.ASTInterpreter)})},
  469. messageSends: []}),
  470. smalltalk.ASTInterpreter);
  471. smalltalk.addMethod(
  472. smalltalk.method({
  473. selector: "eval:",
  474. fn: function (aString){
  475. var self=this;
  476. var source,function_;
  477. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  478. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  479. return smalltalk.withContext(function($ctx1) {
  480. var $1,$2,$3;
  481. source=_st($String())._streamContents_((function(str){
  482. return smalltalk.withContext(function($ctx2) {
  483. _st(str)._nextPutAll_("(function(");
  484. _st(_st(_st(_st(self)._context())._locals())._keys())._do_separatedBy_((function(each){
  485. return smalltalk.withContext(function($ctx3) {
  486. return _st(str)._nextPutAll_(each);
  487. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  488. return smalltalk.withContext(function($ctx3) {
  489. return _st(str)._nextPutAll_(",");
  490. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  491. $1=str;
  492. _st($1)._nextPutAll_("){ return (function() {");
  493. _st($1)._nextPutAll_(aString);
  494. $2=_st($1)._nextPutAll_("})() })");
  495. return $2;
  496. }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1)})}));
  497. function_=_st(_st($Compiler())._new())._eval_(source);
  498. $3=_st(function_)._valueWithPossibleArguments_(_st(_st(_st(self)._context())._locals())._values());
  499. return $3;
  500. }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString,source:source,function_:function_},smalltalk.ASTInterpreter)})},
  501. messageSends: ["streamContents:", "nextPutAll:", "do:separatedBy:", "keys", "locals", "context", "eval:", "new", "valueWithPossibleArguments:", "values"]}),
  502. smalltalk.ASTInterpreter);
  503. smalltalk.addMethod(
  504. smalltalk.method({
  505. selector: "initialize",
  506. fn: function (){
  507. var self=this;
  508. return smalltalk.withContext(function($ctx1) {
  509. smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  510. self["@shouldReturn"]=false;
  511. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ASTInterpreter)})},
  512. messageSends: ["initialize"]}),
  513. smalltalk.ASTInterpreter);
  514. smalltalk.addMethod(
  515. smalltalk.method({
  516. selector: "interpret:",
  517. fn: function (aNode){
  518. var self=this;
  519. return smalltalk.withContext(function($ctx1) {
  520. self["@shouldReturn"]=false;
  521. _st(self)._interpret_continue_(aNode,(function(value){
  522. return smalltalk.withContext(function($ctx2) {
  523. self["@result"]=value;
  524. return self["@result"];
  525. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  526. return self}, function($ctx1) {$ctx1.fill(self,"interpret:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  527. messageSends: ["interpret:continue:"]}),
  528. smalltalk.ASTInterpreter);
  529. smalltalk.addMethod(
  530. smalltalk.method({
  531. selector: "interpret:continue:",
  532. fn: function (aNode,aBlock){
  533. var self=this;
  534. return smalltalk.withContext(function($ctx1) {
  535. var $1,$2,$3;
  536. $1=self["@shouldReturn"];
  537. if(smalltalk.assert($1)){
  538. $2=self;
  539. return $2;
  540. };
  541. $3=_st(aNode)._isNode();
  542. if(smalltalk.assert($3)){
  543. self["@currentNode"]=aNode;
  544. self["@currentNode"];
  545. _st(self)._interpretNode_continue_(aNode,(function(value){
  546. return smalltalk.withContext(function($ctx2) {
  547. return _st(self)._continue_value_(aBlock,value);
  548. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  549. } else {
  550. _st(self)._continue_value_(aBlock,aNode);
  551. };
  552. return self}, function($ctx1) {$ctx1.fill(self,"interpret:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  553. messageSends: ["ifTrue:", "ifTrue:ifFalse:", "interpretNode:continue:", "continue:value:", "isNode"]}),
  554. smalltalk.ASTInterpreter);
  555. smalltalk.addMethod(
  556. smalltalk.method({
  557. selector: "interpretAll:continue:",
  558. fn: function (aCollection,aBlock){
  559. var self=this;
  560. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  561. return smalltalk.withContext(function($ctx1) {
  562. _st(self)._interpretAll_continue_result_(aCollection,aBlock,_st($OrderedCollection())._new());
  563. return self}, function($ctx1) {$ctx1.fill(self,"interpretAll:continue:",{aCollection:aCollection,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  564. messageSends: ["interpretAll:continue:result:", "new"]}),
  565. smalltalk.ASTInterpreter);
  566. smalltalk.addMethod(
  567. smalltalk.method({
  568. selector: "interpretAll:continue:result:",
  569. fn: function (nodes,aBlock,aCollection){
  570. var self=this;
  571. return smalltalk.withContext(function($ctx1) {
  572. var $1;
  573. $1=_st(nodes)._isEmpty();
  574. if(smalltalk.assert($1)){
  575. _st(self)._continue_value_(aBlock,aCollection);
  576. } else {
  577. _st(self)._interpret_continue_(_st(nodes)._first(),(function(value){
  578. return smalltalk.withContext(function($ctx2) {
  579. return _st(self)._interpretAll_continue_result_(_st(nodes)._allButFirst(),aBlock,_st(aCollection).__comma([value]));
  580. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  581. };
  582. return self}, function($ctx1) {$ctx1.fill(self,"interpretAll:continue:result:",{nodes:nodes,aBlock:aBlock,aCollection:aCollection},smalltalk.ASTInterpreter)})},
  583. messageSends: ["ifTrue:ifFalse:", "continue:value:", "interpret:continue:", "first", "interpretAll:continue:result:", "allButFirst", ",", "isEmpty"]}),
  584. smalltalk.ASTInterpreter);
  585. smalltalk.addMethod(
  586. smalltalk.method({
  587. selector: "interpretAssignmentNode:continue:",
  588. fn: function (aNode,aBlock){
  589. var self=this;
  590. return smalltalk.withContext(function($ctx1) {
  591. _st(self)._interpret_continue_(_st(aNode)._right(),(function(value){
  592. return smalltalk.withContext(function($ctx2) {
  593. return _st(self)._continue_value_(aBlock,_st(self)._assign_to_(_st(aNode)._left(),value));
  594. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  595. return self}, function($ctx1) {$ctx1.fill(self,"interpretAssignmentNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  596. messageSends: ["interpret:continue:", "right", "continue:value:", "assign:to:", "left"]}),
  597. smalltalk.ASTInterpreter);
  598. smalltalk.addMethod(
  599. smalltalk.method({
  600. selector: "interpretBlockNode:continue:",
  601. fn: function (aNode,aBlock){
  602. var self=this;
  603. return smalltalk.withContext(function($ctx1) {
  604. var $1,$2;
  605. _st(self)._continue_value_(aBlock,(function(){
  606. return smalltalk.withContext(function($ctx2) {
  607. return _st(self)._withBlockContext_((function(){
  608. return smalltalk.withContext(function($ctx3) {
  609. $1=self;
  610. _st($1)._interpret_(_st(_st(aNode)._nodes())._first());
  611. $2=_st($1)._result();
  612. return $2;
  613. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  614. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  615. return self}, function($ctx1) {$ctx1.fill(self,"interpretBlockNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  616. messageSends: ["continue:value:", "withBlockContext:", "interpret:", "first", "nodes", "result"]}),
  617. smalltalk.ASTInterpreter);
  618. smalltalk.addMethod(
  619. smalltalk.method({
  620. selector: "interpretBlockSequenceNode:continue:",
  621. fn: function (aNode,aBlock){
  622. var self=this;
  623. return smalltalk.withContext(function($ctx1) {
  624. _st(self)._interpretSequenceNode_continue_(aNode,aBlock);
  625. return self}, function($ctx1) {$ctx1.fill(self,"interpretBlockSequenceNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  626. messageSends: ["interpretSequenceNode:continue:"]}),
  627. smalltalk.ASTInterpreter);
  628. smalltalk.addMethod(
  629. smalltalk.method({
  630. selector: "interpretCascadeNode:continue:",
  631. fn: function (aNode,aBlock){
  632. var self=this;
  633. return smalltalk.withContext(function($ctx1) {
  634. _st(self)._interpret_continue_(_st(aNode)._receiver(),(function(receiver){
  635. return smalltalk.withContext(function($ctx2) {
  636. _st(_st(aNode)._nodes())._do_((function(each){
  637. return smalltalk.withContext(function($ctx3) {
  638. return _st(each)._receiver_(receiver);
  639. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  640. return _st(self)._interpretAll_continue_(_st(_st(aNode)._nodes())._allButLast(),(function(){
  641. return smalltalk.withContext(function($ctx3) {
  642. return _st(self)._interpret_continue_(_st(_st(aNode)._nodes())._last(),(function(val){
  643. return smalltalk.withContext(function($ctx4) {
  644. return _st(self)._continue_value_(aBlock,val);
  645. }, function($ctx4) {$ctx4.fillBlock({val:val},$ctx1)})}));
  646. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  647. }, function($ctx2) {$ctx2.fillBlock({receiver:receiver},$ctx1)})}));
  648. return self}, function($ctx1) {$ctx1.fill(self,"interpretCascadeNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  649. messageSends: ["interpret:continue:", "receiver", "do:", "receiver:", "nodes", "interpretAll:continue:", "allButLast", "last", "continue:value:"]}),
  650. smalltalk.ASTInterpreter);
  651. smalltalk.addMethod(
  652. smalltalk.method({
  653. selector: "interpretClassReferenceNode:continue:",
  654. fn: function (aNode,aBlock){
  655. var self=this;
  656. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  657. return smalltalk.withContext(function($ctx1) {
  658. _st(self)._continue_value_(aBlock,_st(_st($Smalltalk())._current())._at_(_st(aNode)._value()));
  659. return self}, function($ctx1) {$ctx1.fill(self,"interpretClassReferenceNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  660. messageSends: ["continue:value:", "at:", "value", "current"]}),
  661. smalltalk.ASTInterpreter);
  662. smalltalk.addMethod(
  663. smalltalk.method({
  664. selector: "interpretDynamicArrayNode:continue:",
  665. fn: function (aNode,aBlock){
  666. var self=this;
  667. return smalltalk.withContext(function($ctx1) {
  668. _st(self)._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  669. return smalltalk.withContext(function($ctx2) {
  670. return _st(self)._continue_value_(aBlock,array);
  671. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  672. return self}, function($ctx1) {$ctx1.fill(self,"interpretDynamicArrayNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  673. messageSends: ["interpretAll:continue:", "nodes", "continue:value:"]}),
  674. smalltalk.ASTInterpreter);
  675. smalltalk.addMethod(
  676. smalltalk.method({
  677. selector: "interpretDynamicDictionaryNode:continue:",
  678. fn: function (aNode,aBlock){
  679. var self=this;
  680. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  681. return smalltalk.withContext(function($ctx1) {
  682. _st(self)._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  683. var hashedCollection;
  684. return smalltalk.withContext(function($ctx2) {
  685. hashedCollection=_st($HashedCollection())._new();
  686. hashedCollection;
  687. _st(array)._do_((function(each){
  688. return smalltalk.withContext(function($ctx3) {
  689. return _st(hashedCollection)._add_(each);
  690. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  691. return _st(self)._continue_value_(aBlock,hashedCollection);
  692. }, function($ctx2) {$ctx2.fillBlock({array:array,hashedCollection:hashedCollection},$ctx1)})}));
  693. return self}, function($ctx1) {$ctx1.fill(self,"interpretDynamicDictionaryNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  694. messageSends: ["interpretAll:continue:", "nodes", "new", "do:", "add:", "continue:value:"]}),
  695. smalltalk.ASTInterpreter);
  696. smalltalk.addMethod(
  697. smalltalk.method({
  698. selector: "interpretJSStatementNode:continue:",
  699. fn: function (aNode,aBlock){
  700. var self=this;
  701. return smalltalk.withContext(function($ctx1) {
  702. self["@shouldReturn"]=true;
  703. _st(self)._continue_value_(aBlock,_st(self)._eval_(_st(aNode)._source()));
  704. return self}, function($ctx1) {$ctx1.fill(self,"interpretJSStatementNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  705. messageSends: ["continue:value:", "eval:", "source"]}),
  706. smalltalk.ASTInterpreter);
  707. smalltalk.addMethod(
  708. smalltalk.method({
  709. selector: "interpretMethodNode:continue:",
  710. fn: function (aNode,aBlock){
  711. var self=this;
  712. return smalltalk.withContext(function($ctx1) {
  713. _st(self)._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  714. return smalltalk.withContext(function($ctx2) {
  715. return _st(self)._continue_value_(aBlock,_st(array)._first());
  716. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  717. return self}, function($ctx1) {$ctx1.fill(self,"interpretMethodNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  718. messageSends: ["interpretAll:continue:", "nodes", "continue:value:", "first"]}),
  719. smalltalk.ASTInterpreter);
  720. smalltalk.addMethod(
  721. smalltalk.method({
  722. selector: "interpretNode:continue:",
  723. fn: function (aNode,aBlock){
  724. var self=this;
  725. return smalltalk.withContext(function($ctx1) {
  726. _st(aNode)._interpreter_continue_(self,aBlock);
  727. return self}, function($ctx1) {$ctx1.fill(self,"interpretNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  728. messageSends: ["interpreter:continue:"]}),
  729. smalltalk.ASTInterpreter);
  730. smalltalk.addMethod(
  731. smalltalk.method({
  732. selector: "interpretReturnNode:continue:",
  733. fn: function (aNode,aBlock){
  734. var self=this;
  735. return smalltalk.withContext(function($ctx1) {
  736. _st(self)._interpret_continue_(_st(_st(aNode)._nodes())._first(),(function(value){
  737. return smalltalk.withContext(function($ctx2) {
  738. self["@shouldReturn"]=true;
  739. self["@shouldReturn"];
  740. return _st(self)._continue_value_(aBlock,value);
  741. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  742. return self}, function($ctx1) {$ctx1.fill(self,"interpretReturnNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  743. messageSends: ["interpret:continue:", "first", "nodes", "continue:value:"]}),
  744. smalltalk.ASTInterpreter);
  745. smalltalk.addMethod(
  746. smalltalk.method({
  747. selector: "interpretSendNode:continue:",
  748. fn: function (aNode,aBlock){
  749. var self=this;
  750. return smalltalk.withContext(function($ctx1) {
  751. _st(self)._interpret_continue_(_st(aNode)._receiver(),(function(receiver){
  752. return smalltalk.withContext(function($ctx2) {
  753. return _st(self)._interpretAll_continue_(_st(aNode)._arguments(),(function(args){
  754. return smalltalk.withContext(function($ctx3) {
  755. return _st(self)._messageFromSendNode_arguments_do_(aNode,args,(function(message){
  756. return smalltalk.withContext(function($ctx4) {
  757. _st(_st(self)._context())._pc_(_st(_st(_st(self)._context())._pc()).__plus((1)));
  758. return _st(self)._continue_value_(aBlock,_st(self)._sendMessage_to_superSend_(message,receiver,_st(aNode)._superSend()));
  759. }, function($ctx4) {$ctx4.fillBlock({message:message},$ctx1)})}));
  760. }, function($ctx3) {$ctx3.fillBlock({args:args},$ctx1)})}));
  761. }, function($ctx2) {$ctx2.fillBlock({receiver:receiver},$ctx1)})}));
  762. return self}, function($ctx1) {$ctx1.fill(self,"interpretSendNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  763. messageSends: ["interpret:continue:", "receiver", "interpretAll:continue:", "arguments", "messageFromSendNode:arguments:do:", "pc:", "+", "pc", "context", "continue:value:", "sendMessage:to:superSend:", "superSend"]}),
  764. smalltalk.ASTInterpreter);
  765. smalltalk.addMethod(
  766. smalltalk.method({
  767. selector: "interpretSequenceNode:continue:",
  768. fn: function (aNode,aBlock){
  769. var self=this;
  770. return smalltalk.withContext(function($ctx1) {
  771. _st(self)._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  772. return smalltalk.withContext(function($ctx2) {
  773. return _st(self)._continue_value_(aBlock,_st(array)._last());
  774. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  775. return self}, function($ctx1) {$ctx1.fill(self,"interpretSequenceNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  776. messageSends: ["interpretAll:continue:", "nodes", "continue:value:", "last"]}),
  777. smalltalk.ASTInterpreter);
  778. smalltalk.addMethod(
  779. smalltalk.method({
  780. selector: "interpretValueNode:continue:",
  781. fn: function (aNode,aBlock){
  782. var self=this;
  783. return smalltalk.withContext(function($ctx1) {
  784. _st(self)._continue_value_(aBlock,_st(aNode)._value());
  785. return self}, function($ctx1) {$ctx1.fill(self,"interpretValueNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  786. messageSends: ["continue:value:", "value"]}),
  787. smalltalk.ASTInterpreter);
  788. smalltalk.addMethod(
  789. smalltalk.method({
  790. selector: "interpretVariableNode:continue:",
  791. fn: function (aNode,aBlock){
  792. var self=this;
  793. return smalltalk.withContext(function($ctx1) {
  794. var $1,$2,$4,$3;
  795. $1=self;
  796. $2=aBlock;
  797. $4=_st(_st(aNode)._binding())._isInstanceVar();
  798. if(smalltalk.assert($4)){
  799. $3=_st(_st(_st(self)._context())._receiver())._instVarAt_(_st(aNode)._value());
  800. } else {
  801. $3=_st(_st(self)._context())._localAt_(_st(aNode)._value());
  802. };
  803. _st($1)._continue_value_($2,$3);
  804. return self}, function($ctx1) {$ctx1.fill(self,"interpretVariableNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  805. messageSends: ["continue:value:", "ifTrue:ifFalse:", "instVarAt:", "value", "receiver", "context", "localAt:", "isInstanceVar", "binding"]}),
  806. smalltalk.ASTInterpreter);
  807. smalltalk.addMethod(
  808. smalltalk.method({
  809. selector: "messageFromSendNode:arguments:do:",
  810. fn: function (aSendNode,aCollection,aBlock){
  811. var self=this;
  812. function $Message(){return smalltalk.Message||(typeof Message=="undefined"?nil:Message)}
  813. return smalltalk.withContext(function($ctx1) {
  814. var $1,$2;
  815. $1=_st($Message())._new();
  816. _st($1)._selector_(_st(aSendNode)._selector());
  817. _st($1)._arguments_(aCollection);
  818. $2=_st($1)._yourself();
  819. _st(self)._continue_value_(aBlock,$2);
  820. return self}, function($ctx1) {$ctx1.fill(self,"messageFromSendNode:arguments:do:",{aSendNode:aSendNode,aCollection:aCollection,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  821. messageSends: ["continue:value:", "selector:", "selector", "new", "arguments:", "yourself"]}),
  822. smalltalk.ASTInterpreter);
  823. smalltalk.addMethod(
  824. smalltalk.method({
  825. selector: "result",
  826. fn: function (){
  827. var self=this;
  828. return smalltalk.withContext(function($ctx1) {
  829. var $1;
  830. $1=self["@result"];
  831. return $1;
  832. }, function($ctx1) {$ctx1.fill(self,"result",{},smalltalk.ASTInterpreter)})},
  833. messageSends: []}),
  834. smalltalk.ASTInterpreter);
  835. smalltalk.addMethod(
  836. smalltalk.method({
  837. selector: "sendMessage:to:superSend:",
  838. fn: function (aMessage,anObject,aBoolean){
  839. var self=this;
  840. var method;
  841. return smalltalk.withContext(function($ctx1) {
  842. var $1,$2,$3,$4,$5,$6;
  843. var $early={};
  844. try {
  845. $1=aBoolean;
  846. if(! smalltalk.assert($1)){
  847. $2=_st(aMessage)._sendTo_(anObject);
  848. return $2;
  849. };
  850. $3=_st(_st(anObject)._class())._superclass();
  851. if(($receiver = $3) == nil || $receiver == undefined){
  852. $4=_st(self)._messageNotUnderstood_receiver_(aMessage,anObject);
  853. return $4;
  854. } else {
  855. $3;
  856. };
  857. method=_st(_st(_st(_st(anObject)._class())._superclass())._methodDictionary())._at_ifAbsent_(_st(aMessage)._selector(),(function(){
  858. return smalltalk.withContext(function($ctx2) {
  859. $5=_st(self)._messageNotUnderstood_receiver_(aMessage,anObject);
  860. throw $early=[$5];
  861. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  862. $6=_st(_st(method)._fn())._applyTo_arguments_(anObject,_st(aMessage)._arguments());
  863. return $6;
  864. }
  865. catch(e) {if(e===$early)return e[0]; throw e}
  866. }, function($ctx1) {$ctx1.fill(self,"sendMessage:to:superSend:",{aMessage:aMessage,anObject:anObject,aBoolean:aBoolean,method:method},smalltalk.ASTInterpreter)})},
  867. messageSends: ["ifFalse:", "sendTo:", "ifNil:", "messageNotUnderstood:receiver:", "superclass", "class", "at:ifAbsent:", "selector", "methodDictionary", "applyTo:arguments:", "arguments", "fn"]}),
  868. smalltalk.ASTInterpreter);
  869. smalltalk.addMethod(
  870. smalltalk.method({
  871. selector: "shouldReturn",
  872. fn: function (){
  873. var self=this;
  874. return smalltalk.withContext(function($ctx1) {
  875. var $2,$1;
  876. $2=self["@shouldReturn"];
  877. if(($receiver = $2) == nil || $receiver == undefined){
  878. $1=false;
  879. } else {
  880. $1=$2;
  881. };
  882. return $1;
  883. }, function($ctx1) {$ctx1.fill(self,"shouldReturn",{},smalltalk.ASTInterpreter)})},
  884. messageSends: ["ifNil:"]}),
  885. smalltalk.ASTInterpreter);
  886. smalltalk.addMethod(
  887. smalltalk.method({
  888. selector: "withBlockContext:",
  889. fn: function (aBlock){
  890. var self=this;
  891. var blockResult;
  892. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  893. return smalltalk.withContext(function($ctx1) {
  894. var $1,$2,$3;
  895. $1=_st($AIContext())._new();
  896. _st($1)._outerContext_(_st(self)._context());
  897. $2=_st($1)._yourself();
  898. _st(self)._context_($2);
  899. blockResult=_st(aBlock)._value();
  900. _st(self)._context_(_st(_st(self)._context())._outerContext());
  901. $3=blockResult;
  902. return $3;
  903. }, function($ctx1) {$ctx1.fill(self,"withBlockContext:",{aBlock:aBlock,blockResult:blockResult},smalltalk.ASTInterpreter)})},
  904. messageSends: ["context:", "outerContext:", "context", "new", "yourself", "value", "outerContext"]}),
  905. smalltalk.ASTInterpreter);
  906. smalltalk.addClass('ASTSteppingInterpreter', smalltalk.ASTInterpreter, ['continuation', 'nextNode'], 'Compiler-Interpreter');
  907. smalltalk.addMethod(
  908. smalltalk.method({
  909. selector: "atEnd",
  910. fn: function (){
  911. var self=this;
  912. return smalltalk.withContext(function($ctx1) {
  913. var $1;
  914. $1=_st(_st(self)._shouldReturn())._or_((function(){
  915. return smalltalk.withContext(function($ctx2) {
  916. return _st(_st(self)._nextNode()).__eq_eq(_st(self)._currentNode());
  917. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  918. return $1;
  919. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.ASTSteppingInterpreter)})},
  920. messageSends: ["or:", "==", "currentNode", "nextNode", "shouldReturn"]}),
  921. smalltalk.ASTSteppingInterpreter);
  922. smalltalk.addMethod(
  923. smalltalk.method({
  924. selector: "initialize",
  925. fn: function (){
  926. var self=this;
  927. return smalltalk.withContext(function($ctx1) {
  928. smalltalk.ASTInterpreter.fn.prototype._initialize.apply(_st(self), []);
  929. self["@continuation"]=(function(){
  930. return smalltalk.withContext(function($ctx2) {
  931. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  932. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ASTSteppingInterpreter)})},
  933. messageSends: ["initialize"]}),
  934. smalltalk.ASTSteppingInterpreter);
  935. smalltalk.addMethod(
  936. smalltalk.method({
  937. selector: "interpret:continue:",
  938. fn: function (aNode,aBlock){
  939. var self=this;
  940. return smalltalk.withContext(function($ctx1) {
  941. self["@nextNode"]=aNode;
  942. self["@continuation"]=(function(){
  943. return smalltalk.withContext(function($ctx2) {
  944. return smalltalk.ASTInterpreter.fn.prototype._interpret_continue_.apply(_st(self), [aNode,aBlock]);
  945. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  946. return self}, function($ctx1) {$ctx1.fill(self,"interpret:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTSteppingInterpreter)})},
  947. messageSends: ["interpret:continue:"]}),
  948. smalltalk.ASTSteppingInterpreter);
  949. smalltalk.addMethod(
  950. smalltalk.method({
  951. selector: "nextNode",
  952. fn: function (){
  953. var self=this;
  954. return smalltalk.withContext(function($ctx1) {
  955. var $1;
  956. $1=self["@nextNode"];
  957. return $1;
  958. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.ASTSteppingInterpreter)})},
  959. messageSends: []}),
  960. smalltalk.ASTSteppingInterpreter);
  961. smalltalk.addMethod(
  962. smalltalk.method({
  963. selector: "step",
  964. fn: function (){
  965. var self=this;
  966. return smalltalk.withContext(function($ctx1) {
  967. _st(self["@continuation"])._value();
  968. return self}, function($ctx1) {$ctx1.fill(self,"step",{},smalltalk.ASTSteppingInterpreter)})},
  969. messageSends: ["value"]}),
  970. smalltalk.ASTSteppingInterpreter);
  971. smalltalk.addMethod(
  972. smalltalk.method({
  973. selector: "interpreter:continue:",
  974. fn: function (anInterpreter,aBlock){
  975. var self=this;
  976. return smalltalk.withContext(function($ctx1) {
  977. var $1;
  978. $1=_st(anInterpreter)._interpretNode_continue_(self,aBlock);
  979. return $1;
  980. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.Node)})},
  981. messageSends: ["interpretNode:continue:"]}),
  982. smalltalk.Node);
  983. smalltalk.addMethod(
  984. smalltalk.method({
  985. selector: "isSteppingNode",
  986. fn: function (){
  987. var self=this;
  988. return smalltalk.withContext(function($ctx1) {
  989. return false;
  990. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.Node)})},
  991. messageSends: []}),
  992. smalltalk.Node);
  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)._interpretAssignmentNode_continue_(self,aBlock);
  1001. return $1;
  1002. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.AssignmentNode)})},
  1003. messageSends: ["interpretAssignmentNode:continue:"]}),
  1004. smalltalk.AssignmentNode);
  1005. smalltalk.addMethod(
  1006. smalltalk.method({
  1007. selector: "isSteppingNode",
  1008. fn: function (){
  1009. var self=this;
  1010. return smalltalk.withContext(function($ctx1) {
  1011. return true;
  1012. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.AssignmentNode)})},
  1013. messageSends: []}),
  1014. smalltalk.AssignmentNode);
  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)._interpretBlockNode_continue_(self,aBlock);
  1023. return $1;
  1024. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.BlockNode)})},
  1025. messageSends: ["interpretBlockNode:continue:"]}),
  1026. smalltalk.BlockNode);
  1027. smalltalk.addMethod(
  1028. 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.BlockNode)})},
  1035. messageSends: []}),
  1036. smalltalk.BlockNode);
  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)._interpretCascadeNode_continue_(self,aBlock);
  1045. return $1;
  1046. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.CascadeNode)})},
  1047. messageSends: ["interpretCascadeNode:continue:"]}),
  1048. smalltalk.CascadeNode);
  1049. smalltalk.addMethod(
  1050. smalltalk.method({
  1051. selector: "interpreter:continue:",
  1052. fn: function (anInterpreter,aBlock){
  1053. var self=this;
  1054. return smalltalk.withContext(function($ctx1) {
  1055. var $1;
  1056. $1=_st(anInterpreter)._interpretDynamicArrayNode_continue_(self,aBlock);
  1057. return $1;
  1058. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.DynamicArrayNode)})},
  1059. messageSends: ["interpretDynamicArrayNode:continue:"]}),
  1060. smalltalk.DynamicArrayNode);
  1061. smalltalk.addMethod(
  1062. smalltalk.method({
  1063. selector: "isSteppingNode",
  1064. fn: function (){
  1065. var self=this;
  1066. return smalltalk.withContext(function($ctx1) {
  1067. return true;
  1068. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.DynamicArrayNode)})},
  1069. messageSends: []}),
  1070. smalltalk.DynamicArrayNode);
  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)._interpretDynamicDictionaryNode_continue_(self,aBlock);
  1079. return $1;
  1080. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.DynamicDictionaryNode)})},
  1081. messageSends: ["interpretDynamicDictionaryNode:continue:"]}),
  1082. smalltalk.DynamicDictionaryNode);
  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.DynamicDictionaryNode)})},
  1091. messageSends: []}),
  1092. smalltalk.DynamicDictionaryNode);
  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)._interpretJSStatementNode_continue_(self,aBlock);
  1101. return $1;
  1102. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.JSStatementNode)})},
  1103. messageSends: ["interpretJSStatementNode:continue:"]}),
  1104. smalltalk.JSStatementNode);
  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.JSStatementNode)})},
  1113. messageSends: []}),
  1114. smalltalk.JSStatementNode);
  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)._interpretMethodNode_continue_(self,aBlock);
  1123. return $1;
  1124. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.MethodNode)})},
  1125. messageSends: ["interpretMethodNode:continue:"]}),
  1126. smalltalk.MethodNode);
  1127. smalltalk.addMethod(
  1128. smalltalk.method({
  1129. selector: "interpreter:continue:",
  1130. fn: function (anInterpreter,aBlock){
  1131. var self=this;
  1132. return smalltalk.withContext(function($ctx1) {
  1133. var $1;
  1134. $1=_st(anInterpreter)._interpretReturnNode_continue_(self,aBlock);
  1135. return $1;
  1136. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.ReturnNode)})},
  1137. messageSends: ["interpretReturnNode:continue:"]}),
  1138. smalltalk.ReturnNode);
  1139. smalltalk.addMethod(
  1140. smalltalk.method({
  1141. selector: "interpreter:continue:",
  1142. fn: function (anInterpreter,aBlock){
  1143. var self=this;
  1144. return smalltalk.withContext(function($ctx1) {
  1145. var $1;
  1146. $1=_st(anInterpreter)._interpretSendNode_continue_(self,aBlock);
  1147. return $1;
  1148. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.SendNode)})},
  1149. messageSends: ["interpretSendNode:continue:"]}),
  1150. smalltalk.SendNode);
  1151. smalltalk.addMethod(
  1152. smalltalk.method({
  1153. selector: "isSteppingNode",
  1154. fn: function (){
  1155. var self=this;
  1156. return smalltalk.withContext(function($ctx1) {
  1157. return true;
  1158. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.SendNode)})},
  1159. messageSends: []}),
  1160. smalltalk.SendNode);
  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)._interpretSequenceNode_continue_(self,aBlock);
  1169. return $1;
  1170. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.SequenceNode)})},
  1171. messageSends: ["interpretSequenceNode:continue:"]}),
  1172. smalltalk.SequenceNode);
  1173. smalltalk.addMethod(
  1174. smalltalk.method({
  1175. selector: "interpreter:continue:",
  1176. fn: function (anInterpreter,aBlock){
  1177. var self=this;
  1178. return smalltalk.withContext(function($ctx1) {
  1179. var $1;
  1180. $1=_st(anInterpreter)._interpretBlockSequenceNode_continue_(self,aBlock);
  1181. return $1;
  1182. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.BlockSequenceNode)})},
  1183. messageSends: ["interpretBlockSequenceNode:continue:"]}),
  1184. smalltalk.BlockSequenceNode);
  1185. smalltalk.addMethod(
  1186. smalltalk.method({
  1187. selector: "interpreter:continue:",
  1188. fn: function (anInterpreter,aBlock){
  1189. var self=this;
  1190. return smalltalk.withContext(function($ctx1) {
  1191. var $1;
  1192. $1=_st(anInterpreter)._interpretValueNode_continue_(self,aBlock);
  1193. return $1;
  1194. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.ValueNode)})},
  1195. messageSends: ["interpretValueNode:continue:"]}),
  1196. smalltalk.ValueNode);
  1197. smalltalk.addMethod(
  1198. smalltalk.method({
  1199. selector: "interpreter:continue:",
  1200. fn: function (anInterpreter,aBlock){
  1201. var self=this;
  1202. return smalltalk.withContext(function($ctx1) {
  1203. var $1;
  1204. $1=_st(anInterpreter)._interpretVariableNode_continue_(self,aBlock);
  1205. return $1;
  1206. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.VariableNode)})},
  1207. messageSends: ["interpretVariableNode:continue:"]}),
  1208. smalltalk.VariableNode);
  1209. smalltalk.addMethod(
  1210. smalltalk.method({
  1211. selector: "interpreter:continue:",
  1212. fn: function (anInterpreter,aBlock){
  1213. var self=this;
  1214. return smalltalk.withContext(function($ctx1) {
  1215. var $1;
  1216. $1=_st(anInterpreter)._interpretClassReferenceNode_continue_(self,aBlock);
  1217. return $1;
  1218. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.ClassReferenceNode)})},
  1219. messageSends: ["interpretClassReferenceNode:continue:"]}),
  1220. smalltalk.ClassReferenceNode);