73
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1995 by Claus Gittinger
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
Object subclass:#SourceFileLoader
|
263
|
14 |
instanceVariableNames:'myStream currentSource package wantChangeLog'
|
|
15 |
classVariableNames:''
|
|
16 |
poolDictionaries:''
|
|
17 |
category:'System-Compiler'
|
73
|
18 |
!
|
|
19 |
|
|
20 |
!SourceFileLoader class methodsFor:'documentation'!
|
|
21 |
|
|
22 |
copyright
|
|
23 |
"
|
|
24 |
COPYRIGHT (c) 1995 by Claus Gittinger
|
|
25 |
All Rights Reserved
|
|
26 |
|
|
27 |
This software is furnished under a license and may be used
|
|
28 |
only in accordance with the terms of that license and with the
|
|
29 |
inclusion of the above copyright notice. This software may not
|
|
30 |
be provided or otherwise made available to, or used by, any
|
|
31 |
other person. No title to or ownership of the software is
|
|
32 |
hereby transferred.
|
|
33 |
"
|
141
|
34 |
!
|
|
35 |
|
|
36 |
documentation
|
|
37 |
"
|
|
38 |
Instances of this class are created temporary during fileIn.
|
|
39 |
They get notified about any errors. Currently, all we
|
|
40 |
do here is to output the error on the Transcript;
|
|
41 |
eventually, we will open a box showing the position of the error.
|
263
|
42 |
|
|
43 |
[author:]
|
|
44 |
Claus Gittinger
|
141
|
45 |
"
|
73
|
46 |
! !
|
|
47 |
|
|
48 |
!SourceFileLoader class methodsFor:'instance creation'!
|
|
49 |
|
|
50 |
on:aStream
|
84
|
51 |
^ self new reader:aStream wantChangeLog:false
|
73
|
52 |
! !
|
|
53 |
|
141
|
54 |
!SourceFileLoader methodsFor:'accessing'!
|
|
55 |
|
|
56 |
source:aString
|
|
57 |
currentSource := aString
|
|
58 |
! !
|
|
59 |
|
|
60 |
!SourceFileLoader methodsFor:'compiler queries'!
|
|
61 |
|
414
|
62 |
packageToInstall
|
|
63 |
"sent by the compiler to ask in which package new methods/classes
|
|
64 |
are to be installed.
|
|
65 |
This is still to be finished ..."
|
|
66 |
|
|
67 |
^ package
|
|
68 |
|
|
69 |
"Created: 5.11.1996 / 19:56:03 / cg"
|
|
70 |
!
|
|
71 |
|
141
|
72 |
wantChangeLog
|
|
73 |
"sent by the compiler to ask if a changeLog entry should
|
|
74 |
be written. Return false here, since SourceFileLaoders are
|
|
75 |
used to read existing source files"
|
|
76 |
|
|
77 |
^ wantChangeLog
|
|
78 |
! !
|
|
79 |
|
|
80 |
!SourceFileLoader methodsFor:'directve processing'!
|
|
81 |
|
|
82 |
requirePackage:packageName
|
|
83 |
'require package: ' print.
|
279
|
84 |
packageName printCR
|
|
85 |
|
|
86 |
"Modified: 20.5.1996 / 10:29:05 / cg"
|
141
|
87 |
!
|
|
88 |
|
|
89 |
setPackage:packageName
|
414
|
90 |
package := packageName asSymbol
|
279
|
91 |
|
414
|
92 |
"Modified: 5.11.1996 / 20:24:33 / cg"
|
141
|
93 |
! !
|
|
94 |
|
73
|
95 |
!SourceFileLoader methodsFor:'error handling'!
|
|
96 |
|
83
|
97 |
correctableError:aMessage position:position to:endPos from:aCompiler
|
73
|
98 |
"error notification during fileIn.
|
|
99 |
This is sent by the compiler/evaluator if it detects errors."
|
|
100 |
|
275
|
101 |
Transcript show:'** '; showCR:aMessage.
|
97
|
102 |
^ false
|
275
|
103 |
|
|
104 |
"Modified: 18.5.1996 / 15:44:50 / cg"
|
73
|
105 |
!
|
|
106 |
|
83
|
107 |
error:aMessage position:position to:endPos from:aCompiler
|
73
|
108 |
"error notification during fileIn.
|
|
109 |
This is sent by the compiler/evaluator if it detects errors."
|
|
110 |
|
162
|
111 |
|cls sel|
|
|
112 |
|
73
|
113 |
"
|
|
114 |
will eventually open a TextBox here, showing the error ....
|
|
115 |
"
|
275
|
116 |
Transcript show:'===> '; showCR:aMessage.
|
162
|
117 |
(cls := aCompiler targetClass) notNil ifTrue:[
|
|
118 |
Transcript show:' when compiling '; show:cls name.
|
275
|
119 |
(sel := aCompiler selector) notNil ifTrue:[
|
162
|
120 |
Transcript show:'>>'; show:sel.
|
275
|
121 |
].
|
|
122 |
Transcript cr.
|
162
|
123 |
].
|
73
|
124 |
^ false
|
275
|
125 |
|
|
126 |
"Modified: 18.5.1996 / 15:44:52 / cg"
|
73
|
127 |
!
|
|
128 |
|
98
|
129 |
insertAndSelect:aString at:aCharacterPosition
|
|
130 |
"ST-80 compatible error notification during fileIn."
|
|
131 |
|
|
132 |
"
|
|
133 |
will eventually open a TextBox here, showing the error ....
|
|
134 |
"
|
275
|
135 |
Transcript show:'===> '; showCR:aString.
|
98
|
136 |
^ false
|
275
|
137 |
|
|
138 |
"Modified: 18.5.1996 / 15:44:54 / cg"
|
141
|
139 |
!
|
|
140 |
|
|
141 |
warning:aMessage position:position to:endPos from:aCompiler
|
|
142 |
"warning notification during fileIn - ignore it.
|
|
143 |
This is sent by the compiler/evaluator if it detects errors."
|
|
144 |
|
|
145 |
^ self
|
73
|
146 |
! !
|
|
147 |
|
|
148 |
!SourceFileLoader methodsFor:'private access'!
|
|
149 |
|
84
|
150 |
reader:aStream wantChangeLog:aBoolean
|
|
151 |
myStream := aStream.
|
|
152 |
wantChangeLog := aBoolean
|
|
153 |
! !
|
|
154 |
|
148
|
155 |
!SourceFileLoader class methodsFor:'documentation'!
|
|
156 |
|
|
157 |
version
|
414
|
158 |
^ '$Header: /cvs/stx/stx/libcomp/Attic/SrcFLoader.st,v 1.15 1996-11-05 19:33:52 cg Exp $'
|
148
|
159 |
! !
|