2
0

Compiler-Interpreter.js 76 KB

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