author | Claus Gittinger <cg@exept.de> |
Tue, 02 Nov 2010 12:52:44 +0100 | |
changeset 2433 | 5ccfab20dcf5 |
parent 2217 | a505d0b7d544 |
child 2443 | b5c69e2f0411 |
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 |
||
48 |
on:aStream |
|
49 |
^ self new reader:aStream |
|
50 |
! ! |
|
51 |
||
928 | 52 |
!CompilationErrorHandler methodsFor:'accessing'! |
53 |
||
2217 | 54 |
failBlock:something |
55 |
failBlock := something. |
|
56 |
! |
|
57 |
||
928 | 58 |
source:aString |
59 |
currentSource := aString |
|
60 |
! ! |
|
61 |
||
70 | 62 |
!CompilationErrorHandler methodsFor:'error handling'! |
63 |
||
928 | 64 |
correctableError:aMessage position:position to:endPos from:aCompiler |
70 | 65 |
"error notification during fileIn. |
66 |
This is sent by the compiler/evaluator if it detects errors." |
|
67 |
||
928 | 68 |
^ self error:aMessage position:position to:endPos from:aCompiler |
70 | 69 |
|
928 | 70 |
"Created: / 30.7.1999 / 18:11:15 / cg" |
70 | 71 |
! |
72 |
||
1493 | 73 |
correctableSelectorWarning:aMessage position:position to:endPos from:aCompiler |
74 |
"warning notification during fileIn. |
|
75 |
This is sent by the compiler/evaluator if it detects errors." |
|
76 |
||
77 |
^ self warning:aMessage position:position to:endPos from:aCompiler |
|
78 |
! |
|
79 |
||
928 | 80 |
error:aMessage position:position to:endPos from:aCompiler |
70 | 81 |
"error notification during fileIn. |
82 |
This is sent by the compiler/evaluator if it detects errors." |
|
83 |
||
84 |
" |
|
85 |
will eventually open a TextBox here, showing the error .... |
|
86 |
" |
|
87 |
"/ position printOn:Transcript. |
|
88 |
"/ Transcript show:' '. |
|
278 | 89 |
Transcript showCR:aMessage. |
2217 | 90 |
failBlock notNil ifTrue:[ failBlock value ]. |
70 | 91 |
^ false |
92 |
||
928 | 93 |
"Created: / 30.7.1999 / 18:10:30 / cg" |
70 | 94 |
! |
95 |
||
1494 | 96 |
unusedVariableWarning:aMessage position:position to:endPos from:aCompiler |
97 |
"warning notification during fileIn. |
|
98 |
This is sent by the compiler/evaluator if it detects errors." |
|
99 |
||
100 |
^ self warning:aMessage position:position to:endPos from:aCompiler |
|
101 |
! |
|
102 |
||
928 | 103 |
warning:aMessage position:position to:endPos from:aCompiler |
70 | 104 |
"warning notification during fileIn - ignore it. |
105 |
This is sent by the compiler/evaluator if it detects errors." |
|
106 |
||
107 |
^ self |
|
108 |
||
928 | 109 |
"Created: / 30.7.1999 / 18:11:05 / cg" |
70 | 110 |
! ! |
111 |
||
1414 | 112 |
!CompilationErrorHandler methodsFor:'private-accessing'! |
70 | 113 |
|
2433 | 114 |
collectingStream:aStream |
115 |
myStream := aStream |
|
116 |
||
117 |
"Created: / 02-11-2010 / 12:51:48 / cg" |
|
118 |
! |
|
119 |
||
70 | 120 |
reader:aStream |
121 |
myStream := aStream |
|
122 |
! ! |
|
123 |
||
928 | 124 |
!CompilationErrorHandler class methodsFor:'documentation'! |
70 | 125 |
|
928 | 126 |
version |
2433 | 127 |
^ '$Header: /cvs/stx/stx/libcomp/CompilationErrorHandler.st,v 1.9 2010-11-02 11:52:44 cg Exp $' |
2217 | 128 |
! |
129 |
||
130 |
version_CVS |
|
2433 | 131 |
^ '$Header: /cvs/stx/stx/libcomp/CompilationErrorHandler.st,v 1.9 2010-11-02 11:52:44 cg Exp $' |
70 | 132 |
! ! |