2
0

Compiler-Interpreter.js 83 KB

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