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