Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!cornell!uw-beaver!uw-june!bnfb From: bnfb@june.cs.washington.edu (Bjorn Freeman-Benson) Newsgroups: comp.lang.smalltalk Subject: ChangeList modification [free code] Message-ID: <6783@june.cs.washington.edu> Date: 22 Dec 88 05:21:46 GMT Reply-To: bnfb@uw-june.UUCP (Bjorn Freeman-Benson) Organization: U of Washington, Computer Science, Seattle Lines: 54 Here is a little modification that John Maloney and I wrote to make ParcPlace Smalltalk-80 ChangeLists read the output of fileOutChanges. "ChangesReorgGoodie.st by Bjorn Freeman-Benson and John Maloney. This goodie updates the ChangeList classes so that they can handle class protocol reorganizations that are written out by fileOutChanges." 'From Smalltalk-80, Version 2.3 of 13 June 1988 on 21 December 1988 at 4:51:30 pm'! !ChangeScanner methodsFor: 'file scanning'! scanSpecialDo: aBlock "Scan a chunk of file beginning with a !!. For now, the only thing I understand is method definitions." | class category tmp | (class _ self nextClass) notNil ifTrue: [(tokenType == #keyword and: [token = 'methodsFor:']) ifTrue: [self scanToken. tokenType == #string ifTrue: [category _ token. self scanToken. tokenType == #doIt ifTrue: [^self scanMethodsClass: class category: category asSymbol do: aBlock]]]]. "Now, thanks to Bjorn Freeman-Benson and John Maloney, I understand class reorganizations as well." (tokenType == #word and: [token = 'reorganize']) ifTrue: [self scanToken. tmp _ (ClassReorgChange file: file position: file position) className: class ; type: #reorganize. self nextChunkStream. ^aBlock value: tmp]. "I don't understand what's on the file. Scan for a blank chunk and hope for the best." [self nextChunkStream atEnd] whileFalse: []! ! ClassOtherChange subclass: #ClassReorgChange instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'System-Changes'! !ClassReorgChange methodsFor: 'accessing'! text file position: position. ^className, ' reorganize ', file nextChunk! ! !ClassReorgChange methodsFor: 'fileIn/Out'! fileOutOn: aStream file position: position. aStream nextPut: $!!. aStream nextChunkPut: (className, ' reorganize') ; cr. aStream nextChunkPut: file nextChunk ; cr ; cr.! !