Compiler-Interpreter.deploy.js 48 KB

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