CompilationErrorHandler.st
author Stefan Vogel <sv@exept.de>
Fri, 25 Apr 2003 18:40:04 +0200
changeset 1401 d9a2949c6229
parent 928 90470934ef24
child 1414 613ec963af7c
permissions -rw-r--r--
Fix typos
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
70
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
     1
"
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
     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
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
     4
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    11
"
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    12
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    13
Object subclass:#CompilationErrorHandler
928
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    14
	instanceVariableNames:'myStream currentSource'
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    15
	classVariableNames:''
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    16
	poolDictionaries:''
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    17
	category:'System-Compiler'
70
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    18
!
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    19
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    20
!CompilationErrorHandler class methodsFor:'documentation'!
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    21
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    22
copyright
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    23
"
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    24
 COPYRIGHT (c) 1995 by Claus Gittinger
135
aa4f7b8f121e uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents: 70
diff changeset
    25
	      All Rights Reserved
70
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    26
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    27
 This software is furnished under a license and may be used
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    28
 only in accordance with the terms of that license and with the
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    29
 inclusion of the above copyright notice.   This software may not
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    30
 be provided or otherwise made available to, or used by, any
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    31
 other person.  No title to or ownership of the software is
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    32
 hereby transferred.
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    33
"
928
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    34
!
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    35
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    36
documentation
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    37
"
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    38
    Instances of this class are created temporary during fileIn.
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    39
    They get notified about any errors. Currently, all we
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    40
    do here is to output the error on the Transcript;
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    41
    eventually, we will open a box showing the position of the error.
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    42
"
70
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    43
! !
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    44
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    45
!CompilationErrorHandler class methodsFor:'instance creation'!
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    46
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    47
on:aStream
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    48
    ^ self new reader:aStream
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    49
! !
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    50
928
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    51
!CompilationErrorHandler methodsFor:'accessing'!
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    52
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    53
source:aString
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    54
    currentSource := aString
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    55
! !
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    56
70
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    57
!CompilationErrorHandler methodsFor:'error handling'!
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    58
928
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    59
correctableError:aMessage position:position to:endPos from:aCompiler
70
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    60
    "error notification during fileIn.
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    61
     This is sent by the compiler/evaluator if it detects errors."
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    62
928
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    63
    ^ self error:aMessage position:position to:endPos from:aCompiler
70
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    64
928
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    65
    "Created: / 30.7.1999 / 18:11:15 / cg"
70
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    66
!
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    67
928
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    68
error:aMessage position:position to:endPos from:aCompiler
70
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    69
    "error notification during fileIn.
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    70
     This is sent by the compiler/evaluator if it detects errors."
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    71
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    72
    "
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    73
     will eventually open a TextBox here, showing the error ....
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    74
    "
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    75
"/    position printOn:Transcript.
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    76
"/    Transcript show:' '.
278
8c8c96856b41 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 135
diff changeset
    77
    Transcript showCR:aMessage.
70
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    78
    ^ false
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    79
928
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    80
    "Created: / 30.7.1999 / 18:10:30 / cg"
70
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    81
!
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    82
928
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    83
warning:aMessage position:position to:endPos from:aCompiler
70
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    84
    "warning notification during fileIn - ignore it.
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    85
     This is sent by the compiler/evaluator if it detects errors."
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    86
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    87
    ^ self
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    88
928
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    89
    "Created: / 30.7.1999 / 18:11:05 / cg"
70
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    90
! !
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    91
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    92
!CompilationErrorHandler methodsFor:'private access'!
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    93
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    94
reader:aStream
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    95
    myStream := aStream
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    96
! !
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    97
928
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
    98
!CompilationErrorHandler class methodsFor:'documentation'!
70
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
    99
928
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   100
version
90470934ef24 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   101
    ^ '$Header: /cvs/stx/stx/libcomp/CompilationErrorHandler.st,v 1.4 1999-07-30 18:01:33 cg Exp $'
70
e1ebc34c4ea7 Initial revision
claus
parents:
diff changeset
   102
! !