1
0

Compiler-Interpreter.js 81 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314
  1. define("amber_core/Compiler-Interpreter", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Methods", "amber_core/Kernel-Objects", "amber_core/Compiler-Core", "amber_core/Kernel-Exceptions", "amber_core/Compiler-AST"], function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Compiler-Interpreter');
  3. smalltalk.packages["Compiler-Interpreter"].transport = {"type":"amd","amdNamespace":"amber_core"};
  4. smalltalk.addClass('AIBlockClosure', smalltalk.BlockClosure, ['node', 'outerContext'], 'Compiler-Interpreter');
  5. smalltalk.AIBlockClosure.comment="I am a special `BlockClosure` subclass used by an interpreter to interpret a block node.\x0a\x0aWhile I am polymorphic with `BlockClosure`, some methods such as `#new` will raise interpretation errors. Unlike a `BlockClosure`, my instance are not JavaScript functions.\x0a\x0aEvaluating an instance will result in interpreting the `node` instance variable (instance of `BlockNode`).";
  6. smalltalk.addMethod(
  7. smalltalk.method({
  8. selector: "applyTo:arguments:",
  9. category: 'evaluating',
  10. fn: function (anObject,aCollection){
  11. var self=this;
  12. return smalltalk.withContext(function($ctx1) {
  13. self._interpreterError();
  14. return self}, function($ctx1) {$ctx1.fill(self,"applyTo:arguments:",{anObject:anObject,aCollection:aCollection},smalltalk.AIBlockClosure)})},
  15. args: ["anObject", "aCollection"],
  16. source: "applyTo: anObject arguments: aCollection\x0a\x09self interpreterError",
  17. messageSends: ["interpreterError"],
  18. referencedClasses: []
  19. }),
  20. smalltalk.AIBlockClosure);
  21. smalltalk.addMethod(
  22. smalltalk.method({
  23. selector: "compiledSource",
  24. category: 'accessing',
  25. fn: function (){
  26. var self=this;
  27. return smalltalk.withContext(function($ctx1) {
  28. return "[ AST Block closure ]";
  29. }, function($ctx1) {$ctx1.fill(self,"compiledSource",{},smalltalk.AIBlockClosure)})},
  30. args: [],
  31. source: "compiledSource\x0a\x09\x22Unlike blocks, the receiver doesn't represent a JS function\x22\x0a\x09\x0a\x09^ '[ AST Block closure ]'",
  32. messageSends: [],
  33. referencedClasses: []
  34. }),
  35. smalltalk.AIBlockClosure);
  36. smalltalk.addMethod(
  37. smalltalk.method({
  38. selector: "currySelf",
  39. category: 'converting',
  40. fn: function (){
  41. var self=this;
  42. return smalltalk.withContext(function($ctx1) {
  43. self._interpreterError();
  44. return self}, function($ctx1) {$ctx1.fill(self,"currySelf",{},smalltalk.AIBlockClosure)})},
  45. args: [],
  46. source: "currySelf\x0a\x09self interpreterError",
  47. messageSends: ["interpreterError"],
  48. referencedClasses: []
  49. }),
  50. smalltalk.AIBlockClosure);
  51. smalltalk.addMethod(
  52. smalltalk.method({
  53. selector: "initializeWithContext:node:",
  54. category: 'initialization',
  55. fn: function (aContext,aNode){
  56. var self=this;
  57. return smalltalk.withContext(function($ctx1) {
  58. self["@node"]=aNode;
  59. self["@outerContext"]=aContext;
  60. return self}, function($ctx1) {$ctx1.fill(self,"initializeWithContext:node:",{aContext:aContext,aNode:aNode},smalltalk.AIBlockClosure)})},
  61. args: ["aContext", "aNode"],
  62. source: "initializeWithContext: aContext node: aNode\x0a\x09node := aNode.\x0a\x09outerContext := aContext",
  63. messageSends: [],
  64. referencedClasses: []
  65. }),
  66. smalltalk.AIBlockClosure);
  67. smalltalk.addMethod(
  68. smalltalk.method({
  69. selector: "interpreterError",
  70. category: 'error handling',
  71. fn: function (){
  72. var self=this;
  73. function $ASTInterpreterError(){return smalltalk.ASTInterpreterError||(typeof ASTInterpreterError=="undefined"?nil:ASTInterpreterError)}
  74. return smalltalk.withContext(function($ctx1) {
  75. _st($ASTInterpreterError())._signal_("Method cannot be interpreted by the interpreter.");
  76. return self}, function($ctx1) {$ctx1.fill(self,"interpreterError",{},smalltalk.AIBlockClosure)})},
  77. args: [],
  78. source: "interpreterError\x0a\x09ASTInterpreterError signal: 'Method cannot be interpreted by the interpreter.'",
  79. messageSends: ["signal:"],
  80. referencedClasses: ["ASTInterpreterError"]
  81. }),
  82. smalltalk.AIBlockClosure);
  83. smalltalk.addMethod(
  84. smalltalk.method({
  85. selector: "numArgs",
  86. category: 'accessing',
  87. fn: function (){
  88. var self=this;
  89. return smalltalk.withContext(function($ctx1) {
  90. var $1;
  91. $1=_st(_st(self["@node"])._temps())._size();
  92. return $1;
  93. }, function($ctx1) {$ctx1.fill(self,"numArgs",{},smalltalk.AIBlockClosure)})},
  94. args: [],
  95. source: "numArgs\x0a\x09^ node temps size",
  96. messageSends: ["size", "temps"],
  97. referencedClasses: []
  98. }),
  99. smalltalk.AIBlockClosure);
  100. smalltalk.addMethod(
  101. smalltalk.method({
  102. selector: "value",
  103. category: 'evaluating',
  104. fn: function (){
  105. var self=this;
  106. return smalltalk.withContext(function($ctx1) {
  107. var $1;
  108. $1=self._valueWithPossibleArguments_([]);
  109. return $1;
  110. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.AIBlockClosure)})},
  111. args: [],
  112. source: "value\x0a\x09^ self valueWithPossibleArguments: #()",
  113. messageSends: ["valueWithPossibleArguments:"],
  114. referencedClasses: []
  115. }),
  116. smalltalk.AIBlockClosure);
  117. smalltalk.addMethod(
  118. smalltalk.method({
  119. selector: "value:",
  120. category: 'evaluating',
  121. fn: function (anArgument){
  122. var self=this;
  123. return smalltalk.withContext(function($ctx1) {
  124. var $1;
  125. $1=self._valueWithPossibleArguments_([anArgument]);
  126. return $1;
  127. }, function($ctx1) {$ctx1.fill(self,"value:",{anArgument:anArgument},smalltalk.AIBlockClosure)})},
  128. args: ["anArgument"],
  129. source: "value: anArgument\x0a\x09^ self valueWithPossibleArguments: {anArgument}",
  130. messageSends: ["valueWithPossibleArguments:"],
  131. referencedClasses: []
  132. }),
  133. smalltalk.AIBlockClosure);
  134. smalltalk.addMethod(
  135. smalltalk.method({
  136. selector: "value:value:",
  137. category: 'evaluating',
  138. fn: function (firstArgument,secondArgument){
  139. var self=this;
  140. return smalltalk.withContext(function($ctx1) {
  141. var $1;
  142. $1=self._valueWithPossibleArguments_([firstArgument,secondArgument]);
  143. return $1;
  144. }, function($ctx1) {$ctx1.fill(self,"value:value:",{firstArgument:firstArgument,secondArgument:secondArgument},smalltalk.AIBlockClosure)})},
  145. args: ["firstArgument", "secondArgument"],
  146. source: "value: firstArgument value: secondArgument\x0a\x09^ self valueWithPossibleArguments: {firstArgument . secondArgument}",
  147. messageSends: ["valueWithPossibleArguments:"],
  148. referencedClasses: []
  149. }),
  150. smalltalk.AIBlockClosure);
  151. smalltalk.addMethod(
  152. smalltalk.method({
  153. selector: "value:value:value:",
  154. category: 'evaluating',
  155. fn: function (firstArgument,secondArgument,thirdArgument){
  156. var self=this;
  157. return smalltalk.withContext(function($ctx1) {
  158. var $1;
  159. $1=self._valueWithPossibleArguments_([firstArgument,secondArgument,thirdArgument]);
  160. return $1;
  161. }, function($ctx1) {$ctx1.fill(self,"value:value:value:",{firstArgument:firstArgument,secondArgument:secondArgument,thirdArgument:thirdArgument},smalltalk.AIBlockClosure)})},
  162. args: ["firstArgument", "secondArgument", "thirdArgument"],
  163. source: "value: firstArgument value: secondArgument value: thirdArgument\x0a\x09^ self valueWithPossibleArguments: {firstArgument . secondArgument . thirdArgument}",
  164. messageSends: ["valueWithPossibleArguments:"],
  165. referencedClasses: []
  166. }),
  167. smalltalk.AIBlockClosure);
  168. smalltalk.addMethod(
  169. smalltalk.method({
  170. selector: "valueWithPossibleArguments:",
  171. category: 'evaluating',
  172. fn: function (aCollection){
  173. var self=this;
  174. var context,sequenceNode;
  175. return smalltalk.withContext(function($ctx1) {
  176. var $1,$2,$3,$4,$5;
  177. context=_st(self["@outerContext"])._newBlockContext();
  178. $1=_st(_st(_st(self["@node"])._nodes())._first())._copy();
  179. _st($1)._parent_(nil);
  180. $2=_st($1)._yourself();
  181. sequenceNode=$2;
  182. _st(_st(self["@node"])._parameters())._withIndexDo_((function(each,index){
  183. return smalltalk.withContext(function($ctx2) {
  184. return _st(context)._localAt_put_(each,_st(aCollection)._at_ifAbsent_(index,(function(){
  185. return smalltalk.withContext(function($ctx3) {
  186. return nil;
  187. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})})));
  188. }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1,1)})}));
  189. $3=_st(context)._interpreter();
  190. _st($3)._node_(_st(sequenceNode)._nextChild());
  191. $4=_st($3)._proceed();
  192. _st(_st(self["@outerContext"])._interpreter())._setNonLocalReturnFromContext_(context);
  193. $5=_st(_st(context)._interpreter())._pop();
  194. return $5;
  195. }, function($ctx1) {$ctx1.fill(self,"valueWithPossibleArguments:",{aCollection:aCollection,context:context,sequenceNode:sequenceNode},smalltalk.AIBlockClosure)})},
  196. args: ["aCollection"],
  197. source: "valueWithPossibleArguments: aCollection\x0a\x09| context sequenceNode |\x0a\x09context := outerContext newBlockContext.\x0a\x0a\x09\x22Interpret a copy of the sequence node to avoid creating a new AIBlockClosure\x22\x0a\x09sequenceNode := node nodes first copy\x0a\x09\x09parent: nil;\x0a\x09\x09yourself.\x0a\x0a\x09\x22Populate the arguments into the context locals\x22\x09\x0a\x09node parameters withIndexDo: [ :each :index |\x0a\x09\x09context localAt: each put: (aCollection at: index ifAbsent: [ nil ]) ].\x0a\x0a\x09\x22Interpret the first node of the BlockSequenceNode\x22\x0a\x09context interpreter\x0a\x09\x09node: sequenceNode nextChild;\x0a\x09\x09proceed.\x0a\x09\x09\x0a\x09outerContext interpreter\x0a\x09\x09setNonLocalReturnFromContext: context.\x0a\x09\x09\x0a\x09^ context interpreter pop",
  198. messageSends: ["newBlockContext", "parent:", "copy", "first", "nodes", "yourself", "withIndexDo:", "parameters", "localAt:put:", "at:ifAbsent:", "node:", "interpreter", "nextChild", "proceed", "setNonLocalReturnFromContext:", "pop"],
  199. referencedClasses: []
  200. }),
  201. smalltalk.AIBlockClosure);
  202. smalltalk.addMethod(
  203. smalltalk.method({
  204. selector: "forContext:node:",
  205. category: 'instance creation',
  206. fn: function (aContext,aNode){
  207. var self=this;
  208. return smalltalk.withContext(function($ctx1) {
  209. var $2,$3,$1;
  210. $2=self._new();
  211. _st($2)._initializeWithContext_node_(aContext,aNode);
  212. $3=_st($2)._yourself();
  213. $1=$3;
  214. return $1;
  215. }, function($ctx1) {$ctx1.fill(self,"forContext:node:",{aContext:aContext,aNode:aNode},smalltalk.AIBlockClosure.klass)})},
  216. args: ["aContext", "aNode"],
  217. source: "forContext: aContext node: aNode\x0a\x09^ self new\x0a\x09\x09initializeWithContext: aContext node: aNode;\x0a\x09\x09yourself",
  218. messageSends: ["initializeWithContext:node:", "new", "yourself"],
  219. referencedClasses: []
  220. }),
  221. smalltalk.AIBlockClosure.klass);
  222. smalltalk.addClass('AIContext', smalltalk.MethodContext, ['outerContext', 'innerContext', 'pc', 'locals', 'selector', 'index', 'ast', 'interpreter'], 'Compiler-Interpreter');
  223. 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)";
  224. smalltalk.addMethod(
  225. smalltalk.method({
  226. selector: "arguments",
  227. category: 'interpreting',
  228. fn: function (){
  229. var self=this;
  230. return smalltalk.withContext(function($ctx1) {
  231. var $1;
  232. $1=_st(_st(self._ast())._arguments())._collect_((function(each){
  233. return smalltalk.withContext(function($ctx2) {
  234. return self._localAt_(each);
  235. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  236. return $1;
  237. }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.AIContext)})},
  238. args: [],
  239. source: "arguments\x0a\x09^ self ast arguments collect: [ :each |\x0a\x09\x09self localAt: each ]",
  240. messageSends: ["collect:", "arguments", "ast", "localAt:"],
  241. referencedClasses: []
  242. }),
  243. smalltalk.AIContext);
  244. smalltalk.addMethod(
  245. smalltalk.method({
  246. selector: "ast",
  247. category: 'interpreting',
  248. fn: function (){
  249. var self=this;
  250. return smalltalk.withContext(function($ctx1) {
  251. var $1,$3,$2,$4,$5;
  252. $1=self._isBlockContext();
  253. if(smalltalk.assert($1)){
  254. $3=self._outerContext();
  255. if(($receiver = $3) == nil || $receiver == null){
  256. $2=$3;
  257. } else {
  258. var context;
  259. context=$receiver;
  260. $2=_st(context)._ast();
  261. };
  262. return $2;
  263. };
  264. $4=self["@ast"];
  265. if(($receiver = $4) == nil || $receiver == null){
  266. self._initializeAST();
  267. } else {
  268. $4;
  269. };
  270. $5=self["@ast"];
  271. return $5;
  272. }, function($ctx1) {$ctx1.fill(self,"ast",{},smalltalk.AIContext)})},
  273. args: [],
  274. source: "ast\x0a\x09self isBlockContext ifTrue: [ \x0a\x09\x09^ self outerContext ifNotNil: [ :context | context ast ] ].\x0a\x0a\x09ast ifNil: [ self initializeAST ].\x0a\x09^ ast",
  275. messageSends: ["ifTrue:", "isBlockContext", "ifNotNil:", "outerContext", "ast", "ifNil:", "initializeAST"],
  276. referencedClasses: []
  277. }),
  278. smalltalk.AIContext);
  279. smalltalk.addMethod(
  280. smalltalk.method({
  281. selector: "index",
  282. category: 'accessing',
  283. fn: function (){
  284. var self=this;
  285. return smalltalk.withContext(function($ctx1) {
  286. var $2,$1;
  287. $2=self["@index"];
  288. if(($receiver = $2) == nil || $receiver == null){
  289. $1=(0);
  290. } else {
  291. $1=$2;
  292. };
  293. return $1;
  294. }, function($ctx1) {$ctx1.fill(self,"index",{},smalltalk.AIContext)})},
  295. args: [],
  296. source: "index\x0a\x09^ index ifNil: [ 0 ]",
  297. messageSends: ["ifNil:"],
  298. referencedClasses: []
  299. }),
  300. smalltalk.AIContext);
  301. smalltalk.addMethod(
  302. smalltalk.method({
  303. selector: "index:",
  304. category: 'accessing',
  305. fn: function (anInteger){
  306. var self=this;
  307. return smalltalk.withContext(function($ctx1) {
  308. self["@index"]=anInteger;
  309. return self}, function($ctx1) {$ctx1.fill(self,"index:",{anInteger:anInteger},smalltalk.AIContext)})},
  310. args: ["anInteger"],
  311. source: "index: anInteger\x0a\x09index := anInteger",
  312. messageSends: [],
  313. referencedClasses: []
  314. }),
  315. smalltalk.AIContext);
  316. smalltalk.addMethod(
  317. smalltalk.method({
  318. selector: "initializeAST",
  319. category: 'initialization',
  320. fn: function (){
  321. var self=this;
  322. function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
  323. return smalltalk.withContext(function($ctx1) {
  324. self["@ast"]=_st(self._method())._ast();
  325. _st(_st($SemanticAnalyzer())._on_(_st(self._method())._methodClass()))._visit_(self["@ast"]);
  326. return self}, function($ctx1) {$ctx1.fill(self,"initializeAST",{},smalltalk.AIContext)})},
  327. args: [],
  328. source: "initializeAST\x0a\x09ast := self method ast.\x0a\x09(SemanticAnalyzer on: self method methodClass)\x0a\x09\x09visit: ast",
  329. messageSends: ["ast", "method", "visit:", "on:", "methodClass"],
  330. referencedClasses: ["SemanticAnalyzer"]
  331. }),
  332. smalltalk.AIContext);
  333. smalltalk.addMethod(
  334. smalltalk.method({
  335. selector: "initializeFromMethodContext:",
  336. category: 'initialization',
  337. fn: function (aMethodContext){
  338. var self=this;
  339. return smalltalk.withContext(function($ctx1) {
  340. var $1,$2,$3,$4;
  341. $1=self;
  342. _st($1)._index_(_st(aMethodContext)._index());
  343. _st($1)._receiver_(_st(aMethodContext)._receiver());
  344. $2=_st($1)._selector_(_st(aMethodContext)._selector());
  345. $3=_st(aMethodContext)._outerContext();
  346. if(($receiver = $3) == nil || $receiver == null){
  347. $3;
  348. } else {
  349. var outer;
  350. outer=$receiver;
  351. $4=_st(outer)._methodContext();
  352. if(($receiver = $4) == nil || $receiver == null){
  353. $4;
  354. } else {
  355. self._outerContext_(_st(self._class())._fromMethodContext_(_st(aMethodContext)._outerContext()));
  356. };
  357. _st(_st(aMethodContext)._locals())._keysAndValuesDo_((function(key,value){
  358. return smalltalk.withContext(function($ctx2) {
  359. return _st(self._locals())._at_put_(key,value);
  360. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1,3)})}));
  361. };
  362. return self}, function($ctx1) {$ctx1.fill(self,"initializeFromMethodContext:",{aMethodContext:aMethodContext},smalltalk.AIContext)})},
  363. args: ["aMethodContext"],
  364. source: "initializeFromMethodContext: aMethodContext\x0a\x0a\x09self\x0a\x09\x09index: aMethodContext index;\x0a\x09\x09receiver: aMethodContext receiver;\x0a\x09\x09selector: aMethodContext selector.\x0a\x09\x09\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 ] ]",
  365. messageSends: ["index:", "index", "receiver:", "receiver", "selector:", "selector", "ifNotNil:", "outerContext", "methodContext", "outerContext:", "fromMethodContext:", "class", "keysAndValuesDo:", "locals", "at:put:"],
  366. referencedClasses: []
  367. }),
  368. smalltalk.AIContext);
  369. smalltalk.addMethod(
  370. smalltalk.method({
  371. selector: "initializeInterpreter",
  372. category: 'initialization',
  373. fn: function (){
  374. var self=this;
  375. function $ASTInterpreter(){return smalltalk.ASTInterpreter||(typeof ASTInterpreter=="undefined"?nil:ASTInterpreter)}
  376. return smalltalk.withContext(function($ctx1) {
  377. var $1,$2,$3;
  378. $1=_st($ASTInterpreter())._new();
  379. _st($1)._context_(self);
  380. _st($1)._node_(self._retrieveNode());
  381. $2=_st($1)._yourself();
  382. self["@interpreter"]=$2;
  383. $3=_st(_st(self._innerContext())._notNil())._and_((function(){
  384. return smalltalk.withContext(function($ctx2) {
  385. return _st(_st(self._innerContext())._isBlockContext())._not();
  386. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  387. if(smalltalk.assert($3)){
  388. self._setupInterpreter_(self["@interpreter"]);
  389. };
  390. return self}, function($ctx1) {$ctx1.fill(self,"initializeInterpreter",{},smalltalk.AIContext)})},
  391. args: [],
  392. source: "initializeInterpreter\x0a\x09interpreter := ASTInterpreter new\x0a\x09\x09context: self;\x0a\x09\x09node: self retrieveNode;\x0a\x09\x09yourself.\x0a\x09\x0a\x09(self innerContext notNil and: [ \x0a\x09\x09self innerContext isBlockContext not ]) ifTrue: [\x0a\x09\x09\x09self setupInterpreter: interpreter ]",
  393. messageSends: ["context:", "new", "node:", "retrieveNode", "yourself", "ifTrue:", "and:", "notNil", "innerContext", "not", "isBlockContext", "setupInterpreter:"],
  394. referencedClasses: ["ASTInterpreter"]
  395. }),
  396. smalltalk.AIContext);
  397. smalltalk.addMethod(
  398. smalltalk.method({
  399. selector: "initializeLocals",
  400. category: 'initialization',
  401. fn: function (){
  402. var self=this;
  403. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  404. return smalltalk.withContext(function($ctx1) {
  405. self["@locals"]=_st($Dictionary())._new();
  406. _st(self["@locals"])._at_put_("thisContext",self);
  407. return self}, function($ctx1) {$ctx1.fill(self,"initializeLocals",{},smalltalk.AIContext)})},
  408. args: [],
  409. source: "initializeLocals\x0a\x09locals := Dictionary new.\x0a\x09locals at: 'thisContext' put: self.",
  410. messageSends: ["new", "at:put:"],
  411. referencedClasses: ["Dictionary"]
  412. }),
  413. smalltalk.AIContext);
  414. smalltalk.addMethod(
  415. smalltalk.method({
  416. selector: "innerContext",
  417. category: 'accessing',
  418. fn: function (){
  419. var self=this;
  420. return smalltalk.withContext(function($ctx1) {
  421. var $1;
  422. $1=self["@innerContext"];
  423. return $1;
  424. }, function($ctx1) {$ctx1.fill(self,"innerContext",{},smalltalk.AIContext)})},
  425. args: [],
  426. source: "innerContext\x0a\x09^ innerContext",
  427. messageSends: [],
  428. referencedClasses: []
  429. }),
  430. smalltalk.AIContext);
  431. smalltalk.addMethod(
  432. smalltalk.method({
  433. selector: "innerContext:",
  434. category: 'accessing',
  435. fn: function (anAIContext){
  436. var self=this;
  437. return smalltalk.withContext(function($ctx1) {
  438. self["@innerContext"]=anAIContext;
  439. return self}, function($ctx1) {$ctx1.fill(self,"innerContext:",{anAIContext:anAIContext},smalltalk.AIContext)})},
  440. args: ["anAIContext"],
  441. source: "innerContext: anAIContext\x0a\x09innerContext := anAIContext",
  442. messageSends: [],
  443. referencedClasses: []
  444. }),
  445. smalltalk.AIContext);
  446. smalltalk.addMethod(
  447. smalltalk.method({
  448. selector: "interpreter",
  449. category: 'interpreting',
  450. fn: function (){
  451. var self=this;
  452. return smalltalk.withContext(function($ctx1) {
  453. var $1,$2;
  454. $1=self["@interpreter"];
  455. if(($receiver = $1) == nil || $receiver == null){
  456. self._initializeInterpreter();
  457. } else {
  458. $1;
  459. };
  460. $2=self["@interpreter"];
  461. return $2;
  462. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.AIContext)})},
  463. args: [],
  464. source: "interpreter\x0a\x09interpreter ifNil: [ self initializeInterpreter ].\x0a\x09^ interpreter",
  465. messageSends: ["ifNil:", "initializeInterpreter"],
  466. referencedClasses: []
  467. }),
  468. smalltalk.AIContext);
  469. smalltalk.addMethod(
  470. smalltalk.method({
  471. selector: "interpreter:",
  472. category: 'interpreting',
  473. fn: function (anInterpreter){
  474. var self=this;
  475. return smalltalk.withContext(function($ctx1) {
  476. self["@interpreter"]=anInterpreter;
  477. return self}, function($ctx1) {$ctx1.fill(self,"interpreter:",{anInterpreter:anInterpreter},smalltalk.AIContext)})},
  478. args: ["anInterpreter"],
  479. source: "interpreter: anInterpreter\x0a\x09interpreter := anInterpreter",
  480. messageSends: [],
  481. referencedClasses: []
  482. }),
  483. smalltalk.AIContext);
  484. smalltalk.addMethod(
  485. smalltalk.method({
  486. selector: "localAt:",
  487. category: 'accessing',
  488. fn: function (aString){
  489. var self=this;
  490. return smalltalk.withContext(function($ctx1) {
  491. var $2,$1;
  492. $1=_st(self._locals())._at_ifAbsent_(aString,(function(){
  493. return smalltalk.withContext(function($ctx2) {
  494. $2=self._outerContext();
  495. if(($receiver = $2) == nil || $receiver == null){
  496. return $2;
  497. } else {
  498. var context;
  499. context=$receiver;
  500. return _st(context)._localAt_(aString);
  501. };
  502. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  503. return $1;
  504. }, function($ctx1) {$ctx1.fill(self,"localAt:",{aString:aString},smalltalk.AIContext)})},
  505. args: ["aString"],
  506. source: "localAt: aString\x0a\x09\x22Lookup the local value up to the method context\x22\x0a\x0a\x09^ self locals at: aString ifAbsent: [ \x0a\x09\x09self outerContext ifNotNil: [ :context | \x0a\x09\x09\x09context localAt: aString ] ]",
  507. messageSends: ["at:ifAbsent:", "locals", "ifNotNil:", "outerContext", "localAt:"],
  508. referencedClasses: []
  509. }),
  510. smalltalk.AIContext);
  511. smalltalk.addMethod(
  512. smalltalk.method({
  513. selector: "localAt:ifAbsent:",
  514. category: 'accessing',
  515. fn: function (aString,aBlock){
  516. var self=this;
  517. return smalltalk.withContext(function($ctx1) {
  518. var $2,$1;
  519. $1=_st(self._locals())._at_ifAbsent_(aString,(function(){
  520. return smalltalk.withContext(function($ctx2) {
  521. $2=self._outerContext();
  522. if(($receiver = $2) == nil || $receiver == null){
  523. return _st(aBlock)._value();
  524. } else {
  525. var context;
  526. context=$receiver;
  527. return _st(context)._localAt_ifAbsent_(aString,aBlock);
  528. };
  529. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  530. return $1;
  531. }, function($ctx1) {$ctx1.fill(self,"localAt:ifAbsent:",{aString:aString,aBlock:aBlock},smalltalk.AIContext)})},
  532. args: ["aString", "aBlock"],
  533. source: "localAt: aString ifAbsent: aBlock\x0a\x09\x22Lookup the local value up to the method context\x22\x0a\x0a\x09^ self locals at: aString ifAbsent: [ \x0a\x09\x09self outerContext \x0a\x09\x09\x09ifNotNil: [ :context | context localAt: aString ifAbsent: aBlock ]\x0a\x09\x09\x09ifNil: [aBlock value] ]",
  534. messageSends: ["at:ifAbsent:", "locals", "ifNotNil:ifNil:", "outerContext", "localAt:ifAbsent:", "value"],
  535. referencedClasses: []
  536. }),
  537. smalltalk.AIContext);
  538. smalltalk.addMethod(
  539. smalltalk.method({
  540. selector: "localAt:put:",
  541. category: 'accessing',
  542. fn: function (aString,anObject){
  543. var self=this;
  544. return smalltalk.withContext(function($ctx1) {
  545. _st(self._locals())._at_put_(aString,anObject);
  546. return self}, function($ctx1) {$ctx1.fill(self,"localAt:put:",{aString:aString,anObject:anObject},smalltalk.AIContext)})},
  547. args: ["aString", "anObject"],
  548. source: "localAt: aString put: anObject\x0a\x09self locals at: aString put: anObject",
  549. messageSends: ["at:put:", "locals"],
  550. referencedClasses: []
  551. }),
  552. smalltalk.AIContext);
  553. smalltalk.addMethod(
  554. smalltalk.method({
  555. selector: "locals",
  556. category: 'accessing',
  557. fn: function (){
  558. var self=this;
  559. return smalltalk.withContext(function($ctx1) {
  560. var $1,$2;
  561. $1=self["@locals"];
  562. if(($receiver = $1) == nil || $receiver == null){
  563. self._initializeLocals();
  564. } else {
  565. $1;
  566. };
  567. $2=self["@locals"];
  568. return $2;
  569. }, function($ctx1) {$ctx1.fill(self,"locals",{},smalltalk.AIContext)})},
  570. args: [],
  571. source: "locals\x0a\x09locals ifNil: [ self initializeLocals ].\x0a\x09\x0a\x09^ locals",
  572. messageSends: ["ifNil:", "initializeLocals"],
  573. referencedClasses: []
  574. }),
  575. smalltalk.AIContext);
  576. smalltalk.addMethod(
  577. smalltalk.method({
  578. selector: "method",
  579. category: 'accessing',
  580. fn: function (){
  581. var self=this;
  582. return smalltalk.withContext(function($ctx1) {
  583. var $2,$1;
  584. $2=self._methodContext();
  585. if(($receiver = $2) == nil || $receiver == null){
  586. $1=$2;
  587. } else {
  588. $1=_st(_st(_st(self._methodContext())._receiver())._class())._lookupSelector_(_st(self._methodContext())._selector());
  589. };
  590. return $1;
  591. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.AIContext)})},
  592. args: [],
  593. source: "method\x0a\x09^ self methodContext ifNotNil: [\x0a\x09\x09self methodContext receiver class lookupSelector: self methodContext selector ]",
  594. messageSends: ["ifNotNil:", "methodContext", "lookupSelector:", "class", "receiver", "selector"],
  595. referencedClasses: []
  596. }),
  597. smalltalk.AIContext);
  598. smalltalk.addMethod(
  599. smalltalk.method({
  600. selector: "newBlockContext",
  601. category: 'factory',
  602. fn: function (){
  603. var self=this;
  604. return smalltalk.withContext(function($ctx1) {
  605. var $2,$3,$1;
  606. $2=_st(self._class())._new();
  607. _st($2)._outerContext_(self);
  608. $3=_st($2)._yourself();
  609. $1=$3;
  610. return $1;
  611. }, function($ctx1) {$ctx1.fill(self,"newBlockContext",{},smalltalk.AIContext)})},
  612. args: [],
  613. source: "newBlockContext\x0a\x09^ self class new\x0a\x09\x09outerContext: self;\x0a\x09\x09yourself",
  614. messageSends: ["outerContext:", "new", "class", "yourself"],
  615. referencedClasses: []
  616. }),
  617. smalltalk.AIContext);
  618. smalltalk.addMethod(
  619. smalltalk.method({
  620. selector: "outerContext",
  621. category: 'accessing',
  622. fn: function (){
  623. var self=this;
  624. return smalltalk.withContext(function($ctx1) {
  625. var $1;
  626. $1=self["@outerContext"];
  627. return $1;
  628. }, function($ctx1) {$ctx1.fill(self,"outerContext",{},smalltalk.AIContext)})},
  629. args: [],
  630. source: "outerContext\x0a\x09^ outerContext",
  631. messageSends: [],
  632. referencedClasses: []
  633. }),
  634. smalltalk.AIContext);
  635. smalltalk.addMethod(
  636. smalltalk.method({
  637. selector: "outerContext:",
  638. category: 'accessing',
  639. fn: function (anAIContext){
  640. var self=this;
  641. return smalltalk.withContext(function($ctx1) {
  642. self["@outerContext"]=anAIContext;
  643. _st(self["@outerContext"])._innerContext_(self);
  644. return self}, function($ctx1) {$ctx1.fill(self,"outerContext:",{anAIContext:anAIContext},smalltalk.AIContext)})},
  645. args: ["anAIContext"],
  646. source: "outerContext: anAIContext\x0a\x09outerContext := anAIContext.\x0a\x09outerContext innerContext: self",
  647. messageSends: ["innerContext:"],
  648. referencedClasses: []
  649. }),
  650. smalltalk.AIContext);
  651. smalltalk.addMethod(
  652. smalltalk.method({
  653. selector: "receiver",
  654. category: 'interpreting',
  655. fn: function (){
  656. var self=this;
  657. return smalltalk.withContext(function($ctx1) {
  658. var $1;
  659. $1=self._localAt_("self");
  660. return $1;
  661. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.AIContext)})},
  662. args: [],
  663. source: "receiver\x0a\x09^ self localAt: 'self'",
  664. messageSends: ["localAt:"],
  665. referencedClasses: []
  666. }),
  667. smalltalk.AIContext);
  668. smalltalk.addMethod(
  669. smalltalk.method({
  670. selector: "receiver:",
  671. category: 'interpreting',
  672. fn: function (anObject){
  673. var self=this;
  674. return smalltalk.withContext(function($ctx1) {
  675. self._localAt_put_("self",anObject);
  676. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.AIContext)})},
  677. args: ["anObject"],
  678. source: "receiver: anObject\x0a\x09self localAt: 'self' put: anObject",
  679. messageSends: ["localAt:put:"],
  680. referencedClasses: []
  681. }),
  682. smalltalk.AIContext);
  683. smalltalk.addMethod(
  684. smalltalk.method({
  685. selector: "retrieveNode",
  686. category: 'interpreting',
  687. fn: function (){
  688. var self=this;
  689. function $ASTPCNodeVisitor(){return smalltalk.ASTPCNodeVisitor||(typeof ASTPCNodeVisitor=="undefined"?nil:ASTPCNodeVisitor)}
  690. return smalltalk.withContext(function($ctx1) {
  691. var $2,$3,$4,$1;
  692. $2=self._ast();
  693. if(($receiver = $2) == nil || $receiver == null){
  694. $1=$2;
  695. } else {
  696. $3=_st($ASTPCNodeVisitor())._new();
  697. _st($3)._context_(self);
  698. _st($3)._visit_(self._ast());
  699. $4=_st($3)._currentNode();
  700. $1=$4;
  701. };
  702. return $1;
  703. }, function($ctx1) {$ctx1.fill(self,"retrieveNode",{},smalltalk.AIContext)})},
  704. args: [],
  705. source: "retrieveNode\x0a\x09^ self ast ifNotNil: [\x0a\x09\x09ASTPCNodeVisitor new\x0a\x09\x09\x09context: self;\x0a\x09\x09\x09visit: self ast;\x0a\x09\x09\x09currentNode ]",
  706. messageSends: ["ifNotNil:", "ast", "context:", "new", "visit:", "currentNode"],
  707. referencedClasses: ["ASTPCNodeVisitor"]
  708. }),
  709. smalltalk.AIContext);
  710. smalltalk.addMethod(
  711. smalltalk.method({
  712. selector: "selector",
  713. category: 'accessing',
  714. fn: function (){
  715. var self=this;
  716. return smalltalk.withContext(function($ctx1) {
  717. var $1;
  718. $1=self["@selector"];
  719. return $1;
  720. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.AIContext)})},
  721. args: [],
  722. source: "selector\x0a\x09^ selector",
  723. messageSends: [],
  724. referencedClasses: []
  725. }),
  726. smalltalk.AIContext);
  727. smalltalk.addMethod(
  728. smalltalk.method({
  729. selector: "selector:",
  730. category: 'accessing',
  731. fn: function (aString){
  732. var self=this;
  733. return smalltalk.withContext(function($ctx1) {
  734. self["@selector"]=aString;
  735. return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.AIContext)})},
  736. args: ["aString"],
  737. source: "selector: aString\x0a\x09selector := aString",
  738. messageSends: [],
  739. referencedClasses: []
  740. }),
  741. smalltalk.AIContext);
  742. smalltalk.addMethod(
  743. smalltalk.method({
  744. selector: "setupInterpreter:",
  745. category: 'interpreting',
  746. fn: function (anInterpreter){
  747. var self=this;
  748. return smalltalk.withContext(function($ctx1) {
  749. _st(_st(_st(self._innerContext())._arguments())._reversed())._do_((function(each){
  750. return smalltalk.withContext(function($ctx2) {
  751. return _st(anInterpreter)._push_(each);
  752. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  753. _st(anInterpreter)._push_(_st(self._innerContext())._receiver());
  754. return self}, function($ctx1) {$ctx1.fill(self,"setupInterpreter:",{anInterpreter:anInterpreter},smalltalk.AIContext)})},
  755. args: ["anInterpreter"],
  756. source: "setupInterpreter: anInterpreter\x0a\x09\x22Push the send args and receiver to the interpreter stack\x22\x0a\x09\x0a\x09self innerContext arguments reversed do: [ :each | \x0a\x09\x09anInterpreter push: each ].\x0a\x09\x09\x0a\x09anInterpreter push: (self innerContext receiver)",
  757. messageSends: ["do:", "reversed", "arguments", "innerContext", "push:", "receiver"],
  758. referencedClasses: []
  759. }),
  760. smalltalk.AIContext);
  761. smalltalk.addMethod(
  762. smalltalk.method({
  763. selector: "fromMethodContext:",
  764. category: 'instance creation',
  765. fn: function (aMethodContext){
  766. var self=this;
  767. return smalltalk.withContext(function($ctx1) {
  768. var $2,$3,$1;
  769. $2=self._new();
  770. _st($2)._initializeFromMethodContext_(aMethodContext);
  771. $3=_st($2)._yourself();
  772. $1=$3;
  773. return $1;
  774. }, function($ctx1) {$ctx1.fill(self,"fromMethodContext:",{aMethodContext:aMethodContext},smalltalk.AIContext.klass)})},
  775. args: ["aMethodContext"],
  776. source: "fromMethodContext: aMethodContext\x0a\x09^ self new\x0a\x09\x09initializeFromMethodContext: aMethodContext;\x0a\x09\x09yourself",
  777. messageSends: ["initializeFromMethodContext:", "new", "yourself"],
  778. referencedClasses: []
  779. }),
  780. smalltalk.AIContext.klass);
  781. smalltalk.addClass('ASTDebugger', smalltalk.Object, ['interpreter', 'context'], 'Compiler-Interpreter');
  782. 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.";
  783. smalltalk.addMethod(
  784. smalltalk.method({
  785. selector: "atEnd",
  786. category: 'testing',
  787. fn: function (){
  788. var self=this;
  789. return smalltalk.withContext(function($ctx1) {
  790. var $1;
  791. $1=_st(self._interpreter())._atEnd();
  792. return $1;
  793. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.ASTDebugger)})},
  794. args: [],
  795. source: "atEnd\x0a\x09^ self interpreter atEnd",
  796. messageSends: ["atEnd", "interpreter"],
  797. referencedClasses: []
  798. }),
  799. smalltalk.ASTDebugger);
  800. smalltalk.addMethod(
  801. smalltalk.method({
  802. selector: "buildAST",
  803. category: 'initialization',
  804. fn: function (){
  805. var self=this;
  806. var ast;
  807. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  808. function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
  809. return smalltalk.withContext(function($ctx1) {
  810. var $1;
  811. ast=_st(_st($Smalltalk())._current())._parse_(_st(self._method())._source());
  812. _st(_st($SemanticAnalyzer())._on_(_st(_st(self._context())._receiver())._class()))._visit_(ast);
  813. $1=ast;
  814. return $1;
  815. }, function($ctx1) {$ctx1.fill(self,"buildAST",{ast:ast},smalltalk.ASTDebugger)})},
  816. args: [],
  817. 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",
  818. messageSends: ["parse:", "current", "source", "method", "visit:", "on:", "class", "receiver", "context"],
  819. referencedClasses: ["Smalltalk", "SemanticAnalyzer"]
  820. }),
  821. smalltalk.ASTDebugger);
  822. smalltalk.addMethod(
  823. smalltalk.method({
  824. selector: "context",
  825. category: 'accessing',
  826. fn: function (){
  827. var self=this;
  828. return smalltalk.withContext(function($ctx1) {
  829. var $1;
  830. $1=self["@context"];
  831. return $1;
  832. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTDebugger)})},
  833. args: [],
  834. source: "context\x0a\x09^ context",
  835. messageSends: [],
  836. referencedClasses: []
  837. }),
  838. smalltalk.ASTDebugger);
  839. smalltalk.addMethod(
  840. smalltalk.method({
  841. selector: "context:",
  842. category: 'accessing',
  843. fn: function (aContext){
  844. var self=this;
  845. return smalltalk.withContext(function($ctx1) {
  846. self["@context"]=aContext;
  847. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTDebugger)})},
  848. args: ["aContext"],
  849. source: "context: aContext\x0a\x09context := aContext",
  850. messageSends: [],
  851. referencedClasses: []
  852. }),
  853. smalltalk.ASTDebugger);
  854. smalltalk.addMethod(
  855. smalltalk.method({
  856. selector: "defaultInterpreterClass",
  857. category: 'defaults',
  858. fn: function (){
  859. var self=this;
  860. function $ASTInterpreter(){return smalltalk.ASTInterpreter||(typeof ASTInterpreter=="undefined"?nil:ASTInterpreter)}
  861. return smalltalk.withContext(function($ctx1) {
  862. var $1;
  863. $1=$ASTInterpreter();
  864. return $1;
  865. }, function($ctx1) {$ctx1.fill(self,"defaultInterpreterClass",{},smalltalk.ASTDebugger)})},
  866. args: [],
  867. source: "defaultInterpreterClass\x0a\x09^ ASTInterpreter",
  868. messageSends: [],
  869. referencedClasses: ["ASTInterpreter"]
  870. }),
  871. smalltalk.ASTDebugger);
  872. smalltalk.addMethod(
  873. smalltalk.method({
  874. selector: "initializeInterpreter",
  875. category: 'initialization',
  876. fn: function (){
  877. var self=this;
  878. var ast,next;
  879. function $ASTPCNodeVisitor(){return smalltalk.ASTPCNodeVisitor||(typeof ASTPCNodeVisitor=="undefined"?nil:ASTPCNodeVisitor)}
  880. return smalltalk.withContext(function($ctx1) {
  881. var $1,$2;
  882. ast=self._buildAST();
  883. $1=_st($ASTPCNodeVisitor())._new();
  884. _st($1)._context_(self._context());
  885. _st($1)._visit_(ast);
  886. $2=_st($1)._currentNode();
  887. next=$2;
  888. _st(self._interpreter())._node_(next);
  889. return self}, function($ctx1) {$ctx1.fill(self,"initializeInterpreter",{ast:ast,next:next},smalltalk.ASTDebugger)})},
  890. args: [],
  891. 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 node: next",
  892. messageSends: ["buildAST", "context:", "new", "context", "visit:", "currentNode", "node:", "interpreter"],
  893. referencedClasses: ["ASTPCNodeVisitor"]
  894. }),
  895. smalltalk.ASTDebugger);
  896. smalltalk.addMethod(
  897. smalltalk.method({
  898. selector: "initializeWithContext:",
  899. category: 'initialization',
  900. fn: function (aContext){
  901. var self=this;
  902. return smalltalk.withContext(function($ctx1) {
  903. self._context_(aContext);
  904. self._initializeInterpreter();
  905. return self}, function($ctx1) {$ctx1.fill(self,"initializeWithContext:",{aContext:aContext},smalltalk.ASTDebugger)})},
  906. args: ["aContext"],
  907. source: "initializeWithContext: aContext\x0a\x09\x22TODO: do we need to handle block contexts?\x22\x0a\x09\x0a\x09self context: aContext.\x0a\x09self initializeInterpreter",
  908. messageSends: ["context:", "initializeInterpreter"],
  909. referencedClasses: []
  910. }),
  911. smalltalk.ASTDebugger);
  912. smalltalk.addMethod(
  913. smalltalk.method({
  914. selector: "interpreter",
  915. category: 'accessing',
  916. fn: function (){
  917. var self=this;
  918. return smalltalk.withContext(function($ctx1) {
  919. var $2,$1;
  920. $2=self["@interpreter"];
  921. if(($receiver = $2) == nil || $receiver == null){
  922. self["@interpreter"]=_st(self._defaultInterpreterClass())._new();
  923. $1=self["@interpreter"];
  924. } else {
  925. $1=$2;
  926. };
  927. return $1;
  928. }, function($ctx1) {$ctx1.fill(self,"interpreter",{},smalltalk.ASTDebugger)})},
  929. args: [],
  930. source: "interpreter\x0a\x09^ interpreter ifNil: [ interpreter := self defaultInterpreterClass new ]",
  931. messageSends: ["ifNil:", "new", "defaultInterpreterClass"],
  932. referencedClasses: []
  933. }),
  934. smalltalk.ASTDebugger);
  935. smalltalk.addMethod(
  936. smalltalk.method({
  937. selector: "interpreter:",
  938. category: 'accessing',
  939. fn: function (anInterpreter){
  940. var self=this;
  941. return smalltalk.withContext(function($ctx1) {
  942. self["@interpreter"]=anInterpreter;
  943. return self}, function($ctx1) {$ctx1.fill(self,"interpreter:",{anInterpreter:anInterpreter},smalltalk.ASTDebugger)})},
  944. args: ["anInterpreter"],
  945. source: "interpreter: anInterpreter\x0a\x09interpreter := anInterpreter",
  946. messageSends: [],
  947. referencedClasses: []
  948. }),
  949. smalltalk.ASTDebugger);
  950. smalltalk.addMethod(
  951. smalltalk.method({
  952. selector: "method",
  953. category: 'accessing',
  954. fn: function (){
  955. var self=this;
  956. return smalltalk.withContext(function($ctx1) {
  957. var $1;
  958. $1=_st(self._context())._method();
  959. return $1;
  960. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.ASTDebugger)})},
  961. args: [],
  962. source: "method\x0a\x09^ self context method",
  963. messageSends: ["method", "context"],
  964. referencedClasses: []
  965. }),
  966. smalltalk.ASTDebugger);
  967. smalltalk.addMethod(
  968. smalltalk.method({
  969. selector: "nextNode",
  970. category: 'accessing',
  971. fn: function (){
  972. var self=this;
  973. return smalltalk.withContext(function($ctx1) {
  974. var $1;
  975. $1=_st(self._interpreter())._nextNode();
  976. return $1;
  977. }, function($ctx1) {$ctx1.fill(self,"nextNode",{},smalltalk.ASTDebugger)})},
  978. args: [],
  979. source: "nextNode\x0a\x09^ self interpreter nextNode",
  980. messageSends: ["nextNode", "interpreter"],
  981. referencedClasses: []
  982. }),
  983. smalltalk.ASTDebugger);
  984. smalltalk.addMethod(
  985. smalltalk.method({
  986. selector: "proceed",
  987. category: 'stepping',
  988. fn: function (){
  989. var self=this;
  990. return smalltalk.withContext(function($ctx1) {
  991. self._shouldBeImplemented();
  992. return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.ASTDebugger)})},
  993. args: [],
  994. source: "proceed\x0a\x09self shouldBeImplemented",
  995. messageSends: ["shouldBeImplemented"],
  996. referencedClasses: []
  997. }),
  998. smalltalk.ASTDebugger);
  999. smalltalk.addMethod(
  1000. smalltalk.method({
  1001. selector: "restart",
  1002. category: 'stepping',
  1003. fn: function (){
  1004. var self=this;
  1005. return smalltalk.withContext(function($ctx1) {
  1006. _st(self._interpreter())._restart();
  1007. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.ASTDebugger)})},
  1008. args: [],
  1009. source: "restart\x0a\x09self interpreter restart",
  1010. messageSends: ["restart", "interpreter"],
  1011. referencedClasses: []
  1012. }),
  1013. smalltalk.ASTDebugger);
  1014. smalltalk.addMethod(
  1015. smalltalk.method({
  1016. selector: "stepInto",
  1017. category: 'stepping',
  1018. fn: function (){
  1019. var self=this;
  1020. return smalltalk.withContext(function($ctx1) {
  1021. self._shouldBeImplemented();
  1022. return self}, function($ctx1) {$ctx1.fill(self,"stepInto",{},smalltalk.ASTDebugger)})},
  1023. args: [],
  1024. source: "stepInto\x0a\x09self shouldBeImplemented",
  1025. messageSends: ["shouldBeImplemented"],
  1026. referencedClasses: []
  1027. }),
  1028. smalltalk.ASTDebugger);
  1029. smalltalk.addMethod(
  1030. smalltalk.method({
  1031. selector: "stepOver",
  1032. category: 'stepping',
  1033. fn: function (){
  1034. var self=this;
  1035. return smalltalk.withContext(function($ctx1) {
  1036. _st(self._interpreter())._stepOver();
  1037. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.ASTDebugger)})},
  1038. args: [],
  1039. source: "stepOver\x0a\x09self interpreter stepOver",
  1040. messageSends: ["stepOver", "interpreter"],
  1041. referencedClasses: []
  1042. }),
  1043. smalltalk.ASTDebugger);
  1044. smalltalk.addMethod(
  1045. smalltalk.method({
  1046. selector: "context:",
  1047. category: 'instance creation',
  1048. fn: function (aContext){
  1049. var self=this;
  1050. return smalltalk.withContext(function($ctx1) {
  1051. var $2,$3,$1;
  1052. $2=self._new();
  1053. _st($2)._initializeWithContext_(aContext);
  1054. $3=_st($2)._yourself();
  1055. $1=$3;
  1056. return $1;
  1057. }, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTDebugger.klass)})},
  1058. args: ["aContext"],
  1059. source: "context: aContext\x0a\x09^ self new\x0a\x09\x09initializeWithContext: aContext;\x0a\x09\x09yourself",
  1060. messageSends: ["initializeWithContext:", "new", "yourself"],
  1061. referencedClasses: []
  1062. }),
  1063. smalltalk.ASTDebugger.klass);
  1064. smalltalk.addClass('ASTInterpreter', smalltalk.NodeVisitor, ['node', 'context', 'stack', 'returnValue', 'returned'], 'Compiler-Interpreter');
  1065. smalltalk.ASTInterpreter.comment="I visit an AST, interpreting (evaluating) nodes one after the other, using a small stack machine.\x0a\x0a## API\x0a\x0aWhile my instances should be used from within an `ASTDebugger`, which provides a more high level interface,\x0ayou can use methods from the `interpreting` protocol:\x0a\x0a- `#step` evaluates the current `node` only\x0a- `#stepOver` evaluates the AST from the current `node` up to the next stepping node (most likely the next send node)\x0a- `#proceed` evaluates eagerly the AST\x0a- `#restart` select the first node of the AST\x0a- `#skip` skips the current node, moving to the next one if any";
  1066. smalltalk.addMethod(
  1067. smalltalk.method({
  1068. selector: "assign:to:",
  1069. category: 'private',
  1070. fn: function (aNode,anObject){
  1071. var self=this;
  1072. return smalltalk.withContext(function($ctx1) {
  1073. var $1;
  1074. $1=_st(_st(aNode)._binding())._isInstanceVar();
  1075. if(smalltalk.assert($1)){
  1076. _st(_st(self._context())._receiver())._instVarAt_put_(_st(aNode)._value(),anObject);
  1077. } else {
  1078. _st(self._context())._localAt_put_(_st(aNode)._value(),anObject);
  1079. };
  1080. return self}, function($ctx1) {$ctx1.fill(self,"assign:to:",{aNode:aNode,anObject:anObject},smalltalk.ASTInterpreter)})},
  1081. args: ["aNode", "anObject"],
  1082. source: "assign: aNode to: anObject\x0a\x09aNode binding isInstanceVar\x0a\x09\x09ifTrue: [ self context receiver instVarAt: aNode value put: anObject ]\x0a\x09\x09ifFalse: [ self context localAt: aNode value put: anObject ]",
  1083. messageSends: ["ifTrue:ifFalse:", "isInstanceVar", "binding", "instVarAt:put:", "receiver", "context", "value", "localAt:put:"],
  1084. referencedClasses: []
  1085. }),
  1086. smalltalk.ASTInterpreter);
  1087. smalltalk.addMethod(
  1088. smalltalk.method({
  1089. selector: "atEnd",
  1090. category: 'testing',
  1091. fn: function (){
  1092. var self=this;
  1093. return smalltalk.withContext(function($ctx1) {
  1094. var $1;
  1095. $1=_st(self._hasReturned())._or_((function(){
  1096. return smalltalk.withContext(function($ctx2) {
  1097. return _st(self._node())._isNil();
  1098. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1099. return $1;
  1100. }, function($ctx1) {$ctx1.fill(self,"atEnd",{},smalltalk.ASTInterpreter)})},
  1101. args: [],
  1102. source: "atEnd\x0a\x09^ self hasReturned or: [ self node isNil ]",
  1103. messageSends: ["or:", "hasReturned", "isNil", "node"],
  1104. referencedClasses: []
  1105. }),
  1106. smalltalk.ASTInterpreter);
  1107. smalltalk.addMethod(
  1108. smalltalk.method({
  1109. selector: "context",
  1110. category: 'accessing',
  1111. fn: function (){
  1112. var self=this;
  1113. return smalltalk.withContext(function($ctx1) {
  1114. var $1;
  1115. $1=self["@context"];
  1116. return $1;
  1117. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTInterpreter)})},
  1118. args: [],
  1119. source: "context\x0a\x09^ context",
  1120. messageSends: [],
  1121. referencedClasses: []
  1122. }),
  1123. smalltalk.ASTInterpreter);
  1124. smalltalk.addMethod(
  1125. smalltalk.method({
  1126. selector: "context:",
  1127. category: 'accessing',
  1128. fn: function (aContext){
  1129. var self=this;
  1130. return smalltalk.withContext(function($ctx1) {
  1131. self["@context"]=aContext;
  1132. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTInterpreter)})},
  1133. args: ["aContext"],
  1134. source: "context: aContext\x0a\x09context := aContext",
  1135. messageSends: [],
  1136. referencedClasses: []
  1137. }),
  1138. smalltalk.ASTInterpreter);
  1139. smalltalk.addMethod(
  1140. smalltalk.method({
  1141. selector: "eval:",
  1142. category: 'private',
  1143. fn: function (aString){
  1144. var self=this;
  1145. var source,function_;
  1146. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1147. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  1148. return smalltalk.withContext(function($ctx1) {
  1149. var $1,$2,$3;
  1150. source=_st($String())._streamContents_((function(str){
  1151. return smalltalk.withContext(function($ctx2) {
  1152. _st(str)._nextPutAll_("(function(");
  1153. _st(_st(_st(self._context())._locals())._keys())._do_separatedBy_((function(each){
  1154. return smalltalk.withContext(function($ctx3) {
  1155. return _st(str)._nextPutAll_(each);
  1156. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}),(function(){
  1157. return smalltalk.withContext(function($ctx3) {
  1158. return _st(str)._nextPutAll_(",");
  1159. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  1160. $1=str;
  1161. _st($1)._nextPutAll_("){ return (function() {");
  1162. _st($1)._nextPutAll_(aString);
  1163. $2=_st($1)._nextPutAll_("})() })");
  1164. return $2;
  1165. }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)})}));
  1166. function_=_st(_st($Compiler())._new())._eval_(source);
  1167. $3=_st(function_)._valueWithPossibleArguments_(_st(_st(self._context())._locals())._values());
  1168. return $3;
  1169. }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString,source:source,function_:function_},smalltalk.ASTInterpreter)})},
  1170. args: ["aString"],
  1171. 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",
  1172. messageSends: ["streamContents:", "nextPutAll:", "do:separatedBy:", "keys", "locals", "context", "eval:", "new", "valueWithPossibleArguments:", "values"],
  1173. referencedClasses: ["String", "Compiler"]
  1174. }),
  1175. smalltalk.ASTInterpreter);
  1176. smalltalk.addMethod(
  1177. smalltalk.method({
  1178. selector: "hasReturned",
  1179. category: 'testing',
  1180. fn: function (){
  1181. var self=this;
  1182. return smalltalk.withContext(function($ctx1) {
  1183. var $2,$1;
  1184. $2=self["@returned"];
  1185. if(($receiver = $2) == nil || $receiver == null){
  1186. $1=false;
  1187. } else {
  1188. $1=$2;
  1189. };
  1190. return $1;
  1191. }, function($ctx1) {$ctx1.fill(self,"hasReturned",{},smalltalk.ASTInterpreter)})},
  1192. args: [],
  1193. source: "hasReturned\x0a\x09^ returned ifNil: [ false ]",
  1194. messageSends: ["ifNil:"],
  1195. referencedClasses: []
  1196. }),
  1197. smalltalk.ASTInterpreter);
  1198. smalltalk.addMethod(
  1199. smalltalk.method({
  1200. selector: "interpret",
  1201. category: 'interpreting',
  1202. fn: function (){
  1203. var self=this;
  1204. return smalltalk.withContext(function($ctx1) {
  1205. self._visit_(self._node());
  1206. return self}, function($ctx1) {$ctx1.fill(self,"interpret",{},smalltalk.ASTInterpreter)})},
  1207. args: [],
  1208. source: "interpret\x0a\x09\x22Interpret the next node to be evaluated\x22\x0a\x09\x0a\x09self visit: self node",
  1209. messageSends: ["visit:", "node"],
  1210. referencedClasses: []
  1211. }),
  1212. smalltalk.ASTInterpreter);
  1213. smalltalk.addMethod(
  1214. smalltalk.method({
  1215. selector: "interpret:",
  1216. category: 'interpreting',
  1217. fn: function (aNode){
  1218. var self=this;
  1219. return smalltalk.withContext(function($ctx1) {
  1220. self._node_(aNode);
  1221. self._interpret();
  1222. return self}, function($ctx1) {$ctx1.fill(self,"interpret:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1223. args: ["aNode"],
  1224. source: "interpret: aNode\x0a\x09self node: aNode.\x0a\x09self interpret",
  1225. messageSends: ["node:", "interpret"],
  1226. referencedClasses: []
  1227. }),
  1228. smalltalk.ASTInterpreter);
  1229. smalltalk.addMethod(
  1230. smalltalk.method({
  1231. selector: "messageFromSendNode:arguments:",
  1232. category: 'private',
  1233. fn: function (aSendNode,aCollection){
  1234. var self=this;
  1235. function $Message(){return smalltalk.Message||(typeof Message=="undefined"?nil:Message)}
  1236. return smalltalk.withContext(function($ctx1) {
  1237. var $2,$3,$1;
  1238. $2=_st($Message())._new();
  1239. _st($2)._selector_(_st(aSendNode)._selector());
  1240. _st($2)._arguments_(aCollection);
  1241. $3=_st($2)._yourself();
  1242. $1=$3;
  1243. return $1;
  1244. }, function($ctx1) {$ctx1.fill(self,"messageFromSendNode:arguments:",{aSendNode:aSendNode,aCollection:aCollection},smalltalk.ASTInterpreter)})},
  1245. args: ["aSendNode", "aCollection"],
  1246. source: "messageFromSendNode: aSendNode arguments: aCollection\x0a\x09^ Message new\x0a\x09\x09selector: aSendNode selector;\x0a\x09\x09arguments: aCollection;\x0a\x09\x09yourself",
  1247. messageSends: ["selector:", "new", "selector", "arguments:", "yourself"],
  1248. referencedClasses: ["Message"]
  1249. }),
  1250. smalltalk.ASTInterpreter);
  1251. smalltalk.addMethod(
  1252. smalltalk.method({
  1253. selector: "messageNotUnderstood:receiver:",
  1254. category: 'private',
  1255. fn: function (aMessage,anObject){
  1256. var self=this;
  1257. function $MessageNotUnderstood(){return smalltalk.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
  1258. return smalltalk.withContext(function($ctx1) {
  1259. var $1,$2;
  1260. $1=_st($MessageNotUnderstood())._new();
  1261. _st($1)._meesage_(aMessage);
  1262. _st($1)._receiver_(anObject);
  1263. $2=_st($1)._signal();
  1264. return self}, function($ctx1) {$ctx1.fill(self,"messageNotUnderstood:receiver:",{aMessage:aMessage,anObject:anObject},smalltalk.ASTInterpreter)})},
  1265. args: ["aMessage", "anObject"],
  1266. source: "messageNotUnderstood: aMessage receiver: anObject\x0a\x09MessageNotUnderstood new\x0a\x09\x09meesage: aMessage;\x0a\x09\x09receiver: anObject;\x0a\x09\x09signal",
  1267. messageSends: ["meesage:", "new", "receiver:", "signal"],
  1268. referencedClasses: ["MessageNotUnderstood"]
  1269. }),
  1270. smalltalk.ASTInterpreter);
  1271. smalltalk.addMethod(
  1272. smalltalk.method({
  1273. selector: "next",
  1274. category: 'interpreting',
  1275. fn: function (){
  1276. var self=this;
  1277. return smalltalk.withContext(function($ctx1) {
  1278. self._node_(_st(self._node())._nextNode());
  1279. return self}, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.ASTInterpreter)})},
  1280. args: [],
  1281. source: "next\x0a\x09self node: self node nextNode",
  1282. messageSends: ["node:", "nextNode", "node"],
  1283. referencedClasses: []
  1284. }),
  1285. smalltalk.ASTInterpreter);
  1286. smalltalk.addMethod(
  1287. smalltalk.method({
  1288. selector: "node",
  1289. category: 'accessing',
  1290. fn: function (){
  1291. var self=this;
  1292. return smalltalk.withContext(function($ctx1) {
  1293. var $1;
  1294. $1=self["@node"];
  1295. return $1;
  1296. }, function($ctx1) {$ctx1.fill(self,"node",{},smalltalk.ASTInterpreter)})},
  1297. args: [],
  1298. source: "node\x0a\x09\x22Answer the next node, ie the node to be evaluated in the next step\x22\x0a\x09\x0a\x09^ node",
  1299. messageSends: [],
  1300. referencedClasses: []
  1301. }),
  1302. smalltalk.ASTInterpreter);
  1303. smalltalk.addMethod(
  1304. smalltalk.method({
  1305. selector: "node:",
  1306. category: 'accessing',
  1307. fn: function (aNode){
  1308. var self=this;
  1309. return smalltalk.withContext(function($ctx1) {
  1310. self["@node"]=aNode;
  1311. return self}, function($ctx1) {$ctx1.fill(self,"node:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1312. args: ["aNode"],
  1313. source: "node: aNode\x0a\x09node := aNode",
  1314. messageSends: [],
  1315. referencedClasses: []
  1316. }),
  1317. smalltalk.ASTInterpreter);
  1318. smalltalk.addMethod(
  1319. smalltalk.method({
  1320. selector: "peek",
  1321. category: 'stack',
  1322. fn: function (){
  1323. var self=this;
  1324. return smalltalk.withContext(function($ctx1) {
  1325. var $1;
  1326. var $early={};
  1327. try {
  1328. _st(self._stack())._ifEmpty_((function(){
  1329. return smalltalk.withContext(function($ctx2) {
  1330. throw $early=[nil];
  1331. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1332. $1=_st(self._stack())._last();
  1333. return $1;
  1334. }
  1335. catch(e) {if(e===$early)return e[0]; throw e}
  1336. }, function($ctx1) {$ctx1.fill(self,"peek",{},smalltalk.ASTInterpreter)})},
  1337. args: [],
  1338. source: "peek\x0a\x09\x22Peek the top object of the context stack\x22\x0a\x09\x0a\x09self stack ifEmpty: [ ^ nil ].\x0a\x09\x0a\x09^ self stack last",
  1339. messageSends: ["ifEmpty:", "stack", "last"],
  1340. referencedClasses: []
  1341. }),
  1342. smalltalk.ASTInterpreter);
  1343. smalltalk.addMethod(
  1344. smalltalk.method({
  1345. selector: "pop",
  1346. category: 'stack',
  1347. fn: function (){
  1348. var self=this;
  1349. var peekedValue;
  1350. return smalltalk.withContext(function($ctx1) {
  1351. var $1;
  1352. peekedValue=self._peek();
  1353. _st(self._stack())._removeLast();
  1354. $1=peekedValue;
  1355. return $1;
  1356. }, function($ctx1) {$ctx1.fill(self,"pop",{peekedValue:peekedValue},smalltalk.ASTInterpreter)})},
  1357. args: [],
  1358. source: "pop\x0a\x09\x22Pop an object from the context stack\x22\x0a\x09\x0a\x09| peekedValue |\x0a\x09\x0a\x09peekedValue := self peek.\x0a\x09self stack removeLast.\x0a\x09^ peekedValue",
  1359. messageSends: ["peek", "removeLast", "stack"],
  1360. referencedClasses: []
  1361. }),
  1362. smalltalk.ASTInterpreter);
  1363. smalltalk.addMethod(
  1364. smalltalk.method({
  1365. selector: "proceed",
  1366. category: 'interpreting',
  1367. fn: function (){
  1368. var self=this;
  1369. return smalltalk.withContext(function($ctx1) {
  1370. _st((function(){
  1371. return smalltalk.withContext(function($ctx2) {
  1372. return self._atEnd();
  1373. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileFalse_((function(){
  1374. return smalltalk.withContext(function($ctx2) {
  1375. return self._step();
  1376. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1377. return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.ASTInterpreter)})},
  1378. args: [],
  1379. source: "proceed\x0a\x09\x22Eagerly evaluate the ast\x22\x0a\x09\x0a\x09[ self atEnd ] whileFalse: [ \x0a\x09\x09self step ]",
  1380. messageSends: ["whileFalse:", "atEnd", "step"],
  1381. referencedClasses: []
  1382. }),
  1383. smalltalk.ASTInterpreter);
  1384. smalltalk.addMethod(
  1385. smalltalk.method({
  1386. selector: "push:",
  1387. category: 'stack',
  1388. fn: function (anObject){
  1389. var self=this;
  1390. return smalltalk.withContext(function($ctx1) {
  1391. var $1;
  1392. $1=_st(self._stack())._add_(anObject);
  1393. return $1;
  1394. }, function($ctx1) {$ctx1.fill(self,"push:",{anObject:anObject},smalltalk.ASTInterpreter)})},
  1395. args: ["anObject"],
  1396. source: "push: anObject\x0a\x09\x22Push an object to the context stack\x22\x0a\x09\x0a\x09^ self stack add: anObject",
  1397. messageSends: ["add:", "stack"],
  1398. referencedClasses: []
  1399. }),
  1400. smalltalk.ASTInterpreter);
  1401. smalltalk.addMethod(
  1402. smalltalk.method({
  1403. selector: "restart",
  1404. category: 'interpreting',
  1405. fn: function (){
  1406. var self=this;
  1407. return smalltalk.withContext(function($ctx1) {
  1408. self._node_(_st(_st(self._context())._ast())._nextChild());
  1409. return self}, function($ctx1) {$ctx1.fill(self,"restart",{},smalltalk.ASTInterpreter)})},
  1410. args: [],
  1411. source: "restart\x0a\x09self node: self context ast nextChild",
  1412. messageSends: ["node:", "nextChild", "ast", "context"],
  1413. referencedClasses: []
  1414. }),
  1415. smalltalk.ASTInterpreter);
  1416. smalltalk.addMethod(
  1417. smalltalk.method({
  1418. selector: "result",
  1419. category: 'accessing',
  1420. fn: function (){
  1421. var self=this;
  1422. return smalltalk.withContext(function($ctx1) {
  1423. var $2,$1;
  1424. $2=self._hasReturned();
  1425. if(smalltalk.assert($2)){
  1426. $1=self._returnValue();
  1427. } else {
  1428. $1=_st(self._context())._receiver();
  1429. };
  1430. return $1;
  1431. }, function($ctx1) {$ctx1.fill(self,"result",{},smalltalk.ASTInterpreter)})},
  1432. args: [],
  1433. source: "result\x0a\x09^ self hasReturned \x0a\x09\x09ifTrue: [ self returnValue ] \x0a\x09\x09ifFalse: [ self context receiver ]",
  1434. messageSends: ["ifTrue:ifFalse:", "hasReturned", "returnValue", "receiver", "context"],
  1435. referencedClasses: []
  1436. }),
  1437. smalltalk.ASTInterpreter);
  1438. smalltalk.addMethod(
  1439. smalltalk.method({
  1440. selector: "returnValue",
  1441. category: 'accessing',
  1442. fn: function (){
  1443. var self=this;
  1444. return smalltalk.withContext(function($ctx1) {
  1445. var $1;
  1446. $1=self["@returnValue"];
  1447. return $1;
  1448. }, function($ctx1) {$ctx1.fill(self,"returnValue",{},smalltalk.ASTInterpreter)})},
  1449. args: [],
  1450. source: "returnValue\x0a\x09^ returnValue",
  1451. messageSends: [],
  1452. referencedClasses: []
  1453. }),
  1454. smalltalk.ASTInterpreter);
  1455. smalltalk.addMethod(
  1456. smalltalk.method({
  1457. selector: "returnValue:",
  1458. category: 'accessing',
  1459. fn: function (anObject){
  1460. var self=this;
  1461. return smalltalk.withContext(function($ctx1) {
  1462. self["@returnValue"]=anObject;
  1463. return self}, function($ctx1) {$ctx1.fill(self,"returnValue:",{anObject:anObject},smalltalk.ASTInterpreter)})},
  1464. args: ["anObject"],
  1465. source: "returnValue: anObject\x0a\x09returnValue := anObject",
  1466. messageSends: [],
  1467. referencedClasses: []
  1468. }),
  1469. smalltalk.ASTInterpreter);
  1470. smalltalk.addMethod(
  1471. smalltalk.method({
  1472. selector: "sendMessage:to:superSend:",
  1473. category: 'private',
  1474. fn: function (aMessage,anObject,aBoolean){
  1475. var self=this;
  1476. var method;
  1477. return smalltalk.withContext(function($ctx1) {
  1478. var $1,$2,$3,$4,$5,$6;
  1479. var $early={};
  1480. try {
  1481. $1=aBoolean;
  1482. if(! smalltalk.assert($1)){
  1483. $2=_st(aMessage)._sendTo_(anObject);
  1484. return $2;
  1485. };
  1486. $3=_st(_st(anObject)._class())._superclass();
  1487. if(($receiver = $3) == nil || $receiver == null){
  1488. $4=self._messageNotUnderstood_receiver_(aMessage,anObject);
  1489. return $4;
  1490. } else {
  1491. $3;
  1492. };
  1493. method=_st(_st(_st(_st(anObject)._class())._superclass())._methodDictionary())._at_ifAbsent_(_st(aMessage)._selector(),(function(){
  1494. return smalltalk.withContext(function($ctx2) {
  1495. $5=self._messageNotUnderstood_receiver_(aMessage,anObject);
  1496. throw $early=[$5];
  1497. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  1498. $6=_st(method)._sendTo_arguments_(anObject,_st(aMessage)._arguments());
  1499. return $6;
  1500. }
  1501. catch(e) {if(e===$early)return e[0]; throw e}
  1502. }, function($ctx1) {$ctx1.fill(self,"sendMessage:to:superSend:",{aMessage:aMessage,anObject:anObject,aBoolean:aBoolean,method:method},smalltalk.ASTInterpreter)})},
  1503. args: ["aMessage", "anObject", "aBoolean"],
  1504. 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 sendTo: anObject arguments: aMessage arguments",
  1505. messageSends: ["ifFalse:", "sendTo:", "ifNil:", "superclass", "class", "messageNotUnderstood:receiver:", "at:ifAbsent:", "methodDictionary", "selector", "sendTo:arguments:", "arguments"],
  1506. referencedClasses: []
  1507. }),
  1508. smalltalk.ASTInterpreter);
  1509. smalltalk.addMethod(
  1510. smalltalk.method({
  1511. selector: "setNonLocalReturnFromContext:",
  1512. category: 'interpreting',
  1513. fn: function (aContext){
  1514. var self=this;
  1515. return smalltalk.withContext(function($ctx1) {
  1516. var $1;
  1517. $1=_st(_st(aContext)._interpreter())._hasReturned();
  1518. if(smalltalk.assert($1)){
  1519. self["@returned"]=true;
  1520. self["@returned"];
  1521. self._returnValue_(_st(_st(aContext)._interpreter())._returnValue());
  1522. };
  1523. return self}, function($ctx1) {$ctx1.fill(self,"setNonLocalReturnFromContext:",{aContext:aContext},smalltalk.ASTInterpreter)})},
  1524. args: ["aContext"],
  1525. source: "setNonLocalReturnFromContext: aContext\x0a\x09aContext interpreter hasReturned ifTrue: [\x0a\x09\x09returned := true.\x0a\x09\x09self returnValue: aContext interpreter returnValue ]",
  1526. messageSends: ["ifTrue:", "hasReturned", "interpreter", "returnValue:", "returnValue"],
  1527. referencedClasses: []
  1528. }),
  1529. smalltalk.ASTInterpreter);
  1530. smalltalk.addMethod(
  1531. smalltalk.method({
  1532. selector: "skip",
  1533. category: 'interpreting',
  1534. fn: function (){
  1535. var self=this;
  1536. return smalltalk.withContext(function($ctx1) {
  1537. self._next();
  1538. return self}, function($ctx1) {$ctx1.fill(self,"skip",{},smalltalk.ASTInterpreter)})},
  1539. args: [],
  1540. source: "skip\x0a\x09self next",
  1541. messageSends: ["next"],
  1542. referencedClasses: []
  1543. }),
  1544. smalltalk.ASTInterpreter);
  1545. smalltalk.addMethod(
  1546. smalltalk.method({
  1547. selector: "stack",
  1548. category: 'accessing',
  1549. fn: function (){
  1550. var self=this;
  1551. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  1552. return smalltalk.withContext(function($ctx1) {
  1553. var $2,$1;
  1554. $2=self["@stack"];
  1555. if(($receiver = $2) == nil || $receiver == null){
  1556. self["@stack"]=_st($OrderedCollection())._new();
  1557. $1=self["@stack"];
  1558. } else {
  1559. $1=$2;
  1560. };
  1561. return $1;
  1562. }, function($ctx1) {$ctx1.fill(self,"stack",{},smalltalk.ASTInterpreter)})},
  1563. args: [],
  1564. source: "stack\x0a\x09^ stack ifNil: [ stack := OrderedCollection new ]",
  1565. messageSends: ["ifNil:", "new"],
  1566. referencedClasses: ["OrderedCollection"]
  1567. }),
  1568. smalltalk.ASTInterpreter);
  1569. smalltalk.addMethod(
  1570. smalltalk.method({
  1571. selector: "step",
  1572. category: 'interpreting',
  1573. fn: function (){
  1574. var self=this;
  1575. return smalltalk.withContext(function($ctx1) {
  1576. var $1,$2;
  1577. $1=self;
  1578. _st($1)._interpret();
  1579. $2=_st($1)._next();
  1580. return self}, function($ctx1) {$ctx1.fill(self,"step",{},smalltalk.ASTInterpreter)})},
  1581. args: [],
  1582. source: "step\x0a\x09self \x0a\x09\x09interpret; \x0a\x09\x09next",
  1583. messageSends: ["interpret", "next"],
  1584. referencedClasses: []
  1585. }),
  1586. smalltalk.ASTInterpreter);
  1587. smalltalk.addMethod(
  1588. smalltalk.method({
  1589. selector: "stepOver",
  1590. category: 'interpreting',
  1591. fn: function (){
  1592. var self=this;
  1593. return smalltalk.withContext(function($ctx1) {
  1594. self._step();
  1595. _st((function(){
  1596. return smalltalk.withContext(function($ctx2) {
  1597. return _st(self._node())._isSteppingNode();
  1598. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileFalse_((function(){
  1599. return smalltalk.withContext(function($ctx2) {
  1600. return self._step();
  1601. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1602. return self}, function($ctx1) {$ctx1.fill(self,"stepOver",{},smalltalk.ASTInterpreter)})},
  1603. args: [],
  1604. source: "stepOver\x0a\x09self step.\x0a\x09\x0a\x09[ self node isSteppingNode ] whileFalse: [ \x0a\x09\x09self step ]",
  1605. messageSends: ["step", "whileFalse:", "isSteppingNode", "node"],
  1606. referencedClasses: []
  1607. }),
  1608. smalltalk.ASTInterpreter);
  1609. smalltalk.addMethod(
  1610. smalltalk.method({
  1611. selector: "visit:",
  1612. category: 'visiting',
  1613. fn: function (aNode){
  1614. var self=this;
  1615. return smalltalk.withContext(function($ctx1) {
  1616. var $1;
  1617. $1=self._hasReturned();
  1618. if(! smalltalk.assert($1)){
  1619. smalltalk.ASTInterpreter.superclass.fn.prototype._visit_.apply(_st(self), [aNode]);
  1620. };
  1621. return self}, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1622. args: ["aNode"],
  1623. source: "visit: aNode\x0a\x09self hasReturned ifFalse: [ super visit: aNode ]",
  1624. messageSends: ["ifFalse:", "hasReturned", "visit:"],
  1625. referencedClasses: []
  1626. }),
  1627. smalltalk.ASTInterpreter);
  1628. smalltalk.addMethod(
  1629. smalltalk.method({
  1630. selector: "visitAssignmentNode:",
  1631. category: 'visiting',
  1632. fn: function (aNode){
  1633. var self=this;
  1634. var poppedValue;
  1635. return smalltalk.withContext(function($ctx1) {
  1636. poppedValue=self._pop();
  1637. self._pop();
  1638. self._push_(poppedValue);
  1639. self._assign_to_(_st(aNode)._left(),poppedValue);
  1640. return self}, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode,poppedValue:poppedValue},smalltalk.ASTInterpreter)})},
  1641. args: ["aNode"],
  1642. source: "visitAssignmentNode: aNode\x0a\x09| poppedValue |\x0a\x09\x0a\x09poppedValue := self pop.\x0a\x09\x0a\x09\x22Pop the left side of the assignment.\x0a\x09It already has been visited, and we don't need its value.\x22\x0a\x09self pop.\x0a\x09\x0a\x09self push: poppedValue.\x0a\x09self assign: aNode left to: poppedValue",
  1643. messageSends: ["pop", "push:", "assign:to:", "left"],
  1644. referencedClasses: []
  1645. }),
  1646. smalltalk.ASTInterpreter);
  1647. smalltalk.addMethod(
  1648. smalltalk.method({
  1649. selector: "visitBlockNode:",
  1650. category: 'visiting',
  1651. fn: function (aNode){
  1652. var self=this;
  1653. var block;
  1654. function $AIBlockClosure(){return smalltalk.AIBlockClosure||(typeof AIBlockClosure=="undefined"?nil:AIBlockClosure)}
  1655. return smalltalk.withContext(function($ctx1) {
  1656. block=_st($AIBlockClosure())._forContext_node_(self._context(),aNode);
  1657. self._push_(block);
  1658. return self}, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode,block:block},smalltalk.ASTInterpreter)})},
  1659. args: ["aNode"],
  1660. source: "visitBlockNode: aNode\x0a\x09\x22Do not evaluate the block node.\x0a\x09Instead, put all instructions into a block that we push to the stack for later evaluation\x22\x0a\x09\x0a\x09| block |\x0a\x09\x0a\x09block := AIBlockClosure forContext: self context node: aNode.\x0a\x09\x0a\x09self push: block",
  1661. messageSends: ["forContext:node:", "context", "push:"],
  1662. referencedClasses: ["AIBlockClosure"]
  1663. }),
  1664. smalltalk.ASTInterpreter);
  1665. smalltalk.addMethod(
  1666. smalltalk.method({
  1667. selector: "visitDynamicArrayNode:",
  1668. category: 'visiting',
  1669. fn: function (aNode){
  1670. var self=this;
  1671. var array;
  1672. return smalltalk.withContext(function($ctx1) {
  1673. array=[];
  1674. _st(_st(aNode)._nodes())._do_((function(each){
  1675. return smalltalk.withContext(function($ctx2) {
  1676. return _st(array)._addFirst_(self._pop());
  1677. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1678. self._push_(array);
  1679. return self}, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode,array:array},smalltalk.ASTInterpreter)})},
  1680. args: ["aNode"],
  1681. source: "visitDynamicArrayNode: aNode\x0a\x09| array |\x0a\x09\x0a\x09array := #().\x0a\x09aNode nodes do: [ :each |\x0a\x09\x09array addFirst: self pop ].\x0a\x09\x0a\x09self push: array",
  1682. messageSends: ["do:", "nodes", "addFirst:", "pop", "push:"],
  1683. referencedClasses: []
  1684. }),
  1685. smalltalk.ASTInterpreter);
  1686. smalltalk.addMethod(
  1687. smalltalk.method({
  1688. selector: "visitDynamicDictionaryNode:",
  1689. category: 'visiting',
  1690. fn: function (aNode){
  1691. var self=this;
  1692. var associations,hashedCollection;
  1693. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  1694. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  1695. return smalltalk.withContext(function($ctx1) {
  1696. associations=_st($OrderedCollection())._new();
  1697. hashedCollection=_st($HashedCollection())._new();
  1698. _st(_st(aNode)._nodes())._do_((function(each){
  1699. return smalltalk.withContext(function($ctx2) {
  1700. return _st(associations)._add_(self._pop());
  1701. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1702. _st(_st(associations)._reversed())._do_((function(each){
  1703. return smalltalk.withContext(function($ctx2) {
  1704. return _st(hashedCollection)._add_(each);
  1705. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
  1706. self._push_(hashedCollection);
  1707. return self}, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode,associations:associations,hashedCollection:hashedCollection},smalltalk.ASTInterpreter)})},
  1708. args: ["aNode"],
  1709. source: "visitDynamicDictionaryNode: aNode\x0a\x09| associations hashedCollection |\x0a\x09\x0a\x09associations := OrderedCollection new.\x0a\x09hashedCollection := HashedCollection new.\x0a\x09\x0a\x09aNode nodes do: [ :each | \x0a\x09\x09associations add: self pop ].\x0a\x09\x0a\x09associations reversed do: [ :each |\x0a\x09\x09hashedCollection add: each ].\x0a\x09\x0a\x09self push: hashedCollection",
  1710. messageSends: ["new", "do:", "nodes", "add:", "pop", "reversed", "push:"],
  1711. referencedClasses: ["OrderedCollection", "HashedCollection"]
  1712. }),
  1713. smalltalk.ASTInterpreter);
  1714. smalltalk.addMethod(
  1715. smalltalk.method({
  1716. selector: "visitJSStatementNode:",
  1717. category: 'visiting',
  1718. fn: function (aNode){
  1719. var self=this;
  1720. return smalltalk.withContext(function($ctx1) {
  1721. self["@returned"]=true;
  1722. self._returnValue_(self._eval_(_st(aNode)._source()));
  1723. return self}, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1724. args: ["aNode"],
  1725. source: "visitJSStatementNode: aNode\x0a\x09returned := true.\x0a\x09self returnValue: (self eval: aNode source)",
  1726. messageSends: ["returnValue:", "eval:", "source"],
  1727. referencedClasses: []
  1728. }),
  1729. smalltalk.ASTInterpreter);
  1730. smalltalk.addMethod(
  1731. smalltalk.method({
  1732. selector: "visitNode:",
  1733. category: 'visiting',
  1734. fn: function (aNode){
  1735. var self=this;
  1736. return smalltalk.withContext(function($ctx1) {
  1737. return self}, function($ctx1) {$ctx1.fill(self,"visitNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1738. args: ["aNode"],
  1739. source: "visitNode: aNode\x0a\x09\x22Do nothing by default. Especially, do not visit children recursively.\x22",
  1740. messageSends: [],
  1741. referencedClasses: []
  1742. }),
  1743. smalltalk.ASTInterpreter);
  1744. smalltalk.addMethod(
  1745. smalltalk.method({
  1746. selector: "visitReturnNode:",
  1747. category: 'visiting',
  1748. fn: function (aNode){
  1749. var self=this;
  1750. return smalltalk.withContext(function($ctx1) {
  1751. self["@returned"]=true;
  1752. self._returnValue_(self._pop());
  1753. return self}, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1754. args: ["aNode"],
  1755. source: "visitReturnNode: aNode\x0a\x09returned := true.\x0a\x09self returnValue: self pop",
  1756. messageSends: ["returnValue:", "pop"],
  1757. referencedClasses: []
  1758. }),
  1759. smalltalk.ASTInterpreter);
  1760. smalltalk.addMethod(
  1761. smalltalk.method({
  1762. selector: "visitSendNode:",
  1763. category: 'visiting',
  1764. fn: function (aNode){
  1765. var self=this;
  1766. var receiver,args,message,result;
  1767. return smalltalk.withContext(function($ctx1) {
  1768. var $1;
  1769. args=_st(_st(aNode)._arguments())._collect_((function(each){
  1770. return smalltalk.withContext(function($ctx2) {
  1771. return self._pop();
  1772. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1773. receiver=self._pop();
  1774. message=self._messageFromSendNode_arguments_(aNode,_st(args)._reversed());
  1775. result=self._sendMessage_to_superSend_(message,receiver,_st(aNode)._superSend());
  1776. $1=_st(_st(aNode)._isCascadeSendNode())._and_((function(){
  1777. return smalltalk.withContext(function($ctx2) {
  1778. return _st(_st(aNode)._isLastChild())._not();
  1779. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1780. if(smalltalk.assert($1)){
  1781. self._push_(receiver);
  1782. } else {
  1783. self._push_(result);
  1784. };
  1785. return self}, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode,receiver:receiver,args:args,message:message,result:result},smalltalk.ASTInterpreter)})},
  1786. args: ["aNode"],
  1787. source: "visitSendNode: aNode\x0a\x09| receiver args message result |\x0a\x09\x0a\x09args := aNode arguments collect: [ :each | self pop ].\x0a\x09receiver := self pop.\x0a\x09\x0a\x09message := self\x0a\x09\x09messageFromSendNode: aNode\x0a\x09\x09arguments: args reversed.\x0a\x09\x0a\x09result := self sendMessage: message to: receiver superSend: aNode superSend.\x0a\x09\x0a\x09\x22For cascade sends, push the reciever if the send is not the last one\x22\x0a\x09(aNode isCascadeSendNode and: [ aNode isLastChild not ])\x0a\x09\x09ifTrue: [ self push: receiver ]\x0a\x09\x09ifFalse: [ self push: result ]",
  1788. messageSends: ["collect:", "arguments", "pop", "messageFromSendNode:arguments:", "reversed", "sendMessage:to:superSend:", "superSend", "ifTrue:ifFalse:", "and:", "isCascadeSendNode", "not", "isLastChild", "push:"],
  1789. referencedClasses: []
  1790. }),
  1791. smalltalk.ASTInterpreter);
  1792. smalltalk.addMethod(
  1793. smalltalk.method({
  1794. selector: "visitValueNode:",
  1795. category: 'visiting',
  1796. fn: function (aNode){
  1797. var self=this;
  1798. return smalltalk.withContext(function($ctx1) {
  1799. self._push_(_st(aNode)._value());
  1800. return self}, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1801. args: ["aNode"],
  1802. source: "visitValueNode: aNode\x0a\x09self push: aNode value",
  1803. messageSends: ["push:", "value"],
  1804. referencedClasses: []
  1805. }),
  1806. smalltalk.ASTInterpreter);
  1807. smalltalk.addMethod(
  1808. smalltalk.method({
  1809. selector: "visitVariableNode:",
  1810. category: 'visiting',
  1811. fn: function (aNode){
  1812. var self=this;
  1813. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  1814. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1815. return smalltalk.withContext(function($ctx1) {
  1816. var $1,$2,$3,$5,$6,$4;
  1817. $1=_st(_st(aNode)._binding())._isUnknownVar();
  1818. if(smalltalk.assert($1)){
  1819. $2=self._push_(_st(_st($PlatformInterface())._globals())._at_ifAbsent_(_st(aNode)._value(),(function(){
  1820. return smalltalk.withContext(function($ctx2) {
  1821. return self._error_("Unknown variable");
  1822. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})})));
  1823. return $2;
  1824. };
  1825. $3=self;
  1826. $5=_st(_st(aNode)._binding())._isInstanceVar();
  1827. if(smalltalk.assert($5)){
  1828. $4=_st(_st(self._context())._receiver())._instVarAt_(_st(aNode)._value());
  1829. } else {
  1830. $4=_st(self._context())._localAt_ifAbsent_(_st(aNode)._value(),(function(){
  1831. return smalltalk.withContext(function($ctx2) {
  1832. $6=_st(_st(aNode)._value())._isCapitalized();
  1833. if(smalltalk.assert($6)){
  1834. return _st(_st($Smalltalk())._current())._at_ifAbsent_(_st(aNode)._value(),(function(){
  1835. return smalltalk.withContext(function($ctx3) {
  1836. return _st(_st($PlatformInterface())._globals())._at_(_st(aNode)._value());
  1837. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,7)})}));
  1838. };
  1839. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)})}));
  1840. };
  1841. _st($3)._push_($4);
  1842. return self}, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
  1843. args: ["aNode"],
  1844. source: "visitVariableNode: aNode\x0a\x09aNode binding isUnknownVar ifTrue: [\x0a\x09\x09^ self push: (PlatformInterface globals at: aNode value ifAbsent: [ self error: 'Unknown variable' ]) ].\x0a\x09\x09\x0a\x09self push: (aNode binding isInstanceVar\x0a\x09\x09ifTrue: [ self context receiver instVarAt: aNode value ]\x0a\x09\x09ifFalse: [ self context \x0a\x09\x09\x09localAt: aNode value\x0a\x09\x09\x09ifAbsent: [\x0a\x09\x09\x09\x09aNode value isCapitalized\x0a\x09\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x09Smalltalk current \x0a\x09\x09\x09\x09\x09\x09\x09at: aNode value \x0a\x09\x09\x09\x09\x09\x09\x09ifAbsent: [ PlatformInterface globals at: aNode value ]]]])",
  1845. messageSends: ["ifTrue:", "isUnknownVar", "binding", "push:", "at:ifAbsent:", "globals", "value", "error:", "ifTrue:ifFalse:", "isInstanceVar", "instVarAt:", "receiver", "context", "localAt:ifAbsent:", "isCapitalized", "current", "at:"],
  1846. referencedClasses: ["PlatformInterface", "Smalltalk"]
  1847. }),
  1848. smalltalk.ASTInterpreter);
  1849. smalltalk.addClass('ASTInterpreterError', smalltalk.Error, [], 'Compiler-Interpreter');
  1850. smalltalk.ASTInterpreterError.comment="I get signaled when an AST interpreter is unable to interpret a node.";
  1851. smalltalk.addClass('ASTPCNodeVisitor', smalltalk.NodeVisitor, ['useInlinings', 'pc', 'context', 'blockIndex', 'currentNode'], 'Compiler-Interpreter');
  1852. 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`";
  1853. smalltalk.addMethod(
  1854. smalltalk.method({
  1855. selector: "blockIndex",
  1856. category: 'accessing',
  1857. fn: function (){
  1858. var self=this;
  1859. return smalltalk.withContext(function($ctx1) {
  1860. var $2,$1;
  1861. $2=self["@blockIndex"];
  1862. if(($receiver = $2) == nil || $receiver == null){
  1863. self["@blockIndex"]=(0);
  1864. $1=self["@blockIndex"];
  1865. } else {
  1866. $1=$2;
  1867. };
  1868. return $1;
  1869. }, function($ctx1) {$ctx1.fill(self,"blockIndex",{},smalltalk.ASTPCNodeVisitor)})},
  1870. args: [],
  1871. source: "blockIndex\x0a\x09^ blockIndex ifNil: [ blockIndex := 0 ]",
  1872. messageSends: ["ifNil:"],
  1873. referencedClasses: []
  1874. }),
  1875. smalltalk.ASTPCNodeVisitor);
  1876. smalltalk.addMethod(
  1877. smalltalk.method({
  1878. selector: "context",
  1879. category: 'accessing',
  1880. fn: function (){
  1881. var self=this;
  1882. return smalltalk.withContext(function($ctx1) {
  1883. var $1;
  1884. $1=self["@context"];
  1885. return $1;
  1886. }, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.ASTPCNodeVisitor)})},
  1887. args: [],
  1888. source: "context\x0a\x09^ context",
  1889. messageSends: [],
  1890. referencedClasses: []
  1891. }),
  1892. smalltalk.ASTPCNodeVisitor);
  1893. smalltalk.addMethod(
  1894. smalltalk.method({
  1895. selector: "context:",
  1896. category: 'accessing',
  1897. fn: function (aContext){
  1898. var self=this;
  1899. return smalltalk.withContext(function($ctx1) {
  1900. self["@context"]=aContext;
  1901. return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.ASTPCNodeVisitor)})},
  1902. args: ["aContext"],
  1903. source: "context: aContext\x0a\x09context := aContext",
  1904. messageSends: [],
  1905. referencedClasses: []
  1906. }),
  1907. smalltalk.ASTPCNodeVisitor);
  1908. smalltalk.addMethod(
  1909. smalltalk.method({
  1910. selector: "currentNode",
  1911. category: 'accessing',
  1912. fn: function (){
  1913. var self=this;
  1914. return smalltalk.withContext(function($ctx1) {
  1915. var $1;
  1916. $1=self["@currentNode"];
  1917. return $1;
  1918. }, function($ctx1) {$ctx1.fill(self,"currentNode",{},smalltalk.ASTPCNodeVisitor)})},
  1919. args: [],
  1920. source: "currentNode\x0a\x09^ currentNode",
  1921. messageSends: [],
  1922. referencedClasses: []
  1923. }),
  1924. smalltalk.ASTPCNodeVisitor);
  1925. smalltalk.addMethod(
  1926. smalltalk.method({
  1927. selector: "increaseBlockIndex",
  1928. category: 'accessing',
  1929. fn: function (){
  1930. var self=this;
  1931. return smalltalk.withContext(function($ctx1) {
  1932. self["@blockIndex"]=_st(self._blockIndex()).__plus((1));
  1933. return self}, function($ctx1) {$ctx1.fill(self,"increaseBlockIndex",{},smalltalk.ASTPCNodeVisitor)})},
  1934. args: [],
  1935. source: "increaseBlockIndex\x0a\x09blockIndex := self blockIndex + 1",
  1936. messageSends: ["+", "blockIndex"],
  1937. referencedClasses: []
  1938. }),
  1939. smalltalk.ASTPCNodeVisitor);
  1940. smalltalk.addMethod(
  1941. smalltalk.method({
  1942. selector: "pc",
  1943. category: 'accessing',
  1944. fn: function (){
  1945. var self=this;
  1946. return smalltalk.withContext(function($ctx1) {
  1947. var $2,$1;
  1948. $2=self["@pc"];
  1949. if(($receiver = $2) == nil || $receiver == null){
  1950. $1=(0);
  1951. } else {
  1952. $1=$2;
  1953. };
  1954. return $1;
  1955. }, function($ctx1) {$ctx1.fill(self,"pc",{},smalltalk.ASTPCNodeVisitor)})},
  1956. args: [],
  1957. source: "pc\x0a\x09^ pc ifNil: [ 0 ]",
  1958. messageSends: ["ifNil:"],
  1959. referencedClasses: []
  1960. }),
  1961. smalltalk.ASTPCNodeVisitor);
  1962. smalltalk.addMethod(
  1963. smalltalk.method({
  1964. selector: "pc:",
  1965. category: 'accessing',
  1966. fn: function (anInteger){
  1967. var self=this;
  1968. return smalltalk.withContext(function($ctx1) {
  1969. self["@pc"]=anInteger;
  1970. return self}, function($ctx1) {$ctx1.fill(self,"pc:",{anInteger:anInteger},smalltalk.ASTPCNodeVisitor)})},
  1971. args: ["anInteger"],
  1972. source: "pc: anInteger\x0a\x09pc := anInteger",
  1973. messageSends: [],
  1974. referencedClasses: []
  1975. }),
  1976. smalltalk.ASTPCNodeVisitor);
  1977. smalltalk.addMethod(
  1978. smalltalk.method({
  1979. selector: "useInlinings",
  1980. category: 'accessing',
  1981. fn: function (){
  1982. var self=this;
  1983. return smalltalk.withContext(function($ctx1) {
  1984. var $2,$1;
  1985. $2=self["@useInlinings"];
  1986. if(($receiver = $2) == nil || $receiver == null){
  1987. $1=true;
  1988. } else {
  1989. $1=$2;
  1990. };
  1991. return $1;
  1992. }, function($ctx1) {$ctx1.fill(self,"useInlinings",{},smalltalk.ASTPCNodeVisitor)})},
  1993. args: [],
  1994. source: "useInlinings\x0a\x09^ useInlinings ifNil: [ true ]",
  1995. messageSends: ["ifNil:"],
  1996. referencedClasses: []
  1997. }),
  1998. smalltalk.ASTPCNodeVisitor);
  1999. smalltalk.addMethod(
  2000. smalltalk.method({
  2001. selector: "useInlinings:",
  2002. category: 'accessing',
  2003. fn: function (aBoolean){
  2004. var self=this;
  2005. return smalltalk.withContext(function($ctx1) {
  2006. self["@useInlinings"]=aBoolean;
  2007. return self}, function($ctx1) {$ctx1.fill(self,"useInlinings:",{aBoolean:aBoolean},smalltalk.ASTPCNodeVisitor)})},
  2008. args: ["aBoolean"],
  2009. source: "useInlinings: aBoolean\x0a\x09useInlinings := aBoolean",
  2010. messageSends: [],
  2011. referencedClasses: []
  2012. }),
  2013. smalltalk.ASTPCNodeVisitor);
  2014. smalltalk.addMethod(
  2015. smalltalk.method({
  2016. selector: "visitBlockNode:",
  2017. category: 'visiting',
  2018. fn: function (aNode){
  2019. var self=this;
  2020. return smalltalk.withContext(function($ctx1) {
  2021. var $1,$2;
  2022. $1=_st(_st(_st(aNode)._parent())._isSendNode())._and_((function(){
  2023. return smalltalk.withContext(function($ctx2) {
  2024. return _st(_st(aNode)._parent())._shouldBeInlined();
  2025. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2026. if(smalltalk.assert($1)){
  2027. smalltalk.ASTPCNodeVisitor.superclass.fn.prototype._visitBlockNode_.apply(_st(self), [aNode]);
  2028. } else {
  2029. $2=_st(self._blockIndex()).__gt_eq(_st(self._context())._index());
  2030. if(! smalltalk.assert($2)){
  2031. self._increaseBlockIndex();
  2032. smalltalk.ASTPCNodeVisitor.superclass.fn.prototype._visitBlockNode_.apply(_st(self), [aNode]);
  2033. };
  2034. };
  2035. return self}, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode},smalltalk.ASTPCNodeVisitor)})},
  2036. args: ["aNode"],
  2037. source: "visitBlockNode: aNode\x0a\x09\x22Inlined send node. Assume that the block is inlined\x22\x0a\x09(aNode parent isSendNode and: [ aNode parent shouldBeInlined ])\x0a\x09\x09ifFalse: [\x0a\x09\x09\x09self blockIndex >= self context index ifFalse: [\x0a\x09\x09\x09\x09self increaseBlockIndex.\x0a\x09\x09\x09\x09super visitBlockNode: aNode ] ]\x0a\x09\x09ifTrue: [ super visitBlockNode: aNode ]",
  2038. messageSends: ["ifFalse:ifTrue:", "and:", "isSendNode", "parent", "shouldBeInlined", "ifFalse:", ">=", "blockIndex", "index", "context", "increaseBlockIndex", "visitBlockNode:"],
  2039. referencedClasses: []
  2040. }),
  2041. smalltalk.ASTPCNodeVisitor);
  2042. smalltalk.addMethod(
  2043. smalltalk.method({
  2044. selector: "visitJSStatementNode:",
  2045. category: 'visiting',
  2046. fn: function (aNode){
  2047. var self=this;
  2048. return smalltalk.withContext(function($ctx1) {
  2049. self["@currentNode"]=aNode;
  2050. return self}, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.ASTPCNodeVisitor)})},
  2051. args: ["aNode"],
  2052. source: "visitJSStatementNode: aNode\x0a\x09currentNode := aNode",
  2053. messageSends: [],
  2054. referencedClasses: []
  2055. }),
  2056. smalltalk.ASTPCNodeVisitor);
  2057. smalltalk.addMethod(
  2058. smalltalk.method({
  2059. selector: "visitSendNode:",
  2060. category: 'visiting',
  2061. fn: function (aNode){
  2062. var self=this;
  2063. return smalltalk.withContext(function($ctx1) {
  2064. var $1,$2,$3;
  2065. smalltalk.ASTPCNodeVisitor.superclass.fn.prototype._visitSendNode_.apply(_st(self), [aNode]);
  2066. $1=_st(self._pc()).__eq(_st(self._context())._pc());
  2067. if(! smalltalk.assert($1)){
  2068. $2=_st(aNode)._shouldBeInlined();
  2069. if(! smalltalk.assert($2)){
  2070. $3=_st(self._blockIndex()).__eq(_st(self._context())._index());
  2071. if(smalltalk.assert($3)){
  2072. self._pc_(_st(self._pc()).__plus((1)));
  2073. self["@currentNode"]=aNode;
  2074. self["@currentNode"];
  2075. };
  2076. };
  2077. };
  2078. return self}, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode},smalltalk.ASTPCNodeVisitor)})},
  2079. args: ["aNode"],
  2080. 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 blockIndex = self context index ifTrue: [\x0a\x09\x09\x09\x09self pc: self pc + 1.\x0a\x09\x09\x09\x09currentNode := aNode ] ] ]",
  2081. messageSends: ["visitSendNode:", "ifFalse:", "=", "pc", "context", "shouldBeInlined", "ifTrue:", "blockIndex", "index", "pc:", "+"],
  2082. referencedClasses: []
  2083. }),
  2084. smalltalk.ASTPCNodeVisitor);
  2085. smalltalk.addMethod(
  2086. smalltalk.method({
  2087. selector: "isSteppingNode",
  2088. category: '*Compiler-Interpreter',
  2089. fn: function (){
  2090. var self=this;
  2091. return smalltalk.withContext(function($ctx1) {
  2092. return false;
  2093. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.Node)})},
  2094. args: [],
  2095. source: "isSteppingNode\x0a\x09^ false",
  2096. messageSends: [],
  2097. referencedClasses: []
  2098. }),
  2099. smalltalk.Node);
  2100. smalltalk.addMethod(
  2101. smalltalk.method({
  2102. selector: "isSteppingNode",
  2103. category: '*Compiler-Interpreter',
  2104. fn: function (){
  2105. var self=this;
  2106. return smalltalk.withContext(function($ctx1) {
  2107. return true;
  2108. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.AssignmentNode)})},
  2109. args: [],
  2110. source: "isSteppingNode\x0a\x09^ true",
  2111. messageSends: [],
  2112. referencedClasses: []
  2113. }),
  2114. smalltalk.AssignmentNode);
  2115. smalltalk.addMethod(
  2116. smalltalk.method({
  2117. selector: "isSteppingNode",
  2118. category: '*Compiler-Interpreter',
  2119. fn: function (){
  2120. var self=this;
  2121. return smalltalk.withContext(function($ctx1) {
  2122. return true;
  2123. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.BlockNode)})},
  2124. args: [],
  2125. source: "isSteppingNode\x0a\x09^ true",
  2126. messageSends: [],
  2127. referencedClasses: []
  2128. }),
  2129. smalltalk.BlockNode);
  2130. smalltalk.addMethod(
  2131. smalltalk.method({
  2132. selector: "isSteppingNode",
  2133. category: '*Compiler-Interpreter',
  2134. fn: function (){
  2135. var self=this;
  2136. return smalltalk.withContext(function($ctx1) {
  2137. return true;
  2138. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.DynamicArrayNode)})},
  2139. args: [],
  2140. source: "isSteppingNode\x0a\x09^ true",
  2141. messageSends: [],
  2142. referencedClasses: []
  2143. }),
  2144. smalltalk.DynamicArrayNode);
  2145. smalltalk.addMethod(
  2146. smalltalk.method({
  2147. selector: "isSteppingNode",
  2148. category: '*Compiler-Interpreter',
  2149. fn: function (){
  2150. var self=this;
  2151. return smalltalk.withContext(function($ctx1) {
  2152. return true;
  2153. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.DynamicDictionaryNode)})},
  2154. args: [],
  2155. source: "isSteppingNode\x0a\x09^ true",
  2156. messageSends: [],
  2157. referencedClasses: []
  2158. }),
  2159. smalltalk.DynamicDictionaryNode);
  2160. smalltalk.addMethod(
  2161. smalltalk.method({
  2162. selector: "isSteppingNode",
  2163. category: '*Compiler-Interpreter',
  2164. fn: function (){
  2165. var self=this;
  2166. return smalltalk.withContext(function($ctx1) {
  2167. return true;
  2168. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.JSStatementNode)})},
  2169. args: [],
  2170. source: "isSteppingNode\x0a\x09^ true",
  2171. messageSends: [],
  2172. referencedClasses: []
  2173. }),
  2174. smalltalk.JSStatementNode);
  2175. smalltalk.addMethod(
  2176. smalltalk.method({
  2177. selector: "isSteppingNode",
  2178. category: '*Compiler-Interpreter',
  2179. fn: function (){
  2180. var self=this;
  2181. return smalltalk.withContext(function($ctx1) {
  2182. return true;
  2183. }, function($ctx1) {$ctx1.fill(self,"isSteppingNode",{},smalltalk.SendNode)})},
  2184. args: [],
  2185. source: "isSteppingNode\x0a\x09^ true",
  2186. messageSends: [],
  2187. referencedClasses: []
  2188. }),
  2189. smalltalk.SendNode);
  2190. });