Compiler-Interpreter.js 65 KB

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