Compiler-Semantic.deploy.js 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274
  1. smalltalk.addPackage('Compiler-Semantic', {});
  2. smalltalk.addClass('LexicalScope', smalltalk.Object, ['node', 'instruction', 'temps', 'args', 'outerScope'], 'Compiler-Semantic');
  3. smalltalk.addMethod(
  4. "_addArg_",
  5. smalltalk.method({
  6. selector: "addArg:",
  7. fn: function (aString){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx) { _st(_st(self)._args())._at_put_(aString,_st((smalltalk.ArgVar || ArgVar))._on_(aString));
  10. _st(_st(_st(self)._args())._at_(aString))._scope_(self);
  11. return self}, self, "addArg:", [aString], smalltalk.LexicalScope)}
  12. }),
  13. smalltalk.LexicalScope);
  14. smalltalk.addMethod(
  15. "_addTemp_",
  16. smalltalk.method({
  17. selector: "addTemp:",
  18. fn: function (aString){
  19. var self=this;
  20. return smalltalk.withContext(function($ctx) { _st(_st(self)._temps())._at_put_(aString,_st((smalltalk.TempVar || TempVar))._on_(aString));
  21. _st(_st(_st(self)._temps())._at_(aString))._scope_(self);
  22. return self}, self, "addTemp:", [aString], smalltalk.LexicalScope)}
  23. }),
  24. smalltalk.LexicalScope);
  25. smalltalk.addMethod(
  26. "_alias",
  27. smalltalk.method({
  28. selector: "alias",
  29. fn: function (){
  30. var self=this;
  31. return smalltalk.withContext(function($ctx) { var $1;
  32. $1=_st("$ctx").__comma(_st(_st(self)._scopeLevel())._asString());
  33. return $1;
  34. }, self, "alias", [], smalltalk.LexicalScope)}
  35. }),
  36. smalltalk.LexicalScope);
  37. smalltalk.addMethod(
  38. "_allVariableNames",
  39. smalltalk.method({
  40. selector: "allVariableNames",
  41. fn: function (){
  42. var self=this;
  43. return smalltalk.withContext(function($ctx) { var $1;
  44. $1=_st(_st(_st(self)._args())._keys()).__comma(_st(_st(self)._temps())._keys());
  45. return $1;
  46. }, self, "allVariableNames", [], smalltalk.LexicalScope)}
  47. }),
  48. smalltalk.LexicalScope);
  49. smalltalk.addMethod(
  50. "_args",
  51. smalltalk.method({
  52. selector: "args",
  53. fn: function (){
  54. var self=this;
  55. return smalltalk.withContext(function($ctx) { var $1;
  56. if(($receiver = self["@args"]) == nil || $receiver == undefined){
  57. self["@args"]=_st((smalltalk.Dictionary || Dictionary))._new();
  58. $1=self["@args"];
  59. } else {
  60. $1=self["@args"];
  61. };
  62. return $1;
  63. }, self, "args", [], smalltalk.LexicalScope)}
  64. }),
  65. smalltalk.LexicalScope);
  66. smalltalk.addMethod(
  67. "_bindingFor_",
  68. smalltalk.method({
  69. selector: "bindingFor:",
  70. fn: function (aStringOrNode){
  71. var self=this;
  72. return smalltalk.withContext(function($ctx) { var $1;
  73. $1=_st(_st(self)._pseudoVars())._at_ifAbsent_(_st(aStringOrNode)._value(),(function(){
  74. return _st(_st(self)._args())._at_ifAbsent_(_st(aStringOrNode)._value(),(function(){
  75. return _st(_st(self)._temps())._at_ifAbsent_(_st(aStringOrNode)._value(),(function(){
  76. return nil;
  77. }));
  78. }));
  79. }));
  80. return $1;
  81. }, self, "bindingFor:", [aStringOrNode], smalltalk.LexicalScope)}
  82. }),
  83. smalltalk.LexicalScope);
  84. smalltalk.addMethod(
  85. "_canInlineNonLocalReturns",
  86. smalltalk.method({
  87. selector: "canInlineNonLocalReturns",
  88. fn: function (){
  89. var self=this;
  90. return smalltalk.withContext(function($ctx) { var $1;
  91. $1=_st(_st(self)._isInlined())._and_((function(){
  92. return _st(_st(self)._outerScope())._canInlineNonLocalReturns();
  93. }));
  94. return $1;
  95. }, self, "canInlineNonLocalReturns", [], smalltalk.LexicalScope)}
  96. }),
  97. smalltalk.LexicalScope);
  98. smalltalk.addMethod(
  99. "_instruction",
  100. smalltalk.method({
  101. selector: "instruction",
  102. fn: function (){
  103. var self=this;
  104. return smalltalk.withContext(function($ctx) { return self["@instruction"];
  105. }, self, "instruction", [], smalltalk.LexicalScope)}
  106. }),
  107. smalltalk.LexicalScope);
  108. smalltalk.addMethod(
  109. "_instruction_",
  110. smalltalk.method({
  111. selector: "instruction:",
  112. fn: function (anIRInstruction){
  113. var self=this;
  114. return smalltalk.withContext(function($ctx) { self["@instruction"]=anIRInstruction;
  115. return self}, self, "instruction:", [anIRInstruction], smalltalk.LexicalScope)}
  116. }),
  117. smalltalk.LexicalScope);
  118. smalltalk.addMethod(
  119. "_isBlockScope",
  120. smalltalk.method({
  121. selector: "isBlockScope",
  122. fn: function (){
  123. var self=this;
  124. return smalltalk.withContext(function($ctx) { var $1;
  125. $1=_st(_st(self)._isMethodScope())._not();
  126. return $1;
  127. }, self, "isBlockScope", [], smalltalk.LexicalScope)}
  128. }),
  129. smalltalk.LexicalScope);
  130. smalltalk.addMethod(
  131. "_isInlined",
  132. smalltalk.method({
  133. selector: "isInlined",
  134. fn: function (){
  135. var self=this;
  136. return smalltalk.withContext(function($ctx) { var $1;
  137. $1=_st(_st(self)._instruction())._isInlined();
  138. return $1;
  139. }, self, "isInlined", [], smalltalk.LexicalScope)}
  140. }),
  141. smalltalk.LexicalScope);
  142. smalltalk.addMethod(
  143. "_isMethodScope",
  144. smalltalk.method({
  145. selector: "isMethodScope",
  146. fn: function (){
  147. var self=this;
  148. return smalltalk.withContext(function($ctx) { return false;
  149. }, self, "isMethodScope", [], smalltalk.LexicalScope)}
  150. }),
  151. smalltalk.LexicalScope);
  152. smalltalk.addMethod(
  153. "_lookupVariable_",
  154. smalltalk.method({
  155. selector: "lookupVariable:",
  156. fn: function (aNode){
  157. var self=this;
  158. return smalltalk.withContext(function($ctx) { var $1;
  159. var lookup;
  160. lookup=_st(self)._bindingFor_(aNode);
  161. if(($receiver = lookup) == nil || $receiver == undefined){
  162. $1=_st(self)._outerScope();
  163. if(($receiver = $1) == nil || $receiver == undefined){
  164. lookup=$1;
  165. } else {
  166. lookup=_st(_st(self)._outerScope())._lookupVariable_(aNode);
  167. };
  168. lookup;
  169. } else {
  170. lookup;
  171. };
  172. return lookup;
  173. }, self, "lookupVariable:", [aNode], smalltalk.LexicalScope)}
  174. }),
  175. smalltalk.LexicalScope);
  176. smalltalk.addMethod(
  177. "_methodScope",
  178. smalltalk.method({
  179. selector: "methodScope",
  180. fn: function (){
  181. var self=this;
  182. return smalltalk.withContext(function($ctx) { var $2,$1;
  183. $2=_st(self)._outerScope();
  184. if(($receiver = $2) == nil || $receiver == undefined){
  185. $1=$2;
  186. } else {
  187. $1=_st(_st(self)._outerScope())._methodScope();
  188. };
  189. return $1;
  190. }, self, "methodScope", [], smalltalk.LexicalScope)}
  191. }),
  192. smalltalk.LexicalScope);
  193. smalltalk.addMethod(
  194. "_node",
  195. smalltalk.method({
  196. selector: "node",
  197. fn: function (){
  198. var self=this;
  199. return smalltalk.withContext(function($ctx) { return self["@node"];
  200. }, self, "node", [], smalltalk.LexicalScope)}
  201. }),
  202. smalltalk.LexicalScope);
  203. smalltalk.addMethod(
  204. "_node_",
  205. smalltalk.method({
  206. selector: "node:",
  207. fn: function (aNode){
  208. var self=this;
  209. return smalltalk.withContext(function($ctx) { self["@node"]=aNode;
  210. return self}, self, "node:", [aNode], smalltalk.LexicalScope)}
  211. }),
  212. smalltalk.LexicalScope);
  213. smalltalk.addMethod(
  214. "_outerScope",
  215. smalltalk.method({
  216. selector: "outerScope",
  217. fn: function (){
  218. var self=this;
  219. return smalltalk.withContext(function($ctx) { return self["@outerScope"];
  220. }, self, "outerScope", [], smalltalk.LexicalScope)}
  221. }),
  222. smalltalk.LexicalScope);
  223. smalltalk.addMethod(
  224. "_outerScope_",
  225. smalltalk.method({
  226. selector: "outerScope:",
  227. fn: function (aLexicalScope){
  228. var self=this;
  229. return smalltalk.withContext(function($ctx) { self["@outerScope"]=aLexicalScope;
  230. return self}, self, "outerScope:", [aLexicalScope], smalltalk.LexicalScope)}
  231. }),
  232. smalltalk.LexicalScope);
  233. smalltalk.addMethod(
  234. "_pseudoVars",
  235. smalltalk.method({
  236. selector: "pseudoVars",
  237. fn: function (){
  238. var self=this;
  239. return smalltalk.withContext(function($ctx) { var $1;
  240. $1=_st(_st(self)._methodScope())._pseudoVars();
  241. return $1;
  242. }, self, "pseudoVars", [], smalltalk.LexicalScope)}
  243. }),
  244. smalltalk.LexicalScope);
  245. smalltalk.addMethod(
  246. "_scopeLevel",
  247. smalltalk.method({
  248. selector: "scopeLevel",
  249. fn: function (){
  250. var self=this;
  251. return smalltalk.withContext(function($ctx) { var $3,$2,$1;
  252. $3=_st(self)._outerScope();
  253. if(($receiver = $3) == nil || $receiver == undefined){
  254. $2=(0);
  255. } else {
  256. $2=_st(_st(self)._outerScope())._scopeLevel();
  257. };
  258. $1=_st($2).__plus((1));
  259. return $1;
  260. }, self, "scopeLevel", [], smalltalk.LexicalScope)}
  261. }),
  262. smalltalk.LexicalScope);
  263. smalltalk.addMethod(
  264. "_temps",
  265. smalltalk.method({
  266. selector: "temps",
  267. fn: function (){
  268. var self=this;
  269. return smalltalk.withContext(function($ctx) { var $1;
  270. if(($receiver = self["@temps"]) == nil || $receiver == undefined){
  271. self["@temps"]=_st((smalltalk.Dictionary || Dictionary))._new();
  272. $1=self["@temps"];
  273. } else {
  274. $1=self["@temps"];
  275. };
  276. return $1;
  277. }, self, "temps", [], smalltalk.LexicalScope)}
  278. }),
  279. smalltalk.LexicalScope);
  280. smalltalk.addClass('MethodLexicalScope', smalltalk.LexicalScope, ['iVars', 'pseudoVars', 'unknownVariables', 'localReturn', 'nonLocalReturns'], 'Compiler-Semantic');
  281. smalltalk.addMethod(
  282. "_addIVar_",
  283. smalltalk.method({
  284. selector: "addIVar:",
  285. fn: function (aString){
  286. var self=this;
  287. return smalltalk.withContext(function($ctx) { _st(_st(self)._iVars())._at_put_(aString,_st((smalltalk.InstanceVar || InstanceVar))._on_(aString));
  288. _st(_st(_st(self)._iVars())._at_(aString))._scope_(self);
  289. return self}, self, "addIVar:", [aString], smalltalk.MethodLexicalScope)}
  290. }),
  291. smalltalk.MethodLexicalScope);
  292. smalltalk.addMethod(
  293. "_addNonLocalReturn_",
  294. smalltalk.method({
  295. selector: "addNonLocalReturn:",
  296. fn: function (aScope){
  297. var self=this;
  298. return smalltalk.withContext(function($ctx) { _st(_st(self)._nonLocalReturns())._add_(aScope);
  299. return self}, self, "addNonLocalReturn:", [aScope], smalltalk.MethodLexicalScope)}
  300. }),
  301. smalltalk.MethodLexicalScope);
  302. smalltalk.addMethod(
  303. "_allVariableNames",
  304. smalltalk.method({
  305. selector: "allVariableNames",
  306. fn: function (){
  307. var self=this;
  308. return smalltalk.withContext(function($ctx) { var $1;
  309. $1=_st(smalltalk.LexicalScope.fn.prototype._allVariableNames.apply(_st(self), [])).__comma(_st(_st(self)._iVars())._keys());
  310. return $1;
  311. }, self, "allVariableNames", [], smalltalk.MethodLexicalScope)}
  312. }),
  313. smalltalk.MethodLexicalScope);
  314. smalltalk.addMethod(
  315. "_bindingFor_",
  316. smalltalk.method({
  317. selector: "bindingFor:",
  318. fn: function (aNode){
  319. var self=this;
  320. return smalltalk.withContext(function($ctx) { var $2,$1;
  321. $2=smalltalk.LexicalScope.fn.prototype._bindingFor_.apply(_st(self), [aNode]);
  322. if(($receiver = $2) == nil || $receiver == undefined){
  323. $1=_st(_st(self)._iVars())._at_ifAbsent_(_st(aNode)._value(),(function(){
  324. return nil;
  325. }));
  326. } else {
  327. $1=$2;
  328. };
  329. return $1;
  330. }, self, "bindingFor:", [aNode], smalltalk.MethodLexicalScope)}
  331. }),
  332. smalltalk.MethodLexicalScope);
  333. smalltalk.addMethod(
  334. "_canInlineNonLocalReturns",
  335. smalltalk.method({
  336. selector: "canInlineNonLocalReturns",
  337. fn: function (){
  338. var self=this;
  339. return smalltalk.withContext(function($ctx) { return true;
  340. }, self, "canInlineNonLocalReturns", [], smalltalk.MethodLexicalScope)}
  341. }),
  342. smalltalk.MethodLexicalScope);
  343. smalltalk.addMethod(
  344. "_hasLocalReturn",
  345. smalltalk.method({
  346. selector: "hasLocalReturn",
  347. fn: function (){
  348. var self=this;
  349. return smalltalk.withContext(function($ctx) { var $1;
  350. $1=_st(self)._localReturn();
  351. return $1;
  352. }, self, "hasLocalReturn", [], smalltalk.MethodLexicalScope)}
  353. }),
  354. smalltalk.MethodLexicalScope);
  355. smalltalk.addMethod(
  356. "_hasNonLocalReturn",
  357. smalltalk.method({
  358. selector: "hasNonLocalReturn",
  359. fn: function (){
  360. var self=this;
  361. return smalltalk.withContext(function($ctx) { var $1;
  362. $1=_st(_st(self)._nonLocalReturns())._notEmpty();
  363. return $1;
  364. }, self, "hasNonLocalReturn", [], smalltalk.MethodLexicalScope)}
  365. }),
  366. smalltalk.MethodLexicalScope);
  367. smalltalk.addMethod(
  368. "_iVars",
  369. smalltalk.method({
  370. selector: "iVars",
  371. fn: function (){
  372. var self=this;
  373. return smalltalk.withContext(function($ctx) { var $1;
  374. if(($receiver = self["@iVars"]) == nil || $receiver == undefined){
  375. self["@iVars"]=_st((smalltalk.Dictionary || Dictionary))._new();
  376. $1=self["@iVars"];
  377. } else {
  378. $1=self["@iVars"];
  379. };
  380. return $1;
  381. }, self, "iVars", [], smalltalk.MethodLexicalScope)}
  382. }),
  383. smalltalk.MethodLexicalScope);
  384. smalltalk.addMethod(
  385. "_isMethodScope",
  386. smalltalk.method({
  387. selector: "isMethodScope",
  388. fn: function (){
  389. var self=this;
  390. return smalltalk.withContext(function($ctx) { return true;
  391. }, self, "isMethodScope", [], smalltalk.MethodLexicalScope)}
  392. }),
  393. smalltalk.MethodLexicalScope);
  394. smalltalk.addMethod(
  395. "_localReturn",
  396. smalltalk.method({
  397. selector: "localReturn",
  398. fn: function (){
  399. var self=this;
  400. return smalltalk.withContext(function($ctx) { var $1;
  401. if(($receiver = self["@localReturn"]) == nil || $receiver == undefined){
  402. $1=false;
  403. } else {
  404. $1=self["@localReturn"];
  405. };
  406. return $1;
  407. }, self, "localReturn", [], smalltalk.MethodLexicalScope)}
  408. }),
  409. smalltalk.MethodLexicalScope);
  410. smalltalk.addMethod(
  411. "_localReturn_",
  412. smalltalk.method({
  413. selector: "localReturn:",
  414. fn: function (aBoolean){
  415. var self=this;
  416. return smalltalk.withContext(function($ctx) { self["@localReturn"]=aBoolean;
  417. return self}, self, "localReturn:", [aBoolean], smalltalk.MethodLexicalScope)}
  418. }),
  419. smalltalk.MethodLexicalScope);
  420. smalltalk.addMethod(
  421. "_methodScope",
  422. smalltalk.method({
  423. selector: "methodScope",
  424. fn: function (){
  425. var self=this;
  426. return smalltalk.withContext(function($ctx) { return self;
  427. }, self, "methodScope", [], smalltalk.MethodLexicalScope)}
  428. }),
  429. smalltalk.MethodLexicalScope);
  430. smalltalk.addMethod(
  431. "_nonLocalReturns",
  432. smalltalk.method({
  433. selector: "nonLocalReturns",
  434. fn: function (){
  435. var self=this;
  436. return smalltalk.withContext(function($ctx) { var $1;
  437. if(($receiver = self["@nonLocalReturns"]) == nil || $receiver == undefined){
  438. self["@nonLocalReturns"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  439. $1=self["@nonLocalReturns"];
  440. } else {
  441. $1=self["@nonLocalReturns"];
  442. };
  443. return $1;
  444. }, self, "nonLocalReturns", [], smalltalk.MethodLexicalScope)}
  445. }),
  446. smalltalk.MethodLexicalScope);
  447. smalltalk.addMethod(
  448. "_pseudoVars",
  449. smalltalk.method({
  450. selector: "pseudoVars",
  451. fn: function (){
  452. var self=this;
  453. return smalltalk.withContext(function($ctx) { var $1,$2;
  454. if(($receiver = self["@pseudoVars"]) == nil || $receiver == undefined){
  455. self["@pseudoVars"]=_st((smalltalk.Dictionary || Dictionary))._new();
  456. self["@pseudoVars"];
  457. _st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._pseudoVariableNames())._do_((function(each){
  458. $1=_st((smalltalk.PseudoVar || PseudoVar))._on_(each);
  459. _st($1)._scope_(_st(self)._methodScope());
  460. $2=_st($1)._yourself();
  461. return _st(self["@pseudoVars"])._at_put_(each,$2);
  462. }));
  463. } else {
  464. self["@pseudoVars"];
  465. };
  466. return self["@pseudoVars"];
  467. }, self, "pseudoVars", [], smalltalk.MethodLexicalScope)}
  468. }),
  469. smalltalk.MethodLexicalScope);
  470. smalltalk.addMethod(
  471. "_removeNonLocalReturn_",
  472. smalltalk.method({
  473. selector: "removeNonLocalReturn:",
  474. fn: function (aScope){
  475. var self=this;
  476. return smalltalk.withContext(function($ctx) { _st(_st(self)._nonLocalReturns())._remove_ifAbsent_(aScope,(function(){
  477. }));
  478. return self}, self, "removeNonLocalReturn:", [aScope], smalltalk.MethodLexicalScope)}
  479. }),
  480. smalltalk.MethodLexicalScope);
  481. smalltalk.addMethod(
  482. "_unknownVariables",
  483. smalltalk.method({
  484. selector: "unknownVariables",
  485. fn: function (){
  486. var self=this;
  487. return smalltalk.withContext(function($ctx) { var $1;
  488. if(($receiver = self["@unknownVariables"]) == nil || $receiver == undefined){
  489. self["@unknownVariables"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  490. $1=self["@unknownVariables"];
  491. } else {
  492. $1=self["@unknownVariables"];
  493. };
  494. return $1;
  495. }, self, "unknownVariables", [], smalltalk.MethodLexicalScope)}
  496. }),
  497. smalltalk.MethodLexicalScope);
  498. smalltalk.addClass('ScopeVar', smalltalk.Object, ['scope', 'name'], 'Compiler-Semantic');
  499. smalltalk.addMethod(
  500. "_alias",
  501. smalltalk.method({
  502. selector: "alias",
  503. fn: function (){
  504. var self=this;
  505. return smalltalk.withContext(function($ctx) { var $1;
  506. $1=_st(_st(self)._name())._asVariableName();
  507. return $1;
  508. }, self, "alias", [], smalltalk.ScopeVar)}
  509. }),
  510. smalltalk.ScopeVar);
  511. smalltalk.addMethod(
  512. "_isArgVar",
  513. smalltalk.method({
  514. selector: "isArgVar",
  515. fn: function (){
  516. var self=this;
  517. return smalltalk.withContext(function($ctx) { return false;
  518. }, self, "isArgVar", [], smalltalk.ScopeVar)}
  519. }),
  520. smalltalk.ScopeVar);
  521. smalltalk.addMethod(
  522. "_isClassRefVar",
  523. smalltalk.method({
  524. selector: "isClassRefVar",
  525. fn: function (){
  526. var self=this;
  527. return smalltalk.withContext(function($ctx) { return false;
  528. }, self, "isClassRefVar", [], smalltalk.ScopeVar)}
  529. }),
  530. smalltalk.ScopeVar);
  531. smalltalk.addMethod(
  532. "_isInstanceVar",
  533. smalltalk.method({
  534. selector: "isInstanceVar",
  535. fn: function (){
  536. var self=this;
  537. return smalltalk.withContext(function($ctx) { return false;
  538. }, self, "isInstanceVar", [], smalltalk.ScopeVar)}
  539. }),
  540. smalltalk.ScopeVar);
  541. smalltalk.addMethod(
  542. "_isPseudoVar",
  543. smalltalk.method({
  544. selector: "isPseudoVar",
  545. fn: function (){
  546. var self=this;
  547. return smalltalk.withContext(function($ctx) { return false;
  548. }, self, "isPseudoVar", [], smalltalk.ScopeVar)}
  549. }),
  550. smalltalk.ScopeVar);
  551. smalltalk.addMethod(
  552. "_isTempVar",
  553. smalltalk.method({
  554. selector: "isTempVar",
  555. fn: function (){
  556. var self=this;
  557. return smalltalk.withContext(function($ctx) { return false;
  558. }, self, "isTempVar", [], smalltalk.ScopeVar)}
  559. }),
  560. smalltalk.ScopeVar);
  561. smalltalk.addMethod(
  562. "_isUnknownVar",
  563. smalltalk.method({
  564. selector: "isUnknownVar",
  565. fn: function (){
  566. var self=this;
  567. return smalltalk.withContext(function($ctx) { return false;
  568. }, self, "isUnknownVar", [], smalltalk.ScopeVar)}
  569. }),
  570. smalltalk.ScopeVar);
  571. smalltalk.addMethod(
  572. "_name",
  573. smalltalk.method({
  574. selector: "name",
  575. fn: function (){
  576. var self=this;
  577. return smalltalk.withContext(function($ctx) { return self["@name"];
  578. }, self, "name", [], smalltalk.ScopeVar)}
  579. }),
  580. smalltalk.ScopeVar);
  581. smalltalk.addMethod(
  582. "_name_",
  583. smalltalk.method({
  584. selector: "name:",
  585. fn: function (aString){
  586. var self=this;
  587. return smalltalk.withContext(function($ctx) { self["@name"]=aString;
  588. return self}, self, "name:", [aString], smalltalk.ScopeVar)}
  589. }),
  590. smalltalk.ScopeVar);
  591. smalltalk.addMethod(
  592. "_scope",
  593. smalltalk.method({
  594. selector: "scope",
  595. fn: function (){
  596. var self=this;
  597. return smalltalk.withContext(function($ctx) { return self["@scope"];
  598. }, self, "scope", [], smalltalk.ScopeVar)}
  599. }),
  600. smalltalk.ScopeVar);
  601. smalltalk.addMethod(
  602. "_scope_",
  603. smalltalk.method({
  604. selector: "scope:",
  605. fn: function (aScope){
  606. var self=this;
  607. return smalltalk.withContext(function($ctx) { self["@scope"]=aScope;
  608. return self}, self, "scope:", [aScope], smalltalk.ScopeVar)}
  609. }),
  610. smalltalk.ScopeVar);
  611. smalltalk.addMethod(
  612. "_validateAssignment",
  613. smalltalk.method({
  614. selector: "validateAssignment",
  615. fn: function (){
  616. var self=this;
  617. return smalltalk.withContext(function($ctx) { var $1,$2,$3;
  618. $1=_st(_st(self)._isArgVar())._or_((function(){
  619. return _st(self)._isPseudoVar();
  620. }));
  621. if(smalltalk.assert($1)){
  622. $2=_st((smalltalk.InvalidAssignmentError || InvalidAssignmentError))._new();
  623. _st($2)._variableName_(_st(self)._name());
  624. $3=_st($2)._signal();
  625. $3;
  626. };
  627. return self}, self, "validateAssignment", [], smalltalk.ScopeVar)}
  628. }),
  629. smalltalk.ScopeVar);
  630. smalltalk.addMethod(
  631. "_on_",
  632. smalltalk.method({
  633. selector: "on:",
  634. fn: function (aString){
  635. var self=this;
  636. return smalltalk.withContext(function($ctx) { var $2,$3,$1;
  637. $2=_st(self)._new();
  638. _st($2)._name_(aString);
  639. $3=_st($2)._yourself();
  640. $1=$3;
  641. return $1;
  642. }, self, "on:", [aString], smalltalk.ScopeVar.klass)}
  643. }),
  644. smalltalk.ScopeVar.klass);
  645. smalltalk.addClass('AliasVar', smalltalk.ScopeVar, ['node'], 'Compiler-Semantic');
  646. smalltalk.addMethod(
  647. "_node",
  648. smalltalk.method({
  649. selector: "node",
  650. fn: function (){
  651. var self=this;
  652. return smalltalk.withContext(function($ctx) { return self["@node"];
  653. }, self, "node", [], smalltalk.AliasVar)}
  654. }),
  655. smalltalk.AliasVar);
  656. smalltalk.addMethod(
  657. "_node_",
  658. smalltalk.method({
  659. selector: "node:",
  660. fn: function (aNode){
  661. var self=this;
  662. return smalltalk.withContext(function($ctx) { self["@node"]=aNode;
  663. return self}, self, "node:", [aNode], smalltalk.AliasVar)}
  664. }),
  665. smalltalk.AliasVar);
  666. smalltalk.addClass('ArgVar', smalltalk.ScopeVar, [], 'Compiler-Semantic');
  667. smalltalk.addMethod(
  668. "_isArgVar",
  669. smalltalk.method({
  670. selector: "isArgVar",
  671. fn: function (){
  672. var self=this;
  673. return smalltalk.withContext(function($ctx) { return true;
  674. }, self, "isArgVar", [], smalltalk.ArgVar)}
  675. }),
  676. smalltalk.ArgVar);
  677. smalltalk.addClass('ClassRefVar', smalltalk.ScopeVar, [], 'Compiler-Semantic');
  678. smalltalk.addMethod(
  679. "_alias",
  680. smalltalk.method({
  681. selector: "alias",
  682. fn: function (){
  683. var self=this;
  684. return smalltalk.withContext(function($ctx) { var $1;
  685. $1=_st(_st(_st(_st("(smalltalk.").__comma(_st(self)._name())).__comma(" || ")).__comma(_st(self)._name())).__comma(")");
  686. return $1;
  687. }, self, "alias", [], smalltalk.ClassRefVar)}
  688. }),
  689. smalltalk.ClassRefVar);
  690. smalltalk.addMethod(
  691. "_isClassRefVar",
  692. smalltalk.method({
  693. selector: "isClassRefVar",
  694. fn: function (){
  695. var self=this;
  696. return smalltalk.withContext(function($ctx) { return true;
  697. }, self, "isClassRefVar", [], smalltalk.ClassRefVar)}
  698. }),
  699. smalltalk.ClassRefVar);
  700. smalltalk.addClass('InstanceVar', smalltalk.ScopeVar, [], 'Compiler-Semantic');
  701. smalltalk.addMethod(
  702. "_alias",
  703. smalltalk.method({
  704. selector: "alias",
  705. fn: function (){
  706. var self=this;
  707. return smalltalk.withContext(function($ctx) { var $1;
  708. $1=_st(_st("self[\x22@").__comma(_st(self)._name())).__comma("\x22]");
  709. return $1;
  710. }, self, "alias", [], smalltalk.InstanceVar)}
  711. }),
  712. smalltalk.InstanceVar);
  713. smalltalk.addMethod(
  714. "_isInstanceVar",
  715. smalltalk.method({
  716. selector: "isInstanceVar",
  717. fn: function (){
  718. var self=this;
  719. return smalltalk.withContext(function($ctx) { return true;
  720. }, self, "isInstanceVar", [], smalltalk.InstanceVar)}
  721. }),
  722. smalltalk.InstanceVar);
  723. smalltalk.addClass('PseudoVar', smalltalk.ScopeVar, [], 'Compiler-Semantic');
  724. smalltalk.addMethod(
  725. "_alias",
  726. smalltalk.method({
  727. selector: "alias",
  728. fn: function (){
  729. var self=this;
  730. return smalltalk.withContext(function($ctx) { var $1;
  731. $1=_st(self)._name();
  732. return $1;
  733. }, self, "alias", [], smalltalk.PseudoVar)}
  734. }),
  735. smalltalk.PseudoVar);
  736. smalltalk.addMethod(
  737. "_isPseudoVar",
  738. smalltalk.method({
  739. selector: "isPseudoVar",
  740. fn: function (){
  741. var self=this;
  742. return smalltalk.withContext(function($ctx) { return true;
  743. }, self, "isPseudoVar", [], smalltalk.PseudoVar)}
  744. }),
  745. smalltalk.PseudoVar);
  746. smalltalk.addClass('TempVar', smalltalk.ScopeVar, [], 'Compiler-Semantic');
  747. smalltalk.addMethod(
  748. "_alias",
  749. smalltalk.method({
  750. selector: "alias",
  751. fn: function (){
  752. var self=this;
  753. return smalltalk.withContext(function($ctx) { var $1;
  754. $1=_st(_st(_st(_st(self)._scope())._alias()).__comma(".")).__comma(smalltalk.ScopeVar.fn.prototype._alias.apply(_st(self), []));
  755. return $1;
  756. }, self, "alias", [], smalltalk.TempVar)}
  757. }),
  758. smalltalk.TempVar);
  759. smalltalk.addMethod(
  760. "_isTempVar",
  761. smalltalk.method({
  762. selector: "isTempVar",
  763. fn: function (){
  764. var self=this;
  765. return smalltalk.withContext(function($ctx) { return true;
  766. }, self, "isTempVar", [], smalltalk.TempVar)}
  767. }),
  768. smalltalk.TempVar);
  769. smalltalk.addClass('UnknownVar', smalltalk.ScopeVar, [], 'Compiler-Semantic');
  770. smalltalk.addMethod(
  771. "_isUnknownVar",
  772. smalltalk.method({
  773. selector: "isUnknownVar",
  774. fn: function (){
  775. var self=this;
  776. return smalltalk.withContext(function($ctx) { return true;
  777. }, self, "isUnknownVar", [], smalltalk.UnknownVar)}
  778. }),
  779. smalltalk.UnknownVar);
  780. smalltalk.addClass('SemanticAnalyzer', smalltalk.NodeVisitor, ['currentScope', 'theClass', 'classReferences', 'messageSends', 'superSends'], 'Compiler-Semantic');
  781. smalltalk.addMethod(
  782. "_classReferences",
  783. smalltalk.method({
  784. selector: "classReferences",
  785. fn: function (){
  786. var self=this;
  787. return smalltalk.withContext(function($ctx) { var $1;
  788. if(($receiver = self["@classReferences"]) == nil || $receiver == undefined){
  789. self["@classReferences"]=_st((smalltalk.Set || Set))._new();
  790. $1=self["@classReferences"];
  791. } else {
  792. $1=self["@classReferences"];
  793. };
  794. return $1;
  795. }, self, "classReferences", [], smalltalk.SemanticAnalyzer)}
  796. }),
  797. smalltalk.SemanticAnalyzer);
  798. smalltalk.addMethod(
  799. "_errorShadowingVariable_",
  800. smalltalk.method({
  801. selector: "errorShadowingVariable:",
  802. fn: function (aString){
  803. var self=this;
  804. return smalltalk.withContext(function($ctx) { var $1,$2;
  805. $1=_st((smalltalk.ShadowingVariableError || ShadowingVariableError))._new();
  806. _st($1)._variableName_(aString);
  807. $2=_st($1)._signal();
  808. return self}, self, "errorShadowingVariable:", [aString], smalltalk.SemanticAnalyzer)}
  809. }),
  810. smalltalk.SemanticAnalyzer);
  811. smalltalk.addMethod(
  812. "_errorUnknownVariable_",
  813. smalltalk.method({
  814. selector: "errorUnknownVariable:",
  815. fn: function (aNode){
  816. var self=this;
  817. return smalltalk.withContext(function($ctx) { var $1,$2,$3;
  818. $1=_st(self)._isVariableGloballyUndefined_(_st(aNode)._value());
  819. if(smalltalk.assert($1)){
  820. $2=_st((smalltalk.UnknownVariableError || UnknownVariableError))._new();
  821. _st($2)._variableName_(_st(aNode)._value());
  822. $3=_st($2)._signal();
  823. $3;
  824. } else {
  825. _st(_st(_st(self["@currentScope"])._methodScope())._unknownVariables())._add_(_st(aNode)._value());
  826. };
  827. return self}, self, "errorUnknownVariable:", [aNode], smalltalk.SemanticAnalyzer)}
  828. }),
  829. smalltalk.SemanticAnalyzer);
  830. smalltalk.addMethod(
  831. "_isVariableGloballyUndefined_",
  832. smalltalk.method({
  833. selector: "isVariableGloballyUndefined:",
  834. fn: function (aString){
  835. var self=this;
  836. return smalltalk.withContext(function($ctx) { return eval('typeof ' + aString + ' == "undefined"');
  837. ;
  838. return self}, self, "isVariableGloballyUndefined:", [aString], smalltalk.SemanticAnalyzer)}
  839. }),
  840. smalltalk.SemanticAnalyzer);
  841. smalltalk.addMethod(
  842. "_messageSends",
  843. smalltalk.method({
  844. selector: "messageSends",
  845. fn: function (){
  846. var self=this;
  847. return smalltalk.withContext(function($ctx) { var $1;
  848. if(($receiver = self["@messageSends"]) == nil || $receiver == undefined){
  849. self["@messageSends"]=_st((smalltalk.Dictionary || Dictionary))._new();
  850. $1=self["@messageSends"];
  851. } else {
  852. $1=self["@messageSends"];
  853. };
  854. return $1;
  855. }, self, "messageSends", [], smalltalk.SemanticAnalyzer)}
  856. }),
  857. smalltalk.SemanticAnalyzer);
  858. smalltalk.addMethod(
  859. "_newBlockScope",
  860. smalltalk.method({
  861. selector: "newBlockScope",
  862. fn: function (){
  863. var self=this;
  864. return smalltalk.withContext(function($ctx) { var $1;
  865. $1=_st(self)._newScopeOfClass_((smalltalk.LexicalScope || LexicalScope));
  866. return $1;
  867. }, self, "newBlockScope", [], smalltalk.SemanticAnalyzer)}
  868. }),
  869. smalltalk.SemanticAnalyzer);
  870. smalltalk.addMethod(
  871. "_newMethodScope",
  872. smalltalk.method({
  873. selector: "newMethodScope",
  874. fn: function (){
  875. var self=this;
  876. return smalltalk.withContext(function($ctx) { var $1;
  877. $1=_st(self)._newScopeOfClass_((smalltalk.MethodLexicalScope || MethodLexicalScope));
  878. return $1;
  879. }, self, "newMethodScope", [], smalltalk.SemanticAnalyzer)}
  880. }),
  881. smalltalk.SemanticAnalyzer);
  882. smalltalk.addMethod(
  883. "_newScopeOfClass_",
  884. smalltalk.method({
  885. selector: "newScopeOfClass:",
  886. fn: function (aLexicalScopeClass){
  887. var self=this;
  888. return smalltalk.withContext(function($ctx) { var $2,$3,$1;
  889. $2=_st(aLexicalScopeClass)._new();
  890. _st($2)._outerScope_(self["@currentScope"]);
  891. $3=_st($2)._yourself();
  892. $1=$3;
  893. return $1;
  894. }, self, "newScopeOfClass:", [aLexicalScopeClass], smalltalk.SemanticAnalyzer)}
  895. }),
  896. smalltalk.SemanticAnalyzer);
  897. smalltalk.addMethod(
  898. "_popScope",
  899. smalltalk.method({
  900. selector: "popScope",
  901. fn: function (){
  902. var self=this;
  903. return smalltalk.withContext(function($ctx) { if(($receiver = self["@currentScope"]) == nil || $receiver == undefined){
  904. self["@currentScope"];
  905. } else {
  906. self["@currentScope"]=_st(self["@currentScope"])._outerScope();
  907. self["@currentScope"];
  908. };
  909. return self}, self, "popScope", [], smalltalk.SemanticAnalyzer)}
  910. }),
  911. smalltalk.SemanticAnalyzer);
  912. smalltalk.addMethod(
  913. "_pushScope_",
  914. smalltalk.method({
  915. selector: "pushScope:",
  916. fn: function (aScope){
  917. var self=this;
  918. return smalltalk.withContext(function($ctx) { _st(aScope)._outerScope_(self["@currentScope"]);
  919. self["@currentScope"]=aScope;
  920. return self}, self, "pushScope:", [aScope], smalltalk.SemanticAnalyzer)}
  921. }),
  922. smalltalk.SemanticAnalyzer);
  923. smalltalk.addMethod(
  924. "_superSends",
  925. smalltalk.method({
  926. selector: "superSends",
  927. fn: function (){
  928. var self=this;
  929. return smalltalk.withContext(function($ctx) { var $1;
  930. if(($receiver = self["@superSends"]) == nil || $receiver == undefined){
  931. self["@superSends"]=_st((smalltalk.Dictionary || Dictionary))._new();
  932. $1=self["@superSends"];
  933. } else {
  934. $1=self["@superSends"];
  935. };
  936. return $1;
  937. }, self, "superSends", [], smalltalk.SemanticAnalyzer)}
  938. }),
  939. smalltalk.SemanticAnalyzer);
  940. smalltalk.addMethod(
  941. "_theClass",
  942. smalltalk.method({
  943. selector: "theClass",
  944. fn: function (){
  945. var self=this;
  946. return smalltalk.withContext(function($ctx) { return self["@theClass"];
  947. }, self, "theClass", [], smalltalk.SemanticAnalyzer)}
  948. }),
  949. smalltalk.SemanticAnalyzer);
  950. smalltalk.addMethod(
  951. "_theClass_",
  952. smalltalk.method({
  953. selector: "theClass:",
  954. fn: function (aClass){
  955. var self=this;
  956. return smalltalk.withContext(function($ctx) { self["@theClass"]=aClass;
  957. return self}, self, "theClass:", [aClass], smalltalk.SemanticAnalyzer)}
  958. }),
  959. smalltalk.SemanticAnalyzer);
  960. smalltalk.addMethod(
  961. "_validateVariableScope_",
  962. smalltalk.method({
  963. selector: "validateVariableScope:",
  964. fn: function (aString){
  965. var self=this;
  966. return smalltalk.withContext(function($ctx) { var $1;
  967. $1=_st(self["@currentScope"])._lookupVariable_(aString);
  968. if(($receiver = $1) == nil || $receiver == undefined){
  969. $1;
  970. } else {
  971. _st(self)._errorShadowingVariable_(aString);
  972. };
  973. return self}, self, "validateVariableScope:", [aString], smalltalk.SemanticAnalyzer)}
  974. }),
  975. smalltalk.SemanticAnalyzer);
  976. smalltalk.addMethod(
  977. "_visitAssignmentNode_",
  978. smalltalk.method({
  979. selector: "visitAssignmentNode:",
  980. fn: function (aNode){
  981. var self=this;
  982. return smalltalk.withContext(function($ctx) { smalltalk.NodeVisitor.fn.prototype._visitAssignmentNode_.apply(_st(self), [aNode]);
  983. _st(_st(aNode)._left())._beAssigned();
  984. return self}, self, "visitAssignmentNode:", [aNode], smalltalk.SemanticAnalyzer)}
  985. }),
  986. smalltalk.SemanticAnalyzer);
  987. smalltalk.addMethod(
  988. "_visitBlockNode_",
  989. smalltalk.method({
  990. selector: "visitBlockNode:",
  991. fn: function (aNode){
  992. var self=this;
  993. return smalltalk.withContext(function($ctx) { _st(self)._pushScope_(_st(self)._newBlockScope());
  994. _st(aNode)._scope_(self["@currentScope"]);
  995. _st(self["@currentScope"])._node_(aNode);
  996. _st(_st(aNode)._parameters())._do_((function(each){
  997. _st(self)._validateVariableScope_(each);
  998. return _st(self["@currentScope"])._addArg_(each);
  999. }));
  1000. smalltalk.NodeVisitor.fn.prototype._visitBlockNode_.apply(_st(self), [aNode]);
  1001. _st(self)._popScope();
  1002. return self}, self, "visitBlockNode:", [aNode], smalltalk.SemanticAnalyzer)}
  1003. }),
  1004. smalltalk.SemanticAnalyzer);
  1005. smalltalk.addMethod(
  1006. "_visitCascadeNode_",
  1007. smalltalk.method({
  1008. selector: "visitCascadeNode:",
  1009. fn: function (aNode){
  1010. var self=this;
  1011. return smalltalk.withContext(function($ctx) { var $1;
  1012. _st(_st(aNode)._nodes())._do_((function(each){
  1013. return _st(each)._receiver_(_st(aNode)._receiver());
  1014. }));
  1015. smalltalk.NodeVisitor.fn.prototype._visitCascadeNode_.apply(_st(self), [aNode]);
  1016. $1=_st(_st(_st(aNode)._nodes())._first())._superSend();
  1017. if(smalltalk.assert($1)){
  1018. _st(_st(aNode)._nodes())._do_((function(each){
  1019. return _st(each)._superSend_(true);
  1020. }));
  1021. };
  1022. return self}, self, "visitCascadeNode:", [aNode], smalltalk.SemanticAnalyzer)}
  1023. }),
  1024. smalltalk.SemanticAnalyzer);
  1025. smalltalk.addMethod(
  1026. "_visitClassReferenceNode_",
  1027. smalltalk.method({
  1028. selector: "visitClassReferenceNode:",
  1029. fn: function (aNode){
  1030. var self=this;
  1031. return smalltalk.withContext(function($ctx) { var $1,$2;
  1032. _st(_st(self)._classReferences())._add_(_st(aNode)._value());
  1033. $1=_st((smalltalk.ClassRefVar || ClassRefVar))._new();
  1034. _st($1)._name_(_st(aNode)._value());
  1035. $2=_st($1)._yourself();
  1036. _st(aNode)._binding_($2);
  1037. return self}, self, "visitClassReferenceNode:", [aNode], smalltalk.SemanticAnalyzer)}
  1038. }),
  1039. smalltalk.SemanticAnalyzer);
  1040. smalltalk.addMethod(
  1041. "_visitMethodNode_",
  1042. smalltalk.method({
  1043. selector: "visitMethodNode:",
  1044. fn: function (aNode){
  1045. var self=this;
  1046. return smalltalk.withContext(function($ctx) { var $1;
  1047. _st(self)._pushScope_(_st(self)._newMethodScope());
  1048. _st(aNode)._scope_(self["@currentScope"]);
  1049. _st(self["@currentScope"])._node_(aNode);
  1050. _st(_st(_st(self)._theClass())._allInstanceVariableNames())._do_((function(each){
  1051. return _st(self["@currentScope"])._addIVar_(each);
  1052. }));
  1053. _st(_st(aNode)._arguments())._do_((function(each){
  1054. _st(self)._validateVariableScope_(each);
  1055. return _st(self["@currentScope"])._addArg_(each);
  1056. }));
  1057. smalltalk.NodeVisitor.fn.prototype._visitMethodNode_.apply(_st(self), [aNode]);
  1058. _st(aNode)._classReferences_(_st(self)._classReferences());
  1059. _st(aNode)._messageSends_(_st(_st(self)._messageSends())._keys());
  1060. $1=_st(aNode)._superSends_(_st(_st(self)._superSends())._keys());
  1061. _st(self)._popScope();
  1062. return self}, self, "visitMethodNode:", [aNode], smalltalk.SemanticAnalyzer)}
  1063. }),
  1064. smalltalk.SemanticAnalyzer);
  1065. smalltalk.addMethod(
  1066. "_visitReturnNode_",
  1067. smalltalk.method({
  1068. selector: "visitReturnNode:",
  1069. fn: function (aNode){
  1070. var self=this;
  1071. return smalltalk.withContext(function($ctx) { var $1;
  1072. _st(aNode)._scope_(self["@currentScope"]);
  1073. $1=_st(self["@currentScope"])._isMethodScope();
  1074. if(smalltalk.assert($1)){
  1075. _st(self["@currentScope"])._localReturn_(true);
  1076. } else {
  1077. _st(_st(self["@currentScope"])._methodScope())._addNonLocalReturn_(self["@currentScope"]);
  1078. };
  1079. smalltalk.NodeVisitor.fn.prototype._visitReturnNode_.apply(_st(self), [aNode]);
  1080. return self}, self, "visitReturnNode:", [aNode], smalltalk.SemanticAnalyzer)}
  1081. }),
  1082. smalltalk.SemanticAnalyzer);
  1083. smalltalk.addMethod(
  1084. "_visitSendNode_",
  1085. smalltalk.method({
  1086. selector: "visitSendNode:",
  1087. fn: function (aNode){
  1088. var self=this;
  1089. return smalltalk.withContext(function($ctx) { var $1,$2,$3;
  1090. $1=_st(_st(_st(aNode)._receiver())._value()).__eq("super");
  1091. if(smalltalk.assert($1)){
  1092. _st(aNode)._superSend_(true);
  1093. _st(_st(aNode)._receiver())._value_("self");
  1094. _st(_st(self)._superSends())._at_ifAbsentPut_(_st(aNode)._selector(),(function(){
  1095. return _st((smalltalk.Set || Set))._new();
  1096. }));
  1097. _st(_st(_st(self)._superSends())._at_(_st(aNode)._selector()))._add_(aNode);
  1098. } else {
  1099. $2=_st(_st((smalltalk.IRSendInliner || IRSendInliner))._inlinedSelectors())._includes_(_st(aNode)._selector());
  1100. if(smalltalk.assert($2)){
  1101. _st(aNode)._shouldBeInlined_(true);
  1102. $3=_st(_st(aNode)._receiver())._isValueNode();
  1103. if(! smalltalk.assert($3)){
  1104. _st(_st(aNode)._receiver())._shouldBeAliased_(true);
  1105. };
  1106. };
  1107. };
  1108. _st(_st(self)._messageSends())._at_ifAbsentPut_(_st(aNode)._selector(),(function(){
  1109. return _st((smalltalk.Set || Set))._new();
  1110. }));
  1111. _st(_st(_st(self)._messageSends())._at_(_st(aNode)._selector()))._add_(aNode);
  1112. _st(aNode)._index_(_st(_st(_st(self)._messageSends())._at_(_st(aNode)._selector()))._size());
  1113. smalltalk.NodeVisitor.fn.prototype._visitSendNode_.apply(_st(self), [aNode]);
  1114. return self}, self, "visitSendNode:", [aNode], smalltalk.SemanticAnalyzer)}
  1115. }),
  1116. smalltalk.SemanticAnalyzer);
  1117. smalltalk.addMethod(
  1118. "_visitSequenceNode_",
  1119. smalltalk.method({
  1120. selector: "visitSequenceNode:",
  1121. fn: function (aNode){
  1122. var self=this;
  1123. return smalltalk.withContext(function($ctx) { _st(_st(aNode)._temps())._do_((function(each){
  1124. _st(self)._validateVariableScope_(each);
  1125. return _st(self["@currentScope"])._addTemp_(each);
  1126. }));
  1127. smalltalk.NodeVisitor.fn.prototype._visitSequenceNode_.apply(_st(self), [aNode]);
  1128. return self}, self, "visitSequenceNode:", [aNode], smalltalk.SemanticAnalyzer)}
  1129. }),
  1130. smalltalk.SemanticAnalyzer);
  1131. smalltalk.addMethod(
  1132. "_visitVariableNode_",
  1133. smalltalk.method({
  1134. selector: "visitVariableNode:",
  1135. fn: function (aNode){
  1136. var self=this;
  1137. return smalltalk.withContext(function($ctx) { var $2,$3,$4,$1;
  1138. $2=_st(self["@currentScope"])._lookupVariable_(aNode);
  1139. if(($receiver = $2) == nil || $receiver == undefined){
  1140. _st(self)._errorUnknownVariable_(aNode);
  1141. $3=_st((smalltalk.UnknownVar || UnknownVar))._new();
  1142. _st($3)._name_(_st(aNode)._value());
  1143. $4=_st($3)._yourself();
  1144. $1=$4;
  1145. } else {
  1146. $1=$2;
  1147. };
  1148. _st(aNode)._binding_($1);
  1149. return self}, self, "visitVariableNode:", [aNode], smalltalk.SemanticAnalyzer)}
  1150. }),
  1151. smalltalk.SemanticAnalyzer);
  1152. smalltalk.addMethod(
  1153. "_on_",
  1154. smalltalk.method({
  1155. selector: "on:",
  1156. fn: function (aClass){
  1157. var self=this;
  1158. return smalltalk.withContext(function($ctx) { var $2,$3,$1;
  1159. $2=_st(self)._new();
  1160. _st($2)._theClass_(aClass);
  1161. $3=_st($2)._yourself();
  1162. $1=$3;
  1163. return $1;
  1164. }, self, "on:", [aClass], smalltalk.SemanticAnalyzer.klass)}
  1165. }),
  1166. smalltalk.SemanticAnalyzer.klass);