author | Claus Gittinger <cg@exept.de> |
Fri, 08 Feb 2019 18:45:32 +0100 | |
changeset 4333 | 06e11aae91bd |
parent 4316 | f420325ea0d8 |
permissions | -rw-r--r-- |
4316 | 1 |
"{ Encoding: utf8 }" |
2 |
||
70 | 3 |
" |
4 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
135
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
70
diff
changeset
|
5 |
All Rights Reserved |
70 | 6 |
|
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
1414 | 14 |
"{ Package: 'stx:libcomp' }" |
15 |
||
4316 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
70 | 18 |
Object subclass:#CompilationErrorHandler |
2217 | 19 |
instanceVariableNames:'myStream currentSource failBlock' |
928 | 20 |
classVariableNames:'' |
21 |
poolDictionaries:'' |
|
22 |
category:'System-Compiler' |
|
70 | 23 |
! |
24 |
||
25 |
!CompilationErrorHandler class methodsFor:'documentation'! |
|
26 |
||
27 |
copyright |
|
28 |
" |
|
29 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
135
aa4f7b8f121e
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
70
diff
changeset
|
30 |
All Rights Reserved |
70 | 31 |
|
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
928 | 39 |
! |
40 |
||
41 |
documentation |
|
42 |
" |
|
4316 | 43 |
Instances of this class (or a subclass) |
44 |
are created temporary during fileIn. |
|
45 |
||
46 |
They get notified about any errors. |
|
47 |
Currently, all we |
|
928 | 48 |
do here is to output the error on the Transcript; |
49 |
eventually, we will open a box showing the position of the error. |
|
50 |
" |
|
70 | 51 |
! ! |
52 |
||
53 |
!CompilationErrorHandler class methodsFor:'instance creation'! |
|
54 |
||
2445 | 55 |
new |
56 |
^ self basicNew initialize |
|
57 |
||
58 |
"Created: / 02-11-2010 / 13:00:35 / cg" |
|
59 |
! |
|
60 |
||
70 | 61 |
on:aStream |
62 |
^ self new reader:aStream |
|
63 |
! ! |
|
64 |
||
928 | 65 |
!CompilationErrorHandler methodsFor:'accessing'! |
66 |
||
2217 | 67 |
failBlock:something |
68 |
failBlock := something. |
|
69 |
! |
|
70 |
||
928 | 71 |
source:aString |
72 |
currentSource := aString |
|
73 |
! ! |
|
74 |
||
70 | 75 |
!CompilationErrorHandler methodsFor:'error handling'! |
76 |
||
928 | 77 |
correctableError:aMessage position:position to:endPos from:aCompiler |
70 | 78 |
"error notification during fileIn. |
79 |
This is sent by the compiler/evaluator if it detects errors." |
|
80 |
||
2443 | 81 |
self error:aMessage position:position to:endPos from:aCompiler. |
82 |
^ false. "/ no correction |
|
70 | 83 |
|
2443 | 84 |
"Created: / 30-07-1999 / 18:11:15 / cg" |
85 |
"Modified: / 02-11-2010 / 12:58:54 / cg" |
|
70 | 86 |
! |
87 |
||
1493 | 88 |
correctableSelectorWarning:aMessage position:position to:endPos from:aCompiler |
89 |
"warning notification during fileIn. |
|
90 |
This is sent by the compiler/evaluator if it detects errors." |
|
91 |
||
2443 | 92 |
self warning:aMessage position:position to:endPos from:aCompiler. |
93 |
^ false. "/ no correction |
|
94 |
||
95 |
"Modified: / 02-11-2010 / 12:59:04 / cg" |
|
1493 | 96 |
! |
97 |
||
2449
c3edabdba704
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
2445
diff
changeset
|
98 |
correctableWarning:aMessage position:position to:endPos from:aCompiler |
c3edabdba704
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
2445
diff
changeset
|
99 |
"error notification during fileIn. |
c3edabdba704
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
2445
diff
changeset
|
100 |
This is sent by the compiler/evaluator if it detects errors." |
c3edabdba704
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
2445
diff
changeset
|
101 |
|
2451
4a8d35607a09
changed: #correctableWarning:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
2449
diff
changeset
|
102 |
self warning:aMessage position:position to:endPos from:aCompiler. |
4a8d35607a09
changed: #correctableWarning:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
2449
diff
changeset
|
103 |
^ false |
2449
c3edabdba704
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
2445
diff
changeset
|
104 |
|
c3edabdba704
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
2445
diff
changeset
|
105 |
"Created: / 02-11-2010 / 13:29:40 / cg" |
c3edabdba704
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
2445
diff
changeset
|
106 |
! |
c3edabdba704
added: #correctableError:position:to:from:
Claus Gittinger <cg@exept.de>
parents:
2445
diff
changeset
|
107 |
|
928 | 108 |
error:aMessage position:position to:endPos from:aCompiler |
70 | 109 |
"error notification during fileIn. |
110 |
This is sent by the compiler/evaluator if it detects errors." |
|
111 |
||
112 |
" |
|
113 |
will eventually open a TextBox here, showing the error .... |
|
114 |
" |
|
115 |
"/ position printOn:Transcript. |
|
116 |
"/ Transcript show:' '. |
|
278 | 117 |
Transcript showCR:aMessage. |
2217 | 118 |
failBlock notNil ifTrue:[ failBlock value ]. |
70 | 119 |
^ false |
120 |
||
928 | 121 |
"Created: / 30.7.1999 / 18:10:30 / cg" |
70 | 122 |
! |
123 |
||
1494 | 124 |
unusedVariableWarning:aMessage position:position to:endPos from:aCompiler |
125 |
"warning notification during fileIn. |
|
126 |
This is sent by the compiler/evaluator if it detects errors." |
|
127 |
||
128 |
^ self warning:aMessage position:position to:endPos from:aCompiler |
|
129 |
! |
|
130 |
||
928 | 131 |
warning:aMessage position:position to:endPos from:aCompiler |
70 | 132 |
"warning notification during fileIn - ignore it. |
133 |
This is sent by the compiler/evaluator if it detects errors." |
|
134 |
||
3377
a56f45133a7c
class: CompilationErrorHandler
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
135 |
^ false |
70 | 136 |
|
928 | 137 |
"Created: / 30.7.1999 / 18:11:05 / cg" |
70 | 138 |
! ! |
139 |
||
1414 | 140 |
!CompilationErrorHandler methodsFor:'private-accessing'! |
70 | 141 |
|
2433 | 142 |
collectingStream:aStream |
143 |
myStream := aStream |
|
144 |
||
145 |
"Created: / 02-11-2010 / 12:51:48 / cg" |
|
146 |
! |
|
147 |
||
70 | 148 |
reader:aStream |
149 |
myStream := aStream |
|
150 |
! ! |
|
151 |
||
928 | 152 |
!CompilationErrorHandler class methodsFor:'documentation'! |
70 | 153 |
|
928 | 154 |
version |
4316 | 155 |
^ '$Header$' |
2217 | 156 |
! |
157 |
||
158 |
version_CVS |
|
4316 | 159 |
^ '$Header$' |
70 | 160 |
! ! |
3377
a56f45133a7c
class: CompilationErrorHandler
Claus Gittinger <cg@exept.de>
parents:
2451
diff
changeset
|
161 |