Compiler-Semantic.deploy.js 33 KB

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