SmallSense__SmalltalkInferencer.st
changeset 883 9c644e7c1d97
parent 453 7f88db59ad3f
child 1054 be59a463c886
--- a/SmallSense__SmalltalkInferencer.st	Sat Aug 08 02:55:51 2015 +0100
+++ b/SmallSense__SmalltalkInferencer.st	Sat Aug 22 00:14:23 2015 +0100
@@ -21,7 +21,8 @@
 "{ NameSpace: SmallSense }"
 
 Object subclass:#SmalltalkInferencer
-	instanceVariableNames:'type class classInfo source parser parserClass tree environment'
+	instanceVariableNames:'type class classInfo source parser parserClass tree environment
+		manager'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'SmallSense-Smalltalk-Types-Inference'
@@ -137,10 +138,19 @@
 !
 
 manager
-
-    ^Manager instance
+    manager isNil ifTrue:[
+        manager := Manager instance
+    ].
+    ^ manager
 
     "Created: / 27-11-2011 / 16:16:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 21-08-2015 / 14:32:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+manager: aManager
+    manager := aManager
+
+    "Created: / 21-08-2015 / 14:32:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 parser
@@ -211,17 +221,14 @@
 !SmalltalkInferencer methodsFor:'private'!
 
 infer
-
-
-    Phase1 process: tree in: class.
-    Phase2 process: tree in: class.
+    Phase1 process:tree in:class manager:manager.
+    Phase2 process:tree in:class manager:manager.
 
     "
-    (SmallSenseParseNodeInspector new node: tree source: source) open
-    "
+     (SmallSenseParseNodeInspector new node: tree source: source) open"
 
     "Created: / 26-11-2011 / 12:51:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 05-08-2014 / 14:04:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 21-08-2015 / 15:45:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 parse
@@ -264,7 +271,7 @@
         self parse.
     ] on: Error do:[:ex|
         Transcript showCR: ex description.
-        ^ self.
+        ^ nil.
     ].
     tree notNil ifTrue:[
         self infer.
@@ -272,7 +279,7 @@
     ^tree
 
     "Created: / 26-11-2011 / 12:50:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 21-03-2014 / 19:00:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 21-08-2015 / 14:35:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !SmalltalkInferencer::Phase1 class methodsFor:'documentation'!
@@ -307,7 +314,7 @@
 
     "/ super initialize.   -- commented since inherited method does nothing
 
-    "Modified: / 26-11-2011 / 19:31:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 21-08-2015 / 15:44:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !SmalltalkInferencer::Phase1 methodsFor:'private'!
@@ -363,13 +370,6 @@
 
 !SmalltalkInferencer::Phase1 methodsFor:'processing'!
 
-process: tree in: cls
-
-    self process: tree in: cls info: (Manager instance infoForClass: cls)
-
-    "Created: / 26-11-2011 / 13:48:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
 process: tree in: cls info: clsInfo
 
      | i c def prereqs |
@@ -427,6 +427,15 @@
 
     "Created: / 27-11-2011 / 16:22:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified (comment): / 21-11-2014 / 17:19:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+process:tree in:cls manager:manager 
+    self 
+        process:tree
+        in:cls
+        info:(manager infoForClass:cls)
+
+    "Modified: / 21-08-2015 / 15:44:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !SmalltalkInferencer::Phase1 methodsFor:'visiting'!