Compiler-Interpreter.deploy.js 46 KB

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