Compiler-Semantic.deploy.js 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248
  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,$3;
  794. $1=_st(self)._isVariableGloballyUndefined_(_st(aNode)._value());
  795. if(smalltalk.assert($1)){
  796. $2=_st((smalltalk.UnknownVariableError || UnknownVariableError))._new();
  797. _st($2)._variableName_(_st(aNode)._value());
  798. $3=_st($2)._signal();
  799. $3;
  800. } else {
  801. _st(_st(_st(self["@currentScope"])._methodScope())._unknownVariables())._add_(_st(aNode)._value());
  802. };
  803. return self}, self, "errorUnknownVariable:", [aNode], smalltalk.SemanticAnalyzer)}
  804. }),
  805. smalltalk.SemanticAnalyzer);
  806. smalltalk.addMethod(
  807. "_isVariableGloballyUndefined_",
  808. smalltalk.method({
  809. selector: "isVariableGloballyUndefined:",
  810. fn: function (aString){
  811. var self=this;
  812. return smalltalk.withContext(function($ctx) { return eval('typeof ' + aString + ' == "undefined"');
  813. ;
  814. return self}, self, "isVariableGloballyUndefined:", [aString], smalltalk.SemanticAnalyzer)}
  815. }),
  816. smalltalk.SemanticAnalyzer);
  817. smalltalk.addMethod(
  818. "_messageSends",
  819. smalltalk.method({
  820. selector: "messageSends",
  821. fn: function (){
  822. var self=this;
  823. return smalltalk.withContext(function($ctx) { var $1;
  824. if(($receiver = self["@messageSends"]) == nil || $receiver == undefined){
  825. self["@messageSends"]=_st((smalltalk.Dictionary || Dictionary))._new();
  826. $1=self["@messageSends"];
  827. } else {
  828. $1=self["@messageSends"];
  829. };
  830. return $1;
  831. }, self, "messageSends", [], smalltalk.SemanticAnalyzer)}
  832. }),
  833. smalltalk.SemanticAnalyzer);
  834. smalltalk.addMethod(
  835. "_newBlockScope",
  836. smalltalk.method({
  837. selector: "newBlockScope",
  838. fn: function (){
  839. var self=this;
  840. return smalltalk.withContext(function($ctx) { var $1;
  841. $1=_st(self)._newScopeOfClass_((smalltalk.LexicalScope || LexicalScope));
  842. return $1;
  843. }, self, "newBlockScope", [], smalltalk.SemanticAnalyzer)}
  844. }),
  845. smalltalk.SemanticAnalyzer);
  846. smalltalk.addMethod(
  847. "_newMethodScope",
  848. smalltalk.method({
  849. selector: "newMethodScope",
  850. fn: function (){
  851. var self=this;
  852. return smalltalk.withContext(function($ctx) { var $1;
  853. $1=_st(self)._newScopeOfClass_((smalltalk.MethodLexicalScope || MethodLexicalScope));
  854. return $1;
  855. }, self, "newMethodScope", [], smalltalk.SemanticAnalyzer)}
  856. }),
  857. smalltalk.SemanticAnalyzer);
  858. smalltalk.addMethod(
  859. "_newScopeOfClass_",
  860. smalltalk.method({
  861. selector: "newScopeOfClass:",
  862. fn: function (aLexicalScopeClass){
  863. var self=this;
  864. return smalltalk.withContext(function($ctx) { var $2,$3,$1;
  865. $2=_st(aLexicalScopeClass)._new();
  866. _st($2)._outerScope_(self["@currentScope"]);
  867. $3=_st($2)._yourself();
  868. $1=$3;
  869. return $1;
  870. }, self, "newScopeOfClass:", [aLexicalScopeClass], smalltalk.SemanticAnalyzer)}
  871. }),
  872. smalltalk.SemanticAnalyzer);
  873. smalltalk.addMethod(
  874. "_popScope",
  875. smalltalk.method({
  876. selector: "popScope",
  877. fn: function (){
  878. var self=this;
  879. return smalltalk.withContext(function($ctx) { if(($receiver = self["@currentScope"]) == nil || $receiver == undefined){
  880. self["@currentScope"];
  881. } else {
  882. self["@currentScope"]=_st(self["@currentScope"])._outerScope();
  883. self["@currentScope"];
  884. };
  885. return self}, self, "popScope", [], smalltalk.SemanticAnalyzer)}
  886. }),
  887. smalltalk.SemanticAnalyzer);
  888. smalltalk.addMethod(
  889. "_pushScope_",
  890. smalltalk.method({
  891. selector: "pushScope:",
  892. fn: function (aScope){
  893. var self=this;
  894. return smalltalk.withContext(function($ctx) { _st(aScope)._outerScope_(self["@currentScope"]);
  895. self["@currentScope"]=aScope;
  896. return self}, self, "pushScope:", [aScope], smalltalk.SemanticAnalyzer)}
  897. }),
  898. smalltalk.SemanticAnalyzer);
  899. smalltalk.addMethod(
  900. "_superSends",
  901. smalltalk.method({
  902. selector: "superSends",
  903. fn: function (){
  904. var self=this;
  905. return smalltalk.withContext(function($ctx) { var $1;
  906. if(($receiver = self["@superSends"]) == nil || $receiver == undefined){
  907. self["@superSends"]=_st((smalltalk.Dictionary || Dictionary))._new();
  908. $1=self["@superSends"];
  909. } else {
  910. $1=self["@superSends"];
  911. };
  912. return $1;
  913. }, self, "superSends", [], smalltalk.SemanticAnalyzer)}
  914. }),
  915. smalltalk.SemanticAnalyzer);
  916. smalltalk.addMethod(
  917. "_theClass",
  918. smalltalk.method({
  919. selector: "theClass",
  920. fn: function (){
  921. var self=this;
  922. return smalltalk.withContext(function($ctx) { return self["@theClass"];
  923. }, self, "theClass", [], smalltalk.SemanticAnalyzer)}
  924. }),
  925. smalltalk.SemanticAnalyzer);
  926. smalltalk.addMethod(
  927. "_theClass_",
  928. smalltalk.method({
  929. selector: "theClass:",
  930. fn: function (aClass){
  931. var self=this;
  932. return smalltalk.withContext(function($ctx) { self["@theClass"]=aClass;
  933. return self}, self, "theClass:", [aClass], smalltalk.SemanticAnalyzer)}
  934. }),
  935. smalltalk.SemanticAnalyzer);
  936. smalltalk.addMethod(
  937. "_validateVariableScope_",
  938. smalltalk.method({
  939. selector: "validateVariableScope:",
  940. fn: function (aString){
  941. var self=this;
  942. return smalltalk.withContext(function($ctx) { var $1;
  943. $1=_st(self["@currentScope"])._lookupVariable_(aString);
  944. if(($receiver = $1) == nil || $receiver == undefined){
  945. $1;
  946. } else {
  947. _st(self)._errorShadowingVariable_(aString);
  948. };
  949. return self}, self, "validateVariableScope:", [aString], smalltalk.SemanticAnalyzer)}
  950. }),
  951. smalltalk.SemanticAnalyzer);
  952. smalltalk.addMethod(
  953. "_visitAssignmentNode_",
  954. smalltalk.method({
  955. selector: "visitAssignmentNode:",
  956. fn: function (aNode){
  957. var self=this;
  958. return smalltalk.withContext(function($ctx) { smalltalk.NodeVisitor.fn.prototype._visitAssignmentNode_.apply(_st(self), [aNode]);
  959. _st(_st(aNode)._left())._beAssigned();
  960. return self}, self, "visitAssignmentNode:", [aNode], smalltalk.SemanticAnalyzer)}
  961. }),
  962. smalltalk.SemanticAnalyzer);
  963. smalltalk.addMethod(
  964. "_visitBlockNode_",
  965. smalltalk.method({
  966. selector: "visitBlockNode:",
  967. fn: function (aNode){
  968. var self=this;
  969. return smalltalk.withContext(function($ctx) { _st(self)._pushScope_(_st(self)._newBlockScope());
  970. _st(aNode)._scope_(self["@currentScope"]);
  971. _st(self["@currentScope"])._node_(aNode);
  972. _st(_st(aNode)._parameters())._do_((function(each){
  973. _st(self)._validateVariableScope_(each);
  974. return _st(self["@currentScope"])._addArg_(each);
  975. }));
  976. smalltalk.NodeVisitor.fn.prototype._visitBlockNode_.apply(_st(self), [aNode]);
  977. _st(self)._popScope();
  978. return self}, self, "visitBlockNode:", [aNode], smalltalk.SemanticAnalyzer)}
  979. }),
  980. smalltalk.SemanticAnalyzer);
  981. smalltalk.addMethod(
  982. "_visitCascadeNode_",
  983. smalltalk.method({
  984. selector: "visitCascadeNode:",
  985. fn: function (aNode){
  986. var self=this;
  987. return smalltalk.withContext(function($ctx) { var $1;
  988. _st(_st(aNode)._nodes())._do_((function(each){
  989. return _st(each)._receiver_(_st(aNode)._receiver());
  990. }));
  991. smalltalk.NodeVisitor.fn.prototype._visitCascadeNode_.apply(_st(self), [aNode]);
  992. $1=_st(_st(_st(aNode)._nodes())._first())._superSend();
  993. if(smalltalk.assert($1)){
  994. _st(_st(aNode)._nodes())._do_((function(each){
  995. return _st(each)._superSend_(true);
  996. }));
  997. };
  998. return self}, self, "visitCascadeNode:", [aNode], smalltalk.SemanticAnalyzer)}
  999. }),
  1000. smalltalk.SemanticAnalyzer);
  1001. smalltalk.addMethod(
  1002. "_visitClassReferenceNode_",
  1003. smalltalk.method({
  1004. selector: "visitClassReferenceNode:",
  1005. fn: function (aNode){
  1006. var self=this;
  1007. return smalltalk.withContext(function($ctx) { var $1,$2;
  1008. _st(_st(self)._classReferences())._add_(_st(aNode)._value());
  1009. $1=_st((smalltalk.ClassRefVar || ClassRefVar))._new();
  1010. _st($1)._name_(_st(aNode)._value());
  1011. $2=_st($1)._yourself();
  1012. _st(aNode)._binding_($2);
  1013. return self}, self, "visitClassReferenceNode:", [aNode], smalltalk.SemanticAnalyzer)}
  1014. }),
  1015. smalltalk.SemanticAnalyzer);
  1016. smalltalk.addMethod(
  1017. "_visitMethodNode_",
  1018. smalltalk.method({
  1019. selector: "visitMethodNode:",
  1020. fn: function (aNode){
  1021. var self=this;
  1022. return smalltalk.withContext(function($ctx) { var $1;
  1023. _st(self)._pushScope_(_st(self)._newMethodScope());
  1024. _st(aNode)._scope_(self["@currentScope"]);
  1025. _st(self["@currentScope"])._node_(aNode);
  1026. _st(_st(_st(self)._theClass())._allInstanceVariableNames())._do_((function(each){
  1027. return _st(self["@currentScope"])._addIVar_(each);
  1028. }));
  1029. _st(_st(aNode)._arguments())._do_((function(each){
  1030. _st(self)._validateVariableScope_(each);
  1031. return _st(self["@currentScope"])._addArg_(each);
  1032. }));
  1033. smalltalk.NodeVisitor.fn.prototype._visitMethodNode_.apply(_st(self), [aNode]);
  1034. _st(aNode)._classReferences_(_st(self)._classReferences());
  1035. _st(aNode)._messageSends_(_st(_st(self)._messageSends())._keys());
  1036. $1=_st(aNode)._superSends_(_st(_st(self)._superSends())._keys());
  1037. _st(self)._popScope();
  1038. return self}, self, "visitMethodNode:", [aNode], smalltalk.SemanticAnalyzer)}
  1039. }),
  1040. smalltalk.SemanticAnalyzer);
  1041. smalltalk.addMethod(
  1042. "_visitReturnNode_",
  1043. smalltalk.method({
  1044. selector: "visitReturnNode:",
  1045. fn: function (aNode){
  1046. var self=this;
  1047. return smalltalk.withContext(function($ctx) { var $1;
  1048. _st(aNode)._scope_(self["@currentScope"]);
  1049. $1=_st(self["@currentScope"])._isMethodScope();
  1050. if(smalltalk.assert($1)){
  1051. _st(self["@currentScope"])._localReturn_(true);
  1052. } else {
  1053. _st(_st(self["@currentScope"])._methodScope())._addNonLocalReturn_(self["@currentScope"]);
  1054. };
  1055. smalltalk.NodeVisitor.fn.prototype._visitReturnNode_.apply(_st(self), [aNode]);
  1056. return self}, self, "visitReturnNode:", [aNode], smalltalk.SemanticAnalyzer)}
  1057. }),
  1058. smalltalk.SemanticAnalyzer);
  1059. smalltalk.addMethod(
  1060. "_visitSendNode_",
  1061. smalltalk.method({
  1062. selector: "visitSendNode:",
  1063. fn: function (aNode){
  1064. var self=this;
  1065. return smalltalk.withContext(function($ctx) { var $1,$2,$3;
  1066. $1=_st(_st(_st(aNode)._receiver())._value()).__eq("super");
  1067. if(smalltalk.assert($1)){
  1068. _st(aNode)._superSend_(true);
  1069. _st(_st(aNode)._receiver())._value_("self");
  1070. _st(_st(self)._superSends())._at_ifAbsentPut_(_st(aNode)._selector(),(function(){
  1071. return _st((smalltalk.Set || Set))._new();
  1072. }));
  1073. _st(_st(_st(self)._superSends())._at_(_st(aNode)._selector()))._add_(aNode);
  1074. } else {
  1075. $2=_st(_st((smalltalk.IRSendInliner || IRSendInliner))._inlinedSelectors())._includes_(_st(aNode)._selector());
  1076. if(smalltalk.assert($2)){
  1077. _st(aNode)._shouldBeInlined_(true);
  1078. $3=_st(_st(aNode)._receiver())._isValueNode();
  1079. if(! smalltalk.assert($3)){
  1080. _st(_st(aNode)._receiver())._shouldBeAliased_(true);
  1081. };
  1082. };
  1083. };
  1084. _st(_st(self)._messageSends())._at_ifAbsentPut_(_st(aNode)._selector(),(function(){
  1085. return _st((smalltalk.Set || Set))._new();
  1086. }));
  1087. _st(_st(_st(self)._messageSends())._at_(_st(aNode)._selector()))._add_(aNode);
  1088. _st(aNode)._index_(_st(_st(_st(self)._messageSends())._at_(_st(aNode)._selector()))._size());
  1089. smalltalk.NodeVisitor.fn.prototype._visitSendNode_.apply(_st(self), [aNode]);
  1090. return self}, self, "visitSendNode:", [aNode], smalltalk.SemanticAnalyzer)}
  1091. }),
  1092. smalltalk.SemanticAnalyzer);
  1093. smalltalk.addMethod(
  1094. "_visitSequenceNode_",
  1095. smalltalk.method({
  1096. selector: "visitSequenceNode:",
  1097. fn: function (aNode){
  1098. var self=this;
  1099. return smalltalk.withContext(function($ctx) { _st(_st(aNode)._temps())._do_((function(each){
  1100. _st(self)._validateVariableScope_(each);
  1101. return _st(self["@currentScope"])._addTemp_(each);
  1102. }));
  1103. smalltalk.NodeVisitor.fn.prototype._visitSequenceNode_.apply(_st(self), [aNode]);
  1104. return self}, self, "visitSequenceNode:", [aNode], smalltalk.SemanticAnalyzer)}
  1105. }),
  1106. smalltalk.SemanticAnalyzer);
  1107. smalltalk.addMethod(
  1108. "_visitVariableNode_",
  1109. smalltalk.method({
  1110. selector: "visitVariableNode:",
  1111. fn: function (aNode){
  1112. var self=this;
  1113. return smalltalk.withContext(function($ctx) { var $2,$3,$4,$1;
  1114. $2=_st(self["@currentScope"])._lookupVariable_(aNode);
  1115. if(($receiver = $2) == nil || $receiver == undefined){
  1116. _st(self)._errorUnknownVariable_(aNode);
  1117. $3=_st((smalltalk.UnknownVar || UnknownVar))._new();
  1118. _st($3)._name_(_st(aNode)._value());
  1119. $4=_st($3)._yourself();
  1120. $1=$4;
  1121. } else {
  1122. $1=$2;
  1123. };
  1124. _st(aNode)._binding_($1);
  1125. return self}, self, "visitVariableNode:", [aNode], smalltalk.SemanticAnalyzer)}
  1126. }),
  1127. smalltalk.SemanticAnalyzer);
  1128. smalltalk.addMethod(
  1129. "_on_",
  1130. smalltalk.method({
  1131. selector: "on:",
  1132. fn: function (aClass){
  1133. var self=this;
  1134. return smalltalk.withContext(function($ctx) { var $2,$3,$1;
  1135. $2=_st(self)._new();
  1136. _st($2)._theClass_(aClass);
  1137. $3=_st($2)._yourself();
  1138. $1=$3;
  1139. return $1;
  1140. }, self, "on:", [aClass], smalltalk.SemanticAnalyzer.klass)}
  1141. }),
  1142. smalltalk.SemanticAnalyzer.klass);