Compiler-Interpreter.js 70 KB

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