1
0

Compiler-Interpreter.js 76 KB

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