compiler/TSourceReader.st
changeset 8 eec72263ed75
parent 7 7556e3d41d80
child 16 17a2d1d9f205
--- a/compiler/TSourceReader.st	Wed Sep 02 18:15:44 2015 +0100
+++ b/compiler/TSourceReader.st	Mon Sep 14 11:19:10 2015 +0100
@@ -3,7 +3,7 @@
 "{ NameSpace: Smalltalk }"
 
 Object subclass:#TSourceReader
-	instanceVariableNames:'stream definitions currentChunk currentChunkTree'
+	instanceVariableNames:'stream unit currentChunk currentChunkTree'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Languages-Tea-Compiler-Model'
@@ -97,10 +97,10 @@
         ]]]].
     ].
 
-    definitions add: class.
+    unit addElement: class.
 
     "Created: / 28-08-2015 / 07:16:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 03-09-2015 / 15:50:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 13-09-2015 / 07:56:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 processMethodDefinitions
@@ -141,18 +141,19 @@
         ] ifFalse:[ 
             method className: className.
         ].
-        definitions add: method
+        unit addElement: method
     ].
 
     "Created: / 31-08-2015 / 16:02:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 13-09-2015 / 07:56:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !TSourceReader methodsFor:'reading'!
 
 read: aStringOrFilenameOrStream
-    "Read Tea source from source and return a list of definitions found in the file"
+    "Read Tea source from source and return a compilation unit from it (as TCompilationUnitDefinition)"
 
-    definitions := OrderedCollection new.
+    unit := TCompilationUnitDefinition new.
     stream := aStringOrFilenameOrStream readStream.
     stream isEncodedStream ifFalse:[
         "/ By default, Tea sources are UTF8 encoded...
@@ -172,9 +173,9 @@
             self process
         ].
     ].
-    ^ definitions
+    ^ unit
 
     "Created: / 31-08-2015 / 15:23:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 31-08-2015 / 16:47:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 13-09-2015 / 07:56:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !