CCReader.st
changeset 699 12f456343eea
parent 528 a083413dfbe8
child 784 0811a8196743
equal deleted inserted replaced
698:04533375e12c 699:12f456343eea
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 
    12 
    13 Object subclass:#ClassCategoryReader
    13 Object subclass:#ClassCategoryReader
    14        instanceVariableNames:'myClass myCategory privacy ignore primSpec'
    14 	 instanceVariableNames:'myClass myCategory privacy ignore primSpec'
    15        classVariableNames:'KeepSource'
    15 	 classVariableNames:'KeepSource'
    16        poolDictionaries:''
    16 	 poolDictionaries:''
    17        category:'Kernel-Support'
    17 	 category:'Kernel-Support'
    18 !
    18 !
    19 
    19 
    20 !ClassCategoryReader class methodsFor:'documentation'!
    20 !ClassCategoryReader class methodsFor:'documentation'!
    21 
    21 
    22 copyright
    22 copyright
    31  other person.  No title to or ownership of the software is
    31  other person.  No title to or ownership of the software is
    32  hereby transferred.
    32  hereby transferred.
    33 "
    33 "
    34 !
    34 !
    35 
    35 
    36 version
       
    37     ^ '$Header: /cvs/stx/stx/libbasic/Attic/CCReader.st,v 1.22 1995-11-11 14:27:31 cg Exp $'
       
    38 !
       
    39 
       
    40 documentation
    36 documentation
    41 "
    37 "
    42     a helper class for fileIn - keeps track of class and category to filein for.
    38     a helper class for fileIn - keeps track of class and category to filein for.
    43     Instances of this are created by the #methodsFor: methods in Class, to
    39     Instances of this are created by the #methodsFor: methods in Class, to
    44     read the next chunk(s) from a stream.
    40     read the next chunk(s) from a stream.
    49 
    45 
    50 initialize
    46 initialize
    51     KeepSource := true
    47     KeepSource := true
    52 ! !
    48 ! !
    53 
    49 
    54 !ClassCategoryReader class methodsFor:'defaults'!
       
    55 
       
    56 keepSource:aBoolean
       
    57     KeepSource := aBoolean
       
    58 
       
    59     "Created: 9.9.1995 / 15:22:26 / claus"
       
    60 !
       
    61 
       
    62 keepSource
       
    63     ^ KeepSource
       
    64 
       
    65     "Created: 9.9.1995 / 15:22:27 / claus"
       
    66 ! !
       
    67 
       
    68 !ClassCategoryReader class methodsFor:'instance creation'!
    50 !ClassCategoryReader class methodsFor:'instance creation'!
    69 
    51 
    70 class:aClass category:aCategory
    52 class:aClass category:aCategory
    71     "return a new ClassCategoryReader to read methods for aClass with
    53     "return a new ClassCategoryReader to read methods for aClass with
    72      methodCategory aCategory"
    54      methodCategory aCategory"
    84     "return a class categoryReader which skips chunks up to the next empty one"
    66     "return a class categoryReader which skips chunks up to the next empty one"
    85 
    67 
    86     ^ self new ignoreMethods
    68     ^ self new ignoreMethods
    87 ! !
    69 ! !
    88 
    70 
    89 !ClassCategoryReader methodsFor:'private'!
    71 !ClassCategoryReader class methodsFor:'defaults'!
    90 
    72 
    91 class:aClass category:aCategory
    73 keepSource
    92     "set the instance variables"
    74     ^ KeepSource
    93 
    75 
    94     myClass := aClass.
    76     "Created: 9.9.1995 / 15:22:27 / claus"
    95     myCategory := aCategory.
    77 !
    96     ignore := false
    78 
    97 !
    79 keepSource:aBoolean
    98 
    80     KeepSource := aBoolean
    99 class:aClass primitiveSpec:which
    81 
   100     "set the instance variables"
    82     "Created: 9.9.1995 / 15:22:26 / claus"
   101 
       
   102     myClass := aClass.
       
   103     primSpec := which.
       
   104     ignore := false
       
   105 ! !
       
   106 
       
   107 !ClassCategoryReader methodsFor:'special'!
       
   108 
       
   109 privateProtocol
       
   110     privacy := #private
       
   111 ! 
       
   112 
       
   113 protectedProtocol
       
   114     privacy := #protected
       
   115 ! 
       
   116 
       
   117 ignoreMethods 
       
   118     ignore := true
       
   119 ! !
    83 ! !
   120 
    84 
   121 !ClassCategoryReader methodsFor:'fileIn'!
    85 !ClassCategoryReader methodsFor:'fileIn'!
       
    86 
       
    87 fileInFrom:aStream
       
    88     "read method-chunks from the input stream, aStream; compile them
       
    89      and add the methods to the class defined by the class-instance var"
       
    90 
       
    91     self fileInFrom:aStream notifying:nil passChunk:false
       
    92 !
   122 
    93 
   123 fileInFrom:aStream notifying:requestor passChunk:passChunk
    94 fileInFrom:aStream notifying:requestor passChunk:passChunk
   124     "read method-chunks from the input stream, aStream; compile them
    95     "read method-chunks from the input stream, aStream; compile them
   125      and add the methods to the class defined by the class-instance var;
    96      and add the methods to the class defined by the class-instance var;
   126      errors and notifications are passed to requestor"
    97      errors and notifications are passed to requestor"
   214 	    ]
   185 	    ]
   215 	]
   186 	]
   216     ]
   187     ]
   217 
   188 
   218     "Modified: 9.9.1995 / 15:29:08 / claus"
   189     "Modified: 9.9.1995 / 15:29:08 / claus"
   219 !
   190 ! !
   220 
   191 
   221 fileInFrom:aStream
   192 !ClassCategoryReader methodsFor:'private'!
   222     "read method-chunks from the input stream, aStream; compile them
   193 
   223      and add the methods to the class defined by the class-instance var"
   194 class:aClass category:aCategory
   224 
   195     "set the instance variables"
   225     self fileInFrom:aStream notifying:nil passChunk:false
   196 
   226 ! !
   197     myClass := aClass.
       
   198     myCategory := aCategory.
       
   199     ignore := false
       
   200 !
       
   201 
       
   202 class:aClass primitiveSpec:which
       
   203     "set the instance variables"
       
   204 
       
   205     myClass := aClass.
       
   206     primSpec := which.
       
   207     ignore := false
       
   208 ! !
       
   209 
       
   210 !ClassCategoryReader methodsFor:'special'!
       
   211 
       
   212 ignoreMethods 
       
   213     ignore := true
       
   214 !
       
   215 
       
   216 privateProtocol
       
   217     privacy := #private
       
   218 !
       
   219 
       
   220 protectedProtocol
       
   221     privacy := #protected
       
   222 ! !
       
   223 
       
   224 !ClassCategoryReader class methodsFor:'documentation'!
       
   225 
       
   226 version
       
   227     ^ '$Header: /cvs/stx/stx/libbasic/Attic/CCReader.st,v 1.23 1995-12-07 21:31:11 cg Exp $'
       
   228 ! !
       
   229 ClassCategoryReader initialize!