Class.st
author Claus Gittinger <cg@exept.de>
Sat, 09 Dec 1995 15:46:03 +0100
changeset 717 a9d03e3c21cf
parent 708 ba92b2a8477d
child 719 c557a530f971
permissions -rw-r--r--
handle (i.e. double) exclas in the extracted copyRightText
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
     1
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
     2
 COPYRIGHT (c) 1989 by Claus Gittinger
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
     3
	       All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     4
a27a279701f8 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
a27a279701f8 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
a27a279701f8 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a27a279701f8 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a27a279701f8 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
a27a279701f8 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
a27a279701f8 Initial revision
claus
parents:
diff changeset
    11
"
a27a279701f8 Initial revision
claus
parents:
diff changeset
    12
717
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
    13
!ClassDescription subclass:#Class
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
    14
	 instanceVariableNames:'classvars comment subclasses classFilename package revision
707
9b3d61b411b0 dont write a change record when updating the version method
Claus Gittinger <cg@exept.de>
parents: 702
diff changeset
    15
                history'
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
    16
	 classVariableNames:'UpdatingChanges LockChangesFile FileOutErrorSignal
707
9b3d61b411b0 dont write a change record when updating the version method
Claus Gittinger <cg@exept.de>
parents: 702
diff changeset
    17
                CatchMethodRedefinitions MethodRedefinitionSignal
9b3d61b411b0 dont write a change record when updating the version method
Claus Gittinger <cg@exept.de>
parents: 702
diff changeset
    18
                UpdateChangeFileQuerySignal'
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
    19
	 poolDictionaries:''
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
    20
	 category:'Kernel-Classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    21
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    22
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    23
!Class class methodsFor:'documentation'!
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    24
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    25
copyright
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    26
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    27
 COPYRIGHT (c) 1989 by Claus Gittinger
527
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    28
	       All Rights Reserved
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    29
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    30
 This software is furnished under a license and may be used
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    31
 only in accordance with the terms of that license and with the
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    33
 be provided or otherwise made available to, or used by, any
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    34
 other person.  No title to or ownership of the software is
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    35
 hereby transferred.
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    36
"
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    37
!
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
    38
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    39
documentation
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    40
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    41
    Class adds more functionality to classes; minimum stuff has already
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
    42
    been defined in Behavior and ClassDescription; this adds naming, categories etc.
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    43
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    44
    Also change management and recompilation is defined here (since the superclasses
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    45
    do not have enough symbolic information to support compilation).
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    46
168
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    47
    For production code, the stc compiler is planned to (optionally) generate classes 
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    48
    as subclasses of Behavior - to excludes all name, source info etc., 
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    49
    however, normally all classes are subclasses of Class.
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    50
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    51
    Instance variables:
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    52
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
    53
	classvars       <String>        the names of the class variables
168
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    54
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    55
	comment         <String>        the classes comment; either a string,
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    56
					a number specifying the offset in classFilename, or nil
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    57
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
    58
	subclasses      <Collection>    cached collection of subclasses
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
    59
					(currently unused - but will be soon)
168
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    60
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    61
	classFilename   <String>        the file (or nil) where the classes
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    62
					sources are found 
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    63
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
    64
	package         <Symbol>        the package, in which the class was defined
385
claus
parents: 384
diff changeset
    65
					(inserted by compilers)
claus
parents: 384
diff changeset
    66
391
claus
parents: 385
diff changeset
    67
	revision        <String>        revision string - inserted by stc
168
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    68
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    69
	history         <any>           a place for a history string (not currently used)
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    70
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    71
    Class variables:
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    72
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
    73
	UpdatingChanges <Boolean>       true if the changes-file shall be updated
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
    74
					(except during startup and when filing in, this flag
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
    75
					 is usually true)
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
    76
488
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
    77
	LockChangesFile <Boolean>       if true, the change file is locked for updates.
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
    78
					Required when multiple users operate on a common
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
    79
					change file.
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
    80
					This is an experimental new feature, being evaluated.
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
    81
421
claus
parents: 415
diff changeset
    82
	UpdateChangeFileQuerySignal     used as an upQuery from the change management.
claus
parents: 415
diff changeset
    83
					Whenever a changeRecord is to be written,
claus
parents: 415
diff changeset
    84
					this signal is raised and a handler (if present)
claus
parents: 415
diff changeset
    85
					is supposed to return true or false.
claus
parents: 415
diff changeset
    86
					If unhandled, the value of the global
claus
parents: 415
diff changeset
    87
					UpdatingChanges is returned for backward
claus
parents: 415
diff changeset
    88
					compatibility (which means that the old
claus
parents: 415
diff changeset
    89
					mechanism is used if no query-handler
claus
parents: 415
diff changeset
    90
					is present).
claus
parents: 415
diff changeset
    91
168
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    92
	FileOutErrorSignal              raised when an error occurs during fileOut
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
    93
362
claus
parents: 360
diff changeset
    94
	CatchMethodRedefinitions        if true, classes protect themself 
claus
parents: 360
diff changeset
    95
	MethodRedefinitionSignal        (by raising MethodRedefinitionSignal)
claus
parents: 360
diff changeset
    96
					from redefining any existing methods,
claus
parents: 360
diff changeset
    97
					which are defined in another package.
claus
parents: 360
diff changeset
    98
					(i.e. a signal will be raised, if you
claus
parents: 360
diff changeset
    99
					 fileIn something which redefines an
claus
parents: 360
diff changeset
   100
					 existing method and the packages do not
claus
parents: 360
diff changeset
   101
					 match).
claus
parents: 360
diff changeset
   102
					The default is (currently) true.
claus
parents: 360
diff changeset
   103
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   104
    WARNING: layout known by compiler and runtime system
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   105
"
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   106
! !
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   107
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   108
!Class class methodsFor:'initialization'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   109
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   110
initialize
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   111
    "the classvariable 'UpdatingChanges' controls if changes are put
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   112
     into the changes-file; normally this variable is set to true, but
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   113
     (for example) during fileIn or when changes are applied, it is set to false
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
   114
     to avoid putting too much junk into the changes-file."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   115
     
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   116
    UpdatingChanges := true.
488
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
   117
    LockChangesFile := false.
362
claus
parents: 360
diff changeset
   118
    CatchMethodRedefinitions := true.
claus
parents: 360
diff changeset
   119
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   120
    FileOutErrorSignal isNil ifTrue:[
421
claus
parents: 415
diff changeset
   121
	FileOutErrorSignal := ErrorSignal newSignalMayProceed:false.
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   122
	FileOutErrorSignal nameClass:self message:#fileOutErrorSignal.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   123
	FileOutErrorSignal notifierString:'error during fileOut'.
362
claus
parents: 360
diff changeset
   124
421
claus
parents: 415
diff changeset
   125
	MethodRedefinitionSignal := ErrorSignal newSignalMayProceed:true.
362
claus
parents: 360
diff changeset
   126
	MethodRedefinitionSignal nameClass:self message:#methodRedefinitionSignal.
claus
parents: 360
diff changeset
   127
	MethodRedefinitionSignal notifierString:'attempt to redefine method from different package'.
421
claus
parents: 415
diff changeset
   128
claus
parents: 415
diff changeset
   129
	UpdateChangeFileQuerySignal := QuerySignal new mayProceed:true.
claus
parents: 415
diff changeset
   130
	UpdateChangeFileQuerySignal nameClass:self message:#updateChangeFileQuerySignal.
claus
parents: 415
diff changeset
   131
	UpdateChangeFileQuerySignal notifierString:'asking if changeFile update is wanted'.
claus
parents: 415
diff changeset
   132
	UpdateChangeFileQuerySignal handlerBlock:[:ex | ex proceedWith:UpdatingChanges].
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   133
    ]
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   134
! !
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   135
345
claus
parents: 333
diff changeset
   136
!Class class methodsFor:'Signal constants'!
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   137
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   138
fileOutErrorSignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   139
    "return the signal raised when an error occurs while fileing out.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   140
     This is signalled to allow browsers some user feed back in case
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   141
     a fileout fails (for example due to disk-full errors)"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   142
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   143
    ^ FileOutErrorSignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   144
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   145
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   146
methodRedefinitionSignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   147
    "return the signal raised when a method is about to be installed
362
claus
parents: 360
diff changeset
   148
     which redefines an existing method and the methods packages are not
claus
parents: 360
diff changeset
   149
     equal. This helps when filing in alien code, to prevent existing
claus
parents: 360
diff changeset
   150
     methods to be overwritten or redefined by incompatible methods"
claus
parents: 360
diff changeset
   151
claus
parents: 360
diff changeset
   152
    ^ MethodRedefinitionSignal
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   153
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   154
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   155
updateChangeFileQuerySignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   156
    "return the signal used as an upQuery if the changeFile should be updated.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   157
     If unhandled, the value of UpdatingChanges is returned by the signals
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   158
     static handler."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   159
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   160
    ^ UpdateChangeFileQuerySignal
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   161
362
claus
parents: 360
diff changeset
   162
! !
claus
parents: 360
diff changeset
   163
claus
parents: 360
diff changeset
   164
!Class class methodsFor:'accessing - flags'!
claus
parents: 360
diff changeset
   165
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   166
catchMethodRedefinitions
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   167
    "return the redefinition catching flag."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   168
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   169
    ^ CatchMethodRedefinitions
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   170
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   171
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   172
catchMethodRedefinitions:aBoolean
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   173
    "turn on/off redefinition catching. Return the prior value of the flag."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   174
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   175
    |prev|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   176
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   177
    prev := CatchMethodRedefinitions.
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   178
    CatchMethodRedefinitions := aBoolean.
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   179
    ^ prev
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   180
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   181
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   182
lockChangesFile
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   183
    "return true, if the change file is locked during update"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   184
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   185
    ^ LockChangesFile
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   186
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   187
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   188
lockChangesFile:aBoolean
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   189
    "turn on/off change-file-locking. Return the previous value of the flag."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   190
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   191
    |prev|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   192
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   193
    prev := LockChangesFile.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   194
    LockChangesFile := aBoolean.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   195
    ^ prev
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   196
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   197
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   198
updateChanges:aBoolean
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   199
    "turn on/off changes management. Return the prior value of the flag."
362
claus
parents: 360
diff changeset
   200
claus
parents: 360
diff changeset
   201
    |prev|
claus
parents: 360
diff changeset
   202
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   203
    prev := UpdatingChanges.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   204
    UpdatingChanges := aBoolean.
362
claus
parents: 360
diff changeset
   205
    ^ prev
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   206
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   207
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   208
updatingChanges
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   209
    "return true if changes are recorded"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   210
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   211
    ^ UpdatingChanges
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   212
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   213
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   214
!Class class methodsFor:'enumeration '!
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   215
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   216
allClassesInCategory:aCategory do:aBlock
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   217
    "evaluate aBlock for all classes in aCategory;
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   218
     no specific order is defined."
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   219
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
   220
    Smalltalk allBehaviorsDo:[:aClass |
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   221
	aClass isMeta ifFalse:[
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   222
	    (aClass category = aCategory) ifTrue:[
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   223
		aBlock value:aClass
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   224
	    ]
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   225
	].
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   226
    ]
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   227
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   228
    "
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   229
     Class allClassesInCategory:'Kernel-Classes' 
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   230
			     do:[:class |Transcript showCr:class name]
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   231
    "
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   232
!
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   233
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   234
allClassesInCategory:aCategory inOrderDo:aBlock
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   235
    "evaluate aBlock for all classes in aCategory;
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   236
     superclasses come first - then subclasses."
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   237
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   238
    |classes|
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   239
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   240
    classes := OrderedCollection new.
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
   241
    Smalltalk allBehaviorsDo:[:aClass |
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   242
	aClass isMeta ifFalse:[
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   243
	    (aClass category = aCategory) ifTrue:[
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   244
		classes add:aClass
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   245
	    ]
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   246
	]
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   247
    ].
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   248
    classes topologicalSort:[:a :b | b isSubclassOf:a].
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   249
    classes do:aBlock
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   250
! !
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
   251
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   252
!Class class methodsFor:'helpers'!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   253
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   254
revisionInfoFromString:aString
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   255
    "return a dictionary filled with revision info.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   256
     This extracts the relevant info from aString."
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   257
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   258
    |words info nm mgr|
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   259
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   260
    info := IdentityDictionary new.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   261
    words := aString asCollectionOfWords.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   262
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   263
    "/
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   264
    "/ supported formats:
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   265
    "/
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   266
    "/ $-Header: pathName rev date time user state $
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   267
    "/ $-Revision: rev $
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   268
    "/ $-Id: fileName rev date time user state $
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   269
    "/
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   270
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   271
    ((words at:1) = '$Header:') ifTrue:[
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   272
	nm := words at:2.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   273
	info at:#repositoryPathName put:nm.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   274
	(nm endsWith:',v') ifTrue:[
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   275
	    nm := nm copyWithoutLast:2
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   276
	].
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   277
	info at:#fileName put:nm asFilename baseName.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   278
	info at:#revision put:(words at:3).
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   279
	info at:#date put:(words at:4).
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   280
	info at:#time put:(words at:5).
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   281
	info at:#user put:(words at:6).
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   282
	info at:#state put:(words at:7).
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   283
	^ info
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   284
    ].
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   285
    ((words at:1) = '$Revision:') ifTrue:[
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   286
	info at:#revision put:(words at:2).
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   287
	^ info
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   288
    ].
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   289
    ((words at:1) = '$Id:') ifTrue:[
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   290
	info at:#fileName put:(words at:2).
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   291
	info at:#revision put:(words at:3).
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   292
	info at:#date put:(words at:4).
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   293
	info at:#time put:(words at:5).
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   294
	info at:#user put:(words at:6).
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   295
	info at:#state put:(words at:7).
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   296
	^ info
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   297
    ].
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   298
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   299
    "/
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   300
    "/ mhmh - maybe its some other source code system
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   301
    "/
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   302
    (mgr := Smalltalk at:SourceCodeManager) notNil ifTrue:[
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   303
	^ mgr revisionInfoFromString:aString
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   304
    ].
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   305
    ^ nil
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   306
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   307
    "Created: 15.11.1995 / 14:58:35 / cg"
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   308
    "Modified: 7.12.1995 / 13:21:40 / cg"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   309
! !
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
   310
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   311
!Class methodsFor:'ST/V subclass creation'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   312
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   313
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
37
d9a302eaa3ef *** empty log message ***
claus
parents: 28
diff changeset
   314
    "this method allows fileIn of ST/V classes 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   315
     (which seem to have no category)"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   316
a27a279701f8 Initial revision
claus
parents:
diff changeset
   317
    ^ self subclass:t 
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   318
	   instanceVariableNames:f
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   319
	   classVariableNames:d
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   320
	   poolDictionaries:s
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   321
	   category:'ST/V classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   322
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   323
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   324
variableByteSubclass:t classVariableNames:d poolDictionaries:s
37
d9a302eaa3ef *** empty log message ***
claus
parents: 28
diff changeset
   325
    "this method allows fileIn of ST/V variable byte classes 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   326
     (which seem to have no category and no instvars)"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   327
a27a279701f8 Initial revision
claus
parents:
diff changeset
   328
    ^ self variableByteSubclass:t 
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   329
	   instanceVariableNames:''
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   330
	   classVariableNames:d
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   331
	   poolDictionaries:s
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   332
	   category:'ST/V classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   333
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   334
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   335
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
37
d9a302eaa3ef *** empty log message ***
claus
parents: 28
diff changeset
   336
    "this method allows fileIn of ST/V variable pointer classes 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   337
     (which seem to have no category)"
a27a279701f8 Initial revision
claus
parents:
diff changeset
   338
a27a279701f8 Initial revision
claus
parents:
diff changeset
   339
    ^ self variableSubclass:t 
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   340
	   instanceVariableNames:f
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   341
	   classVariableNames:d
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   342
	   poolDictionaries:s
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
   343
	   category:'ST/V classes'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   344
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   345
a27a279701f8 Initial revision
claus
parents:
diff changeset
   346
!Class methodsFor:'accessing'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   347
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   348
addClassVarName:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   349
    "add a class variable if not already there and initialize it with nil.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   350
     Also writes a change record and notifies dependents.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   351
     BUG: Currently, no recompilation is done - this will change."
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   352
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   353
    (self classVarNames includes:aString) ifFalse:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   354
	self classVariableString:(self classVariableString , ' ' , aString).
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   355
	self addChangeRecordForClass:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   356
	self changed:#definition.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   357
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   358
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   359
    "Created: 29.10.1995 / 19:40:51 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   360
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   361
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   362
allClassVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   363
    "return a collection of all the class variable name-strings
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   364
     this includes all superclass-class variables"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   365
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   366
    ^ self addAllClassVarNamesTo:(OrderedCollection new)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   367
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   368
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   369
     Float allClassVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   370
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   371
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   372
686
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   373
binaryRevision
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   374
    "return the revision-ID from which the class was stc-compiled;
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   375
     nil if its an autoloaded or filedIn class.
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   376
     If a classes binary is up-to-date w.r.t. the source repository,
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   377
     the returned string is the same as the one returned by #revision."
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   378
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   379
    ^ revision
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   380
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   381
    "
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   382
     Object binaryRevision
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   383
    "
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   384
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   385
    "
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   386
     to find all classes which are not up-to-date:
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   387
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   388
     |classes|
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   389
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   390
     classes := Smalltalk allClasses 
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   391
		    select:[:cls | cls binaryRevision notNil and:[cls binaryRevision ~= cls revision]].
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   392
     SystemBrowser browseClasses:classes title:'classes which are not up-to-date'
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   393
    "
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   394
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   395
    "Created: 7.12.1995 / 10:58:47 / cg"
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   396
!
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
   397
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   398
classFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   399
    "return the name of the file from which the class was compiled.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   400
     This is currently NOT used."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   401
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   402
    ^ classFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   403
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   404
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   405
classVarAt:aSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   406
    "return the value of a class variable.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   407
     Currently, this returns nil if there is no such classvar -
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   408
     this may change."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   409
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   410
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   411
     this hides the (current) implementation of classVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   412
     from the outside world. Currently, classvars are stored in
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   413
     the Smalltalk dictionary with a funny name, since there are
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   414
     no classPools yet.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   415
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   416
    ^ Smalltalk at:(self name , ':' , aSymbol) asSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   417
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   418
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   419
classVarAt:aSymbol put:something
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   420
    "store something in a classvariable.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   421
     Currently this creates a global with a funny name if no such
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   422
     classVar exists - this may change."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   423
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   424
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   425
     this hides the (current) implementation of classVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   426
     from the outside world. Currently, classvars are stored in
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   427
     the Smalltalk dictionary with a funny name, since there are
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   428
     no classPools yet.
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
   429
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   430
    Smalltalk at:(self name , ':' , aSymbol) asSymbol put:something.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   431
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   432
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   433
classVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   434
    "return a collection of the class variable name-strings.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   435
     Only names of class variables defined in this class are included
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   436
     in the returned collection - use allClassVarNames, to get all known names."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   437
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   438
    classvars isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   439
	^ OrderedCollection new
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   440
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   441
    ^ classvars asCollectionOfWords
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   442
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   443
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   444
     Object classVarNames 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   445
     Float classVarNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   446
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   447
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   448
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   449
classVariableString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   450
    "return a string of the class variables names.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   451
     Only names of class variables defined in this class are in the
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   452
     returned string."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   453
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   454
    classvars isNil ifTrue:[^ ''].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   455
    ^ classvars
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   456
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   457
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   458
     Object classVariableString 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   459
     Float classVariableString  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   460
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   461
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   462
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   463
classVariableString:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   464
    "set the classes classvarnames string; 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   465
     Initialize new class variables with nil, clear and remove old ones. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   466
     No change record is written and no classes are recompiled."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   467
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   468
    |prevVarNames varNames any|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   469
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   470
    "ignore for metaclasses except the one"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   471
    (self isMeta) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   472
	(self == Metaclass) ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   473
	    ^ self
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   474
	]
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   475
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   476
    (classvars = aString) ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   477
	prevVarNames := self classVarNames.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   478
	classvars := aString.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   479
	varNames := self classVarNames.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   480
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   481
	"new ones get initialized to nil;
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   482
	 - old ones are nilled and removed from Smalltalk"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   483
	any := false.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   484
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   485
	varNames do:[:aName |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   486
	    (prevVarNames includes:aName) ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   487
		"a new one"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   488
		self classVarAt:aName put:nil.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   489
		any := true.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   490
	    ] ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   491
		prevVarNames remove:aName
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   492
	    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   493
	].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   494
	"left overs are gone"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   495
	prevVarNames do:[:aName |
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   496
	    self classVarAt:aName put:nil.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   497
	    Smalltalk removeKey:(self name , ':' , aName) asSymbol.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   498
	].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   499
	any ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   500
	    Smalltalk changed:#classVariables with:self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   501
	].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   502
    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   503
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   504
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   505
comment
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   506
    "return the comment (aString) of the class"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   507
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   508
    |stream string|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   509
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   510
    "the comment is either a string, or an integer specifying the
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   511
     position within the classes sourcefile ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   512
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   513
    comment isNumber ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   514
	classFilename notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   515
	    stream := self sourceStream. "/ Smalltalk sourceFileStreamFor:classFilename.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   516
	    stream notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   517
		stream position:comment.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   518
		string := String readFrom:stream onError:''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   519
		stream close.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   520
		^ string
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   521
	    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   522
	]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   523
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   524
    ^ comment
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   525
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   526
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   527
     Object comment 
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   528
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   529
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   530
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   531
comment:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   532
    "set the comment of the class to be the argument, aString;
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   533
     create a change record and notify dependents."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   534
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   535
    |oldComment|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   536
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   537
    comment ~= aString ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   538
	oldComment := self comment.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   539
	comment := aString.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   540
	self changed:#comment with:oldComment.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   541
	self addChangeRecordForClassComment:self.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   542
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   543
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   544
    "Created: 29.10.1995 / 19:41:24 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   545
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   546
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   547
definition
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   548
    "return an expression-string to define myself"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   549
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   550
    |s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   551
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   552
    s := WriteStream on:(String new).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   553
    self fileOutDefinitionOn:s.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   554
    ^ s contents
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   555
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   556
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   557
     Object definition 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   558
     Point definition  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   559
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   560
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   561
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   562
history 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   563
    "return the history  of the class"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   564
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   565
    ^ history 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   566
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   567
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   568
     Object history   
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   569
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   570
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   571
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   572
history:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   573
    "set the history of the class."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   574
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   575
    history  := aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   576
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   577
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   578
package
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   579
    "return the package of the class"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   580
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   581
    ^ package
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   582
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   583
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   584
     Object package  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   585
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   586
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   587
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   588
package:aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   589
    "set the package of the class."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   590
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   591
    package := aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   592
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   593
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   594
packageSourceCodeInfo
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   595
    "return the sourceCodeInfo, which defines the module and the subdirectory
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   596
     in which the receiver class was built. 
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   597
     This info is extracted from the package id (which is added to stc-compiled classes).
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   598
     This method is to be obsoleted soon, since the same info is now found
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   599
     in the versionString.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   600
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   601
     The info returned consists of a dictionary
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   602
     filled with (at least) values at: #module, #directory and #library.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   603
     If no such info is present in the class, nil is returned.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   604
     (this happens with autoloaded and filed0in classes)
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   605
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   606
     By convention, this info is encoded in the classes package
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   607
     string (which is given as argument to stc) as the last word in parenthesis. 
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   608
     The info consists of 1 to 3 subcomponents, separated by colons.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   609
     The first defines the classes module (i.e. some application identifier), 
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   610
     the second defines the subdirectory within that module, the third
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   611
     defines the name of the class library. 
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   612
     If left blank, the module info defaults to 'stx',
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   613
     the directory info defaults to library name.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   614
     The library name may not be left blank.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   615
     (this is done for backward compatibility,)
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   616
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   617
     For example: 
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   618
	'....(libbasic)'                         -> module: stx directory: libbasic library: libbasic
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   619
	'....(stx:libbasic)'                     -> module: stx directory: libbasic library: libbasic
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   620
	'....(aeg:libIECInterface)'              -> module: aeg directory: libIECInterface library:libIECInterface
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   621
	'....(stx:goodies/persistency:libdbase)' -> module: stx directory: goodies/persistency library:libdbase 
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   622
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   623
     The way how the sourceCodeManager uses this to find the source location
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   624
     depends on the scheme used. For CVS, the module is taken as the -d arg,
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   625
     while the directory is prepended to the file name.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   626
     Other schemes may do things differently - these are not yet specified.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   627
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   628
     Caveat:
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   629
	Encoding this info in the package string seems somewhat kludgy.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   630
    "
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   631
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   632
    |sourceInfo packageString idx1 idx2 
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   633
     moduleString directoryString libraryString components|
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   634
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   635
    package isNil ifTrue:[^ nil].
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   636
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   637
    packageString := package asString.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   638
    idx1 := packageString lastIndexOf:$(.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   639
    idx1 ~~ 0 ifTrue:[
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   640
	idx2 := packageString indexOf:$) startingAt:idx1+1.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   641
	idx2 ~~ 0 ifTrue:[
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   642
	    sourceInfo := packageString copyFrom:idx1 + 1 to:idx2 - 1
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   643
	]
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   644
    ].
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   645
    sourceInfo isNil ifTrue:[^ nil].
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   646
    components := sourceInfo asCollectionOfSubstringsSeparatedBy:$:.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   647
    components size == 0 ifTrue:[
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   648
	moduleString := 'stx'.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   649
	directoryString := libraryString := ''.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   650
	^ nil
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   651
    ] ifFalse:[
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   652
	components size == 1 ifTrue:[
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   653
	    "/ a single name given - the module becomes 'stx',
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   654
	    "/ if the component includes slashes, its the directory
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   655
	    "/ otherwise the library
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   656
	    "/ 
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   657
	    moduleString := 'stx'.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   658
	    directoryString := libraryString := components at:1.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   659
	    (libraryString includes:$/) ifTrue:[
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   660
		libraryString := libraryString asFilename baseName
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   661
	    ]
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   662
	] ifFalse:[
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   663
	    components size == 2 ifTrue:[
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   664
		"/ two components - assume its the directory and the library
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   665
		moduleString := 'stx'.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   666
		directoryString := components at:1.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   667
		libraryString := components at:2.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   668
	    ] ifFalse:[
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   669
		"/ all components given
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   670
		moduleString := components at:1.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   671
		directoryString := components at:2.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   672
		libraryString := components at:3.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   673
	    ]
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   674
	]
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   675
    ].
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   676
    libraryString isEmpty ifTrue:[
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   677
	directoryString notEmpty ifTrue:[
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   678
	    libraryString := directoryString asFilename baseName
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   679
	].
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   680
	libraryString isEmpty ifTrue:[
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   681
	    "/ lets extract the library from the liblist file ...
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   682
	    libraryString := Smalltalk libraryFileNameOfClass:self.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   683
	    libraryString isNil ifTrue:[^ nil].
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   684
	]
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   685
    ].
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   686
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   687
    moduleString isEmpty ifTrue:[
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   688
	moduleString := 'stx'.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   689
    ].
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   690
    directoryString isEmpty ifTrue:[
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   691
	directoryString := libraryString.
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   692
    ].
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   693
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   694
    ^ IdentityDictionary
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   695
	with:(#module->moduleString)
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   696
	with:(#directory->directoryString)
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   697
	with:(#library->libraryString)
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   698
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   699
    "
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   700
     Object packageSourceCodeInfo     
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   701
     View packageSourceCodeInfo    
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   702
     Model packageSourceCodeInfo  
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   703
     BinaryObjectStorage packageSourceCodeInfo  
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   704
     MemoryMonitor packageSourceCodeInfo  
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   705
     ClockView packageSourceCodeInfo  
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   706
    "
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   707
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   708
    "Created: 4.11.1995 / 20:36:53 / cg"
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   709
    "Modified: 25.11.1995 / 18:29:31 / cg"
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   710
!
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   711
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   712
primitiveDefinitions:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   713
    "set the primitiveDefinition string"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   714
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   715
    self setPrimitiveSpecsAt:1 to:aString.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   716
    self addChangeRecordForPrimitiveDefinitions:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   717
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   718
    "Created: 29.10.1995 / 19:41:39 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   719
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   720
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   721
primitiveDefinitionsString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   722
    "return the primitiveDefinition string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   723
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   724
    ^ self getPrimitiveSpecsAt:1
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   725
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   726
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   727
     Object primitiveDefinitionsString 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   728
     String primitiveDefinitionsString
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   729
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   730
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   731
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   732
primitiveFunctions:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   733
    "set the primitiveFunction string"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   734
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   735
    self setPrimitiveSpecsAt:3 to:aString.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   736
    self addChangeRecordForPrimitiveFunctions:self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   737
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   738
    "Created: 29.10.1995 / 19:41:48 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   739
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   740
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   741
primitiveFunctionsString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   742
    "return the primitiveFunctions string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   743
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   744
    ^ self getPrimitiveSpecsAt:3 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   745
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   746
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   747
primitiveSpec
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   748
    "return the primitiveSpec or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   749
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   750
    ^  primitiveSpec
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   751
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   752
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   753
primitiveSpec:anArrayOf3ElementsOrNil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   754
    "set the primitiveSpec or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   755
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   756
    primitiveSpec := anArrayOf3ElementsOrNil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   757
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   758
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   759
primitiveVariables:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   760
    "set the primitiveVariable string"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   761
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   762
    self setPrimitiveSpecsAt:2 to:aString.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   763
    self addChangeRecordForPrimitiveVariables:self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   764
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   765
    "Created: 29.10.1995 / 19:41:58 / cg"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   766
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   767
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   768
primitiveVariablesString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   769
    "return the primitiveVariables string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   770
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   771
    ^ self getPrimitiveSpecsAt:2 
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   772
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   773
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   774
removeClassVarName:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   775
    "remove a class variable if not already there.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   776
     Also writes a change record and notifies dependents.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   777
     BUG: Currently, no recompilation is done - this will change."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   778
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   779
    |names newNames|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   780
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   781
    names := self classVarNames.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   782
    (names includes:aString) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   783
	newNames := ''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   784
	names do:[:nm | nm ~= aString ifTrue:[newNames := newNames , nm , ' ']].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   785
	self classVariableString:newNames withoutSpaces.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   786
	self addChangeRecordForClass:self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   787
	self changed:#definition.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   788
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   789
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   790
    "Created: 29.10.1995 / 19:42:08 / cg"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   791
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   792
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   793
renameCategory:oldCategory to:newCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   794
    "rename a category (changes category of those methods).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   795
     Appends a change record and notifies dependents."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   796
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   797
    |any|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   798
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   799
    any := false.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   800
    methodArray do:[:aMethod |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   801
	aMethod category = oldCategory ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   802
	    aMethod category:newCategory.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   803
	    any := true.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   804
	]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   805
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   806
    any ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   807
	self addChangeRecordForRenameCategory:oldCategory to:newCategory.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   808
	self changed:#methodCategory.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   809
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   810
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   811
    "Created: 29.10.1995 / 19:42:15 / cg"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   812
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   813
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   814
revision
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   815
    "return the revision-ID of the class which corresponds to the
685
626b477e5be3 binaryRevision may be different from the logical revision
Claus Gittinger <cg@exept.de>
parents: 671
diff changeset
   816
     rcs-id of the source to which this class is equivalent.
626b477e5be3 binaryRevision may be different from the logical revision
Claus Gittinger <cg@exept.de>
parents: 671
diff changeset
   817
     Initially, this is the same as #binaryRevision; however, once changes have
626b477e5be3 binaryRevision may be different from the logical revision
Claus Gittinger <cg@exept.de>
parents: 671
diff changeset
   818
     been checked into a source repository, the binary continues to remain based upon
626b477e5be3 binaryRevision may be different from the logical revision
Claus Gittinger <cg@exept.de>
parents: 671
diff changeset
   819
     the old revision, while logically, the class has the new (checked-in) revision.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   820
     To check if a source corresponds to a compiled binary, compare this 
685
626b477e5be3 binaryRevision may be different from the logical revision
Claus Gittinger <cg@exept.de>
parents: 671
diff changeset
   821
     ID with the one returned by #binaryRevision."
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   822
562
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   823
    |info|
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   824
562
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   825
    info := self revisionInfo.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   826
    info notNil ifTrue:[
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
   827
	^ info at:#revision
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
   828
    ].
685
626b477e5be3 binaryRevision may be different from the logical revision
Claus Gittinger <cg@exept.de>
parents: 671
diff changeset
   829
    ^ revision
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   830
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   831
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   832
     Object revision 
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
   833
    "
527
7eedfdb0db62 try revisionString for revision-number as well
Claus Gittinger <cg@exept.de>
parents: 524
diff changeset
   834
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   835
    "Created: 11.11.1995 / 14:27:20 / cg"
685
626b477e5be3 binaryRevision may be different from the logical revision
Claus Gittinger <cg@exept.de>
parents: 671
diff changeset
   836
    "Modified: 7.12.1995 / 10:54:53 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   837
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   838
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   839
revision:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   840
    "set the revision-ID.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   841
     This should normally not be done in the running system, as the source-manager
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   842
     will need this to validate sourcefiles being correct for a given binary
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   843
     (and optionally: extracting the required sourcefile from the rcs source)"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   844
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   845
    revision := aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   846
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   847
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   848
setClassFilename:aFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   849
    "set the classes filename. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   850
     This is a dangerous (low level) operation, since the 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   851
     comment and primitiveSpecs may no longer be accessable, if a wrong filename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   852
     is set here."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   853
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   854
    classFilename := aFilename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   855
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   856
    "Modified: 8.9.1995 / 14:16:48 / claus"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   857
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   858
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   859
setClassVariableString:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   860
    "set the classes classvarnames string. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   861
     This is a dangerous (low level) operation, since the 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   862
     classvariables are not really created or updated. Also,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   863
     NO change record is written."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   864
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   865
    classvars := aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   866
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   867
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   868
setComment:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   869
    "set the comment of the class to be the argument, aString;
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   870
     do NOT create a change record"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   871
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   872
    comment := aString
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   873
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   874
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   875
setComment:com category:categoryStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   876
    "set the comment and category of the class;
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   877
     do NOT create a change record"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   878
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   879
    |cat|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   880
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   881
    comment := com.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   882
    categoryStringOrSymbol isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   883
	cat := ''
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   884
    ] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   885
	cat := categoryStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   886
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   887
    category := cat asSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   888
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   889
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   890
setHistory:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   891
    "set the history of the class."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   892
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   893
    history  := aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   894
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   895
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   896
setPackage:aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   897
    "set the package of the class."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   898
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   899
    package := aStringOrSymbol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   900
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   901
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   902
sharedPools
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   903
    "ST/X does not (currently) support pools"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   904
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   905
    ^ #()
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   906
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   907
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   908
source
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   909
    "return the classes full source code"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   910
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   911
    |code aStream|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   912
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   913
" this is too slow for big classes ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   914
    code := String new:1000.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   915
    aStream := WriteStream on:code.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   916
    self fileOutOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   917
"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   918
    aStream := FileStream newFileNamed:'__temp'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   919
    aStream isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   920
	self notify:'cannot create temporary file.'.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   921
	^ nil
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   922
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   923
    FileOutErrorSignal handle:[:ex |
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   924
	aStream nextPutAll:'"no source available"'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   925
    ] do:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   926
	self fileOutOn:aStream.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   927
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   928
    aStream close.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   929
    aStream := FileStream oldFileNamed:'__temp'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   930
    aStream isNil ifTrue:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   931
	self notify:'oops - cannot reopen temp file'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   932
	^ nil
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   933
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   934
    code := aStream contents.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   935
    aStream close.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   936
    OperatingSystem removeFile:'__temp'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   937
    ^ code
385
claus
parents: 384
diff changeset
   938
!
claus
parents: 384
diff changeset
   939
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   940
sourceCodeManager
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   941
    "return my source code manager.
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   942
     For now, all classes return the same global manager.
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   943
     But future versions may support mixed reporitories"
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   944
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   945
    ^ Smalltalk at:#SourceCodeManager
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   946
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   947
    "Created: 7.12.1995 / 13:16:46 / cg"
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   948
!
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   949
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   950
sourceStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   951
    "return an open stream on my sourcefile, nil if that is not available"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   952
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   953
    |source fileName aStream cls mgr|
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   954
653
e94b7a898b7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 649
diff changeset
   955
    self isMeta ifTrue:[
e94b7a898b7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 649
diff changeset
   956
	cls := self soleInstance
e94b7a898b7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 649
diff changeset
   957
    ] ifFalse:[
e94b7a898b7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 649
diff changeset
   958
	cls := self
e94b7a898b7f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 649
diff changeset
   959
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   960
    classFilename notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
   961
	source := classFilename
523
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
   962
    ] ifFalse:[
524
1a5c3e68bd6a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 523
diff changeset
   963
	source := (Smalltalk fileNameForClass:cls) , '.st'
523
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
   964
    ].
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
   965
625
5f45ffc4cdd4 if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents: 620
diff changeset
   966
    "/
5f45ffc4cdd4 if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents: 620
diff changeset
   967
    "/ if there is no SourceCodeManager, look in
5f45ffc4cdd4 if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents: 620
diff changeset
   968
    "/ standard places first
5f45ffc4cdd4 if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents: 620
diff changeset
   969
    "/
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
   970
    (mgr := self sourceCodeManager) isNil ifTrue:[
625
5f45ffc4cdd4 if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents: 620
diff changeset
   971
	fileName := Smalltalk getSourceFileName:source.
5f45ffc4cdd4 if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents: 620
diff changeset
   972
	fileName notNil ifTrue:[
5f45ffc4cdd4 if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents: 620
diff changeset
   973
	    aStream := fileName asFilename readStream.
5f45ffc4cdd4 if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents: 620
diff changeset
   974
	]
523
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
   975
    ].
625
5f45ffc4cdd4 if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents: 620
diff changeset
   976
523
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
   977
    aStream isNil ifTrue:[
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
   978
	"/      
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
   979
	"/ hard case - there is no source file for this class
601
338404aae5ec take local source file as last chance only (in case of a fileOut,
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
   980
	"/ (in the source-dir-path).
523
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
   981
	"/      
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
   982
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
   983
	"/      
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
   984
	"/ look if my binary is from a dynamically loaded module,
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
   985
	"/ and, if so, look in the modules directory for the
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
   986
	"/ source file.
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
   987
	"/      
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
   988
	ObjectFileLoader notNil ifTrue:[
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
   989
	    ObjectFileLoader loadedObjectHandlesDo:[:h |
584
8a6d27f51aa6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 578
diff changeset
   990
		|f classes|
523
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
   991
524
1a5c3e68bd6a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 523
diff changeset
   992
		aStream isNil ifTrue:[
584
8a6d27f51aa6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 578
diff changeset
   993
		    (classes := h classes) notNil ifTrue:[
8a6d27f51aa6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 578
diff changeset
   994
			(classes includes:self) ifTrue:[
8a6d27f51aa6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 578
diff changeset
   995
			    f := h pathName.
8a6d27f51aa6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 578
diff changeset
   996
			    f := f asFilename directory.
8a6d27f51aa6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 578
diff changeset
   997
			    f := f construct:source.
8a6d27f51aa6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 578
diff changeset
   998
			    f exists ifTrue:[
8a6d27f51aa6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 578
diff changeset
   999
				aStream := f readStream.
8a6d27f51aa6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 578
diff changeset
  1000
			    ].
524
1a5c3e68bd6a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 523
diff changeset
  1001
			].
523
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1002
		    ].
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1003
		]
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1004
	    ].
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1005
	].
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1006
    ].
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1007
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1008
    aStream isNil ifTrue:[
524
1a5c3e68bd6a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 523
diff changeset
  1009
523
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1010
	"/ mhmh - still no source file.
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1011
	"/ If there is a SourceCodeManager, ask it to aquire the
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1012
	"/ the source for my class, and return an open stream on it. 
625
5f45ffc4cdd4 if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents: 620
diff changeset
  1013
	"/ if that one does not know about the source, look in
5f45ffc4cdd4 if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents: 620
diff changeset
  1014
	"/ standard places
524
1a5c3e68bd6a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 523
diff changeset
  1015
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1016
	mgr notNil ifTrue:[
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1017
	    aStream := mgr sourceStreamFor:cls.
625
5f45ffc4cdd4 if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents: 620
diff changeset
  1018
	    aStream isNil ifTrue:[
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1019
		fileName := Smalltalk getSourceFileName:cls name.
625
5f45ffc4cdd4 if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents: 620
diff changeset
  1020
		fileName notNil ifTrue:[
5f45ffc4cdd4 if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents: 620
diff changeset
  1021
		    aStream := fileName asFilename readStream.
5f45ffc4cdd4 if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents: 620
diff changeset
  1022
		]
5f45ffc4cdd4 if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents: 620
diff changeset
  1023
	    ].
601
338404aae5ec take local source file as last chance only (in case of a fileOut,
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
  1024
	].
338404aae5ec take local source file as last chance only (in case of a fileOut,
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
  1025
338404aae5ec take local source file as last chance only (in case of a fileOut,
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
  1026
	"/
338404aae5ec take local source file as last chance only (in case of a fileOut,
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
  1027
	"/ final chance: try current directory
338404aae5ec take local source file as last chance only (in case of a fileOut,
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
  1028
	"/
338404aae5ec take local source file as last chance only (in case of a fileOut,
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
  1029
	aStream isNil ifTrue:[
338404aae5ec take local source file as last chance only (in case of a fileOut,
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
  1030
	    aStream := source asFilename readStream.
338404aae5ec take local source file as last chance only (in case of a fileOut,
Claus Gittinger <cg@exept.de>
parents: 600
diff changeset
  1031
	].
523
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1032
    ].
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1033
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1034
    ^ aStream
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1035
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1036
    "
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1037
     Object sourceStream
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1038
     Clock sourceStream
625
5f45ffc4cdd4 if a SourceCodeManager is available, ask that one FIRST for the source,
Claus Gittinger <cg@exept.de>
parents: 620
diff changeset
  1039
     Autoload sourceStream
523
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1040
    "
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1041
27e13690f124 sourceStream added (handles dynamic loaded code);
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
  1042
    "Created: 10.11.1995 / 21:05:13 / cg"
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  1043
    "Modified: 7.12.1995 / 13:21:16 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1044
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1045
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1046
!Class methodsFor:'adding/removing'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1047
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1048
addSelector:newSelector withMethod:newMethod
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
  1049
    "add the method given by 2nd argument under the selector given by
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1050
     1st argument to the methodDictionary. 
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1051
     Append a change record to the changes file and tell dependents."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1052
362
claus
parents: 360
diff changeset
  1053
    |oldMethod|
claus
parents: 360
diff changeset
  1054
claus
parents: 360
diff changeset
  1055
    CatchMethodRedefinitions ifTrue:[
claus
parents: 360
diff changeset
  1056
	"check for attempts to redefine a method
claus
parents: 360
diff changeset
  1057
	 in a different package. Signal a resumable error if so.
claus
parents: 360
diff changeset
  1058
	 This allows tracing redefinitions of existing system methods
claus
parents: 360
diff changeset
  1059
	 when filing in alien code ....
claus
parents: 360
diff changeset
  1060
	 (which we may want to forbit sometimes)
claus
parents: 360
diff changeset
  1061
	"
claus
parents: 360
diff changeset
  1062
	oldMethod := self compiledMethodAt:newSelector.
claus
parents: 360
diff changeset
  1063
	oldMethod notNil ifTrue:[
claus
parents: 360
diff changeset
  1064
	    oldMethod package ~= newMethod package ifTrue:[
claus
parents: 360
diff changeset
  1065
		"
claus
parents: 360
diff changeset
  1066
		 attempt to redefine an existing method, which was
claus
parents: 360
diff changeset
  1067
		 defined in another package.
claus
parents: 360
diff changeset
  1068
		 If you continue in the debugger, the new method gets installed.
claus
parents: 360
diff changeset
  1069
		 Otherwise, the existing (old) method remains valid.
claus
parents: 360
diff changeset
  1070
claus
parents: 360
diff changeset
  1071
		 You can turn of the catching of redefinitions by setting
claus
parents: 360
diff changeset
  1072
		   CatchMethodRedefinitions to false
claus
parents: 360
diff changeset
  1073
		 (also found in the NewLaunchers 'settings-misc' menu)
claus
parents: 360
diff changeset
  1074
		"
406
claus
parents: 403
diff changeset
  1075
		MethodRedefinitionSignal 
claus
parents: 403
diff changeset
  1076
		    raiseErrorString:(' ' , name , '>>' , newSelector) 
362
claus
parents: 360
diff changeset
  1077
	    ]
claus
parents: 360
diff changeset
  1078
	]
claus
parents: 360
diff changeset
  1079
    ].
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1080
    (super addSelector:newSelector withMethod:newMethod) ifTrue:[
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1081
	self addChangeRecordForMethod:newMethod.
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1082
    ]
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1083
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1084
    "Created: 29.10.1995 / 19:42:42 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1085
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1086
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1087
removeSelector:aSelector
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1088
    "remove the selector, aSelector and its associated method 
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1089
     from the methodDictionary.
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1090
     Append a change record to the changes file and tell dependents."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1091
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1092
    (super removeSelector:aSelector) ifTrue:[
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1093
	self addChangeRecordForRemoveSelector:aSelector.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1094
	self changed:#methodDictionary with:aSelector.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1095
    ]
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1096
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1097
    "Created: 29.10.1995 / 19:42:47 / cg"
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1098
!
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1099
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1100
unload
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1101
    "if the receiver was autoloaded, unload and reinstall it as
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1102
     autoloaded. Can be used to get rid of no longer needed autoloaded
328
claus
parents: 326
diff changeset
  1103
     classes. 
claus
parents: 326
diff changeset
  1104
     (maybe, autoloaded classes should unload themselfes when no
claus
parents: 326
diff changeset
  1105
      longer needed - for example, after some delay when the last instance 
claus
parents: 326
diff changeset
  1106
      is gone ...)"
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1107
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1108
    |nm|
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1109
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1110
    self wasAutoloaded ifFalse:[
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1111
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1112
	"
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1113
	 can it be done ?
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1114
	"
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1115
	self methodArray do:[:aMethod |
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1116
	    aMethod source isNil ifTrue:[^false].
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1117
	    aMethod hasPrimitiveCode ifTrue:[^ false].
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1118
	].
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1119
    ].
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1120
283
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1121
    self allSubclassesDo:[:aClass |
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1122
	aClass unload
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1123
    ].
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1124
    Transcript showCr:'unloading ' , name.
a897d331b4c1 *** empty log message ***
claus
parents: 278
diff changeset
  1125
359
claus
parents: 357
diff changeset
  1126
    Autoload removeClass:self.    
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1127
    nm := name.
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1128
    Smalltalk at:nm put:nil.
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1129
    name := nm , ' (leftover)'.
288
88283f196381 *** empty log message ***
claus
parents: 283
diff changeset
  1130
    ObjectMemory flushInlineCaches.
88283f196381 *** empty log message ***
claus
parents: 283
diff changeset
  1131
    ObjectMemory flushMethodCache.
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1132
    Autoload addClass:nm inCategory:category.
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1133
    ^ true
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1134
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1135
    "
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1136
     Clock open.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1137
     Clock unload.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1138
     ClockView unload.
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1139
     Clock open
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
  1140
    "
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1141
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1142
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1143
!Class methodsFor:'binary storage'!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1144
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1145
addGlobalsTo: globalDictionary manager: manager
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1146
"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1147
    classPool == nil ifFalse: [
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1148
	classPool associationsDo: [:assoc|
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1149
	    globalDictionary at: assoc put: self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1150
	]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1151
    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1152
"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1153
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1154
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1155
storeBinaryDefinitionOf: anAssociation on: stream manager: manager
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1156
    "not usable at the moment - there are no classpools currently"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1157
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1158
    | string |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1159
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1160
    string := self name, ' classPool at: ', anAssociation key storeString.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1161
    stream nextNumber: 2 put: string size.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1162
    string do: [:char| stream nextPut: char asciiValue]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1163
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1164
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1165
storeBinaryDefinitionOn: stream manager: manager
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1166
    "classes will store the name, signature and instvar names.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1167
     They restore by looking for that name in the Smalltalk dictionary.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1168
     However, using the signature, a check for being valid is made at
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1169
     restore time."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1170
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1171
    |varnames n sz|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1172
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1173
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1174
     output the signature
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1175
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1176
    stream nextNumber:4 put:self signature.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1177
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1178
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1179
     output the instance variable name string
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1180
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1181
    varnames := self allInstVarNames.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1182
    n := varnames size.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1183
    n == 0 ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1184
	sz := 0
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1185
    ] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1186
	sz := varnames inject:0 into:[:sum :nm | sum + nm size].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1187
	sz := sz + n - 1.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1188
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1189
    stream nextNumber:2 put:sz.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1190
    varnames keysAndValuesDo:[:i :nm |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1191
	nm do:[:c |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1192
	    stream nextPut:c asciiValue
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1193
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1194
	i ~~ n ifTrue:[stream nextPut:(Character space asciiValue)]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1195
    ].
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1196
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1197
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1198
     output my name
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1199
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1200
    stream nextNumber:2 put:name size.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1201
    name do:[:c| 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1202
	stream nextPut:c asciiValue
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1203
    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1204
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1205
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1206
     |s|
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1207
     s := WriteStream on:ByteArray new.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1208
     Rectangle storeBinaryOn:s.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1209
     Object readBinaryFrom:(ReadStream on:s contents)  
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1210
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1211
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1212
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1213
!Class methodsFor:'c function interfacing'!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1214
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1215
cInterfaceFunction:selector calling:cFunctionNameString args:argTypeArray returning:returnType
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1216
    "create an interface to an existing (i.e. already linked in) c function.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1217
     The function can be called by sending selector to the receiver class.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1218
     The c-function has the name cFunctionNameString, and expects parameters as specified in
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1219
     argTypeArray. The functions return value has a type as specified by returnType.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1220
     WARNING: 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1221
	this interface is EXPERIMENTAL - it may change or even be removed."
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1222
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1223
    StubGenerator isNil ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1224
	^ self error:'this system does not support dynamic C Interface functions'.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1225
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1226
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1227
    StubGenerator 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1228
	createStubFor:selector 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1229
	calling:cFunctionNameString 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1230
	args:argTypeArray 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1231
	returning:returnType
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1232
	in:self                          
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1233
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1234
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1235
     Object subclass:#CInterface
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1236
	    instanceVariableNames:''
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1237
	    classVariableNames:''
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1238
	    poolDictionaries:''
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1239
	    category:'Examples'.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1240
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1241
     CInterface cInterfaceFunction:#printfOn:format:withFloat: 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1242
			   calling:'fprintf' 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1243
			      args:#(ExternalStream String Float) 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1244
			 returning:#SmallInteger.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1245
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1246
     CInterface printfOn:Stdout format:'this is a float: %g' withFloat:(Float pi). Stdout cr  
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1247
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1248
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1249
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1250
!Class methodsFor:'changes management'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1251
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1252
addChangeRecordForChangeCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1253
    "add a category change record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1254
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1255
    self writingChangePerform:#addChangeRecordForChangeCategory:to: with:category.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1256
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1257
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1258
addChangeRecordForChangeCategory:category to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1259
    "append a category change record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1260
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1261
    self printClassNameOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1262
    aStream nextPutAll:(' category:' , category storeString).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1263
    aStream nextPutChunkSeparator.
663
f3db8103ef49 fixes for projects changeSet
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
  1264
f3db8103ef49 fixes for projects changeSet
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
  1265
    "this test allows a smalltalk without Projects/ChangeSets"
f3db8103ef49 fixes for projects changeSet
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
  1266
    Project notNil ifTrue:[
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1267
	Project addClassDefinitionChangeFor:self
663
f3db8103ef49 fixes for projects changeSet
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
  1268
    ]
f3db8103ef49 fixes for projects changeSet
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
  1269
f3db8103ef49 fixes for projects changeSet
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
  1270
    "Created: 3.12.1995 / 13:43:33 / cg"
f3db8103ef49 fixes for projects changeSet
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
  1271
    "Modified: 3.12.1995 / 14:10:34 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1272
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1273
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1274
addChangeRecordForClass:aClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1275
    "add a class-definition-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1276
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1277
    self writingChangePerform:#addChangeRecordForClass:to: with:aClass.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1278
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1279
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1280
addChangeRecordForClass:aClass to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1281
    "append a class-definition-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1282
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1283
    aClass isLoaded ifTrue:[
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1284
	aClass fileOutDefinitionOn:aStream.
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1285
	aStream nextPutChunkSeparator.
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1286
	Project notNil ifTrue:[
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1287
	    Project addClassDefinitionChangeFor:aClass 
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1288
	]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1289
    ]
663
f3db8103ef49 fixes for projects changeSet
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
  1290
f3db8103ef49 fixes for projects changeSet
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
  1291
    "Created: 3.12.1995 / 13:57:44 / cg"
f3db8103ef49 fixes for projects changeSet
Claus Gittinger <cg@exept.de>
parents: 662
diff changeset
  1292
    "Modified: 3.12.1995 / 14:11:26 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1293
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1294
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1295
addChangeRecordForClassCheckIn:aClass
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1296
    "append a class-was-checkedIn-record to the changes file"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1297
708
ba92b2a8477d include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
  1298
    self addInfoRecord:('checkin ' , aClass name , ' (' , aClass revision , ')')
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1299
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1300
    "Created: 18.11.1995 / 17:04:58 / cg"
708
ba92b2a8477d include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
  1301
    "Modified: 7.12.1995 / 23:45:01 / cg"
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1302
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1303
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1304
addChangeRecordForClassComment:aClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1305
    "add a class-comment-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1306
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1307
    self writingChangePerform:#addChangeRecordForClassComment:to: with:aClass.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1308
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1309
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1310
addChangeRecordForClassComment:aClass to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1311
    "append a class-comment-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1312
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1313
    aClass fileOutCommentOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1314
    aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1315
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1316
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1317
addChangeRecordForClassFileOut:aClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1318
    "append a class-was-filedOut-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1319
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1320
    self addInfoRecord:('fileOut ' , aClass name) 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1321
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1322
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1323
addChangeRecordForClassInstvars:aClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1324
    "add a class-instvars-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1325
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1326
    self writingChangePerform:#addChangeRecordForClassInstvars:to: with:aClass.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1327
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1328
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1329
addChangeRecordForClassInstvars:aClass to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1330
    "append a class-instvars-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1331
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1332
    aClass fileOutClassInstVarDefinitionOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1333
    aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1334
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1335
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1336
addChangeRecordForClassRemove:oldName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1337
    "add a class-remove-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1338
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1339
    self writingChangePerform:#addChangeRecordForClassRemove:to: with:oldName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1340
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1341
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1342
addChangeRecordForClassRemove:oldName to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1343
    "append a class-remove-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1344
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1345
    aStream nextPutAll:('Smalltalk removeClass:' , oldName).
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1346
    aStream nextPutChunkSeparator.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1347
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1348
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1349
addChangeRecordForClassRename:oldName to:newName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1350
    "add a class-rename-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1351
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1352
    self writingChangeDo:[:aStream |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1353
	self addChangeRecordForClassRename:oldName to:newName to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1354
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1355
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1356
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1357
addChangeRecordForClassRename:oldName to:newName to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1358
    "append a class-rename-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1359
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1360
    aStream nextPutAll:('Smalltalk renameClass:' , oldName , ' to:''' , newName , '''').
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1361
    aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1362
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1363
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1364
addChangeRecordForMethod:aMethod
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1365
    "add a method-change-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1366
669
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1367
    (UpdateChangeFileQuerySignal raise) ifTrue:[
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1368
	self writingChangePerform:#addChangeRecordForMethod:to: with:aMethod.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1369
	"this test allows a smalltalk without Projects/ChangeSets"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1370
	Project notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1371
	    Project addMethodChange:aMethod in:self
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1372
	]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1373
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1374
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1375
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1376
addChangeRecordForMethod:aMethod to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1377
    "append a method-change-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1378
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1379
    self fileOutMethod:aMethod on:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1380
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1381
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1382
addChangeRecordForMethodCategory:aMethod category:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1383
    "add a methodCategory-change-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1384
669
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1385
    (UpdateChangeFileQuerySignal raise) ifTrue:[
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1386
	self writingChangeDo:[:aStream |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1387
	    self addChangeRecordForMethodCategory:aMethod category:aString to:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1388
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1389
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1390
	"this test allows a smalltalk without Projects/ChangeSets"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1391
	Project notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1392
	    Project addMethodCategoryChange:aMethod category:aString in:self
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1393
	]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1394
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1395
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1396
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1397
addChangeRecordForMethodCategory:aMethod category:newCategory to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1398
    "append a methodCategory-change-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1399
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1400
    |selector|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1401
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1402
    selector := aMethod selector.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1403
    selector notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1404
	aStream nextPutAll:'('.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1405
	self printClassNameOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1406
	aStream nextPutAll:(' compiledMethodAt:' , selector storeString).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1407
	aStream nextPutAll:(') category:' , newCategory storeString).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1408
	aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1409
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1410
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1411
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1412
addChangeRecordForMethodPrivacy:aMethod
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1413
    "add a method-privacy-change-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1414
669
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1415
    (UpdateChangeFileQuerySignal raise) ifTrue:[
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1416
	self writingChangePerform:#addChangeRecordForMethodPrivacy:to: with:aMethod.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1417
	"this test allows a smalltalk without Projects/ChangeSets"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1418
	Project notNil ifTrue:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1419
	    Project addMethodPrivacyChange:aMethod in:self
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1420
	]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1421
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1422
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1423
    "Modified: 27.8.1995 / 22:47:32 / claus"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1424
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1425
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1426
addChangeRecordForMethodPrivacy:aMethod to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1427
    "append a method-privacy-change-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1428
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1429
    |selector|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1430
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1431
    selector := aMethod selector.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1432
    selector notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1433
	aStream nextPutAll:'('.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1434
	self printClassNameOn:aStream.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1435
	aStream nextPutAll:(' compiledMethodAt:' , selector storeString).
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1436
	aStream nextPutAll:(') privacy:' , aMethod privacy storeString).
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1437
	aStream nextPutChunkSeparator.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1438
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1439
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1440
    "Modified: 27.8.1995 / 22:59:56 / claus"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1441
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1442
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1443
addChangeRecordForPrimitiveDefinitions:aClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1444
    "add a primitiveDefinitions-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1445
669
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1446
    (UpdateChangeFileQuerySignal raise) ifTrue:[
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1447
	self writingChangePerform:#addChangeRecordForPrimitiveDefinitions:to: with:aClass.
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1448
	Project notNil ifTrue:[
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1449
	    Project addPrimitiveDefinitionsChangeFor:aClass
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1450
	]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1451
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1452
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1453
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1454
addChangeRecordForPrimitiveDefinitions:aClass to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1455
    "append a primitiveDefinitions-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1456
667
3b1e83ecf6d5 save primitive change-chunk with %{ at begin of line
Claus Gittinger <cg@exept.de>
parents: 666
diff changeset
  1457
    aStream nextPutAll:aClass name; nextPutAll:' primitiveDefinitions:'''; cr; 
3b1e83ecf6d5 save primitive change-chunk with %{ at begin of line
Claus Gittinger <cg@exept.de>
parents: 666
diff changeset
  1458
	    nextPutAll:(aClass primitiveDefinitionsString storeString copyFrom:2).
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1459
    aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1460
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1461
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1462
addChangeRecordForPrimitiveFunctions:aClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1463
    "add a primitiveFunctions-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1464
669
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1465
    (UpdateChangeFileQuerySignal raise) ifTrue:[
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1466
	self writingChangePerform:#addChangeRecordForPrimitiveFunctions:to: with:aClass.
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1467
	Project notNil ifTrue:[
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1468
	    Project addPrimitiveFunctionsChangeFor:aClass
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1469
	]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1470
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1471
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1472
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1473
addChangeRecordForPrimitiveFunctions:aClass to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1474
    "append a primitiveFunctions-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1475
667
3b1e83ecf6d5 save primitive change-chunk with %{ at begin of line
Claus Gittinger <cg@exept.de>
parents: 666
diff changeset
  1476
    aStream nextPutAll:aClass name; nextPutAll:' primitiveFunctions:'''; cr; 
3b1e83ecf6d5 save primitive change-chunk with %{ at begin of line
Claus Gittinger <cg@exept.de>
parents: 666
diff changeset
  1477
	    nextPutAll:(aClass primitiveFunctionsString storeString copyFrom:2).
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1478
    aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1479
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1480
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1481
addChangeRecordForPrimitiveVariables:aClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1482
    "add a primitiveVariables-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1483
669
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1484
    (UpdateChangeFileQuerySignal raise) ifTrue:[
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1485
	self writingChangePerform:#addChangeRecordForPrimitiveVariables:to: with:aClass.
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1486
	Project notNil ifTrue:[
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1487
	    Project addPrimitiveVariablesChangeFor:aClass
62784300daa6 oops - dont add primitive-change-records if not updating changes
Claus Gittinger <cg@exept.de>
parents: 667
diff changeset
  1488
	]
666
6d4175de8c55 fixed primitiveDefinitions changes
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
  1489
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1490
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1491
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1492
addChangeRecordForPrimitiveVariables:aClass to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1493
    "append a primitiveVariables-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1494
667
3b1e83ecf6d5 save primitive change-chunk with %{ at begin of line
Claus Gittinger <cg@exept.de>
parents: 666
diff changeset
  1495
    aStream nextPutAll:aClass name; nextPutAll:' primitiveVariables:'''; cr; 
3b1e83ecf6d5 save primitive change-chunk with %{ at begin of line
Claus Gittinger <cg@exept.de>
parents: 666
diff changeset
  1496
	    nextPutAll:(aClass primitiveVariablesString storeString copyFrom:2).
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1497
    aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1498
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1499
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1500
addChangeRecordForRemoveSelector:aSelector
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1501
    "add a method-remove-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1502
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1503
    self writingChangePerform:#addChangeRecordForRemoveSelector:to: with:aSelector.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1504
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1505
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1506
addChangeRecordForRemoveSelector:aSelector to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1507
    "append a method-remove-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1508
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1509
    self printClassNameOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1510
    aStream nextPutAll:(' removeSelector:#' , aSelector).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1511
    aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1512
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1513
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1514
addChangeRecordForRenameCategory:oldCategory to:newCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1515
    "add a category-rename record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1516
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1517
    self writingChangeDo:[:aStream |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1518
	self addChangeRecordForRenameCategory:oldCategory to:newCategory to:aStream.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1519
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1520
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1521
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1522
addChangeRecordForRenameCategory:oldCategory to:newCategory to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1523
    "append a category-rename record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1524
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1525
    self printClassNameOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1526
    aStream nextPutAll:(' renameCategory:' , oldCategory storeString).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1527
    aStream nextPutAll:(' to:' , newCategory storeString).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1528
    aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1529
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1530
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1531
addChangeRecordForSnapshot:aFileName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1532
    "add a snapshot-record to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1533
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1534
    self addInfoRecord:('snapshot ' , aFileName) 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1535
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1536
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1537
addChangeRecordForSnapshot:aFileName to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1538
    "add a snapshot-record to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1539
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1540
    self addInfoRecord:('snapshot ' , aFileName) to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1541
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1542
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1543
addChangeTimeStampTo:aStream
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1544
    "a timestamp - prepended to any change, except infoRecords"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1545
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1546
    |info|
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1547
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1548
    info := 'timestamp ' , OperatingSystem getLoginName , '@' , OperatingSystem getHostName.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1549
    self addInfoRecord:info to:aStream. aStream cr.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1550
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1551
    "Created: 18.11.1995 / 15:41:01 / cg"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1552
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1553
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1554
addInfoRecord:aMessage
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1555
    "add an info-record (snapshot, class fileOut etc.) to the changes file"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1556
576
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1557
    self writingChangeWithTimeStamp:false perform:#addInfoRecord:to: with:aMessage.
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1558
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1559
    "Modified: 18.11.1995 / 15:45:10 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1560
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1561
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1562
addInfoRecord:aMessage to:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1563
    "append an info-record (snapshot, class fileOut etc.) to aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1564
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1565
    aStream nextPutAll:('''---- ' , aMessage , ' ',
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1566
			Date today printString , ' ' ,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1567
			Time now printString ,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1568
			' ----''').
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1569
    aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1570
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1571
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1572
changesStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1573
    "return a Stream for the writing changes file - or nil if no update is wanted"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1574
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1575
    |streamType aStream fileName|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1576
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1577
    (UpdateChangeFileQuerySignal raise) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1578
	fileName := ObjectMemory nameForChanges.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1579
        
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1580
	LockChangesFile ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1581
	    streamType := LockedFileStream. 
488
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
  1582
	] ifFalse:[
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
  1583
	    streamType := FileStream.
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
  1584
	].
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
  1585
	aStream := streamType oldFileNamed:fileName.
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1586
	aStream isNil ifTrue:[
488
1677ee52d630 hooks for change-file-locking. Experimental
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
  1587
	    aStream := streamType newFileNamed:fileName.
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1588
	    aStream isNil ifTrue:[
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1589
		self warn:'cannot create/update the changes file'.
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1590
		^ nil
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1591
	    ]
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1592
	].
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  1593
	aStream setToEnd
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1594
    ].
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1595
    ^ aStream
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1596
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1597
    "Created: 28.10.1995 / 16:53:43 / cg"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  1598
    "Modified: 28.10.1995 / 16:55:03 / cg"
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1599
!
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1600
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1601
sourcesStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1602
    "return a stream for writing the sources file.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1603
     Notice, in ST/X, it is noncommon to use a single
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1604
     source file; typically each classes source is kept
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1605
     in a separate file."
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1606
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1607
    |aStream fileName|
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1608
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1609
    fileName := ObjectMemory nameForSources.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1610
    aStream := FileStream oldFileNamed:fileName.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1611
    aStream isNil ifTrue:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1612
	aStream := FileStream newFileNamed:fileName.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1613
	aStream isNil ifTrue:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1614
	    Transcript showCr:'cannot update sources file'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1615
	    ^ nil
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1616
	]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1617
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1618
    aStream setToEnd.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1619
    ^ aStream
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1620
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1621
    "Created: 28.10.1995 / 16:53:17 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1622
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1623
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1624
withoutUpdatingChangesDo:aBlock
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1625
    "turn off change file update while evaluating aBlock.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1626
     This method makes sure, that the update-flag is correctly restored
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1627
     in case of an abort or other error."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1628
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1629
    UpdateChangeFileQuerySignal handle:[:ex | 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1630
	ex proceedWith:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1631
    ] do:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1632
	aBlock value
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1633
    ].
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  1634
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  1635
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1636
writingChangeDo:aBlock
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1637
    "common helper to write a change record.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1638
     Opens the changefile and executes aBlock passing the stream
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1639
     as argument. WriteErrors are cought and will lead to a warning.
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1640
     The changefile is not kept open, to force the change to go to disk
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1641
     as soon as possible - thus, in case of a crash, no changes should
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1642
     be lost due to buffering."
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1643
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1644
    self writingChangeWithTimeStamp:true do:aBlock
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1645
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1646
    "Modified: 18.11.1995 / 15:43:36 / cg"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1647
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1648
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1649
writingChangePerform:aSelector with:anArgument
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1650
    self writingChangeWithTimeStamp:true perform:aSelector with:anArgument
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1651
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1652
    "Created: 28.10.1995 / 16:50:48 / cg"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1653
    "Modified: 18.11.1995 / 15:44:53 / cg"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1654
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  1655
576
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1656
writingChangeWithTimeStamp:doStampIt do:aBlock
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1657
    "common helper to write a change record.
155
edd7fc34e104 *** empty log message ***
claus
parents: 153
diff changeset
  1658
     Opens the changefile and executes aBlock passing the stream
168
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
  1659
     as argument. WriteErrors are cought and will lead to a warning.
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
  1660
     The changefile is not kept open, to force the change to go to disk
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
  1661
     as soon as possible - thus, in case of a crash, no changes should
3c7266ecf04c new comments, support private & protected code
claus
parents: 155
diff changeset
  1662
     be lost due to buffering."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1663
139
19ccaf2031c8 project changeSet interface
claus
parents: 137
diff changeset
  1664
    |aStream|
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1665
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1666
    aStream := self changesStream.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1667
    aStream notNil ifTrue:[
155
edd7fc34e104 *** empty log message ***
claus
parents: 153
diff changeset
  1668
	FileStream writeErrorSignal handle:[:ex |
355
2d96938a5081 *** empty log message ***
claus
parents: 345
diff changeset
  1669
	    self warn:('could not update the changes-file\\' , ex errorString) withCRs.
155
edd7fc34e104 *** empty log message ***
claus
parents: 153
diff changeset
  1670
	    ex return
edd7fc34e104 *** empty log message ***
claus
parents: 153
diff changeset
  1671
	] do:[
576
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1672
	    doStampIt ifTrue:[self addChangeTimeStampTo:aStream].
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  1673
	    aBlock value:aStream.
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  1674
	    aStream cr.
155
edd7fc34e104 *** empty log message ***
claus
parents: 153
diff changeset
  1675
	].
edd7fc34e104 *** empty log message ***
claus
parents: 153
diff changeset
  1676
	aStream close
edd7fc34e104 *** empty log message ***
claus
parents: 153
diff changeset
  1677
    ]
576
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1678
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1679
    "Created: 18.11.1995 / 15:36:02 / cg"
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1680
!
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1681
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1682
writingChangeWithTimeStamp:stampIt perform:aSelector with:anArgument
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1683
    self writingChangeWithTimeStamp:stampIt do:[:stream |
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1684
	self perform:aSelector with:anArgument with:stream.
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1685
    ]
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1686
b9f067c9814c change record for checkin; timestamp changes
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
  1687
    "Created: 18.11.1995 / 15:44:28 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1688
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1689
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1690
!Class methodsFor:'compiling'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1691
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1692
compile:code
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1693
    "compile code, aString for this class; 
671
53de87163ad5 spelling
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1694
     if successful update the method dictionary."
328
claus
parents: 326
diff changeset
  1695
claus
parents: 326
diff changeset
  1696
    self compilerClass 
claus
parents: 326
diff changeset
  1697
	compile:code 
claus
parents: 326
diff changeset
  1698
	forClass:self
claus
parents: 326
diff changeset
  1699
!
claus
parents: 326
diff changeset
  1700
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1701
compile:code classified:category
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1702
    "compile code, aString for this class; 
671
53de87163ad5 spelling
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  1703
     if successful update the method dictionary. 
328
claus
parents: 326
diff changeset
  1704
     The method is classified under category."
claus
parents: 326
diff changeset
  1705
claus
parents: 326
diff changeset
  1706
    self compilerClass 
claus
parents: 326
diff changeset
  1707
	compile:code 
claus
parents: 326
diff changeset
  1708
	forClass:self 
claus
parents: 326
diff changeset
  1709
	inCategory:category
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1710
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1711
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1712
compile:code notifying:requestor
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1713
    "compile code, aString for this class; on any error, notify
328
claus
parents: 326
diff changeset
  1714
     requestor, anObject with the error reason."
claus
parents: 326
diff changeset
  1715
claus
parents: 326
diff changeset
  1716
    self compilerClass 
claus
parents: 326
diff changeset
  1717
	compile:code 
claus
parents: 326
diff changeset
  1718
	forClass:self 
claus
parents: 326
diff changeset
  1719
	notifying:requestor
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1720
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1721
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1722
recompile
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1723
    "recompile all methods
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1724
     used when a class changes instances and therefore all methods
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1725
     have to be recompiled"
2
claus
parents: 1
diff changeset
  1726
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1727
    selectorArray do:[:aSelector |
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1728
	self recompile:aSelector
2
claus
parents: 1
diff changeset
  1729
    ]
claus
parents: 1
diff changeset
  1730
!
claus
parents: 1
diff changeset
  1731
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1732
recompile:aSelector
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1733
    "recompile the method associated with the argument, aSelector;
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1734
     used when a superclass changes instances and we have to recompile
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1735
     subclasses"
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1736
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  1737
    |cat code|
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1738
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  1739
    Class withoutUpdatingChangesDo:[
362
claus
parents: 360
diff changeset
  1740
	Class methodRedefinitionSignal handle:[:ex |
claus
parents: 360
diff changeset
  1741
	    ex proceed
claus
parents: 360
diff changeset
  1742
	] do:[
claus
parents: 360
diff changeset
  1743
	    cat := (self compiledMethodAt:aSelector) category.
claus
parents: 360
diff changeset
  1744
	    code := self sourceCodeAt:aSelector.
claus
parents: 360
diff changeset
  1745
	    self compilerClass compile:code forClass:self inCategory:cat
claus
parents: 360
diff changeset
  1746
	]
2
claus
parents: 1
diff changeset
  1747
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1748
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1749
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1750
recompileAll
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1751
    "recompile this class and all subclasses"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1752
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1753
    |classes|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1754
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1755
    classes := self subclasses.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1756
    self recompile.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1757
    classes do:[:aClass |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1758
	aClass recompileAll
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1759
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1760
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1761
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1762
recompileInvalidatedMethods:trap
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1763
    "recompile all invalidated methods"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1764
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1765
    |trapCode trapByteCode|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1766
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1767
    trapCode := trap code.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1768
    trapByteCode := trap byteCode.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1769
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1770
    selectorArray do:[:aSelector |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1771
	|m|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1772
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1773
	m := self compiledMethodAt:aSelector.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1774
	((m code = trapCode) and:[m byteCode == trapByteCode]) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1775
	    self recompile:aSelector
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1776
	]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1777
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1778
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1779
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1780
recompileMethodsAccessingAny:setOfNames
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1781
    "recompile all methods accessing a variable from setOfNames"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1782
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1783
    self recompileMethodsAccessingAny:setOfNames orSuper:false 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1784
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1785
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1786
recompileMethodsAccessingAny:setOfNames orSuper:superBoolean
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1787
    "recompile all methods accessing a variable from setOfNames,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1788
     or super (if superBoolean is true)"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1789
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1790
    |p|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1791
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1792
    selectorArray do:[:aSelector |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1793
	|m|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1794
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1795
	m := self compiledMethodAt:aSelector.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1796
	p := Parser parseMethod:(m source) in:self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1797
	(p isNil 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1798
	 or:[(p usedVars notNil and:[p usedVars includesAny:setOfNames])
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1799
	 or:[superBoolean and:[p usesSuper]]]) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1800
	    self recompile:aSelector
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1801
	]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1802
    ]
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1803
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1804
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1805
!Class methodsFor:'fileIn interface'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1806
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1807
ignoredMethodsFor:aCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1808
    "this is a speciality of ST/X - it allows quick commenting of methods
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1809
     from a source-file by replacing the 'methodsFor:' by 'ignoredMethodsFor'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1810
     Returns a ClassCategoryReader to read in and skip methods."
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1811
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1812
    ^ ClassCategoryReader skippingChunks
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1813
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1814
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1815
methods
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1816
    "this method allows fileIn of ST/V methods -
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1817
     return a ClassCategoryReader to read in and compile methods for me."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1818
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1819
    ^ ClassCategoryReader class:self category:'ST/V methods'
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1820
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1821
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1822
methodsFor:aCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1823
    "return a ClassCategoryReader to read in and compile methods for me.
10
claus
parents: 5
diff changeset
  1824
     This one actually creates the ClassReader when code is filed-in."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1825
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1826
    ^ ClassCategoryReader class:self category:aCategory
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1827
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1828
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1829
methodsForUndefined:categoryString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1830
    "ST-80 compatibility.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1831
     I dont yet know what this does - it was encountered by some tester.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1832
     For now, simply forward it."
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1833
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1834
    ^ self methodsFor:categoryString
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1835
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  1836
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1837
primitiveDefinitions
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1838
    "this method allows fileIn of classes with primitive code
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1839
     outside of methods - it returns a CCReader which skips the next chunks"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1840
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1841
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveDefinitions: 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1842
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1843
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1844
primitiveFunctions
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1845
    "this method allows fileIn of classes with primitive code
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1846
     outside of methods - it returns a CCReader which skips the next chunks"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1847
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1848
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveFunctions: 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1849
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1850
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1851
primitiveVariables
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1852
    "this method allows fileIn of classes with primitive code
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1853
     outside of methods - it returns a CCReader which skips the next chunks"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1854
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1855
    ^ ClassCategoryReader class:self primitiveSpec:#primitiveVariables: 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1856
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1857
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1858
privateMethodsFor:aCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1859
    "this method allows fileIn of ENVY methods 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1860
     (although ST/X currently does NOT really enforce method visibility yet).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1861
     Returns a ClassCategoryReader to read in and compile methods for me."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1862
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1863
    ^ (self methodsFor:aCategory) privateProtocol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1864
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1865
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1866
protectedMethodsFor:aCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1867
    "this method allows fileIn of ENVY methods 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1868
     (although ST/X currently does NOT really enforce method visibility yet).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1869
     Returns a ClassCategoryReader to read in and compile methods for me."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1870
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1871
    ^ (self methodsFor:aCategory) protectedProtocol
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1872
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1873
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1874
publicMethodsFor:aCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1875
    "this method allows fileIn of ENVY methods 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1876
     (although ST/X currently does NOT support method visibility).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1877
     Returns a ClassCategoryReader to read in and compile methods for me."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1878
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1879
    ^ self methodsFor:aCategory
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1880
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1881
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1882
!Class methodsFor:'fileOut'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1883
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1884
basicFileOutDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1885
    "append an expression on aStream, which defines myself."
238
a4a50c67aeae *** empty log message ***
claus
parents: 216
diff changeset
  1886
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1887
    |isVar line s|
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1888
68
59faa75185ba *** empty log message ***
claus
parents: 54
diff changeset
  1889
    "take care of nil-superclass"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1890
    superclass isNil ifTrue:[
92
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1891
"/      previous versions of stc were not able to compile nil-subclasses;
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1892
"/      after 2.10, it can ...
0c73b48551ac *** empty log message ***
claus
parents: 88
diff changeset
  1893
"/        line := 'Object "nil"'.
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1894
	line := 'nil'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1895
    ] ifFalse:[
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1896
	line := (superclass name)
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1897
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1898
    superclass isNil ifTrue:[
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1899
	isVar := self isVariable
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1900
    ] ifFalse:[
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1901
	"I cant remember what this is for ?"
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1902
	isVar := (self isVariable and:[superclass isVariable not])
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1903
    ].
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1904
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1905
    isVar ifTrue:[
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1906
	self isBytes ifTrue:[
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1907
	    s := ' variableByteSubclass:#'
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1908
	] ifFalse:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1909
	    self isWords ifTrue:[
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1910
		s := ' variableWordSubclass:#'
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1911
	    ] ifFalse:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1912
		self isLongs ifTrue:[
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1913
		    s := ' variableLongSubclass:#'
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1914
		] ifFalse:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1915
		    self isFloats ifTrue:[
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1916
			s := ' variableFloatSubclass:#'
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1917
		    ] ifFalse:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1918
			self isDoubles ifTrue:[
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1919
			    s := ' variableDoubleSubclass:#'
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1920
			] ifFalse:[
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1921
			    s := ' variableSubclass:#'
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1922
			]
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1923
		    ]
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1924
		]
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1925
	    ]
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1926
	]
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1927
    ] ifFalse:[
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1928
	s := ' subclass:#'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1929
    ].
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  1930
    line := line , s , name.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1931
    aStream nextPutAll:line.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1932
345
claus
parents: 333
diff changeset
  1933
    aStream crtab. 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1934
    aStream nextPutAll:' instanceVariableNames:'''.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1935
    self printInstVarNamesOn:aStream indent:16.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1936
    aStream nextPutAll:''''.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1937
345
claus
parents: 333
diff changeset
  1938
    aStream crtab.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1939
    aStream nextPutAll:' classVariableNames:'''.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1940
    self printClassVarNamesOn:aStream indent:16.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1941
    aStream nextPutAll:''''.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1942
345
claus
parents: 333
diff changeset
  1943
    aStream crtab.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1944
    aStream nextPutAll:' poolDictionaries:'''''.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1945
345
claus
parents: 333
diff changeset
  1946
    aStream crtab.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1947
    aStream nextPutAll:' category:'.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1948
    category isNil ifTrue:[
333
claus
parents: 328
diff changeset
  1949
	s := ''''''
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1950
    ] ifFalse:[
333
claus
parents: 328
diff changeset
  1951
	s := category asString storeString
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1952
    ].
333
claus
parents: 328
diff changeset
  1953
    aStream nextPutAll:s.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1954
    aStream cr
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1955
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1956
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1957
fileOut
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1958
    "create a file 'class.st' consisting of all methods in myself.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1959
     If the current project is not nil, create the file in the projects
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1960
     directory. Care is taken, to not clobber any existing file in
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1961
     case of errors (for example: disk full). 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1962
     Also, since the classes methods need a valid sourcefile, the current 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1963
     sourceFile may not be rewritten."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1964
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1965
    |aStream baseName dirName fileName newFileName needRename
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1966
     mySourceFileName sameFile|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1967
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1968
    baseName := (Smalltalk fileNameForClass:self name).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1969
    fileName := baseName , '.st'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1970
139
19ccaf2031c8 project changeSet interface
claus
parents: 137
diff changeset
  1971
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1972
     this test allows a smalltalk to be built without Projects/ChangeSets
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1973
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1974
    Project notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1975
	dirName := Project currentProjectDirectory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1976
    ] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1977
	dirName := ''
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1978
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1979
    fileName := dirName , fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1980
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1981
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1982
     if file exists, copy the existing to a .sav-file,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1983
     create the new file as XXX.new-file,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1984
     and, if that worked rename afterwards ...
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  1985
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1986
    (fileName asFilename exists 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1987
    and:[classFilename notNil]) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1988
	"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1989
	 check for overwriting my current source file
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1990
	 this is not allowed, since it would clobber my methods source
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1991
	 file ... you have to save it to some other place.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1992
	 This happens if you ask for a fileOut into the source-directory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1993
	 (from which my methods get their source)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1994
	"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1995
	mySourceFileName := Smalltalk getSourceFileName:classFilename. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1996
	sameFile := (fileName = mySourceFileName).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  1997
	sameFile ifFalse:[
600
10d5c6a49061 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
  1998
	    mySourceFileName notNil ifTrue:[
10d5c6a49061 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
  1999
		sameFile := (fileName asFilename info at:#id) == (mySourceFileName asFilename info at:#id)
10d5c6a49061 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 584
diff changeset
  2000
	    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2001
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2002
	sameFile ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2003
	    ^ FileOutErrorSignal 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2004
		raiseRequestWith:fileName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2005
		errorString:('may not overwrite sourcefile:', fileName)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2006
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2007
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2008
	fileName asFilename copyTo:('/tmp/' , baseName , '.sav').
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2009
	newFileName := dirName , baseName , '.new'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2010
	needRename := true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2011
    ] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2012
	newFileName := fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2013
	needRename := false
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2014
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2015
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2016
    aStream := FileStream newFileNamed:newFileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2017
    aStream isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2018
	^ FileOutErrorSignal 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2019
		raiseRequestWith:newFileName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2020
		errorString:('cannot create file:', newFileName)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2021
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2022
    self fileOutOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2023
    aStream close.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2024
199
d3c10cc4adb6 more change records
claus
parents: 193
diff changeset
  2025
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2026
     finally, replace the old-file
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2027
     be careful, if the old one is a symbolic link; in this case,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2028
     we have to do a copy ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2029
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2030
    needRename ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2031
	newFileName asFilename copyTo:fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2032
	newFileName asFilename delete
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2033
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2034
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2035
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2036
     add a change record; that way, administration is much easier,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2037
     since we can see in that changeBrowser, which changes have 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2038
     already found their way into a sourceFile and which must be
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2039
     applied again
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2040
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2041
    self addChangeRecordForClassFileOut:self
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2042
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2043
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2044
fileOutCategory:aCategory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2045
    "create a file 'class-category.st' consisting of all methods in aCategory.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2046
     If the current project is not nil, create the file in the projects
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2047
     directory."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2048
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2049
    |aStream fileName|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2050
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2051
    fileName := name , '-' , aCategory , '.st'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2052
    fileName replaceAll:(Character space) by:$_.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2053
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2054
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2055
     this test allows a smalltalk to be built without Projects/ChangeSets
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2056
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2057
    Project notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2058
	fileName := Project currentProjectDirectory , fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2059
    ].
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  2060
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  2061
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2062
     if file exists, save original in a .sav file
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  2063
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2064
    fileName asFilename exists ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2065
	fileName asFilename copyTo:(fileName , '.sav')
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2066
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2067
    aStream := FileStream newFileNamed:fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2068
    aStream isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2069
	^ FileOutErrorSignal 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2070
		raiseRequestWith:fileName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2071
		errorString:('cannot create file:', fileName)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2072
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2073
    self fileOutCategory:aCategory on:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2074
    aStream close
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2075
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2076
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2077
fileOutCategory:aCategory except:skippedMethods only:savedMethods on:aStream
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2078
    "file out all methods belonging to aCategory, aString onto aStream.
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2079
     If skippedMethods is nonNil, those are not saved.
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2080
     If savedMethods is nonNil, only those are saved.
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2081
     If both are nil, all are saved. See version-method handling in
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2082
     fileOut for what this is needed."
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2083
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2084
    |source sortedSelectors first privacy interrestingMethods|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2085
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2086
    methodArray notNil ifTrue:[
562
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2087
	interrestingMethods := OrderedCollection new.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2088
	methodArray do:[:aMethod |
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2089
	    |wanted|
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2090
562
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2091
	    (aCategory = aMethod category) ifTrue:[
649
6a2a1eec91fe more revision stuff for sourceCodeManager
Claus Gittinger <cg@exept.de>
parents: 638
diff changeset
  2092
		skippedMethods notNil ifTrue:[
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2093
		    wanted := (skippedMethods includesIdentical:aMethod) not
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2094
		] ifFalse:[
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2095
		    savedMethods notNil ifTrue:[
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2096
			wanted := (savedMethods includesIdentical:aMethod).
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2097
		    ] ifFalse:[
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2098
			wanted := true
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2099
		    ]
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2100
		].
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2101
		wanted ifTrue:[interrestingMethods add:aMethod].
562
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2102
	    ]
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2103
	].
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2104
	interrestingMethods notEmpty ifTrue:[
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2105
	    first := true.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2106
	    privacy := nil.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2107
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2108
	    "/
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2109
	    "/ sort by selector
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2110
	    "/
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2111
	    sortedSelectors := interrestingMethods collect:[:m | self selectorAtMethod:m].
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2112
	    sortedSelectors sortWith:interrestingMethods.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2113
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2114
	    interrestingMethods do:[:aMethod |
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2115
		first ifFalse:[
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2116
		    privacy ~~ aMethod privacy ifTrue:[
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2117
			first := true.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2118
			aStream space.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2119
			aStream nextPutChunkSeparator.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2120
		    ].
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2121
		    aStream cr; cr
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2122
		].
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2123
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2124
		privacy := aMethod privacy.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2125
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2126
		first ifTrue:[
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2127
		    aStream nextPutChunkSeparator.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2128
		    self printClassNameOn:aStream.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2129
		    privacy ~~ #public ifTrue:[
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2130
			aStream space; nextPutAll:privacy; nextPutAll:'MethodsFor:'''.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2131
		    ] ifFalse:[
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2132
			aStream nextPutAll:' methodsFor:'''.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2133
		    ].
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2134
		    aCategory notNil ifTrue:[
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2135
			aStream nextPutAll:aCategory
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2136
		    ].
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2137
		    aStream nextPut:$'; nextPutChunkSeparator; cr; cr.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2138
		    first := false.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2139
		].
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2140
		source := aMethod source.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2141
		source isNil ifTrue:[
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2142
		    FileOutErrorSignal raiseRequestWith:'no source for method'
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2143
		] ifFalse:[
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2144
		    aStream nextChunkPut:source.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2145
		].
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2146
	    ].
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2147
	    aStream space.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2148
	    aStream nextPutChunkSeparator.
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2149
	    aStream cr
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2150
	]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2151
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2152
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2153
    "Modified: 28.8.1995 / 14:30:41 / claus"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2154
    "Modified: 15.11.1995 / 12:45:54 / cg"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2155
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2156
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2157
fileOutCategory:aCategory on:aStream
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2158
    "file out all methods belonging to aCategory, aString onto aStream"
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2159
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2160
    self fileOutCategory:aCategory except:nil only:nil on:aStream
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2161
!
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2162
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2163
fileOutClassInstVarDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2164
    "append an expression to define my classInstanceVariables on aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2165
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2166
    aStream nextPutAll:(name , ' class instanceVariableNames:''').
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2167
    self class printInstVarNamesOn:aStream indent:8.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2168
    aStream nextPutAll:''''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2169
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2170
    "mhmh - good idea; saw this in SmallDraw sourcecode ..."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2171
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2172
    aStream cr; cr; nextPut:(Character doubleQuote); cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2173
    aStream space; 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2174
	    nextPutAll:'The following class instance variables are inherited by this class:';
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2175
	    cr; cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2176
    self allSuperclassesDo:[:aSuperClass |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2177
	aStream tab; nextPutAll:aSuperClass name; nextPutAll:' - '.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2178
	aStream nextPutAll:(aSuperClass class instanceVariableString); cr.
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  2179
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2180
    aStream nextPut:(Character doubleQuote); cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2181
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2182
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2183
fileOutCommentOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2184
    "append an expression on aStream, which defines my comment"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2185
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2186
    |comment s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2187
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2188
    aStream nextPutAll:name; nextPutAll:' comment:'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2189
    (comment := self comment) isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2190
	s := ''''''
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2191
    ] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2192
	s := comment storeString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2193
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2194
    aStream nextPutAll:s.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2195
    aStream cr
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2196
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2197
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2198
fileOutDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2199
    "append an expression on aStream, which defines myself."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2200
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2201
    ^ self basicFileOutDefinitionOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2202
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2203
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2204
fileOutIn:aFileDirectory
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2205
    "create a file 'class.st' consisting of all methods in self in
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2206
     directory aFileDirectory (ignoring any directory setting in
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2207
     the current porject). 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2208
     This is not logged in that change file (should it be ?)."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2209
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2210
    |aStream fileName|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2211
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2212
    fileName := (Smalltalk fileNameForClass:self name) , '.st'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2213
    aStream := FileStream newFileNamed:fileName in:aFileDirectory.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2214
    aStream isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2215
	^ FileOutErrorSignal 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2216
		raiseRequestWith:fileName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2217
		errorString:('cannot create file:', fileName)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2218
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2219
    self fileOutOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2220
    aStream close
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2221
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2222
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2223
fileOutMethod:aMethod
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2224
    "create a file 'class-method.st' consisting of the method, aMethod.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2225
     If the current project is not nil, create the file in the projects
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2226
     directory."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2227
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2228
    |aStream fileName selector|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2229
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2230
    selector := self selectorAtMethod:aMethod.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2231
    selector notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2232
	fileName := name , '-' , selector, '.st'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2233
	fileName replaceAll:$: by:$_.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2234
	"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2235
	 this test allows a smalltalk to be built without Projects/ChangeSets
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2236
	"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2237
	Project notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2238
	    fileName := Project currentProjectDirectory , fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2239
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2240
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2241
	"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2242
	 if file exists, save original in a .sav file
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2243
	"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2244
	fileName asFilename exists ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2245
	    fileName asFilename copyTo:(fileName , '.sav')
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2246
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2247
	aStream := FileStream newFileNamed:fileName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2248
	aStream isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2249
	    ^ FileOutErrorSignal 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2250
		raiseRequestWith:fileName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2251
		errorString:('cannot create file:', fileName)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2252
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2253
	self fileOutMethod:aMethod on:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2254
	aStream close
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2255
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2256
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2257
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2258
fileOutMethod:aMethod on:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2259
    "file out the method, aMethod onto aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2260
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2261
    |cat source privacy|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2262
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2263
    methodArray notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2264
	aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2265
	self printClassNameOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2266
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2267
	(privacy := aMethod privacy) ~~ #public ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2268
	    aStream space; nextPutAll:privacy; nextPutAll:'MethodsFor:'''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2269
	] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2270
	    aStream nextPutAll:' methodsFor:'''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2271
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2272
	cat := aMethod category.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2273
	cat notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2274
	    aStream nextPutAll:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2275
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2276
	aStream nextPut:$'; nextPutChunkSeparator; cr; cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2277
	source := aMethod source.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2278
	source isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2279
	    FileOutErrorSignal 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2280
		raiseRequestWith:self
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2281
		errorString:('no source for method: ' ,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2282
			     self name , '>>' ,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2283
			     (self selectorAtMethod:aMethod))
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2284
	] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2285
	    aStream nextChunkPut:source.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2286
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2287
	aStream space.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2288
	aStream nextPutChunkSeparator.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2289
	aStream cr
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2290
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2291
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2292
    "Modified: 27.8.1995 / 01:23:19 / claus"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2293
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2294
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2295
fileOutOn:aStream
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2296
    "file out my definition and all methods onto aStream"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2297
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2298
    ^ self fileOutOn:aStream withTimeStamp:true
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2299
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2300
    "Created: 15.11.1995 / 12:53:32 / cg"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2301
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2302
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2303
fileOutOn:aStream withTimeStamp:stampIt
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2304
    "file out my definition and all methods onto aStream"
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2305
717
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2306
    |collectionOfCategories copyrightMethod copyrightText comment cls versionMethod skippedMethods|
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2307
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2308
    self isLoaded ifFalse:[
717
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2309
        ^ FileOutErrorSignal 
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2310
            raiseRequestWith:self
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2311
                 errorString:'will not fileOut unloaded classes'
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2312
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2313
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2314
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2315
     if there is a copyright method, add a copyright comment
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2316
     at the beginning, taking the string from the copyright method.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2317
     We cannot do this unconditionally - that would lead to my copyrights
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2318
     being put on your code ;-).
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2319
     On the other hand: I want every file created by myself to have the
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2320
     copyright string at the beginning be preserved .... even if the
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2321
     code was edited in the browser and filedOut.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2322
    "
717
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2323
    (copyrightMethod := self class compiledMethodAt:#copyright) notNil ifTrue:[
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2324
        "
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2325
         get the copyright methods source,
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2326
         and insert at beginning.
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2327
        "
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2328
        copyrightText := copyrightMethod source.
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2329
        copyrightText isNil ifTrue:[
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2330
            "
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2331
             no source available - trigger an error
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2332
            "
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2333
            FileOutErrorSignal
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2334
                raiseRequestWith:'no source for class ' , name , ' available. Cannot fileOut'.
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2335
            ^ self
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2336
        ].
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2337
        "
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2338
         strip off the selector-line
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2339
        "
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2340
        copyrightText := copyrightText asCollectionOfLines asStringCollection.
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2341
        copyrightText := copyrightText copyFrom:2 to:(copyrightText size).
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2342
"/        copyrightText do:[:line | aStream nextPutAll:line. aStream cr.].
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2343
        copyrightText := copyrightText asString.
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2344
        aStream nextChunkPut:copyrightText.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2345
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2346
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2347
    stampIt ifTrue:[
717
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2348
        "/
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2349
        "/ first, a timestamp
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2350
        "/
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2351
        aStream nextPutAll:(Smalltalk timeStamp).
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2352
        aStream nextPutChunkSeparator. 
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2353
        aStream cr; cr.
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2354
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2355
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2356
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2357
    "/ then the definition
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2358
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2359
    self fileOutDefinitionOn:aStream.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2360
    aStream nextPutChunkSeparator. 
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2361
    aStream cr; cr.
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2362
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2363
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2364
    "/ optional classInstanceVariables
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2365
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2366
    self class instanceVariableString isBlank ifFalse:[
717
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2367
        self fileOutClassInstVarDefinitionOn:aStream.
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2368
        aStream nextPutChunkSeparator. 
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2369
        aStream cr; cr
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2370
    ].
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2371
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2372
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2373
    "/ a comment - if any
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2374
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2375
    (comment := self comment) notNil ifTrue:[
717
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2376
        aStream nextPutAll:name; nextPutAll:' comment:'.
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2377
        aStream nextPutAll:(comment storeString).
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2378
        aStream nextPutChunkSeparator.
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2379
        aStream cr; cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2380
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2381
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2382
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2383
    "/ primitive definitions - if any
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2384
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2385
    self fileOutPrimitiveSpecsOn:aStream.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2386
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2387
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2388
    "/ methods from all categories in metaclass (i.e. class methods)
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2389
    "/ EXCEPT: the version method is placed at the very end, to
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2390
    "/         avoid sourcePosition-shifts when checked out later.
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2391
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2392
    collectionOfCategories := self class categories asSortedCollection.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2393
    collectionOfCategories notNil ifTrue:[
717
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2394
        "/
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2395
        "/ documentation first (if any), but not the version method
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2396
        "/
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2397
        (collectionOfCategories includes:'documentation') ifTrue:[
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2398
            versionMethod := self class compiledMethodAt:#version.
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2399
            versionMethod notNil ifTrue:[
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2400
                skippedMethods := Array with:versionMethod
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2401
            ].
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2402
            self class fileOutCategory:'documentation' except:skippedMethods only:nil on:aStream.
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2403
            aStream cr.
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2404
        ].
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2405
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2406
        "/
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2407
        "/ initialization next (if any)
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2408
        "/
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2409
        (collectionOfCategories includes:'initialization') ifTrue:[
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2410
            self class fileOutCategory:'initialization' on:aStream.
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2411
            aStream cr.
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2412
        ].
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2413
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2414
        "/
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2415
        "/ instance creation next (if any)
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2416
        "/
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2417
        (collectionOfCategories includes:'instance creation') ifTrue:[
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2418
            self class fileOutCategory:'instance creation' on:aStream.
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2419
            aStream cr.
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2420
        ].
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2421
        collectionOfCategories do:[:aCategory |
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2422
            ((aCategory ~= 'documentation')
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2423
            and:[(aCategory ~= 'initialization')
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2424
            and:[aCategory ~= 'instance creation']]) ifTrue:[
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2425
                self class fileOutCategory:aCategory on:aStream.
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2426
                aStream cr
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2427
            ]
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2428
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2429
    ].
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2430
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2431
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2432
    "/ methods from all categories in myself
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2433
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2434
    collectionOfCategories := self categories asSortedCollection.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2435
    collectionOfCategories notNil ifTrue:[
717
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2436
        collectionOfCategories do:[:aCategory |
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2437
            self fileOutCategory:aCategory on:aStream.
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2438
            aStream cr
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2439
        ]
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2440
    ].
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2441
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2442
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2443
    "/ finally, the previously skipped version method
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2444
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2445
    versionMethod notNil ifTrue:[
717
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2446
        self class fileOutCategory:'documentation' except:nil only:skippedMethods on:aStream.
638
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2447
    ].
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2448
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2449
    "/
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2450
    "/ optionally an initialize message
70584e2d2f38 place version method at the end
Claus Gittinger <cg@exept.de>
parents: 625
diff changeset
  2451
    "/
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2452
    (self class implements:#initialize) ifTrue:[
717
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2453
        aStream nextPutAll:(name , ' initialize').
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2454
        aStream nextPutChunkSeparator.
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2455
        aStream cr
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2456
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2457
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2458
    "Created: 15.11.1995 / 12:53:06 / cg"
717
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  2459
    "Modified: 9.12.1995 / 15:38:31 / cg"
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2460
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2461
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2462
fileOutPrimitiveDefinitionsOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2463
    "append primitive defs (if any) to aStream."
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2464
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2465
    |s|
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2466
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2467
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2468
     primitive definitions - if any
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2469
    "
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2470
    (s := self primitiveDefinitionsString) notNil ifTrue:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2471
	aStream nextPutChunkSeparator; 
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2472
		nextPutAll:name; nextPutAll:' primitiveDefinitions';
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2473
		nextPutChunkSeparator;
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2474
		cr.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2475
	aStream nextPutAll:s.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2476
	aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2477
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2478
    (s := self primitiveVariablesString) notNil ifTrue:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2479
	aStream nextPutChunkSeparator; 
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2480
		nextPutAll:name; nextPutAll:' primitiveVariables';
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2481
		nextPutChunkSeparator;
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2482
		cr.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2483
	aStream nextPutAll:s.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2484
	aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2485
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2486
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2487
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2488
fileOutPrimitiveSpecsOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2489
    "append primitive defs (if any) to aStream."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2490
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2491
    |s|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2492
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2493
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2494
     primitive definitions - if any
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2495
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2496
    self fileOutPrimitiveDefinitionsOn:aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2497
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2498
     primitive functions - if any
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2499
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2500
    (s := self primitiveFunctionsString) notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2501
	aStream nextPutChunkSeparator; 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2502
		nextPutAll:name; nextPutAll:' primitiveFunctions';
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2503
		nextPutChunkSeparator;
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2504
		cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2505
	aStream nextPutAll:s.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2506
	aStream nextPutChunkSeparator; space; nextPutChunkSeparator; cr; cr
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2507
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2508
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2509
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2510
!Class methodsFor:'printOut'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2511
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2512
printClassNameOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2513
    "helper for fileOut - print my name if I am not a Metaclass;
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2514
     otherwise my name without -class followed by space-class"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2515
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2516
    self isMeta ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2517
	aStream nextPutAll:(name copyTo:(name size - 5)); nextPutAll:' class'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2518
    ] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2519
	name printOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2520
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2521
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2522
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2523
printClassVarNamesOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2524
    "print the class variable names indented and breaking at line end"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2525
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2526
    self printNameArray:(self classVarNames) on:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2527
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2528
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2529
printFullHierarchyOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2530
    "print myself and all subclasses on aStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2531
     recursively calls itself to print subclasses. 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2532
     Can be used to print hierarchy on the printer."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2533
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2534
    aStream spaces:indent; bold; nextPutAll:name; normal; nextPutAll:' ('.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2535
    self printInstVarNamesOn:aStream indent:(indent + name size + 2).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2536
    aStream nextPutAll:')'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2537
    aStream cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2538
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2539
    (self subclasses sort:[:a :b | a name < b name]) do:[:aSubclass |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2540
	aSubclass printFullHierarchyOn:aStream indent:(indent + 2)
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2541
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2542
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2543
    "|printStream|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2544
     printStream := Printer new.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2545
     Object printFullHierarchyOn:printStream indent:0.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2546
     printStream close"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2547
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2548
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2549
printHierarchyAnswerIndentOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2550
    "print my class hierarchy on aStream - return indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2551
     recursively calls itself to print superclass and use returned indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2552
     for my description - used in the browser"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2553
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2554
    |indent|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2555
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2556
    indent := 0.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2557
    (superclass notNil) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2558
	indent := (superclass printHierarchyAnswerIndentOn:aStream) + 2
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2559
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2560
    aStream spaces:indent.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2561
    aStream nextPutAll:name; nextPutAll:' ('.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2562
    self printInstVarNamesOn:aStream indent:(indent + name size + 2).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2563
    aStream nextPutAll:')'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2564
    aStream cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2565
    ^ indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2566
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2567
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2568
printHierarchyOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2569
    "print my class hierarchy on aStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2570
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2571
    self printHierarchyAnswerIndentOn:aStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2572
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2573
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2574
printInstVarNamesOn:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2575
    "print the instance variable names indented and breaking at line end"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2576
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2577
    self printNameArray:(self instVarNames) on:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2578
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2579
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2580
printNameArray:anArray on:aStream indent:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2581
    "print an array of strings separated by spaces; when the stream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2582
     defines a lineLength, break when this limit is reached; indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2583
     every line; used to printOut instance variable names"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2584
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2585
    |thisName nextName arraySize lenMax pos mustBreak line spaces|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2586
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2587
    arraySize := anArray size.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2588
    arraySize ~~ 0 ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2589
	pos := indent.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2590
	lenMax := aStream lineLength.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2591
	thisName := anArray at:1.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2592
	line := ''.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2593
	1 to:arraySize do:[:index |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2594
	    line := line , thisName.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2595
	    pos := pos + thisName size.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2596
	    (index == arraySize) ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2597
		nextName := anArray at:(index + 1).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2598
		mustBreak := false.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2599
		(lenMax > 0) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2600
		    ((pos + nextName size) > lenMax) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2601
			mustBreak := true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2602
		    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2603
		].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2604
		mustBreak ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2605
		    aStream nextPutAll:line.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2606
		    aStream cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2607
		    spaces isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2608
			spaces := String new:indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2609
		    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2610
		    line := spaces.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2611
		    pos := indent
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2612
		] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2613
		    line := line , ' '.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2614
		    pos := pos + 1
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2615
		].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2616
		thisName := nextName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2617
	    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2618
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2619
	aStream nextPutAll:line
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2620
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2621
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2622
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2623
printOutCategory:aCategory on:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2624
    "print out all methods in aCategory on aPrintStream should be a PrintStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2625
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2626
    |any|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2627
    methodArray notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2628
	any := false.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2629
	methodArray do:[:aMethod |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2630
	    (aCategory = aMethod category) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2631
		any := true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2632
	    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2633
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2634
	any ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2635
	     aPrintStream italic.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2636
	     aPrintStream nextPutAll:aCategory.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2637
	     aPrintStream normal.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2638
	     aPrintStream cr; cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2639
	     methodArray do:[:aMethod |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2640
		 (aCategory = aMethod category) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2641
		     self printOutSource:(aMethod source) on:aPrintStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2642
		     aPrintStream cr; cr
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2643
		 ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2644
	     ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2645
	     aPrintStream cr
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2646
	 ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2647
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2648
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2649
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2650
printOutCategoryProtocol:aCategory on:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2651
    |any|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2652
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2653
    methodArray notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2654
	any := false.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2655
	methodArray do:[:aMethod |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2656
	    (aCategory = aMethod category) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2657
		any := true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2658
	    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2659
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2660
	any ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2661
	    aPrintStream italic.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2662
	    aPrintStream nextPutAll:aCategory.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2663
	    aPrintStream normal.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2664
	    aPrintStream cr; cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2665
	    methodArray do:[:aMethod |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2666
		(aCategory = aMethod category) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2667
		    self printOutSourceProtocol:aMethod
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2668
					     on:aPrintStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2669
		    aPrintStream cr; cr
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2670
		]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2671
	    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2672
	    aPrintStream cr
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2673
	]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2674
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2675
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2676
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2677
printOutDefinitionOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2678
    "print out my definition"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2679
333
claus
parents: 328
diff changeset
  2680
    |comment s|
claus
parents: 328
diff changeset
  2681
claus
parents: 328
diff changeset
  2682
    aPrintStream nextPutAll:'class                '; bold; nextPutAll:name; normal; cr. 
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2683
    aPrintStream nextPutAll:'superclass           '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2684
    superclass isNil ifTrue:[
333
claus
parents: 328
diff changeset
  2685
	s := 'Object'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2686
    ] ifFalse:[
333
claus
parents: 328
diff changeset
  2687
	s := superclass name
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2688
    ].
333
claus
parents: 328
diff changeset
  2689
    aPrintStream nextPutAll:s.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2690
    aPrintStream cr. 
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2691
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2692
    aPrintStream nextPutAll:'instance Variables   '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2693
    self printInstVarNamesOn:aPrintStream indent:21.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2694
    aPrintStream cr. 
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2695
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2696
    aPrintStream nextPutAll:'class Variables      '.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2697
    self printClassVarNamesOn:aPrintStream indent:21.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2698
    aPrintStream cr.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2699
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2700
    category notNil ifTrue:[
333
claus
parents: 328
diff changeset
  2701
	aPrintStream nextPutAll:'category             '; nextPutAll:(category printString).
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2702
	aPrintStream cr
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2703
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2704
193
5f2ace36fc07 more comment changes
claus
parents: 168
diff changeset
  2705
    (comment := self comment) notNil ifTrue:[
333
claus
parents: 328
diff changeset
  2706
	aPrintStream cr; nextPutAll:'comment:'; cr; italic; nextPutAll:comment; normal; cr
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2707
    ]
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2708
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2709
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2710
printOutOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2711
    "print out all methods on aPrintStream which should be a printStream"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2712
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2713
    |collectionOfCategories|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2714
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2715
    self printOutDefinitionOn:aPrintStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2716
    aPrintStream cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2717
    collectionOfCategories := self class categories.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2718
    collectionOfCategories notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2719
	aPrintStream nextPutAll:'class protocol'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2720
	aPrintStream cr; cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2721
	collectionOfCategories do:[:aCategory |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2722
	    self class printOutCategory:aCategory on:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2723
	]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2724
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2725
    collectionOfCategories := self categories.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2726
    collectionOfCategories notNil ifTrue:[
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2727
	aPrintStream nextPutAll:'instance protocol'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2728
	aPrintStream cr; cr.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2729
	collectionOfCategories do:[:aCategory |
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2730
	    self printOutCategory:aCategory on:aPrintStream
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2731
	]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2732
    ]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2733
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2734
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2735
printOutProtocolOn:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2736
    |collectionOfCategories|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2737
    self printOutDefinitionOn:aPrintStream.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2738
    aPrintStream cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2739
    collectionOfCategories := self class categories.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2740
    collectionOfCategories notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2741
	aPrintStream nextPutAll:'class protocol'.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2742
	aPrintStream cr; cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2743
	collectionOfCategories do:[:aCategory |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2744
	    self class printOutCategoryProtocol:aCategory on:aPrintStream
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2745
	]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2746
    ].
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2747
    collectionOfCategories := self categories.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2748
    collectionOfCategories notNil ifTrue:[
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2749
	aPrintStream nextPutAll:'instance protocol'.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2750
	aPrintStream cr; cr.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2751
	collectionOfCategories do:[:aCategory |
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2752
	    self printOutCategoryProtocol:aCategory on:aPrintStream
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2753
	]
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2754
    ]
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2755
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2756
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2757
printOutSource:aString on:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2758
    "print out a source-string; the message-specification is printed bold,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2759
     comments are printed italic"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2760
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2761
    |text textIndex textSize line lineIndex lineSize inComment aCharacter|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2762
    text := aString asStringCollection.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2763
    aPrintStream bold.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2764
    aPrintStream nextPutAll:(text at:1).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2765
    aPrintStream normal.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2766
    aPrintStream cr.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2767
    inComment := false.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2768
    textSize := text size.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2769
    textIndex := 2.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2770
    [textIndex <= textSize] whileTrue:[
153
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2771
	line := text at:textIndex.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2772
	((line occurrencesOf:Character doubleQuote) == 0) ifTrue:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2773
	    aPrintStream nextPutAll:line
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2774
	] ifFalse:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2775
	    lineSize := line size.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2776
	    lineIndex := 1.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2777
	    [lineIndex <= lineSize] whileTrue:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2778
		aCharacter := line at:lineIndex.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2779
		(aCharacter == Character doubleQuote) ifTrue:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2780
		    inComment ifTrue:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2781
			aPrintStream normal.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2782
			aPrintStream nextPut:aCharacter.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2783
			inComment := false
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2784
		    ] ifFalse:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2785
			aPrintStream nextPut:aCharacter.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2786
			aPrintStream italic.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2787
			inComment := true
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2788
		    ]
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2789
		] ifFalse:[
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2790
		    aPrintStream nextPut:aCharacter
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2791
		].
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2792
		lineIndex := lineIndex + 1
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2793
	    ]
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2794
	].
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2795
	aPrintStream cr.
22f4c4bcc93f *** empty log message ***
claus
parents: 139
diff changeset
  2796
	textIndex := textIndex + 1
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2797
    ]
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2798
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2799
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2800
printOutSourceProtocol:aMethod on:aPrintStream
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2801
    "given the source in aString, print the methods message specification
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2802
     and any method comments - without source; used to generate documentation
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2803
     pages"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2804
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2805
    |text|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2806
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2807
    text := aMethod source asStringCollection.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2808
    (text size < 1) ifTrue:[^self].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2809
    aPrintStream bold.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2810
    aPrintStream nextPutAll:(text at:1).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2811
    aPrintStream cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2812
    (text size >= 2) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2813
	aPrintStream italic.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2814
	aPrintStream spaces:((text at:2) indexOfNonSeparatorStartingAt:1).
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2815
	aPrintStream nextPutAll:aMethod comment.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2816
	aPrintStream cr.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2817
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2818
    aPrintStream normal
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2819
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2820
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2821
      Float printOutProtocolOn:Stdout 
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  2822
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2823
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2824
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2825
!Class methodsFor:'private'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2826
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2827
addAllCategoriesTo:aCollection
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2828
    "helper - add categories and all superclasses categories
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2829
     to the argument, aCollection"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2830
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2831
    (superclass notNil) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2832
	superclass addAllCategoriesTo:aCollection
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2833
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2834
    self addCategoriesTo:aCollection
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  2835
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  2836
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2837
addAllClassVarNamesTo:aCollection
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2838
    "helper - add the name-strings of the class variables and of the class-vars
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2839
     of all superclasses to the argument, aCollection. Return aCollection"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2840
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2841
    (superclass notNil) ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2842
	superclass addAllClassVarNamesTo:aCollection
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2843
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2844
    classvars notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2845
	aCollection addAll:(classvars asCollectionOfWords).
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  2846
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2847
    ^ aCollection
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2848
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2849
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2850
addCategoriesTo:aCollection
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2851
    "helper - add categories to the argument, aCollection"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2852
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2853
    methodArray do:[:aMethod |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2854
	|cat|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2855
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2856
	cat := aMethod category.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2857
	(aCollection includes:cat) ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2858
	    aCollection add:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2859
	]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2860
    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2861
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2862
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2863
getPrimitiveSpecsAt:index
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2864
    "return a primitiveSpecification component as string or nil"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2865
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2866
    |pos stream string|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2867
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2868
    primitiveSpec isNil ifTrue:[^ nil].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2869
    pos := primitiveSpec at:index.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2870
    pos isNil ifTrue:[^ nil].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2871
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2872
    "the primitiveSpec is either a string, or an integer specifying the
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2873
     position within the classes sourcefile ...
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2874
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2875
    pos isNumber ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2876
	classFilename notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2877
	    stream := self sourceStream. "/ Smalltalk sourceFileStreamFor:classFilename.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2878
	    stream notNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2879
		stream position:pos+1.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2880
		string := stream nextChunk.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2881
		stream close.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2882
		^ string
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2883
	    ]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2884
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2885
	^ nil
544
d78012b20769 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 527
diff changeset
  2886
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2887
    ^ pos
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2888
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2889
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2890
revisionInfo
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2891
    "return a dictionary filled with revision info.
686
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
  2892
     This extracts the relevant info from the revisionString.
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
  2893
     The revisionInfo contains all or a subset of:
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  2894
	#binaryRevision - the revision upon which the binary of this class is based
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  2895
	#revision       - the revision upon which the class is based logically
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  2896
			  (different, if a changed class was checked in, but not yet recompiled)
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  2897
	#user           - the user who checked in the logical revision
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  2898
	#date           - the date when the logical revision was checked in
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  2899
	#time           - the time when the logical revision was checked in
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  2900
	#fileName       - the classes source file name
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  2901
	#repositoryPath - the classes source container
686
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
  2902
    "
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
  2903
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
  2904
    |vsnString info|
562
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2905
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2906
    vsnString := self revisionString.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2907
    vsnString notNil ifTrue:[
689
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  2908
	info := Class revisionInfoFromString:vsnString.
d8f2044c6634 access SOurceCodeManager via a class-specific method
Claus Gittinger <cg@exept.de>
parents: 686
diff changeset
  2909
	info at:#binaryRevision put:revision.
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2910
    ].
686
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
  2911
    ^ info
544
d78012b20769 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 527
diff changeset
  2912
d78012b20769 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 527
diff changeset
  2913
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2914
     Object revisionString 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2915
     Object revisionInfo 
686
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
  2916
     Image revisionInfo 
544
d78012b20769 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 527
diff changeset
  2917
    "
d78012b20769 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 527
diff changeset
  2918
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2919
    "Created: 11.11.1995 / 14:27:20 / cg"
686
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
  2920
    "Modified: 7.12.1995 / 12:45:06 / cg"
562
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2921
!
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2922
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2923
revisionString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2924
    "return my revision string; that one is extracted from the
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2925
     classes #version method. Either this is a method returning that string,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2926
     or its a comment-only method and the comment defines the version.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2927
     If the source is not accessable or no such method exists,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2928
     nil is returned."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2929
562
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2930
    |cls meta m src val|
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2931
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2932
    self isMeta ifTrue:[
656
8b7e135d0272 fix revision extract
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
  2933
	meta := self. cls := self soleInstance
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2934
    ] ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2935
	cls := self. meta := self class
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2936
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2937
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2938
    m := meta compiledMethodAt:#version.
656
8b7e135d0272 fix revision extract
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
  2939
    m isNil ifTrue:[
8b7e135d0272 fix revision extract
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
  2940
	m := cls compiledMethodAt:#version.
8b7e135d0272 fix revision extract
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
  2941
	m isNil ifTrue:[^ nil].
8b7e135d0272 fix revision extract
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
  2942
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2943
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2944
    "/ if its a method returning the string,
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2945
    val := cls version.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2946
    val isString ifTrue:[^ val].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2947
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2948
    src := m source.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2949
    src isNil ifTrue:[^ nil].
562
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2950
    ^ self revisionStringFromSource:src 
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2951
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2952
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2953
     Smalltalk allClassesDo:[:cls |
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2954
	Transcript showCr:cls revisionString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2955
     ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2956
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2957
     Number revisionString  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2958
     FileDirectory revisionString  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2959
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2960
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2961
    "Created: 29.10.1995 / 19:28:03 / cg"
562
606cbaa20296 more versionInfo methods
Claus Gittinger <cg@exept.de>
parents: 558
diff changeset
  2962
    "Modified: 15.11.1995 / 15:01:54 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2963
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2964
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2965
revisionStringFromSource:aMethodSourceString
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2966
    "extract a revision string from a methods source string"
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2967
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2968
    |lines idx val|
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2969
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2970
    lines := aMethodSourceString asCollectionOfLines.
656
8b7e135d0272 fix revision extract
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
  2971
    lines do:[:l |
8b7e135d0272 fix revision extract
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
  2972
	|i|
8b7e135d0272 fix revision extract
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
  2973
8b7e135d0272 fix revision extract
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
  2974
	i := l indexOfSubCollection:'$Header: '.
8b7e135d0272 fix revision extract
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
  2975
	i ~~ 0 ifTrue:[
8b7e135d0272 fix revision extract
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
  2976
	    ^ l copyFrom:i
8b7e135d0272 fix revision extract
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
  2977
	]
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2978
    ].
656
8b7e135d0272 fix revision extract
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
  2979
    ^ nil
620
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2980
!
c7353f86a302 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 601
diff changeset
  2981
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2982
setPrimitiveSpecsAt:index to:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2983
    "set a primitiveSpecification component to aString"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2984
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2985
    primitiveSpec isNil ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2986
	primitiveSpec := Array new:3
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2987
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2988
    primitiveSpec at:index put:aString
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2989
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  2990
702
6a5a2ebff51b need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
  2991
updateVersionMethodFor:newRevisionString
6a5a2ebff51b need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
  2992
    "helper for the checkin procedure.
6a5a2ebff51b need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
  2993
     Update my #version method, to now return newRevisionString."
6a5a2ebff51b need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
  2994
6a5a2ebff51b need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
  2995
    |cls vs m mgr|
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2996
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2997
    cls := self.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  2998
    self isMeta ifFalse:[
707
9b3d61b411b0 dont write a change record when updating the version method
Claus Gittinger <cg@exept.de>
parents: 702
diff changeset
  2999
        cls := self class
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3000
    ].
702
6a5a2ebff51b need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
  3001
"/    m := cls compiledMethodAt:#version.
6a5a2ebff51b need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
  3002
"/    m isNil ifTrue:[^ false].
6a5a2ebff51b need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
  3003
"/    vs := self revisionString.
6a5a2ebff51b need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
  3004
"/    vs isNil ifTrue:[^ false].
6a5a2ebff51b need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
  3005
"/
6a5a2ebff51b need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
  3006
"/    (mgr := self sourceCodeManager) isNil ifTrue:[^ false].
6a5a2ebff51b need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
  3007
"/    newString := mgr updatedRevisionStringOf:cls forRevision:newRevision with:vs. 
6a5a2ebff51b need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
  3008
"/    newString isNil ifTrue:[^ false].
6a5a2ebff51b need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
  3009
707
9b3d61b411b0 dont write a change record when updating the version method
Claus Gittinger <cg@exept.de>
parents: 702
diff changeset
  3010
    Class withoutUpdatingChangesDo:[
9b3d61b411b0 dont write a change record when updating the version method
Claus Gittinger <cg@exept.de>
parents: 702
diff changeset
  3011
        Compiler compile:'version
702
6a5a2ebff51b need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
  3012
    ^ ''' , newRevisionString , '''
6a5a2ebff51b need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
  3013
'
707
9b3d61b411b0 dont write a change record when updating the version method
Claus Gittinger <cg@exept.de>
parents: 702
diff changeset
  3014
                 forClass:cls inCategory:#documentation notifying:nil 
9b3d61b411b0 dont write a change record when updating the version method
Claus Gittinger <cg@exept.de>
parents: 702
diff changeset
  3015
                     install:true skipIfSame:false silent:true. 
9b3d61b411b0 dont write a change record when updating the version method
Claus Gittinger <cg@exept.de>
parents: 702
diff changeset
  3016
    ].
702
6a5a2ebff51b need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
  3017
"/ ('updated to :' , newRevisionString) printNL.
6a5a2ebff51b need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
  3018
686
5cde213f9093 more revisionInfo changes
Claus Gittinger <cg@exept.de>
parents: 685
diff changeset
  3019
    ^ true
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3020
702
6a5a2ebff51b need to fully update the versionMethod when checkin in
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
  3021
    "Created: 7.12.1995 / 20:42:22 / cg"
707
9b3d61b411b0 dont write a change record when updating the version method
Claus Gittinger <cg@exept.de>
parents: 702
diff changeset
  3022
    "Modified: 7.12.1995 / 23:34:43 / cg"
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3023
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3024
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3025
!Class methodsFor:'queries'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3026
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3027
allCategories
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3028
    "Return a Collection of all method-category strings known in class
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3029
     and all superclasses. The returned collection is not sorted by any order."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3030
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3031
    |coll|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3032
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3033
    coll := OrderedCollection new.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3034
    self addAllCategoriesTo:coll.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3035
    ^ coll
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3036
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3037
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3038
     Point categories  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3039
     Point allCategories 
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3040
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3041
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3042
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3043
categories
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3044
    "Return a Collection of all method-category strings known in class.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3045
     The returned collection is not sorted by any order."
457
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3046
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3047
    |newList cat|
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3048
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3049
    newList := OrderedCollection new.
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3050
    methodArray do:[:aMethod |
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3051
	cat := aMethod category.
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3052
	newList indexOf:cat ifAbsent:[newList add:cat]
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3053
    ].
41c73cbee305 change classes versionString when class changes (prepare for sourceCode system)
Claus Gittinger <cg@exept.de>
parents: 453
diff changeset
  3054
    ^ newList
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3055
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3056
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3057
     Point categories  
293
31df3850e98c *** empty log message ***
claus
parents: 289
diff changeset
  3058
    "
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3059
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3060
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3061
isClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3062
    "return true, if the receiver is some kind of class 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3063
     (a real class, not just behavior);
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3064
     true is returned here - the method is redefined from Object.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3065
     See also Behavior>>isBehavior."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3066
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3067
    ^ true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3068
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3069
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3070
     Point isClass  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3071
     1 isClass      
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3072
     Behavior new isBehavior  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3073
     Behavior new isClass       
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3074
     Class new isBehavior    
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3075
     Class new isClass
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3076
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3077
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3078
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3079
wasAutoloaded
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3080
    "return true, if this class came into the system via an
555
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3081
     autoload; false otherwise.
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3082
     This is not an attribute of the class, but instead remembered in
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3083
     Autoload. The interface here is for covenience."
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3084
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3085
    ^ Autoload wasAutoloaded:self
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3086
!
d63400e20718 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  3087
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3088
whichClassDefinesClassVar:aVariableName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3089
    "return the class which defines the class variable
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3090
     named aVariableName. This method should not be used for
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3091
     repeated searches (i.e. in the compiler/parser), since it creates
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3092
     many throw away intermediate objects."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3093
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3094
    |cls|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3095
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3096
    cls := self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3097
    [cls notNil] whileTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3098
	(cls classVarNames includes:aVariableName) ifTrue:[ ^ cls].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3099
	cls := cls superclass
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3100
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3101
    ^ nil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3102
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3103
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3104
     StandardSystemView whichClassDefinesClassVar:'ErrorSignal'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3105
     StandardSystemView whichClassDefinesClassVar:'Foo'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3106
    "
556
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3107
!
62f9b313a40c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 555
diff changeset
  3108
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3109
whichClassDefinesInstVar:aVariableName
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3110
    "return the class which defines the instance variable
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3111
     named aVariableName. This method should not be used for
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3112
     repeated searches (i.e. in the compiler/parser), since it creates
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3113
     many throw away intermediate objects."
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3114
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3115
    |cls|
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3116
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3117
    cls := self.
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3118
    [cls notNil] whileTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3119
	(cls instVarNames includes:aVariableName) ifTrue:[ ^ cls].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3120
	cls := cls superclass
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3121
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3122
    ^ nil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3123
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3124
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3125
     StandardSystemView whichClassDefinesInstVar:'label'  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3126
     StandardSystemView whichClassDefinesInstVar:'paint'  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3127
     StandardSystemView whichClassDefinesInstVar:'foo'  
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3128
    "
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3129
! !
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3130
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3131
!Class methodsFor:'subclass creation'!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3132
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3133
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3134
    "create a new class as a subclass of an existing class (the receiver).
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3135
     The subclass will have indexed variables if the receiving-class has."
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3136
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3137
    self isVariable ifFalse:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3138
	^ self class
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3139
	    name:t
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3140
	    inEnvironment:Smalltalk
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3141
	    subclassOf:self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3142
	    instanceVariableNames:f
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3143
	    variable:false
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3144
	    words:true
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3145
	    pointers:true
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3146
	    classVariableNames:d
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3147
	    poolDictionaries:s
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3148
	    category:cat
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3149
	    comment:nil
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3150
	    changed:false
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3151
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3152
    self isBytes ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3153
	^ self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3154
	    variableByteSubclass:t
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3155
	    instanceVariableNames:f
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3156
	    classVariableNames:d
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3157
	    poolDictionaries:s
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3158
	    category:cat
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3159
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3160
    self isLongs ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3161
	^ self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3162
	    variableLongSubclass:t
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3163
	    instanceVariableNames:f
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3164
	    classVariableNames:d
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3165
	    poolDictionaries:s
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3166
	    category:cat
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3167
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3168
    self isFloats ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3169
	^ self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3170
	    variableFloatSubclass:t
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3171
	    instanceVariableNames:f
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3172
	    classVariableNames:d
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3173
	    poolDictionaries:s
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3174
	    category:cat
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3175
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3176
    self isDoubles ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3177
	^ self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3178
	    variableDoubleSubclass:t
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3179
	    instanceVariableNames:f
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3180
	    classVariableNames:d
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3181
	    poolDictionaries:s
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3182
	    category:cat
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3183
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3184
    self isWords ifTrue:[
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3185
	^ self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3186
	    variableWordSubclass:t
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3187
	    instanceVariableNames:f
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3188
	    classVariableNames:d
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3189
	    poolDictionaries:s
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3190
	    category:cat
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3191
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3192
    ^ self
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3193
	variableSubclass:t
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3194
	instanceVariableNames:f
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3195
	classVariableNames:d
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3196
	poolDictionaries:s
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3197
	category:cat
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3198
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3199
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3200
variableByteSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3201
    "create a new class as a subclass of an existing class (the receiver) 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3202
     in which the subclass has indexable byte-sized nonpointer variables"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3203
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3204
    self isVariable ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3205
	self isBytes ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3206
	    ^ self error:
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3207
		'cannot make a variable byte subclass of a variable non-byte class'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3208
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3209
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3210
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3211
    ^ self class
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3212
	name:t
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3213
	inEnvironment:Smalltalk
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3214
	subclassOf:self
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3215
	instanceVariableNames:f
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3216
	variable:true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3217
	words:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3218
	pointers:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3219
	classVariableNames:d
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3220
	poolDictionaries:s
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3221
	category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3222
	comment:nil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3223
	changed:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3224
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3225
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3226
variableDoubleSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3227
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3228
    "create a new class as a subclass of an existing class (the receiver) 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3229
     in which the subclass has indexable double-sized nonpointer variables"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3230
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3231
    self isVariable ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3232
	self isDoubles ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3233
	    ^ self error:
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3234
		'cannot make a variable double subclass of a variable non-double class'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3235
	].
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3236
    ].
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3237
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3238
    ^ self class
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3239
	name:t
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3240
	inEnvironment:Smalltalk
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3241
	subclassOf:self
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3242
	instanceVariableNames:f
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3243
	variable:#double 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3244
	words:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3245
	pointers:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3246
	classVariableNames:d
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3247
	poolDictionaries:s
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3248
	category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3249
	comment:nil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3250
	changed:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3251
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3252
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3253
variableFloatSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3254
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3255
    "create a new class as a subclass of an existing class (the receiver) 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3256
     in which the subclass has indexable float-sized nonpointer variables"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3257
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3258
    self isVariable ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3259
	self isFloats ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3260
	    ^ self error:
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3261
		'cannot make a variable float subclass of a variable non-float class'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3262
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3263
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3264
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3265
    ^ self class
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3266
	name:t
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3267
	inEnvironment:Smalltalk
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3268
	subclassOf:self
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3269
	instanceVariableNames:f
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3270
	variable:#float 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3271
	words:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3272
	pointers:false
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3273
	classVariableNames:d
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3274
	poolDictionaries:s
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3275
	category:cat
557
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3276
	comment:nil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3277
	changed:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3278
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3279
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3280
variableLongSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3281
    "create a new class as a subclass of an existing class (the receiver) 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3282
     in which the subclass has indexable long-sized nonpointer variables"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3283
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3284
    self isVariable ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3285
	self isLongs ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3286
	    ^ self error:
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3287
		'cannot make a variable long subclass of a variable non-long class'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3288
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3289
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3290
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3291
    ^ self class
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3292
	name:t
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3293
	inEnvironment:Smalltalk
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3294
	subclassOf:self
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3295
	instanceVariableNames:f
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3296
	variable:#long 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3297
	words:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3298
	pointers:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3299
	classVariableNames:d
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3300
	poolDictionaries:s
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3301
	category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3302
	comment:nil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3303
	changed:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3304
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3305
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3306
variableSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3307
    "create a new class as a subclass of an existing class (the receiver) 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3308
     in which the subclass has indexable pointer variables"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3309
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3310
    self isVariable ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3311
	self isPointers ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3312
	    ^ self error:
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3313
		'cannot make a variable pointer subclass of a variable non-pointer class'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3314
	]
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3315
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3316
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3317
    ^ self class
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3318
	name:t
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3319
	inEnvironment:Smalltalk
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3320
	subclassOf:self
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3321
	instanceVariableNames:f
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3322
	variable:true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3323
	words:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3324
	pointers:true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3325
	classVariableNames:d
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3326
	poolDictionaries:s
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3327
	category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3328
	comment:nil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3329
	changed:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3330
!
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3331
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3332
variableWordSubclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3333
    "create a new class as a subclass of an existing class (the receiver) 
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3334
     in which the subclass has indexable word-sized nonpointer variables"
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3335
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3336
    self isVariable ifTrue:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3337
	self isWords ifFalse:[
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3338
	    ^ self error:
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3339
		'cannot make a variable word subclass of a variable non-word class'
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3340
	].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3341
    ].
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3342
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3343
    ^ self class
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3344
	name:t
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3345
	inEnvironment:Smalltalk
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3346
	subclassOf:self
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3347
	instanceVariableNames:f
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3348
	variable:true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3349
	words:true
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3350
	pointers:false
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3351
	classVariableNames:d
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3352
	poolDictionaries:s
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3353
	category:cat
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3354
	comment:nil
0d93da4afc03 previous was corrupted by a wrong checkin ...
Claus Gittinger <cg@exept.de>
parents: 556
diff changeset
  3355
	changed:false
2
claus
parents: 1
diff changeset
  3356
! !
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3357
662
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  3358
!Class class methodsFor:'documentation'!
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  3359
df7953db3847 version method at the end
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  3360
version
717
a9d03e3c21cf handle (i.e. double) exclas in the extracted copyRightText
Claus Gittinger <cg@exept.de>
parents: 708
diff changeset
  3361
    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.101 1995-12-09 14:46:03 cg Exp $'
708
ba92b2a8477d include classes checkin revision in checkin-change-record
Claus Gittinger <cg@exept.de>
parents: 707
diff changeset
  3362
! !
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 435
diff changeset
  3363
Class initialize!