70
|
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 |
'From Smalltalk/X, Version:2.10.4 on 24-feb-1995 at 3:12:23 am'!
|
|
14 |
|
|
15 |
Object subclass:#CompilationErrorHandler
|
|
16 |
instanceVariableNames:'myStream currentSource'
|
|
17 |
classVariableNames:''
|
|
18 |
poolDictionaries:''
|
|
19 |
category:'System-Compiler'
|
|
20 |
!
|
|
21 |
|
|
22 |
!CompilationErrorHandler class methodsFor:'documentation'!
|
|
23 |
|
|
24 |
version
|
|
25 |
"
|
|
26 |
$Header: /cvs/stx/stx/libcomp/CompilationErrorHandler.st,v 1.1 1995-02-24 15:21:56 claus Exp $
|
|
27 |
"
|
|
28 |
!
|
|
29 |
|
|
30 |
documentation
|
|
31 |
"
|
|
32 |
Instances of this class are created temporary during fileIn.
|
|
33 |
They get notified about any errors. Currently, all we
|
|
34 |
do here is to output the error on the Transcript;
|
|
35 |
eventually, we will open a box showing the position of the error.
|
|
36 |
"
|
|
37 |
!
|
|
38 |
|
|
39 |
copyright
|
|
40 |
"
|
|
41 |
COPYRIGHT (c) 1995 by Claus Gittinger
|
|
42 |
All Rights Reserved
|
|
43 |
|
|
44 |
This software is furnished under a license and may be used
|
|
45 |
only in accordance with the terms of that license and with the
|
|
46 |
inclusion of the above copyright notice. This software may not
|
|
47 |
be provided or otherwise made available to, or used by, any
|
|
48 |
other person. No title to or ownership of the software is
|
|
49 |
hereby transferred.
|
|
50 |
"
|
|
51 |
! !
|
|
52 |
|
|
53 |
!CompilationErrorHandler class methodsFor:'instance creation'!
|
|
54 |
|
|
55 |
on:aStream
|
|
56 |
^ self new reader:aStream
|
|
57 |
! !
|
|
58 |
|
|
59 |
!CompilationErrorHandler methodsFor:'error handling'!
|
|
60 |
|
|
61 |
correctableError:aMessage position:position to:endPos
|
|
62 |
"error notification during fileIn.
|
|
63 |
This is sent by the compiler/evaluator if it detects errors."
|
|
64 |
|
|
65 |
^ self error:aMessage position:position to:endPos
|
|
66 |
|
|
67 |
|
|
68 |
!
|
|
69 |
|
|
70 |
error:aMessage position:position to:endPos
|
|
71 |
"error notification during fileIn.
|
|
72 |
This is sent by the compiler/evaluator if it detects errors."
|
|
73 |
|
|
74 |
"
|
|
75 |
will eventually open a TextBox here, showing the error ....
|
|
76 |
"
|
|
77 |
"/ position printOn:Transcript.
|
|
78 |
"/ Transcript show:' '.
|
|
79 |
Transcript showCr:aMessage.
|
|
80 |
^ false
|
|
81 |
|
|
82 |
!
|
|
83 |
|
|
84 |
warning:aMessage position:position to:endPos
|
|
85 |
"warning notification during fileIn - ignore it.
|
|
86 |
This is sent by the compiler/evaluator if it detects errors."
|
|
87 |
|
|
88 |
^ self
|
|
89 |
|
|
90 |
! !
|
|
91 |
|
|
92 |
!CompilationErrorHandler methodsFor:'private access'!
|
|
93 |
|
|
94 |
reader:aStream
|
|
95 |
myStream := aStream
|
|
96 |
! !
|
|
97 |
|
|
98 |
!CompilationErrorHandler methodsFor:'accessing'!
|
|
99 |
|
|
100 |
source:aString
|
|
101 |
currentSource := aString
|
|
102 |
! !
|
|
103 |
|