Compiler-Interpreter.js 64 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613
  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 (aContext){
  292. var self=this;
  293. return smalltalk.withContext(function($ctx1) { self["@context"]=_st((smalltalk.AIContext || AIContext))._new();
  294. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext}, smalltalk.ASTDebugger)})},
  295. args: ["aContext"],
  296. source: "context: aContext\x0a\x09context := AIContext new.",
  297. messageSends: ["new"],
  298. referencedClasses: ["AIContext"]
  299. }),
  300. smalltalk.ASTDebugger);
  301. smalltalk.addMethod(
  302. "_defaultInterpreterClass",
  303. smalltalk.method({
  304. selector: "defaultInterpreterClass",
  305. category: 'defaults',
  306. fn: function (){
  307. var self=this;
  308. return smalltalk.withContext(function($ctx1) { var $1;
  309. $1=(smalltalk.ASTSteppingInterpreter || ASTSteppingInterpreter);
  310. return $1;
  311. }, function($ctx1) {$ctx1.fill(self,"defaultInterpreterClass",{}, smalltalk.ASTDebugger)})},
  312. args: [],
  313. source: "defaultInterpreterClass\x0a\x09^ ASTSteppingInterpreter",
  314. messageSends: [],
  315. referencedClasses: ["ASTSteppingInterpreter"]
  316. }),
  317. smalltalk.ASTDebugger);
  318. smalltalk.addMethod(
  319. "_initializeInterpreter",
  320. smalltalk.method({
  321. selector: "initializeInterpreter",
  322. category: 'initialization',
  323. fn: function (){
  324. var self=this;
  325. return smalltalk.withContext(function($ctx1) { _st(_st(self)._interpreter())._interpret_(_st(_st(_st(self)._buildAST())._nodes())._first());
  326. return self}, function($ctx1) {$ctx1.fill(self,"initializeInterpreter",{}, smalltalk.ASTDebugger)})},
  327. args: [],
  328. source: "initializeInterpreter\x0a\x09self interpreter interpret: self buildAST nodes first",
  329. messageSends: ["interpret:", "first", "nodes", "buildAST", "interpreter"],
  330. referencedClasses: []
  331. }),
  332. smalltalk.ASTDebugger);
  333. smalltalk.addMethod(
  334. "_initializeWithContext_",
  335. smalltalk.method({
  336. selector: "initializeWithContext:",
  337. category: 'initialization',
  338. fn: function (aMethodContext){
  339. var self=this;
  340. return smalltalk.withContext(function($ctx1) { _st(self)._context_fromMethodContext_((smalltalk.IAContext || IAContext),aMethodContext);
  341. _st(self)._initializeInterpreter();
  342. return self}, function($ctx1) {$ctx1.fill(self,"initializeWithContext:",{aMethodContext:aMethodContext}, smalltalk.ASTDebugger)})},
  343. args: ["aMethodContext"],
  344. source: "initializeWithContext: aMethodContext\x0a\x09\x22TODO: do we need to handle block contexts?\x22\x0a \x0a self context: IAContext fromMethodContext: aMethodContext.\x0a self initializeInterpreter",
  345. messageSends: ["context:fromMethodContext:", "initializeInterpreter"],
  346. referencedClasses: ["IAContext"]
  347. }),
  348. smalltalk.ASTDebugger);
  349. smalltalk.addMethod(
  350. "_interpreter",
  351. smalltalk.method({
  352. selector: "interpreter",
  353. category: 'accessing',
  354. fn: function (){
  355. var self=this;
  356. return smalltalk.withContext(function($ctx1) { var $2,$1;
  357. $2=self["@interpreter"];
  358. if(($receiver = $2) == nil || $receiver == undefined){
  359. self["@interpreter"]=_st(_st(self)._defaultInterpreterClass())._new();
  360. $1=self["@interpreter"];
  361. } else {
  362. $1=$2;
  363. };
  364. return $1;
  365. }, function($ctx1) {$ctx1.fill(self,"interpreter",{}, smalltalk.ASTDebugger)})},
  366. args: [],
  367. source: "interpreter\x0a\x09^ interpreter ifNil: [ interpreter := self defaultInterpreterClass new ]",
  368. messageSends: ["ifNil:", "new", "defaultInterpreterClass"],
  369. referencedClasses: []
  370. }),
  371. smalltalk.ASTDebugger);
  372. smalltalk.addMethod(
  373. "_interpreter_",
  374. smalltalk.method({
  375. selector: "interpreter:",
  376. category: 'accessing',
  377. fn: function (anInterpreter){
  378. var self=this;
  379. return smalltalk.withContext(function($ctx1) { self["@interpreter"]=anInterpreter;
  380. return self}, function($ctx1) {$ctx1.fill(self,"interpreter:",{anInterpreter:anInterpreter}, smalltalk.ASTDebugger)})},
  381. args: ["anInterpreter"],
  382. source: "interpreter: anInterpreter\x0a\x09interpreter := anInterpreter",
  383. messageSends: [],
  384. referencedClasses: []
  385. }),
  386. smalltalk.ASTDebugger);
  387. smalltalk.addMethod(
  388. "_method",
  389. smalltalk.method({
  390. selector: "method",
  391. category: 'accessing',
  392. fn: function (){
  393. var self=this;
  394. return smalltalk.withContext(function($ctx1) { var $1;
  395. $1=_st(_st(self)._context())._method();
  396. return $1;
  397. }, function($ctx1) {$ctx1.fill(self,"method",{}, smalltalk.ASTDebugger)})},
  398. args: [],
  399. source: "method\x0a\x09^ self context method",
  400. messageSends: ["method", "context"],
  401. referencedClasses: []
  402. }),
  403. smalltalk.ASTDebugger);
  404. smalltalk.addMethod(
  405. "_restart",
  406. smalltalk.method({
  407. selector: "restart",
  408. category: 'stepping',
  409. fn: function (){
  410. var self=this;
  411. return smalltalk.withContext(function($ctx1) { _st(self)._shouldBeImplemented();
  412. return self}, function($ctx1) {$ctx1.fill(self,"restart",{}, smalltalk.ASTDebugger)})},
  413. args: [],
  414. source: "restart\x0a\x09self shouldBeImplemented",
  415. messageSends: ["shouldBeImplemented"],
  416. referencedClasses: []
  417. }),
  418. smalltalk.ASTDebugger);
  419. smalltalk.addMethod(
  420. "_resume",
  421. smalltalk.method({
  422. selector: "resume",
  423. category: 'stepping',
  424. fn: function (){
  425. var self=this;
  426. return smalltalk.withContext(function($ctx1) { _st(self)._shouldBeImplemented();
  427. return self}, function($ctx1) {$ctx1.fill(self,"resume",{}, smalltalk.ASTDebugger)})},
  428. args: [],
  429. source: "resume\x0a\x09self shouldBeImplemented",
  430. messageSends: ["shouldBeImplemented"],
  431. referencedClasses: []
  432. }),
  433. smalltalk.ASTDebugger);
  434. smalltalk.addMethod(
  435. "_step",
  436. smalltalk.method({
  437. selector: "step",
  438. category: 'stepping',
  439. fn: function (){
  440. var self=this;
  441. return smalltalk.withContext(function($ctx1) { _st((function(){
  442. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(_st(_st(self)._interpreter())._nextNode())._notNil())._and_((function(){
  443. return smalltalk.withContext(function($ctx3) { return _st(_st(_st(self)._interpreter())._nextNode())._stopOnStepping();
  444. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})))._or_((function(){
  445. return smalltalk.withContext(function($ctx3) { return _st(_st(_st(self)._interpreter())._atEnd())._not();
  446. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  447. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
  448. return smalltalk.withContext(function($ctx2) { _st(_st(self)._interpreter())._step();
  449. return _st(self)._step();
  450. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  451. return self}, function($ctx1) {$ctx1.fill(self,"step",{}, smalltalk.ASTDebugger)})},
  452. args: [],
  453. 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 ]",
  454. messageSends: ["whileFalse:", "step", "interpreter", "or:", "not", "atEnd", "and:", "stopOnStepping", "nextNode", "notNil"],
  455. referencedClasses: []
  456. }),
  457. smalltalk.ASTDebugger);
  458. smalltalk.addMethod(
  459. "_stepInto",
  460. smalltalk.method({
  461. selector: "stepInto",
  462. category: 'stepping',
  463. fn: function (){
  464. var self=this;
  465. return smalltalk.withContext(function($ctx1) { _st(self)._shouldBeImplemented();
  466. return self}, function($ctx1) {$ctx1.fill(self,"stepInto",{}, smalltalk.ASTDebugger)})},
  467. args: [],
  468. source: "stepInto\x0a\x09self shouldBeImplemented",
  469. messageSends: ["shouldBeImplemented"],
  470. referencedClasses: []
  471. }),
  472. smalltalk.ASTDebugger);
  473. smalltalk.addMethod(
  474. "_stepOver",
  475. smalltalk.method({
  476. selector: "stepOver",
  477. category: 'stepping',
  478. fn: function (){
  479. var self=this;
  480. return smalltalk.withContext(function($ctx1) { _st(self)._step();
  481. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{}, smalltalk.ASTDebugger)})},
  482. args: [],
  483. source: "stepOver\x0a\x09self step",
  484. messageSends: ["step"],
  485. referencedClasses: []
  486. }),
  487. smalltalk.ASTDebugger);
  488. smalltalk.addMethod(
  489. "_context_",
  490. smalltalk.method({
  491. selector: "context:",
  492. category: 'instance creation',
  493. fn: function (aMethodContext){
  494. var self=this;
  495. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  496. $2=_st(self)._new();
  497. _st($2)._initializeWithContext_(aMethodContext);
  498. $3=_st($2)._yourself();
  499. $1=$3;
  500. return $1;
  501. }, function($ctx1) {$ctx1.fill(self,"context:",{aMethodContext:aMethodContext}, smalltalk.ASTDebugger.klass)})},
  502. args: ["aMethodContext"],
  503. source: "context: aMethodContext\x0a\x09^ self new\x0a \x09initializeWithContext: aMethodContext;\x0a yourself",
  504. messageSends: ["initializeWithContext:", "new", "yourself"],
  505. referencedClasses: []
  506. }),
  507. smalltalk.ASTDebugger.klass);
  508. smalltalk.addClass('ASTInterpreter', smalltalk.Object, ['currentNode', 'context', 'shouldReturn', 'result'], 'Compiler-Interpreter');
  509. 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"
  510. smalltalk.addMethod(
  511. "_assign_to_",
  512. smalltalk.method({
  513. selector: "assign:to:",
  514. category: 'private',
  515. fn: function (aNode,anObject){
  516. var self=this;
  517. return smalltalk.withContext(function($ctx1) { var $2,$1;
  518. $2=_st(_st(aNode)._binding())._isInstanceVar();
  519. if(smalltalk.assert($2)){
  520. $1=_st(_st(_st(self)._context())._receiver())._instVarAt_put_(_st(aNode)._value(),anObject);
  521. } else {
  522. $1=_st(_st(self)._context())._localAt_put_(_st(aNode)._value(),anObject);
  523. };
  524. return $1;
  525. }, function($ctx1) {$ctx1.fill(self,"assign:to:",{aNode:aNode,anObject:anObject}, smalltalk.ASTInterpreter)})},
  526. args: ["aNode", "anObject"],
  527. 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 ]",
  528. messageSends: ["ifTrue:ifFalse:", "instVarAt:put:", "value", "receiver", "context", "localAt:put:", "isInstanceVar", "binding"],
  529. referencedClasses: []
  530. }),
  531. smalltalk.ASTInterpreter);
  532. smalltalk.addMethod(
  533. "_context",
  534. smalltalk.method({
  535. selector: "context",
  536. category: 'accessing',
  537. fn: function (){
  538. var self=this;
  539. return smalltalk.withContext(function($ctx1) { var $2,$1;
  540. $2=self["@context"];
  541. if(($receiver = $2) == nil || $receiver == undefined){
  542. self["@context"]=_st((smalltalk.AIContext || AIContext))._new();
  543. $1=self["@context"];
  544. } else {
  545. $1=$2;
  546. };
  547. return $1;
  548. }, function($ctx1) {$ctx1.fill(self,"context",{}, smalltalk.ASTInterpreter)})},
  549. args: [],
  550. source: "context\x0a\x09^ context ifNil: [ context := AIContext new ]",
  551. messageSends: ["ifNil:", "new"],
  552. referencedClasses: ["AIContext"]
  553. }),
  554. smalltalk.ASTInterpreter);
  555. smalltalk.addMethod(
  556. "_context_",
  557. smalltalk.method({
  558. selector: "context:",
  559. category: 'accessing',
  560. fn: function (anAIContext){
  561. var self=this;
  562. return smalltalk.withContext(function($ctx1) { self["@context"]=anAIContext;
  563. return self}, function($ctx1) {$ctx1.fill(self,"context:",{anAIContext:anAIContext}, smalltalk.ASTInterpreter)})},
  564. args: ["anAIContext"],
  565. source: "context: anAIContext\x0a\x09context := anAIContext",
  566. messageSends: [],
  567. referencedClasses: []
  568. }),
  569. smalltalk.ASTInterpreter);
  570. smalltalk.addMethod(
  571. "_continue_value_",
  572. smalltalk.method({
  573. selector: "continue:value:",
  574. category: 'private',
  575. fn: function (aBlock,anObject){
  576. var self=this;
  577. return smalltalk.withContext(function($ctx1) { self["@result"]=anObject;
  578. _st(aBlock)._value_(anObject);
  579. return self}, function($ctx1) {$ctx1.fill(self,"continue:value:",{aBlock:aBlock,anObject:anObject}, smalltalk.ASTInterpreter)})},
  580. args: ["aBlock", "anObject"],
  581. source: "continue: aBlock value: anObject\x0a\x09result := anObject.\x0a aBlock value: anObject",
  582. messageSends: ["value:"],
  583. referencedClasses: []
  584. }),
  585. smalltalk.ASTInterpreter);
  586. smalltalk.addMethod(
  587. "_currentNode",
  588. smalltalk.method({
  589. selector: "currentNode",
  590. category: 'accessing',
  591. fn: function (){
  592. var self=this;
  593. return smalltalk.withContext(function($ctx1) { var $1;
  594. $1=self["@currentNode"];
  595. return $1;
  596. }, function($ctx1) {$ctx1.fill(self,"currentNode",{}, smalltalk.ASTInterpreter)})},
  597. args: [],
  598. source: "currentNode\x0a\x09^ currentNode",
  599. messageSends: [],
  600. referencedClasses: []
  601. }),
  602. smalltalk.ASTInterpreter);
  603. smalltalk.addMethod(
  604. "_eval_",
  605. smalltalk.method({
  606. selector: "eval:",
  607. category: 'private',
  608. fn: function (aString){
  609. var self=this;
  610. var source,function_;
  611. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  612. source=_st((smalltalk.String || String))._streamContents_((function(str){
  613. return smalltalk.withContext(function($ctx2) { _st(str)._nextPutAll_("(function(");
  614. _st(_st(_st(_st(self)._context())._locals())._keys())._do_separatedBy_((function(each){
  615. return smalltalk.withContext(function($ctx3) { return _st(str)._nextPutAll_(each);
  616. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}),(function(){
  617. return smalltalk.withContext(function($ctx3) { return _st(str)._nextPutAll_(",");
  618. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  619. $1=str;
  620. _st($1)._nextPutAll_("){ return (function() {");
  621. _st($1)._nextPutAll_(aString);
  622. $2=_st($1)._nextPutAll_("})() })");
  623. return $2;
  624. }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1)})}));
  625. function_=_st(_st((smalltalk.Compiler || Compiler))._new())._eval_(source);
  626. $3=_st(function_)._valueWithPossibleArguments_(_st(_st(_st(self)._context())._locals())._values());
  627. return $3;
  628. }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString,source:source,function_:function_}, smalltalk.ASTInterpreter)})},
  629. args: ["aString"],
  630. 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",
  631. messageSends: ["streamContents:", "nextPutAll:", "do:separatedBy:", "keys", "locals", "context", "eval:", "new", "valueWithPossibleArguments:", "values"],
  632. referencedClasses: ["String", "Compiler"]
  633. }),
  634. smalltalk.ASTInterpreter);
  635. smalltalk.addMethod(
  636. "_initialize",
  637. smalltalk.method({
  638. selector: "initialize",
  639. category: 'initialization',
  640. fn: function (){
  641. var self=this;
  642. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  643. self["@shouldReturn"]=false;
  644. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.ASTInterpreter)})},
  645. args: [],
  646. source: "initialize\x0a\x09super initialize.\x0a shouldReturn := false",
  647. messageSends: ["initialize"],
  648. referencedClasses: []
  649. }),
  650. smalltalk.ASTInterpreter);
  651. smalltalk.addMethod(
  652. "_interpret_",
  653. smalltalk.method({
  654. selector: "interpret:",
  655. category: 'interpreting',
  656. fn: function (aNode){
  657. var self=this;
  658. return smalltalk.withContext(function($ctx1) { self["@shouldReturn"]=false;
  659. _st(self)._interpret_continue_(aNode,(function(value){
  660. return smalltalk.withContext(function($ctx2) { self["@result"]=value;
  661. return self["@result"];
  662. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  663. return self}, function($ctx1) {$ctx1.fill(self,"interpret:",{aNode:aNode}, smalltalk.ASTInterpreter)})},
  664. args: ["aNode"],
  665. source: "interpret: aNode\x0a\x09shouldReturn := false.\x0a self interpret: aNode continue: [ :value |\x0a \x09result := value ]",
  666. messageSends: ["interpret:continue:"],
  667. referencedClasses: []
  668. }),
  669. smalltalk.ASTInterpreter);
  670. smalltalk.addMethod(
  671. "_interpret_continue_",
  672. smalltalk.method({
  673. selector: "interpret:continue:",
  674. category: 'interpreting',
  675. fn: function (aNode,aBlock){
  676. var self=this;
  677. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  678. $1=self["@shouldReturn"];
  679. if(smalltalk.assert($1)){
  680. $2=self;
  681. return $2;
  682. };
  683. $3=_st(aNode)._isNode();
  684. if(smalltalk.assert($3)){
  685. self["@currentNode"]=aNode;
  686. self["@currentNode"];
  687. _st(self)._interpretNode_continue_(aNode,(function(value){
  688. return smalltalk.withContext(function($ctx2) { return _st(self)._continue_value_(aBlock,value);
  689. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  690. } else {
  691. _st(self)._continue_value_(aBlock,aNode);
  692. };
  693. return self}, function($ctx1) {$ctx1.fill(self,"interpret:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  694. args: ["aNode", "aBlock"],
  695. 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 ]",
  696. messageSends: ["ifTrue:", "ifTrue:ifFalse:", "interpretNode:continue:", "continue:value:", "isNode"],
  697. referencedClasses: []
  698. }),
  699. smalltalk.ASTInterpreter);
  700. smalltalk.addMethod(
  701. "_interpretAll_continue_",
  702. smalltalk.method({
  703. selector: "interpretAll:continue:",
  704. category: 'private',
  705. fn: function (aCollection,aBlock){
  706. var self=this;
  707. return smalltalk.withContext(function($ctx1) { _st(self)._interpretAll_continue_result_(aCollection,aBlock,_st((smalltalk.OrderedCollection || OrderedCollection))._new());
  708. return self}, function($ctx1) {$ctx1.fill(self,"interpretAll:continue:",{aCollection:aCollection,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  709. args: ["aCollection", "aBlock"],
  710. source: "interpretAll: aCollection continue: aBlock\x0a\x09self \x0a \x09interpretAll: aCollection \x0a continue: aBlock \x0a result: OrderedCollection new",
  711. messageSends: ["interpretAll:continue:result:", "new"],
  712. referencedClasses: ["OrderedCollection"]
  713. }),
  714. smalltalk.ASTInterpreter);
  715. smalltalk.addMethod(
  716. "_interpretAll_continue_result_",
  717. smalltalk.method({
  718. selector: "interpretAll:continue:result:",
  719. category: 'private',
  720. fn: function (nodes,aBlock,aCollection){
  721. var self=this;
  722. return smalltalk.withContext(function($ctx1) { var $1;
  723. $1=_st(nodes)._isEmpty();
  724. if(smalltalk.assert($1)){
  725. _st(self)._continue_value_(aBlock,aCollection);
  726. } else {
  727. _st(self)._interpret_continue_(_st(nodes)._first(),(function(value){
  728. return smalltalk.withContext(function($ctx2) { return _st(self)._interpretAll_continue_result_(_st(nodes)._allButFirst(),aBlock,_st(aCollection).__comma([value]));
  729. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  730. };
  731. return self}, function($ctx1) {$ctx1.fill(self,"interpretAll:continue:result:",{nodes:nodes,aBlock:aBlock,aCollection:aCollection}, smalltalk.ASTInterpreter)})},
  732. args: ["nodes", "aBlock", "aCollection"],
  733. 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 } ] ]",
  734. messageSends: ["ifTrue:ifFalse:", "continue:value:", "interpret:continue:", "first", "interpretAll:continue:result:", "allButFirst", ",", "isEmpty"],
  735. referencedClasses: []
  736. }),
  737. smalltalk.ASTInterpreter);
  738. smalltalk.addMethod(
  739. "_interpretAssignmentNode_continue_",
  740. smalltalk.method({
  741. selector: "interpretAssignmentNode:continue:",
  742. category: 'interpreting',
  743. fn: function (aNode,aBlock){
  744. var self=this;
  745. return smalltalk.withContext(function($ctx1) { _st(self)._interpret_continue_(_st(aNode)._right(),(function(value){
  746. return smalltalk.withContext(function($ctx2) { return _st(self)._continue_value_(aBlock,_st(self)._assign_to_(_st(aNode)._left(),value));
  747. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  748. return self}, function($ctx1) {$ctx1.fill(self,"interpretAssignmentNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  749. args: ["aNode", "aBlock"],
  750. 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) ]",
  751. messageSends: ["interpret:continue:", "right", "continue:value:", "assign:to:", "left"],
  752. referencedClasses: []
  753. }),
  754. smalltalk.ASTInterpreter);
  755. smalltalk.addMethod(
  756. "_interpretBlockNode_continue_",
  757. smalltalk.method({
  758. selector: "interpretBlockNode:continue:",
  759. category: 'interpreting',
  760. fn: function (aNode,aBlock){
  761. var self=this;
  762. return smalltalk.withContext(function($ctx1) { var $1,$2;
  763. _st(self)._continue_value_(aBlock,(function(){
  764. return smalltalk.withContext(function($ctx2) { $1=self;
  765. _st($1)._interpret_(_st(_st(aNode)._nodes())._first());
  766. $2=_st($1)._result();
  767. return $2;
  768. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  769. return self}, function($ctx1) {$ctx1.fill(self,"interpretBlockNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  770. args: ["aNode", "aBlock"],
  771. 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 ]",
  772. messageSends: ["continue:value:", "interpret:", "first", "nodes", "result"],
  773. referencedClasses: []
  774. }),
  775. smalltalk.ASTInterpreter);
  776. smalltalk.addMethod(
  777. "_interpretBlockSequenceNode_continue_",
  778. smalltalk.method({
  779. selector: "interpretBlockSequenceNode:continue:",
  780. category: 'interpreting',
  781. fn: function (aNode,aBlock){
  782. var self=this;
  783. return smalltalk.withContext(function($ctx1) { _st(self)._interpretSequenceNode_continue_(aNode,aBlock);
  784. return self}, function($ctx1) {$ctx1.fill(self,"interpretBlockSequenceNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  785. args: ["aNode", "aBlock"],
  786. source: "interpretBlockSequenceNode: aNode continue: aBlock\x0a\x09self interpretSequenceNode: aNode continue: aBlock",
  787. messageSends: ["interpretSequenceNode:continue:"],
  788. referencedClasses: []
  789. }),
  790. smalltalk.ASTInterpreter);
  791. smalltalk.addMethod(
  792. "_interpretCascadeNode_continue_",
  793. smalltalk.method({
  794. selector: "interpretCascadeNode:continue:",
  795. category: 'interpreting',
  796. fn: function (aNode,aBlock){
  797. var self=this;
  798. return smalltalk.withContext(function($ctx1) { _st(self)._interpret_continue_(_st(aNode)._receiver(),(function(receiver){
  799. return smalltalk.withContext(function($ctx2) { _st(_st(aNode)._nodes())._do_((function(each){
  800. return smalltalk.withContext(function($ctx3) { return _st(each)._receiver_(receiver);
  801. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  802. return _st(self)._interpretAll_continue_(_st(_st(aNode)._nodes())._allButLast(),(function(){
  803. return smalltalk.withContext(function($ctx3) { return _st(self)._interpret_continue_(_st(_st(aNode)._nodes())._last(),(function(val){
  804. return smalltalk.withContext(function($ctx4) { return _st(self)._continue_value_(aBlock,val);
  805. }, function($ctx4) {$ctx4.fillBlock({val:val},$ctx1)})}));
  806. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  807. }, function($ctx2) {$ctx2.fillBlock({receiver:receiver},$ctx1)})}));
  808. return self}, function($ctx1) {$ctx1.fill(self,"interpretCascadeNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  809. args: ["aNode", "aBlock"],
  810. 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 ] ] ]",
  811. messageSends: ["interpret:continue:", "receiver", "do:", "receiver:", "nodes", "interpretAll:continue:", "allButLast", "last", "continue:value:"],
  812. referencedClasses: []
  813. }),
  814. smalltalk.ASTInterpreter);
  815. smalltalk.addMethod(
  816. "_interpretClassReferenceNode_continue_",
  817. smalltalk.method({
  818. selector: "interpretClassReferenceNode:continue:",
  819. category: 'interpreting',
  820. fn: function (aNode,aBlock){
  821. var self=this;
  822. return smalltalk.withContext(function($ctx1) { _st(self)._continue_value_(aBlock,_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(_st(aNode)._value()));
  823. return self}, function($ctx1) {$ctx1.fill(self,"interpretClassReferenceNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  824. args: ["aNode", "aBlock"],
  825. source: "interpretClassReferenceNode: aNode continue: aBlock\x0a\x09self continue: aBlock value: (Smalltalk current at: aNode value)",
  826. messageSends: ["continue:value:", "at:", "value", "current"],
  827. referencedClasses: ["Smalltalk"]
  828. }),
  829. smalltalk.ASTInterpreter);
  830. smalltalk.addMethod(
  831. "_interpretDynamicArrayNode_continue_",
  832. smalltalk.method({
  833. selector: "interpretDynamicArrayNode:continue:",
  834. category: 'interpreting',
  835. fn: function (aNode,aBlock){
  836. var self=this;
  837. return smalltalk.withContext(function($ctx1) { _st(self)._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  838. return smalltalk.withContext(function($ctx2) { return _st(self)._continue_value_(aBlock,array);
  839. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  840. return self}, function($ctx1) {$ctx1.fill(self,"interpretDynamicArrayNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  841. args: ["aNode", "aBlock"],
  842. source: "interpretDynamicArrayNode: aNode continue: aBlock\x0a\x09self interpretAll: aNode nodes continue: [ :array |\x0a \x09self \x0a \x09continue: aBlock\x0a\x09\x09\x09value: array ]",
  843. messageSends: ["interpretAll:continue:", "nodes", "continue:value:"],
  844. referencedClasses: []
  845. }),
  846. smalltalk.ASTInterpreter);
  847. smalltalk.addMethod(
  848. "_interpretDynamicDictionaryNode_continue_",
  849. smalltalk.method({
  850. selector: "interpretDynamicDictionaryNode: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. var hashedCollection;
  856. return smalltalk.withContext(function($ctx2) { hashedCollection=_st((smalltalk.HashedCollection || HashedCollection))._new();
  857. hashedCollection;
  858. _st(array)._do_((function(each){
  859. return smalltalk.withContext(function($ctx3) { return _st(hashedCollection)._add_(each);
  860. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  861. return _st(self)._continue_value_(aBlock,hashedCollection);
  862. }, function($ctx2) {$ctx2.fillBlock({array:array,hashedCollection:hashedCollection},$ctx1)})}));
  863. return self}, function($ctx1) {$ctx1.fill(self,"interpretDynamicDictionaryNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  864. args: ["aNode", "aBlock"],
  865. 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 ]",
  866. messageSends: ["interpretAll:continue:", "nodes", "new", "do:", "add:", "continue:value:"],
  867. referencedClasses: ["HashedCollection"]
  868. }),
  869. smalltalk.ASTInterpreter);
  870. smalltalk.addMethod(
  871. "_interpretJSStatementNode_continue_",
  872. smalltalk.method({
  873. selector: "interpretJSStatementNode:continue:",
  874. category: 'interpreting',
  875. fn: function (aNode,aBlock){
  876. var self=this;
  877. return smalltalk.withContext(function($ctx1) { self["@shouldReturn"]=true;
  878. _st(self)._continue_value_(aBlock,_st(self)._eval_(_st(aNode)._source()));
  879. return self}, function($ctx1) {$ctx1.fill(self,"interpretJSStatementNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  880. args: ["aNode", "aBlock"],
  881. source: "interpretJSStatementNode: aNode continue: aBlock\x0a\x09shouldReturn := true.\x0a\x09self continue: aBlock value: (self eval: aNode source)",
  882. messageSends: ["continue:value:", "eval:", "source"],
  883. referencedClasses: []
  884. }),
  885. smalltalk.ASTInterpreter);
  886. smalltalk.addMethod(
  887. "_interpretMethodNode_continue_",
  888. smalltalk.method({
  889. selector: "interpretMethodNode:continue:",
  890. category: 'interpreting',
  891. fn: function (aNode,aBlock){
  892. var self=this;
  893. return smalltalk.withContext(function($ctx1) { _st(self)._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  894. return smalltalk.withContext(function($ctx2) { return _st(self)._continue_value_(aBlock,_st(array)._first());
  895. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  896. return self}, function($ctx1) {$ctx1.fill(self,"interpretMethodNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  897. args: ["aNode", "aBlock"],
  898. source: "interpretMethodNode: aNode continue: aBlock\x0a\x09self interpretAll: aNode nodes continue: [ :array |\x0a \x09self continue: aBlock value: array first ]",
  899. messageSends: ["interpretAll:continue:", "nodes", "continue:value:", "first"],
  900. referencedClasses: []
  901. }),
  902. smalltalk.ASTInterpreter);
  903. smalltalk.addMethod(
  904. "_interpretNode_continue_",
  905. smalltalk.method({
  906. selector: "interpretNode:continue:",
  907. category: 'interpreting',
  908. fn: function (aNode,aBlock){
  909. var self=this;
  910. return smalltalk.withContext(function($ctx1) { _st(aNode)._interpreter_continue_(self,aBlock);
  911. return self}, function($ctx1) {$ctx1.fill(self,"interpretNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  912. args: ["aNode", "aBlock"],
  913. source: "interpretNode: aNode continue: aBlock\x0a aNode interpreter: self continue: aBlock",
  914. messageSends: ["interpreter:continue:"],
  915. referencedClasses: []
  916. }),
  917. smalltalk.ASTInterpreter);
  918. smalltalk.addMethod(
  919. "_interpretReturnNode_continue_",
  920. smalltalk.method({
  921. selector: "interpretReturnNode:continue:",
  922. category: 'interpreting',
  923. fn: function (aNode,aBlock){
  924. var self=this;
  925. return smalltalk.withContext(function($ctx1) { _st(self)._interpret_continue_(_st(_st(aNode)._nodes())._first(),(function(value){
  926. return smalltalk.withContext(function($ctx2) { self["@shouldReturn"]=true;
  927. self["@shouldReturn"];
  928. return _st(self)._continue_value_(aBlock,value);
  929. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})}));
  930. return self}, function($ctx1) {$ctx1.fill(self,"interpretReturnNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  931. args: ["aNode", "aBlock"],
  932. source: "interpretReturnNode: aNode continue: aBlock\x0a self interpret: aNode nodes first continue: [ :value |\x0a \x09shouldReturn := true.\x0a\x09\x09self continue: aBlock value: value ]",
  933. messageSends: ["interpret:continue:", "first", "nodes", "continue:value:"],
  934. referencedClasses: []
  935. }),
  936. smalltalk.ASTInterpreter);
  937. smalltalk.addMethod(
  938. "_interpretSendNode_continue_",
  939. smalltalk.method({
  940. selector: "interpretSendNode:continue:",
  941. category: 'interpreting',
  942. fn: function (aNode,aBlock){
  943. var self=this;
  944. return smalltalk.withContext(function($ctx1) { _st(self)._interpret_continue_(_st(aNode)._receiver(),(function(receiver){
  945. return smalltalk.withContext(function($ctx2) { return _st(self)._interpretAll_continue_(_st(aNode)._arguments(),(function(args){
  946. return smalltalk.withContext(function($ctx3) { return _st(self)._messageFromSendNode_arguments_do_(aNode,args,(function(message){
  947. return smalltalk.withContext(function($ctx4) { _st(_st(self)._context())._pc_(_st(_st(_st(self)._context())._pc()).__plus((1)));
  948. return _st(self)._continue_value_(aBlock,_st(message)._sendTo_(receiver));
  949. }, function($ctx4) {$ctx4.fillBlock({message:message},$ctx1)})}));
  950. }, function($ctx3) {$ctx3.fillBlock({args:args},$ctx1)})}));
  951. }, function($ctx2) {$ctx2.fillBlock({receiver:receiver},$ctx1)})}));
  952. return self}, function($ctx1) {$ctx1.fill(self,"interpretSendNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  953. args: ["aNode", "aBlock"],
  954. 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) ] ] ]",
  955. messageSends: ["interpret:continue:", "receiver", "interpretAll:continue:", "arguments", "messageFromSendNode:arguments:do:", "pc:", "+", "pc", "context", "continue:value:", "sendTo:"],
  956. referencedClasses: []
  957. }),
  958. smalltalk.ASTInterpreter);
  959. smalltalk.addMethod(
  960. "_interpretSequenceNode_continue_",
  961. smalltalk.method({
  962. selector: "interpretSequenceNode:continue:",
  963. category: 'interpreting',
  964. fn: function (aNode,aBlock){
  965. var self=this;
  966. return smalltalk.withContext(function($ctx1) { _st(self)._interpretAll_continue_(_st(aNode)._nodes(),(function(array){
  967. return smalltalk.withContext(function($ctx2) { return _st(self)._continue_value_(aBlock,_st(array)._last());
  968. }, function($ctx2) {$ctx2.fillBlock({array:array},$ctx1)})}));
  969. return self}, function($ctx1) {$ctx1.fill(self,"interpretSequenceNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  970. args: ["aNode", "aBlock"],
  971. source: "interpretSequenceNode: aNode continue: aBlock\x0a\x09self interpretAll: aNode nodes continue: [ :array |\x0a \x09self continue: aBlock value: array last ]",
  972. messageSends: ["interpretAll:continue:", "nodes", "continue:value:", "last"],
  973. referencedClasses: []
  974. }),
  975. smalltalk.ASTInterpreter);
  976. smalltalk.addMethod(
  977. "_interpretValueNode_continue_",
  978. smalltalk.method({
  979. selector: "interpretValueNode:continue:",
  980. category: 'interpreting',
  981. fn: function (aNode,aBlock){
  982. var self=this;
  983. return smalltalk.withContext(function($ctx1) { _st(self)._continue_value_(aBlock,_st(aNode)._value());
  984. return self}, function($ctx1) {$ctx1.fill(self,"interpretValueNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  985. args: ["aNode", "aBlock"],
  986. source: "interpretValueNode: aNode continue: aBlock\x0a\x09self continue: aBlock value: aNode value",
  987. messageSends: ["continue:value:", "value"],
  988. referencedClasses: []
  989. }),
  990. smalltalk.ASTInterpreter);
  991. smalltalk.addMethod(
  992. "_interpretVariableNode_continue_",
  993. smalltalk.method({
  994. selector: "interpretVariableNode:continue:",
  995. category: 'interpreting',
  996. fn: function (aNode,aBlock){
  997. var self=this;
  998. return smalltalk.withContext(function($ctx1) { var $1,$2,$4,$3;
  999. $1=self;
  1000. $2=aBlock;
  1001. $4=_st(_st(aNode)._binding())._isInstanceVar();
  1002. if(smalltalk.assert($4)){
  1003. $3=_st(_st(_st(self)._context())._receiver())._instVarAt_(_st(aNode)._value());
  1004. } else {
  1005. $3=_st(_st(self)._context())._localAt_(_st(aNode)._value());
  1006. };
  1007. _st($1)._continue_value_($2,$3);
  1008. return self}, function($ctx1) {$ctx1.fill(self,"interpretVariableNode:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  1009. args: ["aNode", "aBlock"],
  1010. 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 ])",
  1011. messageSends: ["continue:value:", "ifTrue:ifFalse:", "instVarAt:", "value", "receiver", "context", "localAt:", "isInstanceVar", "binding"],
  1012. referencedClasses: []
  1013. }),
  1014. smalltalk.ASTInterpreter);
  1015. smalltalk.addMethod(
  1016. "_messageFromSendNode_arguments_do_",
  1017. smalltalk.method({
  1018. selector: "messageFromSendNode:arguments:do:",
  1019. category: 'private',
  1020. fn: function (aSendNode,aCollection,aBlock){
  1021. var self=this;
  1022. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1023. $1=_st((smalltalk.Message || Message))._new();
  1024. _st($1)._selector_(_st(aSendNode)._selector());
  1025. _st($1)._arguments_(aCollection);
  1026. $2=_st($1)._yourself();
  1027. _st(self)._continue_value_(aBlock,$2);
  1028. return self}, function($ctx1) {$ctx1.fill(self,"messageFromSendNode:arguments:do:",{aSendNode:aSendNode,aCollection:aCollection,aBlock:aBlock}, smalltalk.ASTInterpreter)})},
  1029. args: ["aSendNode", "aCollection", "aBlock"],
  1030. 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)",
  1031. messageSends: ["continue:value:", "selector:", "selector", "new", "arguments:", "yourself"],
  1032. referencedClasses: ["Message"]
  1033. }),
  1034. smalltalk.ASTInterpreter);
  1035. smalltalk.addMethod(
  1036. "_result",
  1037. smalltalk.method({
  1038. selector: "result",
  1039. category: 'accessing',
  1040. fn: function (){
  1041. var self=this;
  1042. return smalltalk.withContext(function($ctx1) { var $1;
  1043. $1=self["@result"];
  1044. return $1;
  1045. }, function($ctx1) {$ctx1.fill(self,"result",{}, smalltalk.ASTInterpreter)})},
  1046. args: [],
  1047. source: "result\x0a\x09^ result",
  1048. messageSends: [],
  1049. referencedClasses: []
  1050. }),
  1051. smalltalk.ASTInterpreter);
  1052. smalltalk.addMethod(
  1053. "_shouldReturn",
  1054. smalltalk.method({
  1055. selector: "shouldReturn",
  1056. category: 'testing',
  1057. fn: function (){
  1058. var self=this;
  1059. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1060. $2=self["@shouldReturn"];
  1061. if(($receiver = $2) == nil || $receiver == undefined){
  1062. $1=false;
  1063. } else {
  1064. $1=$2;
  1065. };
  1066. return $1;
  1067. }, function($ctx1) {$ctx1.fill(self,"shouldReturn",{}, smalltalk.ASTInterpreter)})},
  1068. args: [],
  1069. source: "shouldReturn\x0a\x09^ shouldReturn ifNil: [ false ]",
  1070. messageSends: ["ifNil:"],
  1071. referencedClasses: []
  1072. }),
  1073. smalltalk.ASTInterpreter);
  1074. smalltalk.addClass('ASTSteppingInterpreter', smalltalk.ASTInterpreter, ['continuation', 'nextNode'], 'Compiler-Interpreter');
  1075. 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 "
  1076. smalltalk.addMethod(
  1077. "_atEnd",
  1078. smalltalk.method({
  1079. selector: "atEnd",
  1080. category: 'testing',
  1081. fn: function (){
  1082. var self=this;
  1083. return smalltalk.withContext(function($ctx1) { var $1;
  1084. $1=_st(_st(self)._shouldReturn())._or_((function(){
  1085. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._nextNode()).__eq_eq(_st(self)._currentNode());
  1086. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1087. return $1;
  1088. }, function($ctx1) {$ctx1.fill(self,"atEnd",{}, smalltalk.ASTSteppingInterpreter)})},
  1089. args: [],
  1090. source: "atEnd\x0a\x09^ self shouldReturn or: [ self nextNode == self currentNode ]",
  1091. messageSends: ["or:", "==", "currentNode", "nextNode", "shouldReturn"],
  1092. referencedClasses: []
  1093. }),
  1094. smalltalk.ASTSteppingInterpreter);
  1095. smalltalk.addMethod(
  1096. "_initialize",
  1097. smalltalk.method({
  1098. selector: "initialize",
  1099. category: 'initialization',
  1100. fn: function (){
  1101. var self=this;
  1102. return smalltalk.withContext(function($ctx1) { smalltalk.ASTInterpreter.fn.prototype._initialize.apply(_st(self), []);
  1103. self["@continuation"]=(function(){
  1104. return smalltalk.withContext(function($ctx2) { }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1105. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.ASTSteppingInterpreter)})},
  1106. args: [],
  1107. source: "initialize\x0a\x09super initialize.\x0a continuation := [ ]",
  1108. messageSends: ["initialize"],
  1109. referencedClasses: []
  1110. }),
  1111. smalltalk.ASTSteppingInterpreter);
  1112. smalltalk.addMethod(
  1113. "_interpret_continue_",
  1114. smalltalk.method({
  1115. selector: "interpret:continue:",
  1116. category: 'interpreting',
  1117. fn: function (aNode,aBlock){
  1118. var self=this;
  1119. return smalltalk.withContext(function($ctx1) { self["@nextNode"]=aNode;
  1120. self["@continuation"]=(function(){
  1121. return smalltalk.withContext(function($ctx2) { return smalltalk.ASTInterpreter.fn.prototype._interpret_continue_.apply(_st(self), [aNode,aBlock]);
  1122. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1123. return self}, function($ctx1) {$ctx1.fill(self,"interpret:continue:",{aNode:aNode,aBlock:aBlock}, smalltalk.ASTSteppingInterpreter)})},
  1124. args: ["aNode", "aBlock"],
  1125. source: "interpret: aNode continue: aBlock\x0a\x09nextNode := aNode.\x0a\x09continuation := [ \x0a \x09super interpret: aNode continue: aBlock ]",
  1126. messageSends: ["interpret:continue:"],
  1127. referencedClasses: []
  1128. }),
  1129. smalltalk.ASTSteppingInterpreter);
  1130. smalltalk.addMethod(
  1131. "_nextNode",
  1132. smalltalk.method({
  1133. selector: "nextNode",
  1134. category: 'accessing',
  1135. fn: function (){
  1136. var self=this;
  1137. return smalltalk.withContext(function($ctx1) { var $1;
  1138. $1=self["@nextNode"];
  1139. return $1;
  1140. }, function($ctx1) {$ctx1.fill(self,"nextNode",{}, smalltalk.ASTSteppingInterpreter)})},
  1141. args: [],
  1142. source: "nextNode\x0a\x09^ nextNode",
  1143. messageSends: [],
  1144. referencedClasses: []
  1145. }),
  1146. smalltalk.ASTSteppingInterpreter);
  1147. smalltalk.addMethod(
  1148. "_step",
  1149. smalltalk.method({
  1150. selector: "step",
  1151. category: 'stepping',
  1152. fn: function (){
  1153. var self=this;
  1154. return smalltalk.withContext(function($ctx1) { _st(self["@continuation"])._value();
  1155. return self}, function($ctx1) {$ctx1.fill(self,"step",{}, smalltalk.ASTSteppingInterpreter)})},
  1156. args: [],
  1157. source: "step\x0a\x09continuation value",
  1158. messageSends: ["value"],
  1159. referencedClasses: []
  1160. }),
  1161. smalltalk.ASTSteppingInterpreter);
  1162. smalltalk.addMethod(
  1163. "_interpreter_continue_",
  1164. smalltalk.method({
  1165. selector: "interpreter:continue:",
  1166. category: '*Compiler-Interpreter',
  1167. fn: function (anInterpreter,aBlock){
  1168. var self=this;
  1169. return smalltalk.withContext(function($ctx1) { var $1;
  1170. $1=_st(anInterpreter)._interpretNode_continue_(self,aBlock);
  1171. return $1;
  1172. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.Node)})},
  1173. args: ["anInterpreter", "aBlock"],
  1174. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretNode: self continue: aBlock",
  1175. messageSends: ["interpretNode:continue:"],
  1176. referencedClasses: []
  1177. }),
  1178. smalltalk.Node);
  1179. smalltalk.addMethod(
  1180. "_isSteppingNode",
  1181. smalltalk.method({
  1182. selector: "isSteppingNode",
  1183. category: '*Compiler-Interpreter',
  1184. fn: function (){
  1185. var self=this;
  1186. return smalltalk.withContext(function($ctx1) { return false;
  1187. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{}, smalltalk.Node)})},
  1188. args: [],
  1189. source: "isSteppingNode\x0a\x09^ false",
  1190. messageSends: [],
  1191. referencedClasses: []
  1192. }),
  1193. smalltalk.Node);
  1194. smalltalk.addMethod(
  1195. "_interpreter_continue_",
  1196. smalltalk.method({
  1197. selector: "interpreter:continue:",
  1198. category: '*Compiler-Interpreter',
  1199. fn: function (anInterpreter,aBlock){
  1200. var self=this;
  1201. return smalltalk.withContext(function($ctx1) { var $1;
  1202. $1=_st(anInterpreter)._interpretAssignmentNode_continue_(self,aBlock);
  1203. return $1;
  1204. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.AssignmentNode)})},
  1205. args: ["anInterpreter", "aBlock"],
  1206. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretAssignmentNode: self continue: aBlock",
  1207. messageSends: ["interpretAssignmentNode:continue:"],
  1208. referencedClasses: []
  1209. }),
  1210. smalltalk.AssignmentNode);
  1211. smalltalk.addMethod(
  1212. "_isSteppingNode",
  1213. smalltalk.method({
  1214. selector: "isSteppingNode",
  1215. category: '*Compiler-Interpreter',
  1216. fn: function (){
  1217. var self=this;
  1218. return smalltalk.withContext(function($ctx1) { return true;
  1219. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{}, smalltalk.AssignmentNode)})},
  1220. args: [],
  1221. source: "isSteppingNode\x0a\x09^ true",
  1222. messageSends: [],
  1223. referencedClasses: []
  1224. }),
  1225. smalltalk.AssignmentNode);
  1226. smalltalk.addMethod(
  1227. "_interpreter_continue_",
  1228. smalltalk.method({
  1229. selector: "interpreter:continue:",
  1230. category: '*Compiler-Interpreter',
  1231. fn: function (anInterpreter,aBlock){
  1232. var self=this;
  1233. return smalltalk.withContext(function($ctx1) { var $1;
  1234. $1=_st(anInterpreter)._interpretBlockNode_continue_(self,aBlock);
  1235. return $1;
  1236. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.BlockNode)})},
  1237. args: ["anInterpreter", "aBlock"],
  1238. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretBlockNode: self continue: aBlock",
  1239. messageSends: ["interpretBlockNode:continue:"],
  1240. referencedClasses: []
  1241. }),
  1242. smalltalk.BlockNode);
  1243. smalltalk.addMethod(
  1244. "_isSteppingNode",
  1245. smalltalk.method({
  1246. selector: "isSteppingNode",
  1247. category: '*Compiler-Interpreter',
  1248. fn: function (){
  1249. var self=this;
  1250. return smalltalk.withContext(function($ctx1) { return true;
  1251. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{}, smalltalk.BlockNode)})},
  1252. args: [],
  1253. source: "isSteppingNode\x0a\x09^ true",
  1254. messageSends: [],
  1255. referencedClasses: []
  1256. }),
  1257. smalltalk.BlockNode);
  1258. smalltalk.addMethod(
  1259. "_interpreter_continue_",
  1260. smalltalk.method({
  1261. selector: "interpreter:continue:",
  1262. category: '*Compiler-Interpreter',
  1263. fn: function (anInterpreter,aBlock){
  1264. var self=this;
  1265. return smalltalk.withContext(function($ctx1) { var $1;
  1266. $1=_st(anInterpreter)._interpretCascadeNode_continue_(self,aBlock);
  1267. return $1;
  1268. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.CascadeNode)})},
  1269. args: ["anInterpreter", "aBlock"],
  1270. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretCascadeNode: self continue: aBlock",
  1271. messageSends: ["interpretCascadeNode:continue:"],
  1272. referencedClasses: []
  1273. }),
  1274. smalltalk.CascadeNode);
  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)._interpretDynamicArrayNode_continue_(self,aBlock);
  1284. return $1;
  1285. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.DynamicArrayNode)})},
  1286. args: ["anInterpreter", "aBlock"],
  1287. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretDynamicArrayNode: self continue: aBlock",
  1288. messageSends: ["interpretDynamicArrayNode:continue:"],
  1289. referencedClasses: []
  1290. }),
  1291. smalltalk.DynamicArrayNode);
  1292. smalltalk.addMethod(
  1293. "_isSteppingNode",
  1294. smalltalk.method({
  1295. selector: "isSteppingNode",
  1296. category: '*Compiler-Interpreter',
  1297. fn: function (){
  1298. var self=this;
  1299. return smalltalk.withContext(function($ctx1) { return true;
  1300. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{}, smalltalk.DynamicArrayNode)})},
  1301. args: [],
  1302. source: "isSteppingNode\x0a\x09^ true",
  1303. messageSends: [],
  1304. referencedClasses: []
  1305. }),
  1306. smalltalk.DynamicArrayNode);
  1307. smalltalk.addMethod(
  1308. "_interpreter_continue_",
  1309. smalltalk.method({
  1310. selector: "interpreter:continue:",
  1311. category: '*Compiler-Interpreter',
  1312. fn: function (anInterpreter,aBlock){
  1313. var self=this;
  1314. return smalltalk.withContext(function($ctx1) { var $1;
  1315. $1=_st(anInterpreter)._interpretDynamicDictionaryNode_continue_(self,aBlock);
  1316. return $1;
  1317. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.DynamicDictionaryNode)})},
  1318. args: ["anInterpreter", "aBlock"],
  1319. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretDynamicDictionaryNode: self continue: aBlock",
  1320. messageSends: ["interpretDynamicDictionaryNode:continue:"],
  1321. referencedClasses: []
  1322. }),
  1323. smalltalk.DynamicDictionaryNode);
  1324. smalltalk.addMethod(
  1325. "_isSteppingNode",
  1326. smalltalk.method({
  1327. selector: "isSteppingNode",
  1328. category: '*Compiler-Interpreter',
  1329. fn: function (){
  1330. var self=this;
  1331. return smalltalk.withContext(function($ctx1) { return true;
  1332. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{}, smalltalk.DynamicDictionaryNode)})},
  1333. args: [],
  1334. source: "isSteppingNode\x0a\x09^ true",
  1335. messageSends: [],
  1336. referencedClasses: []
  1337. }),
  1338. smalltalk.DynamicDictionaryNode);
  1339. smalltalk.addMethod(
  1340. "_interpreter_continue_",
  1341. smalltalk.method({
  1342. selector: "interpreter:continue:",
  1343. category: '*Compiler-Interpreter',
  1344. fn: function (anInterpreter,aBlock){
  1345. var self=this;
  1346. return smalltalk.withContext(function($ctx1) { var $1;
  1347. $1=_st(anInterpreter)._interpretJSStatementNode_continue_(self,aBlock);
  1348. return $1;
  1349. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.JSStatementNode)})},
  1350. args: ["anInterpreter", "aBlock"],
  1351. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretJSStatementNode: self continue: aBlock",
  1352. messageSends: ["interpretJSStatementNode:continue:"],
  1353. referencedClasses: []
  1354. }),
  1355. smalltalk.JSStatementNode);
  1356. smalltalk.addMethod(
  1357. "_isSteppingNode",
  1358. smalltalk.method({
  1359. selector: "isSteppingNode",
  1360. category: '*Compiler-Interpreter',
  1361. fn: function (){
  1362. var self=this;
  1363. return smalltalk.withContext(function($ctx1) { return true;
  1364. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{}, smalltalk.JSStatementNode)})},
  1365. args: [],
  1366. source: "isSteppingNode\x0a\x09^ true",
  1367. messageSends: [],
  1368. referencedClasses: []
  1369. }),
  1370. smalltalk.JSStatementNode);
  1371. smalltalk.addMethod(
  1372. "_interpreter_continue_",
  1373. smalltalk.method({
  1374. selector: "interpreter:continue:",
  1375. category: '*Compiler-Interpreter',
  1376. fn: function (anInterpreter,aBlock){
  1377. var self=this;
  1378. return smalltalk.withContext(function($ctx1) { var $1;
  1379. $1=_st(anInterpreter)._interpretMethodNode_continue_(self,aBlock);
  1380. return $1;
  1381. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.MethodNode)})},
  1382. args: ["anInterpreter", "aBlock"],
  1383. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretMethodNode: self continue: aBlock",
  1384. messageSends: ["interpretMethodNode:continue:"],
  1385. referencedClasses: []
  1386. }),
  1387. smalltalk.MethodNode);
  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)._interpretReturnNode_continue_(self,aBlock);
  1397. return $1;
  1398. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.ReturnNode)})},
  1399. args: ["anInterpreter", "aBlock"],
  1400. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretReturnNode: self continue: aBlock",
  1401. messageSends: ["interpretReturnNode:continue:"],
  1402. referencedClasses: []
  1403. }),
  1404. smalltalk.ReturnNode);
  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)._interpretSendNode_continue_(self,aBlock);
  1414. return $1;
  1415. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.SendNode)})},
  1416. args: ["anInterpreter", "aBlock"],
  1417. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretSendNode: self continue: aBlock",
  1418. messageSends: ["interpretSendNode:continue:"],
  1419. referencedClasses: []
  1420. }),
  1421. smalltalk.SendNode);
  1422. smalltalk.addMethod(
  1423. "_isSteppingNode",
  1424. smalltalk.method({
  1425. selector: "isSteppingNode",
  1426. category: '*Compiler-Interpreter',
  1427. fn: function (){
  1428. var self=this;
  1429. return smalltalk.withContext(function($ctx1) { return true;
  1430. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{}, smalltalk.SendNode)})},
  1431. args: [],
  1432. source: "isSteppingNode\x0a\x09^ true",
  1433. messageSends: [],
  1434. referencedClasses: []
  1435. }),
  1436. smalltalk.SendNode);
  1437. smalltalk.addMethod(
  1438. "_interpreter_continue_",
  1439. smalltalk.method({
  1440. selector: "interpreter:continue:",
  1441. category: '*Compiler-Interpreter',
  1442. fn: function (anInterpreter,aBlock){
  1443. var self=this;
  1444. return smalltalk.withContext(function($ctx1) { var $1;
  1445. $1=_st(anInterpreter)._interpretSequenceNode_continue_(self,aBlock);
  1446. return $1;
  1447. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.SequenceNode)})},
  1448. args: ["anInterpreter", "aBlock"],
  1449. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretSequenceNode: self continue: aBlock",
  1450. messageSends: ["interpretSequenceNode:continue:"],
  1451. referencedClasses: []
  1452. }),
  1453. smalltalk.SequenceNode);
  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)._interpretBlockSequenceNode_continue_(self,aBlock);
  1463. return $1;
  1464. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.BlockSequenceNode)})},
  1465. args: ["anInterpreter", "aBlock"],
  1466. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretBlockSequenceNode: self continue: aBlock",
  1467. messageSends: ["interpretBlockSequenceNode:continue:"],
  1468. referencedClasses: []
  1469. }),
  1470. smalltalk.BlockSequenceNode);
  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)._interpretValueNode_continue_(self,aBlock);
  1480. return $1;
  1481. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.ValueNode)})},
  1482. args: ["anInterpreter", "aBlock"],
  1483. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretValueNode: self continue: aBlock",
  1484. messageSends: ["interpretValueNode:continue:"],
  1485. referencedClasses: []
  1486. }),
  1487. smalltalk.ValueNode);
  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)._interpretVariableNode_continue_(self,aBlock);
  1497. return $1;
  1498. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.VariableNode)})},
  1499. args: ["anInterpreter", "aBlock"],
  1500. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretVariableNode: self continue: aBlock",
  1501. messageSends: ["interpretVariableNode:continue:"],
  1502. referencedClasses: []
  1503. }),
  1504. smalltalk.VariableNode);
  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)._interpretClassReferenceNode_continue_(self,aBlock);
  1514. return $1;
  1515. }, function($ctx1) {$ctx1.fill(self,"interpreter:continue:",{anInterpreter:anInterpreter,aBlock:aBlock}, smalltalk.ClassReferenceNode)})},
  1516. args: ["anInterpreter", "aBlock"],
  1517. source: "interpreter: anInterpreter continue: aBlock\x0a\x09^ anInterpreter interpretClassReferenceNode: self continue: aBlock",
  1518. messageSends: ["interpretClassReferenceNode:continue:"],
  1519. referencedClasses: []
  1520. }),
  1521. smalltalk.ClassReferenceNode);