SrcFLoader.st
author Claus Gittinger <cg@exept.de>
Fri, 20 Dec 1996 00:22:30 +0100
changeset 452 466112d0d3fd
parent 430 fbf6a7c19b86
child 464 f409008c2106
permissions -rw-r--r--
checkin from browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
     1
"
317a3bd63c65 Initial revision
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
317a3bd63c65 Initial revision
claus
parents:
diff changeset
     3
	      All Rights Reserved
317a3bd63c65 Initial revision
claus
parents:
diff changeset
     4
317a3bd63c65 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
317a3bd63c65 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
317a3bd63c65 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
317a3bd63c65 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
317a3bd63c65 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    11
"
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    12
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    13
Object subclass:#SourceFileLoader
416
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
    14
	instanceVariableNames:'myStream currentSource package wantChangeLog currentNameSpace
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
    15
		usedNameSpaces'
263
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
    16
	classVariableNames:''
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
    17
	poolDictionaries:''
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
    18
	category:'System-Compiler'
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    19
!
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    20
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    21
!SourceFileLoader class methodsFor:'documentation'!
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    22
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    23
copyright
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    24
"
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    25
 COPYRIGHT (c) 1995 by Claus Gittinger
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    26
	      All Rights Reserved
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    27
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    28
 This software is furnished under a license and may be used
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    29
 only in accordance with the terms of that license and with the
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    31
 be provided or otherwise made available to, or used by, any
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    32
 other person.  No title to or ownership of the software is
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    33
 hereby transferred.
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    34
"
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    35
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    36
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    37
documentation
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    38
"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    39
    Instances of this class are created temporary during fileIn.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    40
    They get notified about any errors. Currently, all we
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    41
    do here is to output the error on the Transcript;
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    42
    eventually, we will open a box showing the position of the error.
263
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
    43
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
    44
    [author:]
3b21d0991eff documentation
Claus Gittinger <cg@exept.de>
parents: 162
diff changeset
    45
        Claus Gittinger
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    46
"
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    47
! !
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    48
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    49
!SourceFileLoader class methodsFor:'instance creation'!
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    50
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    51
on:aStream
84
claus
parents: 83
diff changeset
    52
    ^ self new reader:aStream wantChangeLog:false
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    53
! !
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    54
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    55
!SourceFileLoader methodsFor:'accessing'!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    56
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    57
source:aString
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    58
    currentSource := aString
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    59
! !
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    60
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    61
!SourceFileLoader methodsFor:'compiler queries'!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    62
416
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
    63
currentNameSpace
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
    64
    "sent by the compiler to ask for the current nameSpace.
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
    65
     This is still to be finished ..."
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
    66
419
5a5140d5523e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
    67
    currentNameSpace isNil ifTrue:[
452
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
    68
        currentNameSpace := Smalltalk defaultNameSpace
419
5a5140d5523e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
    69
    ].
416
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
    70
    ^ currentNameSpace
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
    71
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
    72
    "Created: 5.11.1996 / 22:05:19 / cg"
452
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
    73
    "Modified: 20.12.1996 / 00:01:32 / cg"
416
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
    74
!
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
    75
414
9fbab8aec86a fixes for package query
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
    76
packageToInstall
9fbab8aec86a fixes for package query
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
    77
    "sent by the compiler to ask in which package new methods/classes
9fbab8aec86a fixes for package query
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
    78
     are to be installed.
9fbab8aec86a fixes for package query
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
    79
     This is still to be finished ..."
9fbab8aec86a fixes for package query
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
    80
419
5a5140d5523e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
    81
    package isNil ifTrue:[
452
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
    82
        package := Project currentPackageName
419
5a5140d5523e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
    83
    ].
414
9fbab8aec86a fixes for package query
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
    84
    ^ package
9fbab8aec86a fixes for package query
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
    85
9fbab8aec86a fixes for package query
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
    86
    "Created: 5.11.1996 / 19:56:03 / cg"
452
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
    87
    "Modified: 20.12.1996 / 00:01:41 / cg"
414
9fbab8aec86a fixes for package query
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
    88
!
9fbab8aec86a fixes for package query
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
    89
416
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
    90
usedNameSpaces
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
    91
    "sent by the compiler to ask for a list of used nameSpaces.
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
    92
     This is still to be finished ..."
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
    93
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
    94
    ^ usedNameSpaces
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
    95
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
    96
    "Created: 5.11.1996 / 22:05:37 / cg"
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
    97
!
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
    98
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    99
wantChangeLog
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   100
    "sent by the compiler to ask if a changeLog entry should
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   101
     be written. Return false here, since SourceFileLaoders are
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   102
     used to read existing source files"
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   103
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   104
    ^ wantChangeLog
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   105
! !
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   106
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   107
!SourceFileLoader methodsFor:'directve processing'!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   108
452
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   109
addUsedSpace:aNameSpace
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   110
    usedNameSpaces isNil ifTrue:[
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   111
        usedNameSpaces := OrderedCollection new.
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   112
    ].
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   113
    usedNameSpaces add:aNameSpace
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   114
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   115
    "Modified: 5.11.1996 / 22:03:53 / cg"
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   116
    "Created: 19.12.1996 / 22:26:12 / cg"
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   117
!
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   118
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   119
addUsedSpaces:aNameSpaceList
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   120
    usedNameSpaces isNil ifTrue:[
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   121
        usedNameSpaces := OrderedCollection new.
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   122
    ].
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   123
    aNameSpaceList do:[:aNameSpace |
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   124
        usedNameSpaces add:aNameSpace
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   125
    ].
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   126
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   127
    "Modified: 5.11.1996 / 22:03:53 / cg"
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   128
    "Created: 19.12.1996 / 22:26:23 / cg"
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   129
!
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   130
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   131
requirePackage:packageName
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   132
    'require package: ' print.
279
bda67d871f7d printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
   133
    packageName printCR
bda67d871f7d printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
   134
bda67d871f7d printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
   135
    "Modified: 20.5.1996 / 10:29:05 / cg"
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   136
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   137
428
1d24f4dfed64 moved namespace creation completely to Namespace class.
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   138
setNameSpace:aNameSpaceName
1d24f4dfed64 moved namespace creation completely to Namespace class.
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   139
    "set the namespace for further variable resolving"
416
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
   140
428
1d24f4dfed64 moved namespace creation completely to Namespace class.
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   141
    currentNameSpace := Namespace fullName:aNameSpaceName
416
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
   142
428
1d24f4dfed64 moved namespace creation completely to Namespace class.
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   143
    "Modified: 8.11.1996 / 13:42:54 / cg"
416
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
   144
!
123973b721e6 namespace support
Claus Gittinger <cg@exept.de>
parents: 414
diff changeset
   145
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   146
setPackage:packageName
414
9fbab8aec86a fixes for package query
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   147
    package := packageName asSymbol
279
bda67d871f7d printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 275
diff changeset
   148
414
9fbab8aec86a fixes for package query
Claus Gittinger <cg@exept.de>
parents: 279
diff changeset
   149
    "Modified: 5.11.1996 / 20:24:33 / cg"
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   150
! !
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   151
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   152
!SourceFileLoader methodsFor:'error handling'!
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   153
83
claus
parents: 73
diff changeset
   154
correctableError:aMessage position:position to:endPos from:aCompiler
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   155
    "error notification during fileIn.
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   156
     This is sent by the compiler/evaluator if it detects errors."
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   157
275
da3efc596541 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
   158
    Transcript show:'**  '; showCR:aMessage.
430
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   159
    self showWherePosition:position to:endPos from:aCompiler.
97
claus
parents: 84
diff changeset
   160
    ^ false
275
da3efc596541 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
   161
430
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   162
    "Modified: 8.11.1996 / 18:53:17 / cg"
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   163
!
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   164
83
claus
parents: 73
diff changeset
   165
error:aMessage position:position to:endPos from:aCompiler
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   166
    "error notification during fileIn.
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   167
     This is sent by the compiler/evaluator if it detects errors."
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   168
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   169
    "
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   170
     will eventually open a TextBox here, showing the error ....
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   171
    "
275
da3efc596541 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
   172
    Transcript show:'===>  '; showCR:aMessage.
430
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   173
    self showWherePosition:position to:endPos from:aCompiler.
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   174
    ^ false
275
da3efc596541 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
   175
430
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   176
    "Modified: 8.11.1996 / 18:49:41 / cg"
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   177
!
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   178
98
claus
parents: 97
diff changeset
   179
insertAndSelect:aString at:aCharacterPosition
claus
parents: 97
diff changeset
   180
    "ST-80 compatible error notification during fileIn."
claus
parents: 97
diff changeset
   181
claus
parents: 97
diff changeset
   182
    "
claus
parents: 97
diff changeset
   183
     will eventually open a TextBox here, showing the error ....
claus
parents: 97
diff changeset
   184
    "
275
da3efc596541 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
   185
    Transcript show:'===>  '; showCR:aString.
98
claus
parents: 97
diff changeset
   186
    ^ false
275
da3efc596541 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
   187
da3efc596541 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
   188
    "Modified: 18.5.1996 / 15:44:54 / cg"
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   189
!
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   190
430
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   191
showWherePosition:position to:endPos from:aCompiler
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   192
    "show more details about the errors/warnings position."
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   193
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   194
    |cls sel where|
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   195
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   196
    "
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   197
     will eventually open a TextBox here, showing the error ....
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   198
    "
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   199
    (cls := aCompiler targetClass) notNil ifTrue:[
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   200
        (sel := aCompiler selector) notNil ifTrue:[
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   201
            Transcript show:'      when compiling '; show:cls name.
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   202
            Transcript show:'>>'; show:sel.
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   203
        ] ifFalse:[
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   204
            Transcript show:'      when compiling/evaluating for '; show:cls name.
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   205
        ].
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   206
        Transcript cr.
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   207
    ].
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   208
    myStream isFileStream ifTrue:[
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   209
        Transcript show:'      while reading '; show:myStream pathName.
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   210
        Transcript cr.
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   211
    ].
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   212
    (where := aCompiler lastTokenLineNumber) notNil ifTrue:[
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   213
        Transcript show:'      at or near line '; show:where.
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   214
        Transcript cr.
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   215
    ].
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   216
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   217
    "Created: 8.11.1996 / 18:49:08 / cg"
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   218
    "Modified: 8.11.1996 / 18:51:11 / cg"
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   219
!
fbf6a7c19b86 show more info in case of errors while reading from a file
Claus Gittinger <cg@exept.de>
parents: 428
diff changeset
   220
141
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   221
warning:aMessage position:position to:endPos from:aCompiler
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   222
    "warning notification during fileIn - ignore it.
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   223
     This is sent by the compiler/evaluator if it detects errors."
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   224
d378d997aab0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
   225
    ^ self
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   226
! !
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   227
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   228
!SourceFileLoader methodsFor:'private access'!
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   229
84
claus
parents: 83
diff changeset
   230
reader:aStream wantChangeLog:aBoolean
claus
parents: 83
diff changeset
   231
    myStream := aStream.
claus
parents: 83
diff changeset
   232
    wantChangeLog := aBoolean
claus
parents: 83
diff changeset
   233
! !
claus
parents: 83
diff changeset
   234
148
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
   235
!SourceFileLoader class methodsFor:'documentation'!
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
   236
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
   237
version
452
466112d0d3fd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   238
    ^ '$Header: /cvs/stx/stx/libcomp/Attic/SrcFLoader.st,v 1.20 1996-12-19 23:22:30 cg Exp $'
148
ef0e604209ec version method at the end
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
   239
! !