1
0

Compiler-Interpreter.js 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760
  1. smalltalk.addPackage('Compiler-Interpreter');
  2. smalltalk.addClass('AIContext', smalltalk.NodeVisitor, ['outerContext', 'pc', 'locals', 'method'], 'Compiler-Interpreter');
  3. smalltalk.AIContext.comment="AIContext is like a `MethodContext`, used by the `ASTInterpreter`.\x0aUnlike a `MethodContext`, it is not read-only.\x0a\x0aWhen debugging, `AIContext` 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="ASTDebugger is a debugger to Amber.\x0aIt uses an AST interpreter to step through the code.\x0a\x0aASTDebugger instances are created from a `MethodContext` with `ASTDebugger class >> context:`.\x0aThey hold an `AIContext` instance internally, recursive copy of the `MethodContext`.\x0a\x0aUse the methods of the 'stepping' protocol to do stepping."
  285. smalltalk.addMethod(
  286. smalltalk.method({
  287. selector: "buildAST",
  288. category: 'initialization',
  289. fn: function (){
  290. var self=this;
  291. var ast;
  292. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  293. function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
  294. return smalltalk.withContext(function($ctx1) {
  295. var $1;
  296. ast=_st(_st($Smalltalk())._current())._parse_(_st(_st(self)._method())._source());
  297. _st(_st($SemanticAnalyzer())._on_(_st(_st(_st(self)._context())._receiver())._class()))._visit_(ast);
  298. $1=ast;
  299. return $1;
  300. }, function($ctx1) {$ctx1.fill(self,"buildAST",{ast:ast},smalltalk.ASTDebugger)})},
  301. args: [],
  302. 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",
  303. messageSends: ["parse:", "source", "method", "current", "visit:", "on:", "class", "receiver", "context"],
  304. referencedClasses: ["Smalltalk", "SemanticAnalyzer"]
  305. }),
  306. smalltalk.ASTDebugger);
  307. smalltalk.addMethod(
  308. smalltalk.method({
  309. selector: "context",
  310. category: 'accessing',
  311. fn: function (){
  312. var self=this;
  313. return smalltalk.withContext(function($ctx1) {
  314. var $1;
  315. $1=self["@context"];
  316. return $1;
  317. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTDebugger)})},
  318. args: [],
  319. source: "context\x0a\x09^ context",
  320. messageSends: [],
  321. referencedClasses: []
  322. }),
  323. smalltalk.ASTDebugger);
  324. smalltalk.addMethod(
  325. smalltalk.method({
  326. selector: "context:",
  327. category: 'accessing',
  328. fn: function (aContext){
  329. var self=this;
  330. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  331. return smalltalk.withContext(function($ctx1) {
  332. self["@context"]=_st($AIContext())._new();
  333. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTDebugger)})},
  334. args: ["aContext"],
  335. source: "context: aContext\x0a\x09context := AIContext new.",
  336. messageSends: ["new"],
  337. referencedClasses: ["AIContext"]
  338. }),
  339. smalltalk.ASTDebugger);
  340. smalltalk.addMethod(
  341. smalltalk.method({
  342. selector: "defaultInterpreterClass",
  343. category: 'defaults',
  344. fn: function (){
  345. var self=this;
  346. function $ASTSteppingInterpreter(){return smalltalk.ASTSteppingInterpreter||(typeof ASTSteppingInterpreter=="undefined"?nil:ASTSteppingInterpreter)}
  347. return smalltalk.withContext(function($ctx1) {
  348. var $1;
  349. $1=$ASTSteppingInterpreter();
  350. return $1;
  351. }, function($ctx1) {$ctx1.fill(self,"defaultInterpreterClass",{},smalltalk.ASTDebugger)})},
  352. args: [],
  353. source: "defaultInterpreterClass\x0a\x09^ ASTSteppingInterpreter",
  354. messageSends: [],
  355. referencedClasses: ["ASTSteppingInterpreter"]
  356. }),
  357. smalltalk.ASTDebugger);
  358. smalltalk.addMethod(
  359. smalltalk.method({
  360. selector: "initializeInterpreter",
  361. category: 'initialization',
  362. fn: function (){
  363. var self=this;
  364. return smalltalk.withContext(function($ctx1) {
  365. _st(_st(self)._interpreter())._interpret_(_st(_st(_st(self)._buildAST())._nodes())._first());
  366. return self}, function($ctx1) {$ctx1.fill(self,"initializeInterpreter",{},smalltalk.ASTDebugger)})},
  367. args: [],
  368. source: "initializeInterpreter\x0a\x09self interpreter interpret: self buildAST nodes first",
  369. messageSends: ["interpret:", "first", "nodes", "buildAST", "interpreter"],
  370. referencedClasses: []
  371. }),
  372. smalltalk.ASTDebugger);
  373. smalltalk.addMethod(
  374. smalltalk.method({
  375. selector: "initializeWithContext:",
  376. category: 'initialization',
  377. fn: function (aMethodContext){
  378. var self=this;
  379. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  380. return smalltalk.withContext(function($ctx1) {
  381. _st(self)._context_(_st($AIContext())._fromMethodContext_(aMethodContext));
  382. _st(self)._initializeInterpreter();
  383. return self}, function($ctx1) {$ctx1.fill(self,"initializeWithContext:",{aMethodContext:aMethodContext},smalltalk.ASTDebugger)})},
  384. args: ["aMethodContext"],
  385. 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",
  386. messageSends: ["context:", "fromMethodContext:", "initializeInterpreter"],
  387. referencedClasses: ["AIContext"]
  388. }),
  389. smalltalk.ASTDebugger);
  390. smalltalk.addMethod(
  391. smalltalk.method({
  392. selector: "interpreter",
  393. category: 'accessing',
  394. fn: function (){
  395. var self=this;
  396. return smalltalk.withContext(function($ctx1) {
  397. var $2,$1;
  398. $2=self["@interpreter"];
  399. if(($receiver = $2) == nil || $receiver == undefined){
  400. self["@interpreter"]=_st(_st(self)._defaultInterpreterClass())._new();
  401. $1=self["@interpreter"];
  402. } else {
  403. $1=$2;
  404. };
  405. return $1;
  406. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.ASTDebugger)})},
  407. args: [],
  408. source: "interpreter\x0a\x09^ interpreter ifNil: [ interpreter := self defaultInterpreterClass new ]",
  409. messageSends: ["ifNil:", "new", "defaultInterpreterClass"],
  410. referencedClasses: []
  411. }),
  412. smalltalk.ASTDebugger);
  413. smalltalk.addMethod(
  414. smalltalk.method({
  415. selector: "interpreter:",
  416. category: 'accessing',
  417. fn: function (anInterpreter){
  418. var self=this;
  419. return smalltalk.withContext(function($ctx1) {
  420. self["@interpreter"]=anInterpreter;
  421. return self}, function($ctx1) {$ctx1.fill(self,"interpreter:",{anInterpreter:anInterpreter},smalltalk.ASTDebugger)})},
  422. args: ["anInterpreter"],
  423. source: "interpreter: anInterpreter\x0a\x09interpreter := anInterpreter",
  424. messageSends: [],
  425. referencedClasses: []
  426. }),
  427. smalltalk.ASTDebugger);
  428. smalltalk.addMethod(
  429. smalltalk.method({
  430. selector: "method",
  431. category: 'accessing',
  432. fn: function (){
  433. var self=this;
  434. return smalltalk.withContext(function($ctx1) {
  435. var $1;
  436. $1=_st(_st(self)._context())._method();
  437. return $1;
  438. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.ASTDebugger)})},
  439. args: [],
  440. source: "method\x0a\x09^ self context method",
  441. messageSends: ["method", "context"],
  442. referencedClasses: []
  443. }),
  444. smalltalk.ASTDebugger);
  445. smalltalk.addMethod(
  446. smalltalk.method({
  447. selector: "restart",
  448. category: 'stepping',
  449. fn: function (){
  450. var self=this;
  451. return smalltalk.withContext(function($ctx1) {
  452. _st(self)._shouldBeImplemented();
  453. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.ASTDebugger)})},
  454. args: [],
  455. source: "restart\x0a\x09self shouldBeImplemented",
  456. messageSends: ["shouldBeImplemented"],
  457. referencedClasses: []
  458. }),
  459. smalltalk.ASTDebugger);
  460. smalltalk.addMethod(
  461. smalltalk.method({
  462. selector: "resume",
  463. category: 'stepping',
  464. fn: function (){
  465. var self=this;
  466. return smalltalk.withContext(function($ctx1) {
  467. _st(self)._shouldBeImplemented();
  468. return self}, function($ctx1) {$ctx1.fill(self,"resume",{},smalltalk.ASTDebugger)})},
  469. args: [],
  470. source: "resume\x0a\x09self shouldBeImplemented",
  471. messageSends: ["shouldBeImplemented"],
  472. referencedClasses: []
  473. }),
  474. smalltalk.ASTDebugger);
  475. smalltalk.addMethod(
  476. smalltalk.method({
  477. selector: "step",
  478. category: 'stepping',
  479. fn: function (){
  480. var self=this;
  481. return smalltalk.withContext(function($ctx1) {
  482. _st((function(){
  483. return smalltalk.withContext(function($ctx2) {
  484. return _st(_st(_st(_st(_st(self)._interpreter())._nextNode())._notNil())._and_((function(){
  485. return smalltalk.withContext(function($ctx3) {
  486. return _st(_st(_st(self)._interpreter())._nextNode())._stopOnStepping();
  487. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})))._or_((function(){
  488. return smalltalk.withContext(function($ctx3) {
  489. return _st(_st(_st(self)._interpreter())._atEnd())._not();
  490. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  491. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  492. return smalltalk.withContext(function($ctx2) {
  493. _st(_st(self)._interpreter())._step();
  494. return _st(self)._step();
  495. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  496. return self}, function($ctx1) {$ctx1.fill(self,"step",{},smalltalk.ASTDebugger)})},
  497. args: [],
  498. 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 ]",
  499. messageSends: ["whileFalse:", "step", "interpreter", "or:", "not", "atEnd", "and:", "stopOnStepping", "nextNode", "notNil"],
  500. referencedClasses: []
  501. }),
  502. smalltalk.ASTDebugger);
  503. smalltalk.addMethod(
  504. smalltalk.method({
  505. selector: "stepInto",
  506. category: 'stepping',
  507. fn: function (){
  508. var self=this;
  509. return smalltalk.withContext(function($ctx1) {
  510. _st(self)._shouldBeImplemented();
  511. return self}, function($ctx1) {$ctx1.fill(self,"stepInto",{},smalltalk.ASTDebugger)})},
  512. args: [],
  513. source: "stepInto\x0a\x09self shouldBeImplemented",
  514. messageSends: ["shouldBeImplemented"],
  515. referencedClasses: []
  516. }),
  517. smalltalk.ASTDebugger);
  518. smalltalk.addMethod(
  519. smalltalk.method({
  520. selector: "stepOver",
  521. category: 'stepping',
  522. fn: function (){
  523. var self=this;
  524. return smalltalk.withContext(function($ctx1) {
  525. _st(self)._step();
  526. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.ASTDebugger)})},
  527. args: [],
  528. source: "stepOver\x0a\x09self step",
  529. messageSends: ["step"],
  530. referencedClasses: []
  531. }),
  532. smalltalk.ASTDebugger);
  533. smalltalk.addMethod(
  534. smalltalk.method({
  535. selector: "context:",
  536. category: 'instance creation',
  537. fn: function (aMethodContext){
  538. var self=this;
  539. return smalltalk.withContext(function($ctx1) {
  540. var $2,$3,$1;
  541. $2=_st(self)._new();
  542. _st($2)._initializeWithContext_(aMethodContext);
  543. $3=_st($2)._yourself();
  544. $1=$3;
  545. return $1;
  546. }, function($ctx1) {$ctx1.fill(self,"context:",{aMethodContext:aMethodContext},smalltalk.ASTDebugger.klass)})},
  547. args: ["aMethodContext"],
  548. source: "context: aMethodContext\x0a\x09^ self new\x0a\x09\x09initializeWithContext: aMethodContext;\x0a\x09\x09yourself",
  549. messageSends: ["initializeWithContext:", "new", "yourself"],
  550. referencedClasses: []
  551. }),
  552. smalltalk.ASTDebugger.klass);
  553. smalltalk.addClass('ASTInterpreter', smalltalk.Object, ['currentNode', 'context', 'shouldReturn', 'result'], 'Compiler-Interpreter');
  554. smalltalk.ASTInterpreter.comment="ASTIntepreter is like a `NodeVisitor`, interpreting nodes one after each other.\x0aIt is built using Continuation Passing Style for stepping purposes.\x0a\x0aUsage 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"
  555. smalltalk.addMethod(
  556. smalltalk.method({
  557. selector: "assign:to:",
  558. category: 'private',
  559. fn: function (aNode,anObject){
  560. var self=this;
  561. return smalltalk.withContext(function($ctx1) {
  562. var $2,$1;
  563. $2=_st(_st(aNode)._binding())._isInstanceVar();
  564. if(smalltalk.assert($2)){
  565. $1=_st(_st(_st(self)._context())._receiver())._instVarAt_put_(_st(aNode)._value(),anObject);
  566. } else {
  567. $1=_st(_st(self)._context())._localAt_put_(_st(aNode)._value(),anObject);
  568. };
  569. return $1;
  570. }, function($ctx1) {$ctx1.fill(self,"assign:to:",{aNode:aNode,anObject:anObject},smalltalk.ASTInterpreter)})},
  571. args: ["aNode", "anObject"],
  572. 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 ]",
  573. messageSends: ["ifTrue:ifFalse:", "instVarAt:put:", "value", "receiver", "context", "localAt:put:", "isInstanceVar", "binding"],
  574. referencedClasses: []
  575. }),
  576. smalltalk.ASTInterpreter);
  577. smalltalk.addMethod(
  578. smalltalk.method({
  579. selector: "context",
  580. category: 'accessing',
  581. fn: function (){
  582. var self=this;
  583. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  584. return smalltalk.withContext(function($ctx1) {
  585. var $2,$1;
  586. $2=self["@context"];
  587. if(($receiver = $2) == nil || $receiver == undefined){
  588. self["@context"]=_st($AIContext())._new();
  589. $1=self["@context"];
  590. } else {
  591. $1=$2;
  592. };
  593. return $1;
  594. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTInterpreter)})},
  595. args: [],
  596. source: "context\x0a\x09^ context ifNil: [ context := AIContext new ]",
  597. messageSends: ["ifNil:", "new"],
  598. referencedClasses: ["AIContext"]
  599. }),
  600. smalltalk.ASTInterpreter);
  601. smalltalk.addMethod(
  602. smalltalk.method({
  603. selector: "context:",
  604. category: 'accessing',
  605. fn: function (anAIContext){
  606. var self=this;
  607. return smalltalk.withContext(function($ctx1) {
  608. self["@context"]=anAIContext;
  609. return self}, function($ctx1) {$ctx1.fill(self,"context:",{anAIContext:anAIContext},smalltalk.ASTInterpreter)})},
  610. args: ["anAIContext"],
  611. source: "context: anAIContext\x0a\x09context := anAIContext",
  612. messageSends: [],
  613. referencedClasses: []
  614. }),
  615. smalltalk.ASTInterpreter);
  616. smalltalk.addMethod(
  617. smalltalk.method({
  618. selector: "continue:value:",
  619. category: 'private',
  620. fn: function (aBlock,anObject){
  621. var self=this;
  622. return smalltalk.withContext(function($ctx1) {
  623. self["@result"]=anObject;
  624. _st(aBlock)._value_(anObject);
  625. return self}, function($ctx1) {$ctx1.fill(self,"continue:value:",{aBlock:aBlock,anObject:anObject},smalltalk.ASTInterpreter)})},
  626. args: ["aBlock", "anObject"],
  627. source: "continue: aBlock value: anObject\x0a\x09result := anObject.\x0a\x09aBlock value: anObject",
  628. messageSends: ["value:"],
  629. referencedClasses: []
  630. }),
  631. smalltalk.ASTInterpreter);
  632. smalltalk.addMethod(
  633. smalltalk.method({
  634. selector: "currentNode",
  635. category: 'accessing',
  636. fn: function (){
  637. var self=this;
  638. return smalltalk.withContext(function($ctx1) {
  639. var $1;
  640. $1=self["@currentNode"];
  641. return $1;
  642. }, function($ctx1) {$ctx1.fill(self,"currentNode",{},smalltalk.ASTInterpreter)})},
  643. args: [],
  644. source: "currentNode\x0a\x09^ currentNode",
  645. messageSends: [],
  646. referencedClasses: []
  647. }),
  648. smalltalk.ASTInterpreter);
  649. smalltalk.addMethod(
  650. smalltalk.method({
  651. selector: "eval:",
  652. category: 'private',
  653. fn: function (aString){
  654. var self=this;
  655. var source,function_;
  656. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  657. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  658. return smalltalk.withContext(function($ctx1) {
  659. var $1,$2,$3;
  660. source=_st($String())._streamContents_((function(str){
  661. return smalltalk.withContext(function($ctx2) {
  662. _st(str)._nextPutAll_("(function(");
  663. _st(_st(_st(_st(self)._context())._locals())._keys())._do_separatedBy_((function(each){
  664. return smalltalk.withContext(function($ctx3) {
  665. return _st(str)._nextPutAll_(each);
  666. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  667. return smalltalk.withContext(function($ctx3) {
  668. return _st(str)._nextPutAll_(",");
  669. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  670. $1=str;
  671. _st($1)._nextPutAll_("){ return (function() {");
  672. _st($1)._nextPutAll_(aString);
  673. $2=_st($1)._nextPutAll_("})() })");
  674. return $2;
  675. }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1)})}));
  676. function_=_st(_st($Compiler())._new())._eval_(source);
  677. $3=_st(function_)._valueWithPossibleArguments_(_st(_st(_st(self)._context())._locals())._values());
  678. return $3;
  679. }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString,source:source,function_:function_},smalltalk.ASTInterpreter)})},
  680. args: ["aString"],
  681. 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",
  682. messageSends: ["streamContents:", "nextPutAll:", "do:separatedBy:", "keys", "locals", "context", "eval:", "new", "valueWithPossibleArguments:", "values"],
  683. referencedClasses: ["String", "Compiler"]
  684. }),
  685. smalltalk.ASTInterpreter);
  686. smalltalk.addMethod(
  687. smalltalk.method({
  688. selector: "initialize",
  689. category: 'initialization',
  690. fn: function (){
  691. var self=this;
  692. return smalltalk.withContext(function($ctx1) {
  693. smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  694. self["@shouldReturn"]=false;
  695. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ASTInterpreter)})},
  696. args: [],
  697. source: "initialize\x0a\x09super initialize.\x0a\x09shouldReturn := false",
  698. messageSends: ["initialize"],
  699. referencedClasses: []
  700. }),
  701. smalltalk.ASTInterpreter);
  702. smalltalk.addMethod(
  703. smalltalk.method({
  704. selector: "interpret:",
  705. category: 'interpreting',
  706. fn: function (aNode){
  707. var self=this;
  708. return smalltalk.withContext(function($ctx1) {
  709. self["@shouldReturn"]=false;
  710. _st(self)._interpret_continue_(aNode,(function(value){
  711. return smalltalk.withContext(function($ctx2) {
  712. self["@result"]=value;
  713. return self["@result"];
  714. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  715. return self}, function($ctx1) {$ctx1.fill(self,"interpret:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  716. args: ["aNode"],
  717. source: "interpret: aNode\x0a\x09shouldReturn := false.\x0a\x09self interpret: aNode continue: [ :value |\x0a\x09\x09result := value ]",
  718. messageSends: ["interpret:continue:"],
  719. referencedClasses: []
  720. }),
  721. smalltalk.ASTInterpreter);
  722. smalltalk.addMethod(
  723. smalltalk.method({
  724. selector: "interpret:continue:",
  725. category: 'interpreting',
  726. fn: function (aNode,aBlock){
  727. var self=this;
  728. return smalltalk.withContext(function($ctx1) {
  729. var $1,$2,$3;
  730. $1=self["@shouldReturn"];
  731. if(smalltalk.assert($1)){
  732. $2=self;
  733. return $2;
  734. };
  735. $3=_st(aNode)._isNode();
  736. if(smalltalk.assert($3)){
  737. self["@currentNode"]=aNode;
  738. self["@currentNode"];
  739. _st(self)._interpretNode_continue_(aNode,(function(value){
  740. return smalltalk.withContext(function($ctx2) {
  741. return _st(self)._continue_value_(aBlock,value);
  742. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  743. } else {
  744. _st(self)._continue_value_(aBlock,aNode);
  745. };
  746. return self}, function($ctx1) {$ctx1.fill(self,"interpret:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  747. args: ["aNode", "aBlock"],
  748. 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 ]",
  749. messageSends: ["ifTrue:", "ifTrue:ifFalse:", "interpretNode:continue:", "continue:value:", "isNode"],
  750. referencedClasses: []
  751. }),
  752. smalltalk.ASTInterpreter);
  753. smalltalk.addMethod(
  754. smalltalk.method({
  755. selector: "interpretAll:continue:",
  756. category: 'private',
  757. fn: function (aCollection,aBlock){
  758. var self=this;
  759. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  760. return smalltalk.withContext(function($ctx1) {
  761. _st(self)._interpretAll_continue_result_(aCollection,aBlock,_st($OrderedCollection())._new());
  762. return self}, function($ctx1) {$ctx1.fill(self,"interpretAll:continue:",{aCollection:aCollection,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  763. args: ["aCollection", "aBlock"],
  764. source: "interpretAll: aCollection continue: aBlock\x0a\x09self\x0a\x09\x09interpretAll: aCollection\x0a\x09\x09continue: aBlock\x0a\x09\x09result: OrderedCollection new",
  765. messageSends: ["interpretAll:continue:result:", "new"],
  766. referencedClasses: ["OrderedCollection"]
  767. }),
  768. smalltalk.ASTInterpreter);
  769. smalltalk.addMethod(
  770. smalltalk.method({
  771. selector: "interpretAll:continue:result:",
  772. category: 'private',
  773. fn: function (nodes,aBlock,aCollection){
  774. var self=this;
  775. return smalltalk.withContext(function($ctx1) {
  776. var $1;
  777. $1=_st(nodes)._isEmpty();
  778. if(smalltalk.assert($1)){
  779. _st(self)._continue_value_(aBlock,aCollection);
  780. } else {
  781. _st(self)._interpret_continue_(_st(nodes)._first(),(function(value){
  782. return smalltalk.withContext(function($ctx2) {
  783. return _st(self)._interpretAll_continue_result_(_st(nodes)._allButFirst(),aBlock,_st(aCollection).__comma([value]));
  784. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  785. };
  786. return self}, function($ctx1) {$ctx1.fill(self,"interpretAll:continue:result:",{nodes:nodes,aBlock:aBlock,aCollection:aCollection},smalltalk.ASTInterpreter)})},
  787. args: ["nodes", "aBlock", "aCollection"],
  788. 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 } ] ]",
  789. messageSends: ["ifTrue:ifFalse:", "continue:value:", "interpret:continue:", "first", "interpretAll:continue:result:", "allButFirst", ",", "isEmpty"],
  790. referencedClasses: []
  791. }),
  792. smalltalk.ASTInterpreter);
  793. smalltalk.addMethod(
  794. smalltalk.method({
  795. selector: "interpretAssignmentNode:continue:",
  796. category: 'interpreting',
  797. fn: function (aNode,aBlock){
  798. var self=this;
  799. return smalltalk.withContext(function($ctx1) {
  800. _st(self)._interpret_continue_(_st(aNode)._right(),(function(value){
  801. return smalltalk.withContext(function($ctx2) {
  802. return _st(self)._continue_value_(aBlock,_st(self)._assign_to_(_st(aNode)._left(),value));
  803. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  804. return self}, function($ctx1) {$ctx1.fill(self,"interpretAssignmentNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  805. args: ["aNode", "aBlock"],
  806. 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) ]",
  807. messageSends: ["interpret:continue:", "right", "continue:value:", "assign:to:", "left"],
  808. referencedClasses: []
  809. }),
  810. smalltalk.ASTInterpreter);
  811. smalltalk.addMethod(
  812. smalltalk.method({
  813. selector: "interpretBlockNode:continue:",
  814. category: 'interpreting',
  815. fn: function (aNode,aBlock){
  816. var self=this;
  817. return smalltalk.withContext(function($ctx1) {
  818. var $1,$2;
  819. _st(self)._continue_value_(aBlock,(function(){
  820. return smalltalk.withContext(function($ctx2) {
  821. return _st(self)._withBlockContext_((function(){
  822. return smalltalk.withContext(function($ctx3) {
  823. $1=self;
  824. _st($1)._interpret_(_st(_st(aNode)._nodes())._first());
  825. $2=_st($1)._result();
  826. return $2;
  827. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  828. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  829. return self}, function($ctx1) {$ctx1.fill(self,"interpretBlockNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  830. args: ["aNode", "aBlock"],
  831. 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 ] ]",
  832. messageSends: ["continue:value:", "withBlockContext:", "interpret:", "first", "nodes", "result"],
  833. referencedClasses: []
  834. }),
  835. smalltalk.ASTInterpreter);
  836. smalltalk.addMethod(
  837. smalltalk.method({
  838. selector: "interpretBlockSequenceNode:continue:",
  839. category: 'interpreting',
  840. fn: function (aNode,aBlock){
  841. var self=this;
  842. return smalltalk.withContext(function($ctx1) {
  843. _st(self)._interpretSequenceNode_continue_(aNode,aBlock);
  844. return self}, function($ctx1) {$ctx1.fill(self,"interpretBlockSequenceNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  845. args: ["aNode", "aBlock"],
  846. source: "interpretBlockSequenceNode: aNode continue: aBlock\x0a\x09self interpretSequenceNode: aNode continue: aBlock",
  847. messageSends: ["interpretSequenceNode:continue:"],
  848. referencedClasses: []
  849. }),
  850. smalltalk.ASTInterpreter);
  851. smalltalk.addMethod(
  852. smalltalk.method({
  853. selector: "interpretCascadeNode:continue:",
  854. category: 'interpreting',
  855. fn: function (aNode,aBlock){
  856. var self=this;
  857. return smalltalk.withContext(function($ctx1) {
  858. _st(self)._interpret_continue_(_st(aNode)._receiver(),(function(receiver){
  859. return smalltalk.withContext(function($ctx2) {
  860. _st(_st(aNode)._nodes())._do_((function(each){
  861. return smalltalk.withContext(function($ctx3) {
  862. return _st(each)._receiver_(receiver);
  863. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  864. return _st(self)._interpretAll_continue_(_st(_st(aNode)._nodes())._allButLast(),(function(){
  865. return smalltalk.withContext(function($ctx3) {
  866. return _st(self)._interpret_continue_(_st(_st(aNode)._nodes())._last(),(function(val){
  867. return smalltalk.withContext(function($ctx4) {
  868. return _st(self)._continue_value_(aBlock,val);
  869. }, function($ctx4) {$ctx4.fillBlock({val:val},$ctx1)})}));
  870. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  871. }, function($ctx2) {$ctx2.fillBlock({receiver:receiver},$ctx1)})}));
  872. return self}, function($ctx1) {$ctx1.fill(self,"interpretCascadeNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  873. args: ["aNode", "aBlock"],
  874. 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 ] ] ]",
  875. messageSends: ["interpret:continue:", "receiver", "do:", "receiver:", "nodes", "interpretAll:continue:", "allButLast", "last", "continue:value:"],
  876. referencedClasses: []
  877. }),
  878. smalltalk.ASTInterpreter);
  879. smalltalk.addMethod(
  880. smalltalk.method({
  881. selector: "interpretClassReferenceNode:continue:",
  882. category: 'interpreting',
  883. fn: function (aNode,aBlock){
  884. var self=this;
  885. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  886. return smalltalk.withContext(function($ctx1) {
  887. _st(self)._continue_value_(aBlock,_st(_st($Smalltalk())._current())._at_(_st(aNode)._value()));
  888. return self}, function($ctx1) {$ctx1.fill(self,"interpretClassReferenceNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  889. args: ["aNode", "aBlock"],
  890. source: "interpretClassReferenceNode: aNode continue: aBlock\x0a\x09self continue: aBlock value: (Smalltalk current at: aNode value)",
  891. messageSends: ["continue:value:", "at:", "value", "current"],
  892. referencedClasses: ["Smalltalk"]
  893. }),
  894. smalltalk.ASTInterpreter);
  895. smalltalk.addMethod(
  896. smalltalk.method({
  897. selector: "interpretDynamicArrayNode:continue:",
  898. category: 'interpreting',
  899. fn: function (aNode,aBlock){
  900. var self=this;
  901. return smalltalk.withContext(function($ctx1) {
  902. _st(self)._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  903. return smalltalk.withContext(function($ctx2) {
  904. return _st(self)._continue_value_(aBlock,array);
  905. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  906. return self}, function($ctx1) {$ctx1.fill(self,"interpretDynamicArrayNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  907. args: ["aNode", "aBlock"],
  908. 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 ]",
  909. messageSends: ["interpretAll:continue:", "nodes", "continue:value:"],
  910. referencedClasses: []
  911. }),
  912. smalltalk.ASTInterpreter);
  913. smalltalk.addMethod(
  914. smalltalk.method({
  915. selector: "interpretDynamicDictionaryNode:continue:",
  916. category: 'interpreting',
  917. fn: function (aNode,aBlock){
  918. var self=this;
  919. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  920. return smalltalk.withContext(function($ctx1) {
  921. _st(self)._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  922. var hashedCollection;
  923. return smalltalk.withContext(function($ctx2) {
  924. hashedCollection=_st($HashedCollection())._new();
  925. hashedCollection;
  926. _st(array)._do_((function(each){
  927. return smalltalk.withContext(function($ctx3) {
  928. return _st(hashedCollection)._add_(each);
  929. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  930. return _st(self)._continue_value_(aBlock,hashedCollection);
  931. }, function($ctx2) {$ctx2.fillBlock({array:array,hashedCollection:hashedCollection},$ctx1)})}));
  932. return self}, function($ctx1) {$ctx1.fill(self,"interpretDynamicDictionaryNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  933. args: ["aNode", "aBlock"],
  934. 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 ]",
  935. messageSends: ["interpretAll:continue:", "nodes", "new", "do:", "add:", "continue:value:"],
  936. referencedClasses: ["HashedCollection"]
  937. }),
  938. smalltalk.ASTInterpreter);
  939. smalltalk.addMethod(
  940. smalltalk.method({
  941. selector: "interpretJSStatementNode:continue:",
  942. category: 'interpreting',
  943. fn: function (aNode,aBlock){
  944. var self=this;
  945. return smalltalk.withContext(function($ctx1) {
  946. self["@shouldReturn"]=true;
  947. _st(self)._continue_value_(aBlock,_st(self)._eval_(_st(aNode)._source()));
  948. return self}, function($ctx1) {$ctx1.fill(self,"interpretJSStatementNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  949. args: ["aNode", "aBlock"],
  950. source: "interpretJSStatementNode: aNode continue: aBlock\x0a\x09shouldReturn := true.\x0a\x09self continue: aBlock value: (self eval: aNode source)",
  951. messageSends: ["continue:value:", "eval:", "source"],
  952. referencedClasses: []
  953. }),
  954. smalltalk.ASTInterpreter);
  955. smalltalk.addMethod(
  956. smalltalk.method({
  957. selector: "interpretMethodNode:continue:",
  958. category: 'interpreting',
  959. fn: function (aNode,aBlock){
  960. var self=this;
  961. return smalltalk.withContext(function($ctx1) {
  962. _st(self)._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  963. return smalltalk.withContext(function($ctx2) {
  964. return _st(self)._continue_value_(aBlock,_st(array)._first());
  965. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  966. return self}, function($ctx1) {$ctx1.fill(self,"interpretMethodNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  967. args: ["aNode", "aBlock"],
  968. source: "interpretMethodNode: aNode continue: aBlock\x0a\x09self interpretAll: aNode nodes continue: [ :array |\x0a\x09\x09self continue: aBlock value: array first ]",
  969. messageSends: ["interpretAll:continue:", "nodes", "continue:value:", "first"],
  970. referencedClasses: []
  971. }),
  972. smalltalk.ASTInterpreter);
  973. smalltalk.addMethod(
  974. smalltalk.method({
  975. selector: "interpretNode:continue:",
  976. category: 'interpreting',
  977. fn: function (aNode,aBlock){
  978. var self=this;
  979. return smalltalk.withContext(function($ctx1) {
  980. _st(aNode)._interpreter_continue_(self,aBlock);
  981. return self}, function($ctx1) {$ctx1.fill(self,"interpretNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  982. args: ["aNode", "aBlock"],
  983. source: "interpretNode: aNode continue: aBlock\x0a\x09aNode interpreter: self continue: aBlock",
  984. messageSends: ["interpreter:continue:"],
  985. referencedClasses: []
  986. }),
  987. smalltalk.ASTInterpreter);
  988. smalltalk.addMethod(
  989. smalltalk.method({
  990. selector: "interpretReturnNode:continue:",
  991. category: 'interpreting',
  992. fn: function (aNode,aBlock){
  993. var self=this;
  994. return smalltalk.withContext(function($ctx1) {
  995. _st(self)._interpret_continue_(_st(_st(aNode)._nodes())._first(),(function(value){
  996. return smalltalk.withContext(function($ctx2) {
  997. self["@shouldReturn"]=true;
  998. self["@shouldReturn"];
  999. return _st(self)._continue_value_(aBlock,value);
  1000. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  1001. return self}, function($ctx1) {$ctx1.fill(self,"interpretReturnNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1002. args: ["aNode", "aBlock"],
  1003. source: "interpretReturnNode: aNode continue: aBlock\x0a\x09self interpret: aNode nodes first continue: [ :value |\x0a\x09\x09shouldReturn := true.\x0a\x09\x09self continue: aBlock value: value ]",
  1004. messageSends: ["interpret:continue:", "first", "nodes", "continue:value:"],
  1005. referencedClasses: []
  1006. }),
  1007. smalltalk.ASTInterpreter);
  1008. smalltalk.addMethod(
  1009. smalltalk.method({
  1010. selector: "interpretSendNode:continue:",
  1011. category: 'interpreting',
  1012. fn: function (aNode,aBlock){
  1013. var self=this;
  1014. return smalltalk.withContext(function($ctx1) {
  1015. _st(self)._interpret_continue_(_st(aNode)._receiver(),(function(receiver){
  1016. return smalltalk.withContext(function($ctx2) {
  1017. return _st(self)._interpretAll_continue_(_st(aNode)._arguments(),(function(args){
  1018. return smalltalk.withContext(function($ctx3) {
  1019. return _st(self)._messageFromSendNode_arguments_do_(aNode,args,(function(message){
  1020. return smalltalk.withContext(function($ctx4) {
  1021. _st(_st(self)._context())._pc_(_st(_st(_st(self)._context())._pc()).__plus((1)));
  1022. return _st(self)._continue_value_(aBlock,_st(self)._sendMessage_to_superSend_(message,receiver,_st(aNode)._superSend()));
  1023. }, function($ctx4) {$ctx4.fillBlock({message:message},$ctx1)})}));
  1024. }, function($ctx3) {$ctx3.fillBlock({args:args},$ctx1)})}));
  1025. }, function($ctx2) {$ctx2.fillBlock({receiver:receiver},$ctx1)})}));
  1026. return self}, function($ctx1) {$ctx1.fill(self,"interpretSendNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1027. args: ["aNode", "aBlock"],
  1028. 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) ] ] ]",
  1029. messageSends: ["interpret:continue:", "receiver", "interpretAll:continue:", "arguments", "messageFromSendNode:arguments:do:", "pc:", "+", "pc", "context", "continue:value:", "sendMessage:to:superSend:", "superSend"],
  1030. referencedClasses: []
  1031. }),
  1032. smalltalk.ASTInterpreter);
  1033. smalltalk.addMethod(
  1034. smalltalk.method({
  1035. selector: "interpretSequenceNode:continue:",
  1036. category: 'interpreting',
  1037. fn: function (aNode,aBlock){
  1038. var self=this;
  1039. return smalltalk.withContext(function($ctx1) {
  1040. _st(self)._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  1041. return smalltalk.withContext(function($ctx2) {
  1042. return _st(self)._continue_value_(aBlock,_st(array)._last());
  1043. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  1044. return self}, function($ctx1) {$ctx1.fill(self,"interpretSequenceNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1045. args: ["aNode", "aBlock"],
  1046. source: "interpretSequenceNode: aNode continue: aBlock\x0a\x09self interpretAll: aNode nodes continue: [ :array |\x0a\x09\x09self continue: aBlock value: array last ]",
  1047. messageSends: ["interpretAll:continue:", "nodes", "continue:value:", "last"],
  1048. referencedClasses: []
  1049. }),
  1050. smalltalk.ASTInterpreter);
  1051. smalltalk.addMethod(
  1052. smalltalk.method({
  1053. selector: "interpretValueNode:continue:",
  1054. category: 'interpreting',
  1055. fn: function (aNode,aBlock){
  1056. var self=this;
  1057. return smalltalk.withContext(function($ctx1) {
  1058. _st(self)._continue_value_(aBlock,_st(aNode)._value());
  1059. return self}, function($ctx1) {$ctx1.fill(self,"interpretValueNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1060. args: ["aNode", "aBlock"],
  1061. source: "interpretValueNode: aNode continue: aBlock\x0a\x09self continue: aBlock value: aNode value",
  1062. messageSends: ["continue:value:", "value"],
  1063. referencedClasses: []
  1064. }),
  1065. smalltalk.ASTInterpreter);
  1066. smalltalk.addMethod(
  1067. smalltalk.method({
  1068. selector: "interpretVariableNode:continue:",
  1069. category: 'interpreting',
  1070. fn: function (aNode,aBlock){
  1071. var self=this;
  1072. return smalltalk.withContext(function($ctx1) {
  1073. var $1,$2,$4,$3;
  1074. $1=self;
  1075. $2=aBlock;
  1076. $4=_st(_st(aNode)._binding())._isInstanceVar();
  1077. if(smalltalk.assert($4)){
  1078. $3=_st(_st(_st(self)._context())._receiver())._instVarAt_(_st(aNode)._value());
  1079. } else {
  1080. $3=_st(_st(self)._context())._localAt_(_st(aNode)._value());
  1081. };
  1082. _st($1)._continue_value_($2,$3);
  1083. return self}, function($ctx1) {$ctx1.fill(self,"interpretVariableNode:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1084. args: ["aNode", "aBlock"],
  1085. 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 ])",
  1086. messageSends: ["continue:value:", "ifTrue:ifFalse:", "instVarAt:", "value", "receiver", "context", "localAt:", "isInstanceVar", "binding"],
  1087. referencedClasses: []
  1088. }),
  1089. smalltalk.ASTInterpreter);
  1090. smalltalk.addMethod(
  1091. smalltalk.method({
  1092. selector: "messageFromSendNode:arguments:do:",
  1093. category: 'private',
  1094. fn: function (aSendNode,aCollection,aBlock){
  1095. var self=this;
  1096. function $Message(){return smalltalk.Message||(typeof Message=="undefined"?nil:Message)}
  1097. return smalltalk.withContext(function($ctx1) {
  1098. var $1,$2;
  1099. $1=_st($Message())._new();
  1100. _st($1)._selector_(_st(aSendNode)._selector());
  1101. _st($1)._arguments_(aCollection);
  1102. $2=_st($1)._yourself();
  1103. _st(self)._continue_value_(aBlock,$2);
  1104. return self}, function($ctx1) {$ctx1.fill(self,"messageFromSendNode:arguments:do:",{aSendNode:aSendNode,aCollection:aCollection,aBlock:aBlock},smalltalk.ASTInterpreter)})},
  1105. args: ["aSendNode", "aCollection", "aBlock"],
  1106. 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)",
  1107. messageSends: ["continue:value:", "selector:", "selector", "new", "arguments:", "yourself"],
  1108. referencedClasses: ["Message"]
  1109. }),
  1110. smalltalk.ASTInterpreter);
  1111. smalltalk.addMethod(
  1112. smalltalk.method({
  1113. selector: "result",
  1114. category: 'accessing',
  1115. fn: function (){
  1116. var self=this;
  1117. return smalltalk.withContext(function($ctx1) {
  1118. var $1;
  1119. $1=self["@result"];
  1120. return $1;
  1121. }, function($ctx1) {$ctx1.fill(self,"result",{},smalltalk.ASTInterpreter)})},
  1122. args: [],
  1123. source: "result\x0a\x09^ result",
  1124. messageSends: [],
  1125. referencedClasses: []
  1126. }),
  1127. smalltalk.ASTInterpreter);
  1128. smalltalk.addMethod(
  1129. smalltalk.method({
  1130. selector: "sendMessage:to:superSend:",
  1131. category: 'private',
  1132. fn: function (aMessage,anObject,aBoolean){
  1133. var self=this;
  1134. var method;
  1135. return smalltalk.withContext(function($ctx1) {
  1136. var $1,$2,$3,$4,$5,$6;
  1137. var $early={};
  1138. try {
  1139. $1=aBoolean;
  1140. if(! smalltalk.assert($1)){
  1141. $2=_st(aMessage)._sendTo_(anObject);
  1142. return $2;
  1143. };
  1144. $3=_st(_st(anObject)._class())._superclass();
  1145. if(($receiver = $3) == nil || $receiver == undefined){
  1146. $4=_st(self)._messageNotUnderstood_receiver_(aMessage,anObject);
  1147. return $4;
  1148. } else {
  1149. $3;
  1150. };
  1151. method=_st(_st(_st(_st(anObject)._class())._superclass())._methodDictionary())._at_ifAbsent_(_st(aMessage)._selector(),(function(){
  1152. return smalltalk.withContext(function($ctx2) {
  1153. $5=_st(self)._messageNotUnderstood_receiver_(aMessage,anObject);
  1154. throw $early=[$5];
  1155. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1156. $6=_st(_st(method)._fn())._applyTo_arguments_(anObject,_st(aMessage)._arguments());
  1157. return $6;
  1158. }
  1159. catch(e) {if(e===$early)return e[0]; throw e}
  1160. }, function($ctx1) {$ctx1.fill(self,"sendMessage:to:superSend:",{aMessage:aMessage,anObject:anObject,aBoolean:aBoolean,method:method},smalltalk.ASTInterpreter)})},
  1161. args: ["aMessage", "anObject", "aBoolean"],
  1162. 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",
  1163. messageSends: ["ifFalse:", "sendTo:", "ifNil:", "messageNotUnderstood:receiver:", "superclass", "class", "at:ifAbsent:", "selector", "methodDictionary", "applyTo:arguments:", "arguments", "fn"],
  1164. referencedClasses: []
  1165. }),
  1166. smalltalk.ASTInterpreter);
  1167. smalltalk.addMethod(
  1168. smalltalk.method({
  1169. selector: "shouldReturn",
  1170. category: 'testing',
  1171. fn: function (){
  1172. var self=this;
  1173. return smalltalk.withContext(function($ctx1) {
  1174. var $2,$1;
  1175. $2=self["@shouldReturn"];
  1176. if(($receiver = $2) == nil || $receiver == undefined){
  1177. $1=false;
  1178. } else {
  1179. $1=$2;
  1180. };
  1181. return $1;
  1182. }, function($ctx1) {$ctx1.fill(self,"shouldReturn",{},smalltalk.ASTInterpreter)})},
  1183. args: [],
  1184. source: "shouldReturn\x0a\x09^ shouldReturn ifNil: [ false ]",
  1185. messageSends: ["ifNil:"],
  1186. referencedClasses: []
  1187. }),
  1188. smalltalk.ASTInterpreter);
  1189. smalltalk.addMethod(
  1190. smalltalk.method({
  1191. selector: "withBlockContext:",
  1192. category: 'private',
  1193. fn: function (aBlock){
  1194. var self=this;
  1195. var blockResult;
  1196. function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
  1197. return smalltalk.withContext(function($ctx1) {
  1198. var $1,$2,$3;
  1199. $1=_st($AIContext())._new();
  1200. _st($1)._outerContext_(_st(self)._context());
  1201. $2=_st($1)._yourself();
  1202. _st(self)._context_($2);
  1203. blockResult=_st(aBlock)._value();
  1204. _st(self)._context_(_st(_st(self)._context())._outerContext());
  1205. $3=blockResult;
  1206. return $3;
  1207. }, function($ctx1) {$ctx1.fill(self,"withBlockContext:",{aBlock:aBlock,blockResult:blockResult},smalltalk.ASTInterpreter)})},
  1208. args: ["aBlock"],
  1209. 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",
  1210. messageSends: ["context:", "outerContext:", "context", "new", "yourself", "value", "outerContext"],
  1211. referencedClasses: ["AIContext"]
  1212. }),
  1213. smalltalk.ASTInterpreter);
  1214. smalltalk.addClass('ASTSteppingInterpreter', smalltalk.ASTInterpreter, ['continuation', 'nextNode'], 'Compiler-Interpreter');
  1215. smalltalk.ASTSteppingInterpreter.comment="ASTSteppingInterpreter is an interpreter with stepping capabilities.\x0aUse `#step` to actually interpret the next node.\x0a\x0aUsage 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\x09debugger step; step.\x0a\x09debugger step; step.\x0a\x09debugger result.\x22Answers 1\x22\x0a\x09debugger step.\x0a\x09debugger result. \x22Answers 3\x22\x0a\x09debugger step.\x0a\x09debugger result. \x22Answers 7\x22"
  1216. smalltalk.addMethod(
  1217. smalltalk.method({
  1218. selector: "atEnd",
  1219. category: 'testing',
  1220. fn: function (){
  1221. var self=this;
  1222. return smalltalk.withContext(function($ctx1) {
  1223. var $1;
  1224. $1=_st(_st(self)._shouldReturn())._or_((function(){
  1225. return smalltalk.withContext(function($ctx2) {
  1226. return _st(_st(self)._nextNode()).__eq_eq(_st(self)._currentNode());
  1227. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1228. return $1;
  1229. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.ASTSteppingInterpreter)})},
  1230. args: [],
  1231. source: "atEnd\x0a\x09^ self shouldReturn or: [ self nextNode == self currentNode ]",
  1232. messageSends: ["or:", "==", "currentNode", "nextNode", "shouldReturn"],
  1233. referencedClasses: []
  1234. }),
  1235. smalltalk.ASTSteppingInterpreter);
  1236. smalltalk.addMethod(
  1237. smalltalk.method({
  1238. selector: "initialize",
  1239. category: 'initialization',
  1240. fn: function (){
  1241. var self=this;
  1242. return smalltalk.withContext(function($ctx1) {
  1243. smalltalk.ASTInterpreter.fn.prototype._initialize.apply(_st(self), []);
  1244. self["@continuation"]=(function(){
  1245. return smalltalk.withContext(function($ctx2) {
  1246. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1247. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ASTSteppingInterpreter)})},
  1248. args: [],
  1249. source: "initialize\x0a\x09super initialize.\x0a\x09continuation := []",
  1250. messageSends: ["initialize"],
  1251. referencedClasses: []
  1252. }),
  1253. smalltalk.ASTSteppingInterpreter);
  1254. smalltalk.addMethod(
  1255. smalltalk.method({
  1256. selector: "interpret:continue:",
  1257. category: 'interpreting',
  1258. fn: function (aNode,aBlock){
  1259. var self=this;
  1260. return smalltalk.withContext(function($ctx1) {
  1261. self["@nextNode"]=aNode;
  1262. self["@continuation"]=(function(){
  1263. return smalltalk.withContext(function($ctx2) {
  1264. return smalltalk.ASTInterpreter.fn.prototype._interpret_continue_.apply(_st(self), [aNode,aBlock]);
  1265. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1266. return self}, function($ctx1) {$ctx1.fill(self,"interpret:continue:",{aNode:aNode,aBlock:aBlock},smalltalk.ASTSteppingInterpreter)})},
  1267. args: ["aNode", "aBlock"],
  1268. source: "interpret: aNode continue: aBlock\x0a\x09nextNode := aNode.\x0a\x09continuation := [\x0a\x09\x09super interpret: aNode continue: aBlock ]",
  1269. messageSends: ["interpret:continue:"],
  1270. referencedClasses: []
  1271. }),
  1272. smalltalk.ASTSteppingInterpreter);
  1273. smalltalk.addMethod(
  1274. smalltalk.method({
  1275. selector: "nextNode",
  1276. category: 'accessing',
  1277. fn: function (){
  1278. var self=this;
  1279. return smalltalk.withContext(function($ctx1) {
  1280. var $1;
  1281. $1=self["@nextNode"];
  1282. return $1;
  1283. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.ASTSteppingInterpreter)})},
  1284. args: [],
  1285. source: "nextNode\x0a\x09^ nextNode",
  1286. messageSends: [],
  1287. referencedClasses: []
  1288. }),
  1289. smalltalk.ASTSteppingInterpreter);
  1290. smalltalk.addMethod(
  1291. smalltalk.method({
  1292. selector: "step",
  1293. category: 'stepping',
  1294. fn: function (){
  1295. var self=this;
  1296. return smalltalk.withContext(function($ctx1) {
  1297. _st(self["@continuation"])._value();
  1298. return self}, function($ctx1) {$ctx1.fill(self,"step",{},smalltalk.ASTSteppingInterpreter)})},
  1299. args: [],
  1300. source: "step\x0a\x09continuation value",
  1301. messageSends: ["value"],
  1302. referencedClasses: []
  1303. }),
  1304. smalltalk.ASTSteppingInterpreter);
  1305. smalltalk.addMethod(
  1306. smalltalk.method({
  1307. selector: "interpreter:continue:",
  1308. category: '*Compiler-Interpreter',
  1309. fn: function (anInterpreter,aBlock){
  1310. var self=this;
  1311. return smalltalk.withContext(function($ctx1) {
  1312. var $1;
  1313. $1=_st(anInterpreter)._interpretNode_continue_(self,aBlock);
  1314. return $1;
  1315. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.Node)})},
  1316. args: ["anInterpreter", "aBlock"],
  1317. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretNode: self continue: aBlock",
  1318. messageSends: ["interpretNode:continue:"],
  1319. referencedClasses: []
  1320. }),
  1321. smalltalk.Node);
  1322. smalltalk.addMethod(
  1323. smalltalk.method({
  1324. selector: "isSteppingNode",
  1325. category: '*Compiler-Interpreter',
  1326. fn: function (){
  1327. var self=this;
  1328. return smalltalk.withContext(function($ctx1) {
  1329. return false;
  1330. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.Node)})},
  1331. args: [],
  1332. source: "isSteppingNode\x0a\x09^ false",
  1333. messageSends: [],
  1334. referencedClasses: []
  1335. }),
  1336. smalltalk.Node);
  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)._interpretAssignmentNode_continue_(self,aBlock);
  1346. return $1;
  1347. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.AssignmentNode)})},
  1348. args: ["anInterpreter", "aBlock"],
  1349. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretAssignmentNode: self continue: aBlock",
  1350. messageSends: ["interpretAssignmentNode:continue:"],
  1351. referencedClasses: []
  1352. }),
  1353. smalltalk.AssignmentNode);
  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 true;
  1362. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.AssignmentNode)})},
  1363. args: [],
  1364. source: "isSteppingNode\x0a\x09^ true",
  1365. messageSends: [],
  1366. referencedClasses: []
  1367. }),
  1368. smalltalk.AssignmentNode);
  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)._interpretBlockNode_continue_(self,aBlock);
  1378. return $1;
  1379. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.BlockNode)})},
  1380. args: ["anInterpreter", "aBlock"],
  1381. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretBlockNode: self continue: aBlock",
  1382. messageSends: ["interpretBlockNode:continue:"],
  1383. referencedClasses: []
  1384. }),
  1385. smalltalk.BlockNode);
  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.BlockNode)})},
  1395. args: [],
  1396. source: "isSteppingNode\x0a\x09^ true",
  1397. messageSends: [],
  1398. referencedClasses: []
  1399. }),
  1400. smalltalk.BlockNode);
  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)._interpretCascadeNode_continue_(self,aBlock);
  1410. return $1;
  1411. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.CascadeNode)})},
  1412. args: ["anInterpreter", "aBlock"],
  1413. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretCascadeNode: self continue: aBlock",
  1414. messageSends: ["interpretCascadeNode:continue:"],
  1415. referencedClasses: []
  1416. }),
  1417. smalltalk.CascadeNode);
  1418. smalltalk.addMethod(
  1419. smalltalk.method({
  1420. selector: "interpreter:continue:",
  1421. category: '*Compiler-Interpreter',
  1422. fn: function (anInterpreter,aBlock){
  1423. var self=this;
  1424. return smalltalk.withContext(function($ctx1) {
  1425. var $1;
  1426. $1=_st(anInterpreter)._interpretDynamicArrayNode_continue_(self,aBlock);
  1427. return $1;
  1428. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.DynamicArrayNode)})},
  1429. args: ["anInterpreter", "aBlock"],
  1430. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretDynamicArrayNode: self continue: aBlock",
  1431. messageSends: ["interpretDynamicArrayNode:continue:"],
  1432. referencedClasses: []
  1433. }),
  1434. smalltalk.DynamicArrayNode);
  1435. smalltalk.addMethod(
  1436. smalltalk.method({
  1437. selector: "isSteppingNode",
  1438. category: '*Compiler-Interpreter',
  1439. fn: function (){
  1440. var self=this;
  1441. return smalltalk.withContext(function($ctx1) {
  1442. return true;
  1443. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.DynamicArrayNode)})},
  1444. args: [],
  1445. source: "isSteppingNode\x0a\x09^ true",
  1446. messageSends: [],
  1447. referencedClasses: []
  1448. }),
  1449. smalltalk.DynamicArrayNode);
  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)._interpretDynamicDictionaryNode_continue_(self,aBlock);
  1459. return $1;
  1460. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.DynamicDictionaryNode)})},
  1461. args: ["anInterpreter", "aBlock"],
  1462. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretDynamicDictionaryNode: self continue: aBlock",
  1463. messageSends: ["interpretDynamicDictionaryNode:continue:"],
  1464. referencedClasses: []
  1465. }),
  1466. smalltalk.DynamicDictionaryNode);
  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.DynamicDictionaryNode)})},
  1476. args: [],
  1477. source: "isSteppingNode\x0a\x09^ true",
  1478. messageSends: [],
  1479. referencedClasses: []
  1480. }),
  1481. smalltalk.DynamicDictionaryNode);
  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)._interpretJSStatementNode_continue_(self,aBlock);
  1491. return $1;
  1492. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.JSStatementNode)})},
  1493. args: ["anInterpreter", "aBlock"],
  1494. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretJSStatementNode: self continue: aBlock",
  1495. messageSends: ["interpretJSStatementNode:continue:"],
  1496. referencedClasses: []
  1497. }),
  1498. smalltalk.JSStatementNode);
  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.JSStatementNode)})},
  1508. args: [],
  1509. source: "isSteppingNode\x0a\x09^ true",
  1510. messageSends: [],
  1511. referencedClasses: []
  1512. }),
  1513. smalltalk.JSStatementNode);
  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)._interpretMethodNode_continue_(self,aBlock);
  1523. return $1;
  1524. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.MethodNode)})},
  1525. args: ["anInterpreter", "aBlock"],
  1526. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretMethodNode: self continue: aBlock",
  1527. messageSends: ["interpretMethodNode:continue:"],
  1528. referencedClasses: []
  1529. }),
  1530. smalltalk.MethodNode);
  1531. smalltalk.addMethod(
  1532. smalltalk.method({
  1533. selector: "interpreter:continue:",
  1534. category: '*Compiler-Interpreter',
  1535. fn: function (anInterpreter,aBlock){
  1536. var self=this;
  1537. return smalltalk.withContext(function($ctx1) {
  1538. var $1;
  1539. $1=_st(anInterpreter)._interpretReturnNode_continue_(self,aBlock);
  1540. return $1;
  1541. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.ReturnNode)})},
  1542. args: ["anInterpreter", "aBlock"],
  1543. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretReturnNode: self continue: aBlock",
  1544. messageSends: ["interpretReturnNode:continue:"],
  1545. referencedClasses: []
  1546. }),
  1547. smalltalk.ReturnNode);
  1548. smalltalk.addMethod(
  1549. smalltalk.method({
  1550. selector: "interpreter:continue:",
  1551. category: '*Compiler-Interpreter',
  1552. fn: function (anInterpreter,aBlock){
  1553. var self=this;
  1554. return smalltalk.withContext(function($ctx1) {
  1555. var $1;
  1556. $1=_st(anInterpreter)._interpretSendNode_continue_(self,aBlock);
  1557. return $1;
  1558. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.SendNode)})},
  1559. args: ["anInterpreter", "aBlock"],
  1560. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretSendNode: self continue: aBlock",
  1561. messageSends: ["interpretSendNode:continue:"],
  1562. referencedClasses: []
  1563. }),
  1564. smalltalk.SendNode);
  1565. smalltalk.addMethod(
  1566. smalltalk.method({
  1567. selector: "isSteppingNode",
  1568. category: '*Compiler-Interpreter',
  1569. fn: function (){
  1570. var self=this;
  1571. return smalltalk.withContext(function($ctx1) {
  1572. return true;
  1573. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.SendNode)})},
  1574. args: [],
  1575. source: "isSteppingNode\x0a\x09^ true",
  1576. messageSends: [],
  1577. referencedClasses: []
  1578. }),
  1579. smalltalk.SendNode);
  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)._interpretSequenceNode_continue_(self,aBlock);
  1589. return $1;
  1590. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.SequenceNode)})},
  1591. args: ["anInterpreter", "aBlock"],
  1592. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretSequenceNode: self continue: aBlock",
  1593. messageSends: ["interpretSequenceNode:continue:"],
  1594. referencedClasses: []
  1595. }),
  1596. smalltalk.SequenceNode);
  1597. smalltalk.addMethod(
  1598. smalltalk.method({
  1599. selector: "interpreter:continue:",
  1600. category: '*Compiler-Interpreter',
  1601. fn: function (anInterpreter,aBlock){
  1602. var self=this;
  1603. return smalltalk.withContext(function($ctx1) {
  1604. var $1;
  1605. $1=_st(anInterpreter)._interpretBlockSequenceNode_continue_(self,aBlock);
  1606. return $1;
  1607. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.BlockSequenceNode)})},
  1608. args: ["anInterpreter", "aBlock"],
  1609. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretBlockSequenceNode: self continue: aBlock",
  1610. messageSends: ["interpretBlockSequenceNode:continue:"],
  1611. referencedClasses: []
  1612. }),
  1613. smalltalk.BlockSequenceNode);
  1614. smalltalk.addMethod(
  1615. smalltalk.method({
  1616. selector: "interpreter:continue:",
  1617. category: '*Compiler-Interpreter',
  1618. fn: function (anInterpreter,aBlock){
  1619. var self=this;
  1620. return smalltalk.withContext(function($ctx1) {
  1621. var $1;
  1622. $1=_st(anInterpreter)._interpretValueNode_continue_(self,aBlock);
  1623. return $1;
  1624. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.ValueNode)})},
  1625. args: ["anInterpreter", "aBlock"],
  1626. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretValueNode: self continue: aBlock",
  1627. messageSends: ["interpretValueNode:continue:"],
  1628. referencedClasses: []
  1629. }),
  1630. smalltalk.ValueNode);
  1631. smalltalk.addMethod(
  1632. smalltalk.method({
  1633. selector: "interpreter:continue:",
  1634. category: '*Compiler-Interpreter',
  1635. fn: function (anInterpreter,aBlock){
  1636. var self=this;
  1637. return smalltalk.withContext(function($ctx1) {
  1638. var $1;
  1639. $1=_st(anInterpreter)._interpretVariableNode_continue_(self,aBlock);
  1640. return $1;
  1641. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.VariableNode)})},
  1642. args: ["anInterpreter", "aBlock"],
  1643. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretVariableNode: self continue: aBlock",
  1644. messageSends: ["interpretVariableNode:continue:"],
  1645. referencedClasses: []
  1646. }),
  1647. smalltalk.VariableNode);
  1648. smalltalk.addMethod(
  1649. smalltalk.method({
  1650. selector: "interpreter:continue:",
  1651. category: '*Compiler-Interpreter',
  1652. fn: function (anInterpreter,aBlock){
  1653. var self=this;
  1654. return smalltalk.withContext(function($ctx1) {
  1655. var $1;
  1656. $1=_st(anInterpreter)._interpretClassReferenceNode_continue_(self,aBlock);
  1657. return $1;
  1658. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock},smalltalk.ClassReferenceNode)})},
  1659. args: ["anInterpreter", "aBlock"],
  1660. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretClassReferenceNode: self continue: aBlock",
  1661. messageSends: ["interpretClassReferenceNode:continue:"],
  1662. referencedClasses: []
  1663. }),
  1664. smalltalk.ClassReferenceNode);