Compiler-Interpreter.js 69 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794
  1. smalltalk.addPackage('Compiler-Interpreter');
  2. smalltalk.addClass('AIContext', smalltalk.NodeVisitor, ['outerContext', 'pc', 'locals', 'method'], 'Compiler-Interpreter');
  3. smalltalk.AIContext.comment="I am like a `MethodContext`, used by the `ASTInterpreter`.\x0aUnlike a `MethodContext`, my instances are not read-only.\x0a\x0aWhen debugging, my instances are created by copying the current `MethodContext` (thisContext)"
  4. smalltalk.addMethod(
  5. smalltalk.method({
  6. selector: "initializeFromMethodContext:",
  7. category: 'initialization',
  8. fn: function (aMethodContext){
  9. var self=this;
  10. return smalltalk.withContext(function($ctx1) {
  11. var $1;
  12. _st(self)._pc_(_st(aMethodContext)._pc());
  13. _st(self)._receiver_(_st(aMethodContext)._receiver());
  14. _st(self)._method_(_st(aMethodContext)._method());
  15. $1=_st(aMethodContext)._outerContext();
  16. if(($receiver = $1) == nil || $receiver == undefined){
  17. $1;
  18. } else {
  19. _st(self)._outerContext_(_st(_st(self)._class())._fromMethodContext_(_st(aMethodContext)._outerContext()));
  20. };
  21. _st(_st(aMethodContext)._locals())._keysAndValuesDo_((function(key,value){
  22. return smalltalk.withContext(function($ctx2) {
  23. return _st(_st(self)._locals())._at_put_(key,value);
  24. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1)})}));
  25. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromMethodContext:",{aMethodContext:aMethodContext},smalltalk.AIContext)})},
  26. args: ["aMethodContext"],
  27. source: "initializeFromMethodContext: aMethodContext\x0a\x09self pc: aMethodContext pc.\x0a\x09self receiver: aMethodContext receiver.\x0a\x09self method: aMethodContext method.\x0a\x09aMethodContext outerContext ifNotNil: [\x0a\x09\x09self outerContext: (self class fromMethodContext: aMethodContext outerContext) ].\x0a\x09aMethodContext locals keysAndValuesDo: [ :key :value |\x0a\x09\x09self locals at: key put: value ]",
  28. messageSends: ["pc:", "pc", "receiver:", "receiver", "method:", "method", "ifNotNil:", "outerContext:", "fromMethodContext:", "outerContext", "class", "keysAndValuesDo:", "at:put:", "locals"],
  29. referencedClasses: []
  30. }),
  31. smalltalk.AIContext);
  32. smalltalk.addMethod(
  33. smalltalk.method({
  34. selector: "initializeLocals",
  35. category: 'initialization',
  36. fn: function (){
  37. var self=this;
  38. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  39. return smalltalk.withContext(function($ctx1) {
  40. self["@locals"]=_st($Dictionary())._new();
  41. _st(self["@locals"])._at_put_("thisContext",self);
  42. return self}, function($ctx1) {$ctx1.fill(self,"initializeLocals",{},smalltalk.AIContext)})},
  43. args: [],
  44. source: "initializeLocals\x0a\x09locals := Dictionary new.\x0a\x09locals at: 'thisContext' put: self.",
  45. messageSends: ["new", "at:put:"],
  46. referencedClasses: ["Dictionary"]
  47. }),
  48. smalltalk.AIContext);
  49. smalltalk.addMethod(
  50. smalltalk.method({
  51. selector: "localAt:",
  52. category: 'accessing',
  53. fn: function (aString){
  54. var self=this;
  55. return smalltalk.withContext(function($ctx1) {
  56. var $1;
  57. $1=_st(_st(self)._locals())._at_ifAbsent_(aString,(function(){
  58. return smalltalk.withContext(function($ctx2) {
  59. return nil;
  60. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  61. return $1;
  62. }, function($ctx1) {$ctx1.fill(self,"localAt:",{aString:aString},smalltalk.AIContext)})},
  63. args: ["aString"],
  64. source: "localAt: aString\x0a\x09^ self locals at: aString ifAbsent: [ nil ]",
  65. messageSends: ["at:ifAbsent:", "locals"],
  66. referencedClasses: []
  67. }),
  68. smalltalk.AIContext);
  69. smalltalk.addMethod(
  70. smalltalk.method({
  71. selector: "localAt:put:",
  72. category: 'accessing',
  73. fn: function (aString,anObject){
  74. var self=this;
  75. return smalltalk.withContext(function($ctx1) {
  76. _st(_st(self)._locals())._at_put_(aString,anObject);
  77. return self}, function($ctx1) {$ctx1.fill(self,"localAt:put:",{aString:aString,anObject:anObject},smalltalk.AIContext)})},
  78. args: ["aString", "anObject"],
  79. source: "localAt: aString put: anObject\x0a\x09self locals at: aString put: anObject",
  80. messageSends: ["at:put:", "locals"],
  81. referencedClasses: []
  82. }),
  83. smalltalk.AIContext);
  84. smalltalk.addMethod(
  85. smalltalk.method({
  86. selector: "locals",
  87. category: 'accessing',
  88. fn: function (){
  89. var self=this;
  90. return smalltalk.withContext(function($ctx1) {
  91. var $1,$2;
  92. $1=self["@locals"];
  93. if(($receiver = $1) == nil || $receiver == undefined){
  94. _st(self)._initializeLocals();
  95. } else {
  96. $1;
  97. };
  98. $2=self["@locals"];
  99. return $2;
  100. }, function($ctx1) {$ctx1.fill(self,"locals",{},smalltalk.AIContext)})},
  101. args: [],
  102. source: "locals\x0a\x09locals ifNil: [ self initializeLocals ].\x0a\x09\x0a\x09^ locals",
  103. messageSends: ["ifNil:", "initializeLocals"],
  104. referencedClasses: []
  105. }),
  106. smalltalk.AIContext);
  107. smalltalk.addMethod(
  108. smalltalk.method({
  109. selector: "method",
  110. category: 'accessing',
  111. fn: function (){
  112. var self=this;
  113. return smalltalk.withContext(function($ctx1) {
  114. var $1;
  115. $1=self["@method"];
  116. return $1;
  117. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.AIContext)})},
  118. args: [],
  119. source: "method\x0a\x09^ method",
  120. messageSends: [],
  121. referencedClasses: []
  122. }),
  123. smalltalk.AIContext);
  124. smalltalk.addMethod(
  125. smalltalk.method({
  126. selector: "method:",
  127. category: 'accessing',
  128. fn: function (aCompiledMethod){
  129. var self=this;
  130. return smalltalk.withContext(function($ctx1) {
  131. self["@method"]=aCompiledMethod;
  132. return self}, function($ctx1) {$ctx1.fill(self,"method:",{aCompiledMethod:aCompiledMethod},smalltalk.AIContext)})},
  133. args: ["aCompiledMethod"],
  134. source: "method: aCompiledMethod\x0a\x09method := aCompiledMethod",
  135. messageSends: [],
  136. referencedClasses: []
  137. }),
  138. smalltalk.AIContext);
  139. smalltalk.addMethod(
  140. smalltalk.method({
  141. selector: "outerContext",
  142. category: 'accessing',
  143. fn: function (){
  144. var self=this;
  145. return smalltalk.withContext(function($ctx1) {
  146. var $1;
  147. $1=self["@outerContext"];
  148. return $1;
  149. }, function($ctx1) {$ctx1.fill(self,"outerContext",{},smalltalk.AIContext)})},
  150. args: [],
  151. source: "outerContext\x0a\x09^ outerContext",
  152. messageSends: [],
  153. referencedClasses: []
  154. }),
  155. smalltalk.AIContext);
  156. smalltalk.addMethod(
  157. smalltalk.method({
  158. selector: "outerContext:",
  159. category: 'accessing',
  160. fn: function (anAIContext){
  161. var self=this;
  162. return smalltalk.withContext(function($ctx1) {
  163. self["@outerContext"]=anAIContext;
  164. return self}, function($ctx1) {$ctx1.fill(self,"outerContext:",{anAIContext:anAIContext},smalltalk.AIContext)})},
  165. args: ["anAIContext"],
  166. source: "outerContext: anAIContext\x0a\x09outerContext := anAIContext",
  167. messageSends: [],
  168. referencedClasses: []
  169. }),
  170. smalltalk.AIContext);
  171. smalltalk.addMethod(
  172. smalltalk.method({
  173. selector: "pc",
  174. category: 'accessing',
  175. fn: function (){
  176. var self=this;
  177. return smalltalk.withContext(function($ctx1) {
  178. var $2,$1;
  179. $2=self["@pc"];
  180. if(($receiver = $2) == nil || $receiver == undefined){
  181. self["@pc"]=(0);
  182. $1=self["@pc"];
  183. } else {
  184. $1=$2;
  185. };
  186. return $1;
  187. }, function($ctx1) {$ctx1.fill(self,"pc",{},smalltalk.AIContext)})},
  188. args: [],
  189. source: "pc\x0a\x09^ pc ifNil: [ pc := 0 ]",
  190. messageSends: ["ifNil:"],
  191. referencedClasses: []
  192. }),
  193. smalltalk.AIContext);
  194. smalltalk.addMethod(
  195. smalltalk.method({
  196. selector: "pc:",
  197. category: 'accessing',
  198. fn: function (anInteger){
  199. var self=this;
  200. return smalltalk.withContext(function($ctx1) {
  201. self["@pc"]=anInteger;
  202. return self}, function($ctx1) {$ctx1.fill(self,"pc:",{anInteger:anInteger},smalltalk.AIContext)})},
  203. args: ["anInteger"],
  204. source: "pc: anInteger\x0a\x09pc := anInteger",
  205. messageSends: [],
  206. referencedClasses: []
  207. }),
  208. smalltalk.AIContext);
  209. smalltalk.addMethod(
  210. smalltalk.method({
  211. selector: "receiver",
  212. category: 'accessing',
  213. fn: function (){
  214. var self=this;
  215. return smalltalk.withContext(function($ctx1) {
  216. var $1;
  217. $1=_st(self)._localAt_("self");
  218. return $1;
  219. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.AIContext)})},
  220. args: [],
  221. source: "receiver\x0a\x09^ self localAt: 'self'",
  222. messageSends: ["localAt:"],
  223. referencedClasses: []
  224. }),
  225. smalltalk.AIContext);
  226. smalltalk.addMethod(
  227. smalltalk.method({
  228. selector: "receiver:",
  229. category: 'accessing',
  230. fn: function (anObject){
  231. var self=this;
  232. return smalltalk.withContext(function($ctx1) {
  233. _st(self)._localAt_put_("self",anObject);
  234. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.AIContext)})},
  235. args: ["anObject"],
  236. source: "receiver: anObject\x0a\x09self localAt: 'self' put: anObject",
  237. messageSends: ["localAt:put:"],
  238. referencedClasses: []
  239. }),
  240. smalltalk.AIContext);
  241. smalltalk.addMethod(
  242. smalltalk.method({
  243. selector: "selector",
  244. category: 'accessing',
  245. fn: function (){
  246. var self=this;
  247. return smalltalk.withContext(function($ctx1) {
  248. var $2,$1;
  249. $2=_st(self)._method();
  250. if(($receiver = $2) == nil || $receiver == undefined){
  251. $1=$2;
  252. } else {
  253. $1=_st(_st(self)._method())._selector();
  254. };
  255. return $1;
  256. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.AIContext)})},
  257. args: [],
  258. source: "selector\x0a\x09^ self method\x0a\x09\x09ifNotNil: [ self method selector ]",
  259. messageSends: ["ifNotNil:", "selector", "method"],
  260. referencedClasses: []
  261. }),
  262. smalltalk.AIContext);
  263. smalltalk.addMethod(
  264. smalltalk.method({
  265. selector: "fromMethodContext:",
  266. category: 'instance creation',
  267. fn: function (aMethodContext){
  268. var self=this;
  269. return smalltalk.withContext(function($ctx1) {
  270. var $2,$3,$1;
  271. $2=_st(self)._new();
  272. _st($2)._initializeFromMethodContext_(aMethodContext);
  273. $3=_st($2)._yourself();
  274. $1=$3;
  275. return $1;
  276. }, function($ctx1) {$ctx1.fill(self,"fromMethodContext:",{aMethodContext:aMethodContext},smalltalk.AIContext.klass)})},
  277. args: ["aMethodContext"],
  278. source: "fromMethodContext: aMethodContext\x0a\x09^ self new\x0a\x09\x09initializeFromMethodContext: aMethodContext;\x0a\x09\x09yourself",
  279. messageSends: ["initializeFromMethodContext:", "new", "yourself"],
  280. referencedClasses: []
  281. }),
  282. smalltalk.AIContext.klass);
  283. smalltalk.addClass('ASTDebugger', smalltalk.Object, ['interpreter', 'context'], 'Compiler-Interpreter');
  284. smalltalk.ASTDebugger.comment="I am a stepping debugger interface for Amber code.\x0aI internally use an instance of `ASTSteppingInterpreter` to actually step through node and interpret them.\x0a\x0aMy instances are created from a `MethodContext` with `ASTDebugger class >> context:`.\x0aThey hold an `AIContext` instance internally, recursive copy of the `MethodContext`.\x0a\x0a## API\x0a\x0aUse the methods of the `'stepping'` protocol to do stepping."
  285. smalltalk.addMethod(
  286. smalltalk.method({
  287. selector: "atEnd",
  288. category: 'testing',
  289. fn: function (){
  290. var self=this;
  291. return smalltalk.withContext(function($ctx1) {
  292. var $1;
  293. $1=_st(_st(self)._interpreter())._atEnd();
  294. return $1;
  295. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.ASTDebugger)})},
  296. args: [],
  297. source: "atEnd\x0a\x09^ self interpreter atEnd",
  298. messageSends: ["atEnd", "interpreter"],
  299. referencedClasses: []
  300. }),
  301. smalltalk.ASTDebugger);
  302. smalltalk.addMethod(
  303. smalltalk.method({
  304. selector: "buildAST",
  305. category: 'initialization',
  306. fn: function (){
  307. var self=this;
  308. var ast;
  309. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  310. function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
  311. return smalltalk.withContext(function($ctx1) {
  312. var $1;
  313. ast=_st(_st($Smalltalk())._current())._parse_(_st(_st(self)._method())._source());
  314. _st(_st($SemanticAnalyzer())._on_(_st(_st(_st(self)._context())._receiver())._class()))._visit_(ast);
  315. $1=ast;
  316. return $1;
  317. }, function($ctx1) {$ctx1.fill(self,"buildAST",{ast:ast},smalltalk.ASTDebugger)})},
  318. args: [],
  319. source: "buildAST\x0a\x09\x22Build the AST tree from the method source code.\x0a\x09The AST is annotated with a SemanticAnalyzer,\x0a\x09to know the semantics and bindings of each node needed for later debugging\x22\x0a\x09\x0a\x09| ast |\x0a\x09\x0a\x09ast := Smalltalk current parse: self method source.\x0a\x09(SemanticAnalyzer on: self context receiver class)\x0a\x09\x09visit: ast.\x0a\x09\x0a\x09^ ast",
  320. messageSends: ["parse:", "source", "method", "current", "visit:", "on:", "class", "receiver", "context"],
  321. referencedClasses: ["Smalltalk", "SemanticAnalyzer"]
  322. }),
  323. smalltalk.ASTDebugger);
  324. smalltalk.addMethod(
  325. smalltalk.method({
  326. selector: "context",
  327. category: 'accessing',
  328. fn: function (){
  329. var self=this;
  330. return smalltalk.withContext(function($ctx1) {
  331. var $1;
  332. $1=self["@context"];
  333. return $1;
  334. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTDebugger)})},
  335. args: [],
  336. source: "context\x0a\x09^ context",
  337. messageSends: [],
  338. referencedClasses: []
  339. }),
  340. smalltalk.ASTDebugger);
  341. smalltalk.addMethod(
  342. smalltalk.method({
  343. selector: "context:",
  344. category: 'accessing',
  345. fn: function (aContext){
  346. var self=this;
  347. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  348. return smalltalk.withContext(function($ctx1) {
  349. self["@context"]=_st($AIContext())._new();
  350. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTDebugger)})},
  351. args: ["aContext"],
  352. source: "context: aContext\x0a\x09context := AIContext new.",
  353. messageSends: ["new"],
  354. referencedClasses: ["AIContext"]
  355. }),
  356. smalltalk.ASTDebugger);
  357. smalltalk.addMethod(
  358. smalltalk.method({
  359. selector: "defaultInterpreterClass",
  360. category: 'defaults',
  361. fn: function (){
  362. var self=this;
  363. function $ASTSteppingInterpreter(){return smalltalk.ASTSteppingInterpreter||(typeof ASTSteppingInterpreter=="undefined"?nil:ASTSteppingInterpreter)}
  364. return smalltalk.withContext(function($ctx1) {
  365. var $1;
  366. $1=$ASTSteppingInterpreter();
  367. return $1;
  368. }, function($ctx1) {$ctx1.fill(self,"defaultInterpreterClass",{},smalltalk.ASTDebugger)})},
  369. args: [],
  370. source: "defaultInterpreterClass\x0a\x09^ ASTSteppingInterpreter",
  371. messageSends: [],
  372. referencedClasses: ["ASTSteppingInterpreter"]
  373. }),
  374. smalltalk.ASTDebugger);
  375. smalltalk.addMethod(
  376. smalltalk.method({
  377. selector: "initializeInterpreter",
  378. category: 'initialization',
  379. fn: function (){
  380. var self=this;
  381. return smalltalk.withContext(function($ctx1) {
  382. _st(_st(self)._interpreter())._interpret_(_st(_st(_st(self)._buildAST())._nodes())._first());
  383. return self}, function($ctx1) {$ctx1.fill(self,"initializeInterpreter",{},smalltalk.ASTDebugger)})},
  384. args: [],
  385. source: "initializeInterpreter\x0a\x09self interpreter interpret: self buildAST nodes first",
  386. messageSends: ["interpret:", "first", "nodes", "buildAST", "interpreter"],
  387. referencedClasses: []
  388. }),
  389. smalltalk.ASTDebugger);
  390. smalltalk.addMethod(
  391. smalltalk.method({
  392. selector: "initializeWithContext:",
  393. category: 'initialization',
  394. fn: function (aMethodContext){
  395. var self=this;
  396. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  397. return smalltalk.withContext(function($ctx1) {
  398. _st(self)._context_(_st($AIContext())._fromMethodContext_(aMethodContext));
  399. _st(self)._initializeInterpreter();
  400. return self}, function($ctx1) {$ctx1.fill(self,"initializeWithContext:",{aMethodContext:aMethodContext},smalltalk.ASTDebugger)})},
  401. args: ["aMethodContext"],
  402. source: "initializeWithContext: aMethodContext\x0a\x09\x22TODO: do we need to handle block contexts?\x22\x0a\x09\x0a\x09self context: (AIContext fromMethodContext: aMethodContext).\x0a\x09self initializeInterpreter",
  403. messageSends: ["context:", "fromMethodContext:", "initializeInterpreter"],
  404. referencedClasses: ["AIContext"]
  405. }),
  406. smalltalk.ASTDebugger);
  407. smalltalk.addMethod(
  408. smalltalk.method({
  409. selector: "interpreter",
  410. category: 'accessing',
  411. fn: function (){
  412. var self=this;
  413. return smalltalk.withContext(function($ctx1) {
  414. var $2,$1;
  415. $2=self["@interpreter"];
  416. if(($receiver = $2) == nil || $receiver == undefined){
  417. self["@interpreter"]=_st(_st(self)._defaultInterpreterClass())._new();
  418. $1=self["@interpreter"];
  419. } else {
  420. $1=$2;
  421. };
  422. return $1;
  423. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.ASTDebugger)})},
  424. args: [],
  425. source: "interpreter\x0a\x09^ interpreter ifNil: [ interpreter := self defaultInterpreterClass new ]",
  426. messageSends: ["ifNil:", "new", "defaultInterpreterClass"],
  427. referencedClasses: []
  428. }),
  429. smalltalk.ASTDebugger);
  430. smalltalk.addMethod(
  431. smalltalk.method({
  432. selector: "interpreter:",
  433. category: 'accessing',
  434. fn: function (anInterpreter){
  435. var self=this;
  436. return smalltalk.withContext(function($ctx1) {
  437. self["@interpreter"]=anInterpreter;
  438. return self}, function($ctx1) {$ctx1.fill(self,"interpreter:",{anInterpreter:anInterpreter},smalltalk.ASTDebugger)})},
  439. args: ["anInterpreter"],
  440. source: "interpreter: anInterpreter\x0a\x09interpreter := anInterpreter",
  441. messageSends: [],
  442. referencedClasses: []
  443. }),
  444. smalltalk.ASTDebugger);
  445. smalltalk.addMethod(
  446. smalltalk.method({
  447. selector: "method",
  448. category: 'accessing',
  449. fn: function (){
  450. var self=this;
  451. return smalltalk.withContext(function($ctx1) {
  452. var $1;
  453. $1=_st(_st(self)._context())._method();
  454. return $1;
  455. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.ASTDebugger)})},
  456. args: [],
  457. source: "method\x0a\x09^ self context method",
  458. messageSends: ["method", "context"],
  459. referencedClasses: []
  460. }),
  461. smalltalk.ASTDebugger);
  462. smalltalk.addMethod(
  463. smalltalk.method({
  464. selector: "proceed",
  465. category: 'stepping',
  466. fn: function (){
  467. var self=this;
  468. return smalltalk.withContext(function($ctx1) {
  469. _st(self)._shouldBeImplemented();
  470. return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.ASTDebugger)})},
  471. args: [],
  472. source: "proceed\x0a\x09self shouldBeImplemented",
  473. messageSends: ["shouldBeImplemented"],
  474. referencedClasses: []
  475. }),
  476. smalltalk.ASTDebugger);
  477. smalltalk.addMethod(
  478. smalltalk.method({
  479. selector: "restart",
  480. category: 'stepping',
  481. fn: function (){
  482. var self=this;
  483. return smalltalk.withContext(function($ctx1) {
  484. _st(self)._shouldBeImplemented();
  485. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.ASTDebugger)})},
  486. args: [],
  487. source: "restart\x0a\x09self shouldBeImplemented",
  488. messageSends: ["shouldBeImplemented"],
  489. referencedClasses: []
  490. }),
  491. smalltalk.ASTDebugger);
  492. smalltalk.addMethod(
  493. smalltalk.method({
  494. selector: "resume",
  495. category: 'stepping',
  496. fn: function (){
  497. var self=this;
  498. return smalltalk.withContext(function($ctx1) {
  499. _st(self)._shouldBeImplemented();
  500. return self}, function($ctx1) {$ctx1.fill(self,"resume",{},smalltalk.ASTDebugger)})},
  501. args: [],
  502. source: "resume\x0a\x09self shouldBeImplemented",
  503. messageSends: ["shouldBeImplemented"],
  504. referencedClasses: []
  505. }),
  506. smalltalk.ASTDebugger);
  507. smalltalk.addMethod(
  508. smalltalk.method({
  509. selector: "step",
  510. category: 'stepping',
  511. fn: function (){
  512. var self=this;
  513. return smalltalk.withContext(function($ctx1) {
  514. _st((function(){
  515. return smalltalk.withContext(function($ctx2) {
  516. return _st(_st(_st(_st(_st(self)._interpreter())._nextNode())._notNil())._and_((function(){
  517. return smalltalk.withContext(function($ctx3) {
  518. return _st(_st(_st(self)._interpreter())._nextNode())._stopOnStepping();
  519. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})))._or_((function(){
  520. return smalltalk.withContext(function($ctx3) {
  521. return _st(_st(_st(self)._interpreter())._atEnd())._not();
  522. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  523. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  524. return smalltalk.withContext(function($ctx2) {
  525. _st(_st(self)._interpreter())._step();
  526. return _st(self)._step();
  527. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  528. return self}, function($ctx1) {$ctx1.fill(self,"step",{},smalltalk.ASTDebugger)})},
  529. args: [],
  530. source: "step\x0a\x09\x22The ASTSteppingInterpreter stops at each node interpretation.\x0a\x09One step will interpret nodes until:\x0a\x09- we get at the end\x0a\x09- the next node is a stepping node (send, assignment, etc.)\x22\x0a\x09\x0a\x09[ (self interpreter nextNode notNil and: [ self interpreter nextNode stopOnStepping ])\x0a\x09\x09or: [ self interpreter atEnd not ] ]\x0a\x09\x09\x09whileFalse: [\x0a\x09\x09\x09\x09self interpreter step.\x0a\x09\x09\x09\x09self step ]",
  531. messageSends: ["whileFalse:", "step", "interpreter", "or:", "not", "atEnd", "and:", "stopOnStepping", "nextNode", "notNil"],
  532. referencedClasses: []
  533. }),
  534. smalltalk.ASTDebugger);
  535. smalltalk.addMethod(
  536. smalltalk.method({
  537. selector: "stepInto",
  538. category: 'stepping',
  539. fn: function (){
  540. var self=this;
  541. return smalltalk.withContext(function($ctx1) {
  542. _st(self)._shouldBeImplemented();
  543. return self}, function($ctx1) {$ctx1.fill(self,"stepInto",{},smalltalk.ASTDebugger)})},
  544. args: [],
  545. source: "stepInto\x0a\x09self shouldBeImplemented",
  546. messageSends: ["shouldBeImplemented"],
  547. referencedClasses: []
  548. }),
  549. smalltalk.ASTDebugger);
  550. smalltalk.addMethod(
  551. smalltalk.method({
  552. selector: "stepOver",
  553. category: 'stepping',
  554. fn: function (){
  555. var self=this;
  556. return smalltalk.withContext(function($ctx1) {
  557. _st(self)._step();
  558. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.ASTDebugger)})},
  559. args: [],
  560. source: "stepOver\x0a\x09self step",
  561. messageSends: ["step"],
  562. referencedClasses: []
  563. }),
  564. smalltalk.ASTDebugger);
  565. smalltalk.addMethod(
  566. smalltalk.method({
  567. selector: "context:",
  568. category: 'instance creation',
  569. fn: function (aMethodContext){
  570. var self=this;
  571. return smalltalk.withContext(function($ctx1) {
  572. var $2,$3,$1;
  573. $2=_st(self)._new();
  574. _st($2)._initializeWithContext_(aMethodContext);
  575. $3=_st($2)._yourself();
  576. $1=$3;
  577. return $1;
  578. }, function($ctx1) {$ctx1.fill(self,"context:",{aMethodContext:aMethodContext},smalltalk.ASTDebugger.klass)})},
  579. args: ["aMethodContext"],
  580. source: "context: aMethodContext\x0a\x09^ self new\x0a\x09\x09initializeWithContext: aMethodContext;\x0a\x09\x09yourself",
  581. messageSends: ["initializeWithContext:", "new", "yourself"],
  582. referencedClasses: []
  583. }),
  584. smalltalk.ASTDebugger.klass);
  585. smalltalk.addClass('ASTInterpreter', smalltalk.Object, ['currentNode', 'context', 'shouldReturn', 'result'], 'Compiler-Interpreter');
  586. smalltalk.ASTInterpreter.comment="I am like a `NodeVisitor`, interpreting nodes one after each other.\x0aI am built using Continuation Passing Style for stepping purposes.\x0a\x0a## Usage example:\x0a\x0a\x09| ast interpreter |\x0a\x09ast := Smalltalk current parse: 'foo 1+2+4'.\x0a\x09(SemanticAnalyzer on: Object) visit: ast.\x0a\x0a\x09ASTInterpreter new\x0a\x09\x09interpret: ast nodes first;\x0a\x09\x09result \x22Answers 7\x22"
  587. smalltalk.addMethod(
  588. smalltalk.method({
  589. selector: "assign:to:",
  590. category: 'private',
  591. fn: function (aNode,anObject){
  592. var self=this;
  593. return smalltalk.withContext(function($ctx1) {
  594. var $2,$1;
  595. $2=_st(_st(aNode)._binding())._isInstanceVar();
  596. if(smalltalk.assert($2)){
  597. $1=_st(_st(_st(self)._context())._receiver())._instVarAt_put_(_st(aNode)._value(),anObject);
  598. } else {
  599. $1=_st(_st(self)._context())._localAt_put_(_st(aNode)._value(),anObject);
  600. };
  601. return $1;
  602. }, function($ctx1) {$ctx1.fill(self,"assign:to:",{aNode:aNode,anObject:anObject},smalltalk.ASTInterpreter)})},
  603. args: ["aNode", "anObject"],
  604. source: "assign: aNode to: anObject\x0a\x09^ aNode binding isInstanceVar\x0a\x09\x09ifTrue: [ self context receiver instVarAt: aNode value put: anObject ]\x0a\x09\x09ifFalse: [ self context localAt: aNode value put: anObject ]",
  605. messageSends: ["ifTrue:ifFalse:", "instVarAt:put:", "value", "receiver", "context", "localAt:put:", "isInstanceVar", "binding"],
  606. referencedClasses: []
  607. }),
  608. smalltalk.ASTInterpreter);
  609. smalltalk.addMethod(
  610. smalltalk.method({
  611. selector: "context",
  612. category: 'accessing',
  613. fn: function (){
  614. var self=this;
  615. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  616. return smalltalk.withContext(function($ctx1) {
  617. var $2,$1;
  618. $2=self["@context"];
  619. if(($receiver = $2) == nil || $receiver == undefined){
  620. self["@context"]=_st($AIContext())._new();
  621. $1=self["@context"];
  622. } else {
  623. $1=$2;
  624. };
  625. return $1;
  626. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTInterpreter)})},
  627. args: [],
  628. source: "context\x0a\x09^ context ifNil: [ context := AIContext new ]",
  629. messageSends: ["ifNil:", "new"],
  630. referencedClasses: ["AIContext"]
  631. }),
  632. smalltalk.ASTInterpreter);
  633. smalltalk.addMethod(
  634. smalltalk.method({
  635. selector: "context:",
  636. category: 'accessing',
  637. fn: function (anAIContext){
  638. var self=this;
  639. return smalltalk.withContext(function($ctx1) {
  640. self["@context"]=anAIContext;
  641. return self}, function($ctx1) {$ctx1.fill(self,"context:",{anAIContext:anAIContext},smalltalk.ASTInterpreter)})},
  642. args: ["anAIContext"],
  643. source: "context: anAIContext\x0a\x09context := anAIContext",
  644. messageSends: [],
  645. referencedClasses: []
  646. }),
  647. smalltalk.ASTInterpreter);
  648. smalltalk.addMethod(
  649. smalltalk.method({
  650. selector: "continue:value:",
  651. category: 'private',
  652. fn: function (aBlock,anObject){
  653. var self=this;
  654. return smalltalk.withContext(function($ctx1) {
  655. self["@result"]=anObject;
  656. _st(aBlock)._value_(anObject);
  657. return self}, function($ctx1) {$ctx1.fill(self,"continue:value:",{aBlock:aBlock,anObject:anObject},smalltalk.ASTInterpreter)})},
  658. args: ["aBlock", "anObject"],
  659. source: "continue: aBlock value: anObject\x0a\x09result := anObject.\x0a\x09aBlock value: anObject",
  660. messageSends: ["value:"],
  661. referencedClasses: []
  662. }),
  663. smalltalk.ASTInterpreter);
  664. smalltalk.addMethod(
  665. smalltalk.method({
  666. selector: "currentNode",
  667. category: 'accessing',
  668. fn: function (){
  669. var self=this;
  670. return smalltalk.withContext(function($ctx1) {
  671. var $1;
  672. $1=self["@currentNode"];
  673. return $1;
  674. }, function($ctx1) {$ctx1.fill(self,"currentNode",{},smalltalk.ASTInterpreter)})},
  675. args: [],
  676. source: "currentNode\x0a\x09^ currentNode",
  677. messageSends: [],
  678. referencedClasses: []
  679. }),
  680. smalltalk.ASTInterpreter);
  681. smalltalk.addMethod(
  682. smalltalk.method({
  683. selector: "eval:",
  684. category: 'private',
  685. fn: function (aString){
  686. var self=this;
  687. var source,function_;
  688. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  689. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  690. return smalltalk.withContext(function($ctx1) {
  691. var $1,$2,$3;
  692. source=_st($String())._streamContents_((function(str){
  693. return smalltalk.withContext(function($ctx2) {
  694. _st(str)._nextPutAll_("(function(");
  695. _st(_st(_st(_st(self)._context())._locals())._keys())._do_separatedBy_((function(each){
  696. return smalltalk.withContext(function($ctx3) {
  697. return _st(str)._nextPutAll_(each);
  698. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  699. return smalltalk.withContext(function($ctx3) {
  700. return _st(str)._nextPutAll_(",");
  701. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  702. $1=str;
  703. _st($1)._nextPutAll_("){ return (function() {");
  704. _st($1)._nextPutAll_(aString);
  705. $2=_st($1)._nextPutAll_("})() })");
  706. return $2;
  707. }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1)})}));
  708. function_=_st(_st($Compiler())._new())._eval_(source);
  709. $3=_st(function_)._valueWithPossibleArguments_(_st(_st(_st(self)._context())._locals())._values());
  710. return $3;
  711. }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString,source:source,function_:function_},smalltalk.ASTInterpreter)})},
  712. args: ["aString"],
  713. source: "eval: aString\x0a\x09\x22Evaluate aString as JS source inside an JS function.\x0a\x09aString is not sandboxed.\x22\x0a\x09\x0a\x09| source function |\x0a\x09\x0a\x09source := String streamContents: [ :str |\x0a\x09\x09str nextPutAll: '(function('.\x0a\x09\x09self context locals keys\x0a\x09\x09\x09do: [ :each | str nextPutAll: each ]\x0a\x09\x09\x09separatedBy: [ str nextPutAll: ',' ].\x0a\x09\x09str\x0a\x09\x09\x09nextPutAll: '){ return (function() {';\x0a\x09\x09\x09nextPutAll: aString;\x0a\x09\x09\x09nextPutAll: '})() })' ].\x0a\x09\x09\x09\x0a\x09function := Compiler new eval: source.\x0a\x09\x0a\x09^ function valueWithPossibleArguments: self context locals values",
  714. messageSends: ["streamContents:", "nextPutAll:", "do:separatedBy:", "keys", "locals", "context", "eval:", "new", "valueWithPossibleArguments:", "values"],
  715. referencedClasses: ["String", "Compiler"]
  716. }),
  717. smalltalk.ASTInterpreter);
  718. smalltalk.addMethod(
  719. smalltalk.method({
  720. selector: "initialize",
  721. category: 'initialization',
  722. fn: function (){
  723. var self=this;
  724. return smalltalk.withContext(function($ctx1) {
  725. smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  726. self["@shouldReturn"]=false;
  727. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ASTInterpreter)})},
  728. args: [],
  729. source: "initialize\x0a\x09super initialize.\x0a\x09shouldReturn := false",
  730. messageSends: ["initialize"],
  731. referencedClasses: []
  732. }),
  733. smalltalk.ASTInterpreter);
  734. smalltalk.addMethod(
  735. smalltalk.method({
  736. selector: "interpret:",
  737. category: 'interpreting',
  738. fn: function (aNode){
  739. var self=this;
  740. return smalltalk.withContext(function($ctx1) {
  741. self["@shouldReturn"]=false;
  742. _st(self)._interpret_continue_(aNode,(function(value){
  743. return smalltalk.withContext(function($ctx2) {
  744. self["@result"]=value;
  745. return self["@result"];
  746. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  747. return self}, function($ctx1) {$ctx1.fill(self,"interpret:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  748. args: ["aNode"],
  749. source: "interpret: aNode\x0a\x09shouldReturn := false.\x0a\x09self interpret: aNode continue: [ :value |\x0a\x09\x09result := value ]",
  750. messageSends: ["interpret:continue:"],
  751. referencedClasses: []
  752. }),
  753. smalltalk.ASTInterpreter);
  754. smalltalk.addMethod(
  755. smalltalk.method({
  756. selector: "interpret:continue:",
  757. category: 'interpreting',
  758. fn: function (aNode,aBlock){
  759. var self=this;
  760. return smalltalk.withContext(function($ctx1) {
  761. var $1,$2,$3;
  762. $1=self["@shouldReturn"];
  763. if(smalltalk.assert($1)){
  764. $2=self;
  765. return $2;
  766. };
  767. $3=_st(aNode)._isNode();
  768. if(smalltalk.assert($3)){
  769. self["@currentNode"]=aNode;
  770. self["@currentNode"];
  771. _st(self)._interpretNode_continue_(aNode,(function(value){
  772. return smalltalk.withContext(function($ctx2) {
  773. return _st(self)._continue_value_(aBlock,value);
  774. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  775. } else {
  776. _st(self)._continue_value_(aBlock,aNode);
  777. };
  778. return self}, function($ctx1) {$ctx1.fill(self,"interpret:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  779. args: ["aNode", "aBlock"],
  780. source: "interpret: aNode continue: aBlock\x0a\x09shouldReturn ifTrue: [ ^ self ].\x0a\x0a\x09aNode isNode\x0a\x09\x09ifTrue: [\x0a\x09\x09\x09currentNode := aNode.\x0a\x09\x09\x09self interpretNode: aNode continue: [ :value |\x0a\x09\x09\x09\x09self continue: aBlock value: value ] ]\x0a\x09\x09ifFalse: [ self continue: aBlock value: aNode ]",
  781. messageSends: ["ifTrue:", "ifTrue:ifFalse:", "interpretNode:continue:", "continue:value:", "isNode"],
  782. referencedClasses: []
  783. }),
  784. smalltalk.ASTInterpreter);
  785. smalltalk.addMethod(
  786. smalltalk.method({
  787. selector: "interpretAll:continue:",
  788. category: 'private',
  789. fn: function (aCollection,aBlock){
  790. var self=this;
  791. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  792. return smalltalk.withContext(function($ctx1) {
  793. _st(self)._interpretAll_continue_result_(aCollection,aBlock,_st($OrderedCollection())._new());
  794. return self}, function($ctx1) {$ctx1.fill(self,"interpretAll:continue:",{aCollection:aCollection,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  795. args: ["aCollection", "aBlock"],
  796. source: "interpretAll: aCollection continue: aBlock\x0a\x09self\x0a\x09\x09interpretAll: aCollection\x0a\x09\x09continue: aBlock\x0a\x09\x09result: OrderedCollection new",
  797. messageSends: ["interpretAll:continue:result:", "new"],
  798. referencedClasses: ["OrderedCollection"]
  799. }),
  800. smalltalk.ASTInterpreter);
  801. smalltalk.addMethod(
  802. smalltalk.method({
  803. selector: "interpretAll:continue:result:",
  804. category: 'private',
  805. fn: function (nodes,aBlock,aCollection){
  806. var self=this;
  807. return smalltalk.withContext(function($ctx1) {
  808. var $1;
  809. $1=_st(nodes)._isEmpty();
  810. if(smalltalk.assert($1)){
  811. _st(self)._continue_value_(aBlock,aCollection);
  812. } else {
  813. _st(self)._interpret_continue_(_st(nodes)._first(),(function(value){
  814. return smalltalk.withContext(function($ctx2) {
  815. return _st(self)._interpretAll_continue_result_(_st(nodes)._allButFirst(),aBlock,_st(aCollection).__comma([value]));
  816. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  817. };
  818. return self}, function($ctx1) {$ctx1.fill(self,"interpretAll:continue:result:",{nodes:nodes,aBlock:aBlock,aCollection:aCollection},smalltalk.ASTInterpreter)})},
  819. args: ["nodes", "aBlock", "aCollection"],
  820. source: "interpretAll: nodes continue: aBlock result: aCollection\x0a\x09nodes isEmpty\x0a\x09\x09ifTrue: [ self continue: aBlock value: aCollection ]\x0a\x09\x09ifFalse: [\x0a\x09\x09\x09self interpret: nodes first continue: [:value |\x0a\x09\x09\x09\x09self\x0a\x09\x09\x09\x09\x09interpretAll: nodes allButFirst\x0a\x09\x09\x09\x09\x09continue: aBlock\x0a\x09\x09\x09\x09\x09result: aCollection, { value } ] ]",
  821. messageSends: ["ifTrue:ifFalse:", "continue:value:", "interpret:continue:", "first", "interpretAll:continue:result:", "allButFirst", ",", "isEmpty"],
  822. referencedClasses: []
  823. }),
  824. smalltalk.ASTInterpreter);
  825. smalltalk.addMethod(
  826. smalltalk.method({
  827. selector: "interpretAssignmentNode:continue:",
  828. category: 'interpreting',
  829. fn: function (aNode,aBlock){
  830. var self=this;
  831. return smalltalk.withContext(function($ctx1) {
  832. _st(self)._interpret_continue_(_st(aNode)._right(),(function(value){
  833. return smalltalk.withContext(function($ctx2) {
  834. return _st(self)._continue_value_(aBlock,_st(self)._assign_to_(_st(aNode)._left(),value));
  835. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  836. return self}, function($ctx1) {$ctx1.fill(self,"interpretAssignmentNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  837. args: ["aNode", "aBlock"],
  838. source: "interpretAssignmentNode: aNode continue: aBlock\x0a\x09self interpret: aNode right continue: [ :value |\x0a\x09\x09self\x0a\x09\x09\x09continue: aBlock\x0a\x09\x09\x09value: (self assign: aNode left to: value) ]",
  839. messageSends: ["interpret:continue:", "right", "continue:value:", "assign:to:", "left"],
  840. referencedClasses: []
  841. }),
  842. smalltalk.ASTInterpreter);
  843. smalltalk.addMethod(
  844. smalltalk.method({
  845. selector: "interpretBlockNode:continue:",
  846. category: 'interpreting',
  847. fn: function (aNode,aBlock){
  848. var self=this;
  849. return smalltalk.withContext(function($ctx1) {
  850. var $1,$2;
  851. _st(self)._continue_value_(aBlock,(function(){
  852. return smalltalk.withContext(function($ctx2) {
  853. return _st(self)._withBlockContext_((function(){
  854. return smalltalk.withContext(function($ctx3) {
  855. $1=self;
  856. _st($1)._interpret_(_st(_st(aNode)._nodes())._first());
  857. $2=_st($1)._result();
  858. return $2;
  859. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  860. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  861. return self}, function($ctx1) {$ctx1.fill(self,"interpretBlockNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  862. args: ["aNode", "aBlock"],
  863. source: "interpretBlockNode: aNode continue: aBlock\x0a\x09self\x0a\x09\x09continue: aBlock\x0a\x09\x09value: [ \x0a\x09\x09\x09self withBlockContext: [ \x0a\x09\x09\x09\x09self interpret: aNode nodes first; result ] ]",
  864. messageSends: ["continue:value:", "withBlockContext:", "interpret:", "first", "nodes", "result"],
  865. referencedClasses: []
  866. }),
  867. smalltalk.ASTInterpreter);
  868. smalltalk.addMethod(
  869. smalltalk.method({
  870. selector: "interpretBlockSequenceNode:continue:",
  871. category: 'interpreting',
  872. fn: function (aNode,aBlock){
  873. var self=this;
  874. return smalltalk.withContext(function($ctx1) {
  875. _st(self)._interpretSequenceNode_continue_(aNode,aBlock);
  876. return self}, function($ctx1) {$ctx1.fill(self,"interpretBlockSequenceNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  877. args: ["aNode", "aBlock"],
  878. source: "interpretBlockSequenceNode: aNode continue: aBlock\x0a\x09self interpretSequenceNode: aNode continue: aBlock",
  879. messageSends: ["interpretSequenceNode:continue:"],
  880. referencedClasses: []
  881. }),
  882. smalltalk.ASTInterpreter);
  883. smalltalk.addMethod(
  884. smalltalk.method({
  885. selector: "interpretCascadeNode:continue:",
  886. category: 'interpreting',
  887. fn: function (aNode,aBlock){
  888. var self=this;
  889. return smalltalk.withContext(function($ctx1) {
  890. _st(self)._interpret_continue_(_st(aNode)._receiver(),(function(receiver){
  891. return smalltalk.withContext(function($ctx2) {
  892. _st(_st(aNode)._nodes())._do_((function(each){
  893. return smalltalk.withContext(function($ctx3) {
  894. return _st(each)._receiver_(receiver);
  895. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  896. return _st(self)._interpretAll_continue_(_st(_st(aNode)._nodes())._allButLast(),(function(){
  897. return smalltalk.withContext(function($ctx3) {
  898. return _st(self)._interpret_continue_(_st(_st(aNode)._nodes())._last(),(function(val){
  899. return smalltalk.withContext(function($ctx4) {
  900. return _st(self)._continue_value_(aBlock,val);
  901. }, function($ctx4) {$ctx4.fillBlock({val:val},$ctx1)})}));
  902. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  903. }, function($ctx2) {$ctx2.fillBlock({receiver:receiver},$ctx1)})}));
  904. return self}, function($ctx1) {$ctx1.fill(self,"interpretCascadeNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  905. args: ["aNode", "aBlock"],
  906. source: "interpretCascadeNode: aNode continue: aBlock\x0a\x09\x22TODO: Handle super sends\x22\x0a\x09\x0a\x09self interpret: aNode receiver continue: [ :receiver |\x0a\x09\x09\x22Only interpret the receiver once\x22\x0a\x09\x09aNode nodes do: [ :each | each receiver: receiver ].\x0a\x0a\x09\x09self\x0a\x09\x09\x09interpretAll: aNode nodes allButLast\x0a\x09\x09\x09continue: [\x0a\x09\x09\x09\x09self\x0a\x09\x09\x09\x09\x09interpret: aNode nodes last\x0a\x09\x09\x09\x09\x09continue: [ :val | self continue: aBlock value: val ] ] ]",
  907. messageSends: ["interpret:continue:", "receiver", "do:", "receiver:", "nodes", "interpretAll:continue:", "allButLast", "last", "continue:value:"],
  908. referencedClasses: []
  909. }),
  910. smalltalk.ASTInterpreter);
  911. smalltalk.addMethod(
  912. smalltalk.method({
  913. selector: "interpretClassReferenceNode:continue:",
  914. category: 'interpreting',
  915. fn: function (aNode,aBlock){
  916. var self=this;
  917. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  918. return smalltalk.withContext(function($ctx1) {
  919. _st(self)._continue_value_(aBlock,_st(_st($Smalltalk())._current())._at_(_st(aNode)._value()));
  920. return self}, function($ctx1) {$ctx1.fill(self,"interpretClassReferenceNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  921. args: ["aNode", "aBlock"],
  922. source: "interpretClassReferenceNode: aNode continue: aBlock\x0a\x09self continue: aBlock value: (Smalltalk current at: aNode value)",
  923. messageSends: ["continue:value:", "at:", "value", "current"],
  924. referencedClasses: ["Smalltalk"]
  925. }),
  926. smalltalk.ASTInterpreter);
  927. smalltalk.addMethod(
  928. smalltalk.method({
  929. selector: "interpretDynamicArrayNode:continue:",
  930. category: 'interpreting',
  931. fn: function (aNode,aBlock){
  932. var self=this;
  933. return smalltalk.withContext(function($ctx1) {
  934. _st(self)._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  935. return smalltalk.withContext(function($ctx2) {
  936. return _st(self)._continue_value_(aBlock,array);
  937. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  938. return self}, function($ctx1) {$ctx1.fill(self,"interpretDynamicArrayNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  939. args: ["aNode", "aBlock"],
  940. source: "interpretDynamicArrayNode: aNode continue: aBlock\x0a\x09self interpretAll: aNode nodes continue: [ :array |\x0a\x09\x09self\x0a\x09\x09\x09continue: aBlock\x0a\x09\x09\x09value: array ]",
  941. messageSends: ["interpretAll:continue:", "nodes", "continue:value:"],
  942. referencedClasses: []
  943. }),
  944. smalltalk.ASTInterpreter);
  945. smalltalk.addMethod(
  946. smalltalk.method({
  947. selector: "interpretDynamicDictionaryNode:continue:",
  948. category: 'interpreting',
  949. fn: function (aNode,aBlock){
  950. var self=this;
  951. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  952. return smalltalk.withContext(function($ctx1) {
  953. _st(self)._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  954. var hashedCollection;
  955. return smalltalk.withContext(function($ctx2) {
  956. hashedCollection=_st($HashedCollection())._new();
  957. hashedCollection;
  958. _st(array)._do_((function(each){
  959. return smalltalk.withContext(function($ctx3) {
  960. return _st(hashedCollection)._add_(each);
  961. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  962. return _st(self)._continue_value_(aBlock,hashedCollection);
  963. }, function($ctx2) {$ctx2.fillBlock({array:array,hashedCollection:hashedCollection},$ctx1)})}));
  964. return self}, function($ctx1) {$ctx1.fill(self,"interpretDynamicDictionaryNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  965. args: ["aNode", "aBlock"],
  966. source: "interpretDynamicDictionaryNode: aNode continue: aBlock\x0a\x09self interpretAll: aNode nodes continue: [ :array | | hashedCollection |\x0a\x09\x09hashedCollection := HashedCollection new.\x0a\x09\x09array do: [ :each | hashedCollection add: each ].\x0a\x09\x09self\x0a\x09\x09\x09continue: aBlock\x0a\x09\x09\x09value: hashedCollection ]",
  967. messageSends: ["interpretAll:continue:", "nodes", "new", "do:", "add:", "continue:value:"],
  968. referencedClasses: ["HashedCollection"]
  969. }),
  970. smalltalk.ASTInterpreter);
  971. smalltalk.addMethod(
  972. smalltalk.method({
  973. selector: "interpretJSStatementNode:continue:",
  974. category: 'interpreting',
  975. fn: function (aNode,aBlock){
  976. var self=this;
  977. return smalltalk.withContext(function($ctx1) {
  978. self["@shouldReturn"]=true;
  979. _st(self)._continue_value_(aBlock,_st(self)._eval_(_st(aNode)._source()));
  980. return self}, function($ctx1) {$ctx1.fill(self,"interpretJSStatementNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  981. args: ["aNode", "aBlock"],
  982. source: "interpretJSStatementNode: aNode continue: aBlock\x0a\x09shouldReturn := true.\x0a\x09self continue: aBlock value: (self eval: aNode source)",
  983. messageSends: ["continue:value:", "eval:", "source"],
  984. referencedClasses: []
  985. }),
  986. smalltalk.ASTInterpreter);
  987. smalltalk.addMethod(
  988. smalltalk.method({
  989. selector: "interpretMethodNode:continue:",
  990. category: 'interpreting',
  991. fn: function (aNode,aBlock){
  992. var self=this;
  993. return smalltalk.withContext(function($ctx1) {
  994. _st(self)._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  995. return smalltalk.withContext(function($ctx2) {
  996. return _st(self)._continue_value_(aBlock,_st(array)._first());
  997. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  998. return self}, function($ctx1) {$ctx1.fill(self,"interpretMethodNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  999. args: ["aNode", "aBlock"],
  1000. source: "interpretMethodNode: aNode continue: aBlock\x0a\x09self interpretAll: aNode nodes continue: [ :array |\x0a\x09\x09self continue: aBlock value: array first ]",
  1001. messageSends: ["interpretAll:continue:", "nodes", "continue:value:", "first"],
  1002. referencedClasses: []
  1003. }),
  1004. smalltalk.ASTInterpreter);
  1005. smalltalk.addMethod(
  1006. smalltalk.method({
  1007. selector: "interpretNode:continue:",
  1008. category: 'interpreting',
  1009. fn: function (aNode,aBlock){
  1010. var self=this;
  1011. return smalltalk.withContext(function($ctx1) {
  1012. _st(aNode)._interpreter_continue_(self,aBlock);
  1013. return self}, function($ctx1) {$ctx1.fill(self,"interpretNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1014. args: ["aNode", "aBlock"],
  1015. source: "interpretNode: aNode continue: aBlock\x0a\x09aNode interpreter: self continue: aBlock",
  1016. messageSends: ["interpreter:continue:"],
  1017. referencedClasses: []
  1018. }),
  1019. smalltalk.ASTInterpreter);
  1020. smalltalk.addMethod(
  1021. smalltalk.method({
  1022. selector: "interpretReturnNode:continue:",
  1023. category: 'interpreting',
  1024. fn: function (aNode,aBlock){
  1025. var self=this;
  1026. return smalltalk.withContext(function($ctx1) {
  1027. _st(self)._interpret_continue_(_st(_st(aNode)._nodes())._first(),(function(value){
  1028. return smalltalk.withContext(function($ctx2) {
  1029. self["@shouldReturn"]=true;
  1030. self["@shouldReturn"];
  1031. return _st(self)._continue_value_(aBlock,value);
  1032. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  1033. return self}, function($ctx1) {$ctx1.fill(self,"interpretReturnNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1034. args: ["aNode", "aBlock"],
  1035. source: "interpretReturnNode: aNode continue: aBlock\x0a\x09self interpret: aNode nodes first continue: [ :value |\x0a\x09\x09shouldReturn := true.\x0a\x09\x09self continue: aBlock value: value ]",
  1036. messageSends: ["interpret:continue:", "first", "nodes", "continue:value:"],
  1037. referencedClasses: []
  1038. }),
  1039. smalltalk.ASTInterpreter);
  1040. smalltalk.addMethod(
  1041. smalltalk.method({
  1042. selector: "interpretSendNode:continue:",
  1043. category: 'interpreting',
  1044. fn: function (aNode,aBlock){
  1045. var self=this;
  1046. return smalltalk.withContext(function($ctx1) {
  1047. _st(self)._interpret_continue_(_st(aNode)._receiver(),(function(receiver){
  1048. return smalltalk.withContext(function($ctx2) {
  1049. return _st(self)._interpretAll_continue_(_st(aNode)._arguments(),(function(args){
  1050. return smalltalk.withContext(function($ctx3) {
  1051. return _st(self)._messageFromSendNode_arguments_do_(aNode,args,(function(message){
  1052. return smalltalk.withContext(function($ctx4) {
  1053. _st(_st(self)._context())._pc_(_st(_st(_st(self)._context())._pc()).__plus((1)));
  1054. return _st(self)._continue_value_(aBlock,_st(self)._sendMessage_to_superSend_(message,receiver,_st(aNode)._superSend()));
  1055. }, function($ctx4) {$ctx4.fillBlock({message:message},$ctx1)})}));
  1056. }, function($ctx3) {$ctx3.fillBlock({args:args},$ctx1)})}));
  1057. }, function($ctx2) {$ctx2.fillBlock({receiver:receiver},$ctx1)})}));
  1058. return self}, function($ctx1) {$ctx1.fill(self,"interpretSendNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1059. args: ["aNode", "aBlock"],
  1060. source: "interpretSendNode: aNode continue: aBlock\x0a\x09self interpret: aNode receiver continue: [ :receiver |\x0a\x09\x09self interpretAll: aNode arguments continue: [ :args |\x0a\x09\x09\x09self\x0a\x09\x09\x09\x09messageFromSendNode: aNode\x0a\x09\x09\x09\x09arguments: args\x0a\x09\x09\x09\x09do: [ :message |\x0a\x09\x09\x09\x09\x09self context pc: self context pc + 1.\x0a\x09\x09\x09\x09\x09self\x0a\x09\x09\x09\x09\x09\x09continue: aBlock\x0a\x09\x09\x09\x09\x09\x09value: (self sendMessage: message to: receiver superSend: aNode superSend) ] ] ]",
  1061. messageSends: ["interpret:continue:", "receiver", "interpretAll:continue:", "arguments", "messageFromSendNode:arguments:do:", "pc:", "+", "pc", "context", "continue:value:", "sendMessage:to:superSend:", "superSend"],
  1062. referencedClasses: []
  1063. }),
  1064. smalltalk.ASTInterpreter);
  1065. smalltalk.addMethod(
  1066. smalltalk.method({
  1067. selector: "interpretSequenceNode:continue:",
  1068. category: 'interpreting',
  1069. fn: function (aNode,aBlock){
  1070. var self=this;
  1071. return smalltalk.withContext(function($ctx1) {
  1072. _st(self)._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  1073. return smalltalk.withContext(function($ctx2) {
  1074. return _st(self)._continue_value_(aBlock,_st(array)._last());
  1075. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  1076. return self}, function($ctx1) {$ctx1.fill(self,"interpretSequenceNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1077. args: ["aNode", "aBlock"],
  1078. source: "interpretSequenceNode: aNode continue: aBlock\x0a\x09self interpretAll: aNode nodes continue: [ :array |\x0a\x09\x09self continue: aBlock value: array last ]",
  1079. messageSends: ["interpretAll:continue:", "nodes", "continue:value:", "last"],
  1080. referencedClasses: []
  1081. }),
  1082. smalltalk.ASTInterpreter);
  1083. smalltalk.addMethod(
  1084. smalltalk.method({
  1085. selector: "interpretValueNode:continue:",
  1086. category: 'interpreting',
  1087. fn: function (aNode,aBlock){
  1088. var self=this;
  1089. return smalltalk.withContext(function($ctx1) {
  1090. _st(self)._continue_value_(aBlock,_st(aNode)._value());
  1091. return self}, function($ctx1) {$ctx1.fill(self,"interpretValueNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1092. args: ["aNode", "aBlock"],
  1093. source: "interpretValueNode: aNode continue: aBlock\x0a\x09self continue: aBlock value: aNode value",
  1094. messageSends: ["continue:value:", "value"],
  1095. referencedClasses: []
  1096. }),
  1097. smalltalk.ASTInterpreter);
  1098. smalltalk.addMethod(
  1099. smalltalk.method({
  1100. selector: "interpretVariableNode:continue:",
  1101. category: 'interpreting',
  1102. fn: function (aNode,aBlock){
  1103. var self=this;
  1104. return smalltalk.withContext(function($ctx1) {
  1105. var $1,$2,$4,$3;
  1106. $1=self;
  1107. $2=aBlock;
  1108. $4=_st(_st(aNode)._binding())._isInstanceVar();
  1109. if(smalltalk.assert($4)){
  1110. $3=_st(_st(_st(self)._context())._receiver())._instVarAt_(_st(aNode)._value());
  1111. } else {
  1112. $3=_st(_st(self)._context())._localAt_(_st(aNode)._value());
  1113. };
  1114. _st($1)._continue_value_($2,$3);
  1115. return self}, function($ctx1) {$ctx1.fill(self,"interpretVariableNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1116. args: ["aNode", "aBlock"],
  1117. source: "interpretVariableNode: aNode continue: aBlock\x0a\x09self\x0a\x09\x09continue: aBlock\x0a\x09\x09value: (aNode binding isInstanceVar\x0a\x09\x09\x09ifTrue: [ self context receiver instVarAt: aNode value ]\x0a\x09\x09\x09ifFalse: [ self context localAt: aNode value ])",
  1118. messageSends: ["continue:value:", "ifTrue:ifFalse:", "instVarAt:", "value", "receiver", "context", "localAt:", "isInstanceVar", "binding"],
  1119. referencedClasses: []
  1120. }),
  1121. smalltalk.ASTInterpreter);
  1122. smalltalk.addMethod(
  1123. smalltalk.method({
  1124. selector: "messageFromSendNode:arguments:do:",
  1125. category: 'private',
  1126. fn: function (aSendNode,aCollection,aBlock){
  1127. var self=this;
  1128. function $Message(){return smalltalk.Message||(typeof Message=="undefined"?nil:Message)}
  1129. return smalltalk.withContext(function($ctx1) {
  1130. var $1,$2;
  1131. $1=_st($Message())._new();
  1132. _st($1)._selector_(_st(aSendNode)._selector());
  1133. _st($1)._arguments_(aCollection);
  1134. $2=_st($1)._yourself();
  1135. _st(self)._continue_value_(aBlock,$2);
  1136. return self}, function($ctx1) {$ctx1.fill(self,"messageFromSendNode:arguments:do:",{aSendNode:aSendNode,aCollection:aCollection,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1137. args: ["aSendNode", "aCollection", "aBlock"],
  1138. source: "messageFromSendNode: aSendNode arguments: aCollection do: aBlock\x0a\x09self\x0a\x09\x09continue: aBlock\x0a\x09\x09value: (Message new\x0a\x09\x09\x09selector: aSendNode selector;\x0a\x09\x09\x09arguments: aCollection;\x0a\x09\x09\x09yourself)",
  1139. messageSends: ["continue:value:", "selector:", "selector", "new", "arguments:", "yourself"],
  1140. referencedClasses: ["Message"]
  1141. }),
  1142. smalltalk.ASTInterpreter);
  1143. smalltalk.addMethod(
  1144. smalltalk.method({
  1145. selector: "result",
  1146. category: 'accessing',
  1147. fn: function (){
  1148. var self=this;
  1149. return smalltalk.withContext(function($ctx1) {
  1150. var $1;
  1151. $1=self["@result"];
  1152. return $1;
  1153. }, function($ctx1) {$ctx1.fill(self,"result",{},smalltalk.ASTInterpreter)})},
  1154. args: [],
  1155. source: "result\x0a\x09^ result",
  1156. messageSends: [],
  1157. referencedClasses: []
  1158. }),
  1159. smalltalk.ASTInterpreter);
  1160. smalltalk.addMethod(
  1161. smalltalk.method({
  1162. selector: "sendMessage:to:superSend:",
  1163. category: 'private',
  1164. fn: function (aMessage,anObject,aBoolean){
  1165. var self=this;
  1166. var method;
  1167. return smalltalk.withContext(function($ctx1) {
  1168. var $1,$2,$3,$4,$5,$6;
  1169. var $early={};
  1170. try {
  1171. $1=aBoolean;
  1172. if(! smalltalk.assert($1)){
  1173. $2=_st(aMessage)._sendTo_(anObject);
  1174. return $2;
  1175. };
  1176. $3=_st(_st(anObject)._class())._superclass();
  1177. if(($receiver = $3) == nil || $receiver == undefined){
  1178. $4=_st(self)._messageNotUnderstood_receiver_(aMessage,anObject);
  1179. return $4;
  1180. } else {
  1181. $3;
  1182. };
  1183. method=_st(_st(_st(_st(anObject)._class())._superclass())._methodDictionary())._at_ifAbsent_(_st(aMessage)._selector(),(function(){
  1184. return smalltalk.withContext(function($ctx2) {
  1185. $5=_st(self)._messageNotUnderstood_receiver_(aMessage,anObject);
  1186. throw $early=[$5];
  1187. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1188. $6=_st(_st(method)._fn())._applyTo_arguments_(anObject,_st(aMessage)._arguments());
  1189. return $6;
  1190. }
  1191. catch(e) {if(e===$early)return e[0]; throw e}
  1192. }, function($ctx1) {$ctx1.fill(self,"sendMessage:to:superSend:",{aMessage:aMessage,anObject:anObject,aBoolean:aBoolean,method:method},smalltalk.ASTInterpreter)})},
  1193. args: ["aMessage", "anObject", "aBoolean"],
  1194. source: "sendMessage: aMessage to: anObject superSend: aBoolean\x0a\x09| method |\x0a\x09\x0a\x09aBoolean ifFalse: [ ^ aMessage sendTo: anObject ].\x0a\x09anObject class superclass ifNil: [ ^ self messageNotUnderstood: aMessage receiver: anObject ].\x0a\x09\x0a\x09method := anObject class superclass methodDictionary\x0a\x09\x09at: aMessage selector\x0a\x09\x09ifAbsent: [ ^ self messageNotUnderstood: aMessage receiver: anObject ].\x0a\x09\x09\x0a\x09^ method fn applyTo: anObject arguments: aMessage arguments\x0a\x09\x09\x0a\x09\x0a\x09",
  1195. messageSends: ["ifFalse:", "sendTo:", "ifNil:", "messageNotUnderstood:receiver:", "superclass", "class", "at:ifAbsent:", "selector", "methodDictionary", "applyTo:arguments:", "arguments", "fn"],
  1196. referencedClasses: []
  1197. }),
  1198. smalltalk.ASTInterpreter);
  1199. smalltalk.addMethod(
  1200. smalltalk.method({
  1201. selector: "shouldReturn",
  1202. category: 'testing',
  1203. fn: function (){
  1204. var self=this;
  1205. return smalltalk.withContext(function($ctx1) {
  1206. var $2,$1;
  1207. $2=self["@shouldReturn"];
  1208. if(($receiver = $2) == nil || $receiver == undefined){
  1209. $1=false;
  1210. } else {
  1211. $1=$2;
  1212. };
  1213. return $1;
  1214. }, function($ctx1) {$ctx1.fill(self,"shouldReturn",{},smalltalk.ASTInterpreter)})},
  1215. args: [],
  1216. source: "shouldReturn\x0a\x09^ shouldReturn ifNil: [ false ]",
  1217. messageSends: ["ifNil:"],
  1218. referencedClasses: []
  1219. }),
  1220. smalltalk.ASTInterpreter);
  1221. smalltalk.addMethod(
  1222. smalltalk.method({
  1223. selector: "withBlockContext:",
  1224. category: 'private',
  1225. fn: function (aBlock){
  1226. var self=this;
  1227. var blockResult;
  1228. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  1229. return smalltalk.withContext(function($ctx1) {
  1230. var $1,$2,$3;
  1231. $1=_st($AIContext())._new();
  1232. _st($1)._outerContext_(_st(self)._context());
  1233. $2=_st($1)._yourself();
  1234. _st(self)._context_($2);
  1235. blockResult=_st(aBlock)._value();
  1236. _st(self)._context_(_st(_st(self)._context())._outerContext());
  1237. $3=blockResult;
  1238. return $3;
  1239. }, function($ctx1) {$ctx1.fill(self,"withBlockContext:",{aBlock:aBlock,blockResult:blockResult},smalltalk.ASTInterpreter)})},
  1240. args: ["aBlock"],
  1241. source: "withBlockContext: aBlock\x0a\x09\x22Evaluate aBlock with a BlockContext:\x0a\x09- a context is pushed before aBlock evaluation.\x0a\x09- the context is poped after aBlock evaluation\x0a\x09- the result of aBlock evaluation is answered\x22\x0a\x09\x0a\x09| blockResult |\x0a\x09\x09\x09\x0a\x09self context: (AIContext new\x0a\x09\x09outerContext: self context;\x0a\x09\x09yourself).\x0a\x09\x0a\x09blockResult := aBlock value.\x0a\x09\x0a\x09self context: self context outerContext.\x0a\x09^ blockResult",
  1242. messageSends: ["context:", "outerContext:", "context", "new", "yourself", "value", "outerContext"],
  1243. referencedClasses: ["AIContext"]
  1244. }),
  1245. smalltalk.ASTInterpreter);
  1246. smalltalk.addClass('ASTSteppingInterpreter', smalltalk.ASTInterpreter, ['continuation', 'nextNode'], 'Compiler-Interpreter');
  1247. smalltalk.ASTSteppingInterpreter.comment="I am an interpreter with stepping capabilities. The higher level `ASTDebugger` class should be used as a debugger model, as it provides convenience methods for debugging.\x0a\x0a## API\x0a\x0aUse `#step` to actually interpret the next node. Interpretation stops at each node evaluation, weither it's a message node or not.\x0a\x0a\x0a## Usage example:\x0a\x0a\x09| ast interpreter |\x0a\x09ast := Smalltalk current parse: 'foo 1+2+4'.\x0a\x09(SemanticAnalyzer on: Object) visit: ast.\x0a\x0a\x09interpreter := ASTSteppingInterpreter new\x0a\x09\x09interpret: ast nodes first;\x0a\x09\x09yourself.\x0a\x09\x09\x0a\x09interpreter step; step.\x0a\x09interpreter step; step.\x0a\x09interpreter result.\x22Answers 1\x22\x0a\x09interpreter step.\x0a\x09interpreter result. \x22Answers 3\x22\x0a\x09interpreter step.\x0a\x09interpreter result. \x22Answers 7\x22"
  1248. smalltalk.addMethod(
  1249. smalltalk.method({
  1250. selector: "atEnd",
  1251. category: 'testing',
  1252. fn: function (){
  1253. var self=this;
  1254. return smalltalk.withContext(function($ctx1) {
  1255. var $1;
  1256. $1=_st(_st(self)._shouldReturn())._or_((function(){
  1257. return smalltalk.withContext(function($ctx2) {
  1258. return _st(_st(self)._nextNode()).__eq_eq(_st(self)._currentNode());
  1259. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1260. return $1;
  1261. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.ASTSteppingInterpreter)})},
  1262. args: [],
  1263. source: "atEnd\x0a\x09^ self shouldReturn or: [ self nextNode == self currentNode ]",
  1264. messageSends: ["or:", "==", "currentNode", "nextNode", "shouldReturn"],
  1265. referencedClasses: []
  1266. }),
  1267. smalltalk.ASTSteppingInterpreter);
  1268. smalltalk.addMethod(
  1269. smalltalk.method({
  1270. selector: "initialize",
  1271. category: 'initialization',
  1272. fn: function (){
  1273. var self=this;
  1274. return smalltalk.withContext(function($ctx1) {
  1275. smalltalk.ASTInterpreter.fn.prototype._initialize.apply(_st(self), []);
  1276. self["@continuation"]=(function(){
  1277. return smalltalk.withContext(function($ctx2) {
  1278. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1279. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ASTSteppingInterpreter)})},
  1280. args: [],
  1281. source: "initialize\x0a\x09super initialize.\x0a\x09continuation := []",
  1282. messageSends: ["initialize"],
  1283. referencedClasses: []
  1284. }),
  1285. smalltalk.ASTSteppingInterpreter);
  1286. smalltalk.addMethod(
  1287. smalltalk.method({
  1288. selector: "interpret:continue:",
  1289. category: 'interpreting',
  1290. fn: function (aNode,aBlock){
  1291. var self=this;
  1292. return smalltalk.withContext(function($ctx1) {
  1293. self["@nextNode"]=aNode;
  1294. self["@continuation"]=(function(){
  1295. return smalltalk.withContext(function($ctx2) {
  1296. return smalltalk.ASTInterpreter.fn.prototype._interpret_continue_.apply(_st(self), [aNode,aBlock]);
  1297. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1298. return self}, function($ctx1) {$ctx1.fill(self,"interpret:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTSteppingInterpreter)})},
  1299. args: ["aNode", "aBlock"],
  1300. source: "interpret: aNode continue: aBlock\x0a\x09nextNode := aNode.\x0a\x09continuation := [\x0a\x09\x09super interpret: aNode continue: aBlock ]",
  1301. messageSends: ["interpret:continue:"],
  1302. referencedClasses: []
  1303. }),
  1304. smalltalk.ASTSteppingInterpreter);
  1305. smalltalk.addMethod(
  1306. smalltalk.method({
  1307. selector: "nextNode",
  1308. category: 'accessing',
  1309. fn: function (){
  1310. var self=this;
  1311. return smalltalk.withContext(function($ctx1) {
  1312. var $1;
  1313. $1=self["@nextNode"];
  1314. return $1;
  1315. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.ASTSteppingInterpreter)})},
  1316. args: [],
  1317. source: "nextNode\x0a\x09^ nextNode",
  1318. messageSends: [],
  1319. referencedClasses: []
  1320. }),
  1321. smalltalk.ASTSteppingInterpreter);
  1322. smalltalk.addMethod(
  1323. smalltalk.method({
  1324. selector: "step",
  1325. category: 'stepping',
  1326. fn: function (){
  1327. var self=this;
  1328. return smalltalk.withContext(function($ctx1) {
  1329. _st(self["@continuation"])._value();
  1330. return self}, function($ctx1) {$ctx1.fill(self,"step",{},smalltalk.ASTSteppingInterpreter)})},
  1331. args: [],
  1332. source: "step\x0a\x09continuation value",
  1333. messageSends: ["value"],
  1334. referencedClasses: []
  1335. }),
  1336. smalltalk.ASTSteppingInterpreter);
  1337. smalltalk.addMethod(
  1338. smalltalk.method({
  1339. selector: "interpreter:continue:",
  1340. category: '*Compiler-Interpreter',
  1341. fn: function (anInterpreter,aBlock){
  1342. var self=this;
  1343. return smalltalk.withContext(function($ctx1) {
  1344. var $1;
  1345. $1=_st(anInterpreter)._interpretNode_continue_(self,aBlock);
  1346. return $1;
  1347. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.Node)})},
  1348. args: ["anInterpreter", "aBlock"],
  1349. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretNode: self continue: aBlock",
  1350. messageSends: ["interpretNode:continue:"],
  1351. referencedClasses: []
  1352. }),
  1353. smalltalk.Node);
  1354. smalltalk.addMethod(
  1355. smalltalk.method({
  1356. selector: "isSteppingNode",
  1357. category: '*Compiler-Interpreter',
  1358. fn: function (){
  1359. var self=this;
  1360. return smalltalk.withContext(function($ctx1) {
  1361. return false;
  1362. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.Node)})},
  1363. args: [],
  1364. source: "isSteppingNode\x0a\x09^ false",
  1365. messageSends: [],
  1366. referencedClasses: []
  1367. }),
  1368. smalltalk.Node);
  1369. smalltalk.addMethod(
  1370. smalltalk.method({
  1371. selector: "interpreter:continue:",
  1372. category: '*Compiler-Interpreter',
  1373. fn: function (anInterpreter,aBlock){
  1374. var self=this;
  1375. return smalltalk.withContext(function($ctx1) {
  1376. var $1;
  1377. $1=_st(anInterpreter)._interpretAssignmentNode_continue_(self,aBlock);
  1378. return $1;
  1379. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.AssignmentNode)})},
  1380. args: ["anInterpreter", "aBlock"],
  1381. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretAssignmentNode: self continue: aBlock",
  1382. messageSends: ["interpretAssignmentNode:continue:"],
  1383. referencedClasses: []
  1384. }),
  1385. smalltalk.AssignmentNode);
  1386. smalltalk.addMethod(
  1387. smalltalk.method({
  1388. selector: "isSteppingNode",
  1389. category: '*Compiler-Interpreter',
  1390. fn: function (){
  1391. var self=this;
  1392. return smalltalk.withContext(function($ctx1) {
  1393. return true;
  1394. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.AssignmentNode)})},
  1395. args: [],
  1396. source: "isSteppingNode\x0a\x09^ true",
  1397. messageSends: [],
  1398. referencedClasses: []
  1399. }),
  1400. smalltalk.AssignmentNode);
  1401. smalltalk.addMethod(
  1402. smalltalk.method({
  1403. selector: "interpreter:continue:",
  1404. category: '*Compiler-Interpreter',
  1405. fn: function (anInterpreter,aBlock){
  1406. var self=this;
  1407. return smalltalk.withContext(function($ctx1) {
  1408. var $1;
  1409. $1=_st(anInterpreter)._interpretBlockNode_continue_(self,aBlock);
  1410. return $1;
  1411. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.BlockNode)})},
  1412. args: ["anInterpreter", "aBlock"],
  1413. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretBlockNode: self continue: aBlock",
  1414. messageSends: ["interpretBlockNode:continue:"],
  1415. referencedClasses: []
  1416. }),
  1417. smalltalk.BlockNode);
  1418. smalltalk.addMethod(
  1419. smalltalk.method({
  1420. selector: "isSteppingNode",
  1421. category: '*Compiler-Interpreter',
  1422. fn: function (){
  1423. var self=this;
  1424. return smalltalk.withContext(function($ctx1) {
  1425. return true;
  1426. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.BlockNode)})},
  1427. args: [],
  1428. source: "isSteppingNode\x0a\x09^ true",
  1429. messageSends: [],
  1430. referencedClasses: []
  1431. }),
  1432. smalltalk.BlockNode);
  1433. smalltalk.addMethod(
  1434. smalltalk.method({
  1435. selector: "interpreter:continue:",
  1436. category: '*Compiler-Interpreter',
  1437. fn: function (anInterpreter,aBlock){
  1438. var self=this;
  1439. return smalltalk.withContext(function($ctx1) {
  1440. var $1;
  1441. $1=_st(anInterpreter)._interpretCascadeNode_continue_(self,aBlock);
  1442. return $1;
  1443. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.CascadeNode)})},
  1444. args: ["anInterpreter", "aBlock"],
  1445. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretCascadeNode: self continue: aBlock",
  1446. messageSends: ["interpretCascadeNode:continue:"],
  1447. referencedClasses: []
  1448. }),
  1449. smalltalk.CascadeNode);
  1450. smalltalk.addMethod(
  1451. smalltalk.method({
  1452. selector: "interpreter:continue:",
  1453. category: '*Compiler-Interpreter',
  1454. fn: function (anInterpreter,aBlock){
  1455. var self=this;
  1456. return smalltalk.withContext(function($ctx1) {
  1457. var $1;
  1458. $1=_st(anInterpreter)._interpretDynamicArrayNode_continue_(self,aBlock);
  1459. return $1;
  1460. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.DynamicArrayNode)})},
  1461. args: ["anInterpreter", "aBlock"],
  1462. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretDynamicArrayNode: self continue: aBlock",
  1463. messageSends: ["interpretDynamicArrayNode:continue:"],
  1464. referencedClasses: []
  1465. }),
  1466. smalltalk.DynamicArrayNode);
  1467. smalltalk.addMethod(
  1468. smalltalk.method({
  1469. selector: "isSteppingNode",
  1470. category: '*Compiler-Interpreter',
  1471. fn: function (){
  1472. var self=this;
  1473. return smalltalk.withContext(function($ctx1) {
  1474. return true;
  1475. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.DynamicArrayNode)})},
  1476. args: [],
  1477. source: "isSteppingNode\x0a\x09^ true",
  1478. messageSends: [],
  1479. referencedClasses: []
  1480. }),
  1481. smalltalk.DynamicArrayNode);
  1482. smalltalk.addMethod(
  1483. smalltalk.method({
  1484. selector: "interpreter:continue:",
  1485. category: '*Compiler-Interpreter',
  1486. fn: function (anInterpreter,aBlock){
  1487. var self=this;
  1488. return smalltalk.withContext(function($ctx1) {
  1489. var $1;
  1490. $1=_st(anInterpreter)._interpretDynamicDictionaryNode_continue_(self,aBlock);
  1491. return $1;
  1492. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.DynamicDictionaryNode)})},
  1493. args: ["anInterpreter", "aBlock"],
  1494. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretDynamicDictionaryNode: self continue: aBlock",
  1495. messageSends: ["interpretDynamicDictionaryNode:continue:"],
  1496. referencedClasses: []
  1497. }),
  1498. smalltalk.DynamicDictionaryNode);
  1499. smalltalk.addMethod(
  1500. smalltalk.method({
  1501. selector: "isSteppingNode",
  1502. category: '*Compiler-Interpreter',
  1503. fn: function (){
  1504. var self=this;
  1505. return smalltalk.withContext(function($ctx1) {
  1506. return true;
  1507. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.DynamicDictionaryNode)})},
  1508. args: [],
  1509. source: "isSteppingNode\x0a\x09^ true",
  1510. messageSends: [],
  1511. referencedClasses: []
  1512. }),
  1513. smalltalk.DynamicDictionaryNode);
  1514. smalltalk.addMethod(
  1515. smalltalk.method({
  1516. selector: "interpreter:continue:",
  1517. category: '*Compiler-Interpreter',
  1518. fn: function (anInterpreter,aBlock){
  1519. var self=this;
  1520. return smalltalk.withContext(function($ctx1) {
  1521. var $1;
  1522. $1=_st(anInterpreter)._interpretJSStatementNode_continue_(self,aBlock);
  1523. return $1;
  1524. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.JSStatementNode)})},
  1525. args: ["anInterpreter", "aBlock"],
  1526. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretJSStatementNode: self continue: aBlock",
  1527. messageSends: ["interpretJSStatementNode:continue:"],
  1528. referencedClasses: []
  1529. }),
  1530. smalltalk.JSStatementNode);
  1531. smalltalk.addMethod(
  1532. smalltalk.method({
  1533. selector: "isSteppingNode",
  1534. category: '*Compiler-Interpreter',
  1535. fn: function (){
  1536. var self=this;
  1537. return smalltalk.withContext(function($ctx1) {
  1538. return true;
  1539. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.JSStatementNode)})},
  1540. args: [],
  1541. source: "isSteppingNode\x0a\x09^ true",
  1542. messageSends: [],
  1543. referencedClasses: []
  1544. }),
  1545. smalltalk.JSStatementNode);
  1546. smalltalk.addMethod(
  1547. smalltalk.method({
  1548. selector: "interpreter:continue:",
  1549. category: '*Compiler-Interpreter',
  1550. fn: function (anInterpreter,aBlock){
  1551. var self=this;
  1552. return smalltalk.withContext(function($ctx1) {
  1553. var $1;
  1554. $1=_st(anInterpreter)._interpretMethodNode_continue_(self,aBlock);
  1555. return $1;
  1556. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.MethodNode)})},
  1557. args: ["anInterpreter", "aBlock"],
  1558. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretMethodNode: self continue: aBlock",
  1559. messageSends: ["interpretMethodNode:continue:"],
  1560. referencedClasses: []
  1561. }),
  1562. smalltalk.MethodNode);
  1563. smalltalk.addMethod(
  1564. smalltalk.method({
  1565. selector: "interpreter:continue:",
  1566. category: '*Compiler-Interpreter',
  1567. fn: function (anInterpreter,aBlock){
  1568. var self=this;
  1569. return smalltalk.withContext(function($ctx1) {
  1570. var $1;
  1571. $1=_st(anInterpreter)._interpretReturnNode_continue_(self,aBlock);
  1572. return $1;
  1573. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.ReturnNode)})},
  1574. args: ["anInterpreter", "aBlock"],
  1575. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretReturnNode: self continue: aBlock",
  1576. messageSends: ["interpretReturnNode:continue:"],
  1577. referencedClasses: []
  1578. }),
  1579. smalltalk.ReturnNode);
  1580. smalltalk.addMethod(
  1581. smalltalk.method({
  1582. selector: "interpreter:continue:",
  1583. category: '*Compiler-Interpreter',
  1584. fn: function (anInterpreter,aBlock){
  1585. var self=this;
  1586. return smalltalk.withContext(function($ctx1) {
  1587. var $1;
  1588. $1=_st(anInterpreter)._interpretSendNode_continue_(self,aBlock);
  1589. return $1;
  1590. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.SendNode)})},
  1591. args: ["anInterpreter", "aBlock"],
  1592. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretSendNode: self continue: aBlock",
  1593. messageSends: ["interpretSendNode:continue:"],
  1594. referencedClasses: []
  1595. }),
  1596. smalltalk.SendNode);
  1597. smalltalk.addMethod(
  1598. smalltalk.method({
  1599. selector: "isSteppingNode",
  1600. category: '*Compiler-Interpreter',
  1601. fn: function (){
  1602. var self=this;
  1603. return smalltalk.withContext(function($ctx1) {
  1604. return true;
  1605. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.SendNode)})},
  1606. args: [],
  1607. source: "isSteppingNode\x0a\x09^ true",
  1608. messageSends: [],
  1609. referencedClasses: []
  1610. }),
  1611. smalltalk.SendNode);
  1612. smalltalk.addMethod(
  1613. smalltalk.method({
  1614. selector: "interpreter:continue:",
  1615. category: '*Compiler-Interpreter',
  1616. fn: function (anInterpreter,aBlock){
  1617. var self=this;
  1618. return smalltalk.withContext(function($ctx1) {
  1619. var $1;
  1620. $1=_st(anInterpreter)._interpretSequenceNode_continue_(self,aBlock);
  1621. return $1;
  1622. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.SequenceNode)})},
  1623. args: ["anInterpreter", "aBlock"],
  1624. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretSequenceNode: self continue: aBlock",
  1625. messageSends: ["interpretSequenceNode:continue:"],
  1626. referencedClasses: []
  1627. }),
  1628. smalltalk.SequenceNode);
  1629. smalltalk.addMethod(
  1630. smalltalk.method({
  1631. selector: "interpreter:continue:",
  1632. category: '*Compiler-Interpreter',
  1633. fn: function (anInterpreter,aBlock){
  1634. var self=this;
  1635. return smalltalk.withContext(function($ctx1) {
  1636. var $1;
  1637. $1=_st(anInterpreter)._interpretBlockSequenceNode_continue_(self,aBlock);
  1638. return $1;
  1639. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.BlockSequenceNode)})},
  1640. args: ["anInterpreter", "aBlock"],
  1641. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretBlockSequenceNode: self continue: aBlock",
  1642. messageSends: ["interpretBlockSequenceNode:continue:"],
  1643. referencedClasses: []
  1644. }),
  1645. smalltalk.BlockSequenceNode);
  1646. smalltalk.addMethod(
  1647. smalltalk.method({
  1648. selector: "interpreter:continue:",
  1649. category: '*Compiler-Interpreter',
  1650. fn: function (anInterpreter,aBlock){
  1651. var self=this;
  1652. return smalltalk.withContext(function($ctx1) {
  1653. var $1;
  1654. $1=_st(anInterpreter)._interpretValueNode_continue_(self,aBlock);
  1655. return $1;
  1656. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.ValueNode)})},
  1657. args: ["anInterpreter", "aBlock"],
  1658. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretValueNode: self continue: aBlock",
  1659. messageSends: ["interpretValueNode:continue:"],
  1660. referencedClasses: []
  1661. }),
  1662. smalltalk.ValueNode);
  1663. smalltalk.addMethod(
  1664. smalltalk.method({
  1665. selector: "interpreter:continue:",
  1666. category: '*Compiler-Interpreter',
  1667. fn: function (anInterpreter,aBlock){
  1668. var self=this;
  1669. return smalltalk.withContext(function($ctx1) {
  1670. var $1;
  1671. $1=_st(anInterpreter)._interpretVariableNode_continue_(self,aBlock);
  1672. return $1;
  1673. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.VariableNode)})},
  1674. args: ["anInterpreter", "aBlock"],
  1675. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretVariableNode: self continue: aBlock",
  1676. messageSends: ["interpretVariableNode:continue:"],
  1677. referencedClasses: []
  1678. }),
  1679. smalltalk.VariableNode);
  1680. smalltalk.addMethod(
  1681. smalltalk.method({
  1682. selector: "interpreter:continue:",
  1683. category: '*Compiler-Interpreter',
  1684. fn: function (anInterpreter,aBlock){
  1685. var self=this;
  1686. return smalltalk.withContext(function($ctx1) {
  1687. var $1;
  1688. $1=_st(anInterpreter)._interpretClassReferenceNode_continue_(self,aBlock);
  1689. return $1;
  1690. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.ClassReferenceNode)})},
  1691. args: ["anInterpreter", "aBlock"],
  1692. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretClassReferenceNode: self continue: aBlock",
  1693. messageSends: ["interpretClassReferenceNode:continue:"],
  1694. referencedClasses: []
  1695. }),
  1696. smalltalk.ClassReferenceNode);