SrcFLoader.st
author claus
Sun, 23 Jul 1995 04:24:56 +0200
changeset 98 ccc7f9389a8e
parent 97 3b0d380771e9
child 102 77e4d1119ff2
permissions -rw-r--r--
.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
     1
"
317a3bd63c65 Initial revision
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
317a3bd63c65 Initial revision
claus
parents:
diff changeset
     3
	      All Rights Reserved
317a3bd63c65 Initial revision
claus
parents:
diff changeset
     4
317a3bd63c65 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
317a3bd63c65 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
317a3bd63c65 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
317a3bd63c65 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
317a3bd63c65 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    11
"
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    12
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    13
'From Smalltalk/X, Version:2.10.4 on 24-feb-1995 at 3:12:23 am'!
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    14
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    15
Object subclass:#SourceFileLoader
84
claus
parents: 83
diff changeset
    16
	 instanceVariableNames:'myStream currentSource package wantChangeLog'
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    17
	 classVariableNames:''
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    18
	 poolDictionaries:''
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    19
	 category:'System-Compiler'
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    20
!
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    21
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    22
!SourceFileLoader class methodsFor:'documentation'!
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    23
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    24
version
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    25
"
98
claus
parents: 97
diff changeset
    26
$Header: /cvs/stx/stx/libcomp/Attic/SrcFLoader.st,v 1.5 1995-07-23 02:24:40 claus Exp $
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    27
"
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    28
!
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    29
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    30
documentation
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    31
"
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    32
    Instances of this class are created temporary during fileIn.
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    33
    They get notified about any errors. Currently, all we
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    34
    do here is to output the error on the Transcript;
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    35
    eventually, we will open a box showing the position of the error.
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    36
"
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    37
!
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    38
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    39
copyright
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    40
"
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    41
 COPYRIGHT (c) 1995 by Claus Gittinger
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    42
	      All Rights Reserved
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    43
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    44
 This software is furnished under a license and may be used
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    45
 only in accordance with the terms of that license and with the
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    46
 inclusion of the above copyright notice.   This software may not
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    47
 be provided or otherwise made available to, or used by, any
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    48
 other person.  No title to or ownership of the software is
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    49
 hereby transferred.
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    50
"
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    51
! !
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    52
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    53
!SourceFileLoader class methodsFor:'instance creation'!
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    54
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    55
on:aStream
84
claus
parents: 83
diff changeset
    56
    ^ self new reader:aStream wantChangeLog:false
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    57
! !
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    58
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    59
!SourceFileLoader methodsFor:'error handling'!
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    60
83
claus
parents: 73
diff changeset
    61
correctableError:aMessage position:position to:endPos from:aCompiler
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    62
    "error notification during fileIn.
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    63
     This is sent by the compiler/evaluator if it detects errors."
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    64
97
claus
parents: 84
diff changeset
    65
    Transcript show:'**  '; showCr:aMessage.
claus
parents: 84
diff changeset
    66
    ^ false
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    67
!
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    68
83
claus
parents: 73
diff changeset
    69
error:aMessage position:position to:endPos from:aCompiler
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    70
    "error notification during fileIn.
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    71
     This is sent by the compiler/evaluator if it detects errors."
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    72
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    73
    "
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    74
     will eventually open a TextBox here, showing the error ....
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    75
    "
97
claus
parents: 84
diff changeset
    76
    Transcript show:'===>  '; showCr:aMessage.
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    77
    ^ false
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    78
!
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    79
83
claus
parents: 73
diff changeset
    80
warning:aMessage position:position to:endPos from:aCompiler
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    81
    "warning notification during fileIn - ignore it.
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    82
     This is sent by the compiler/evaluator if it detects errors."
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    83
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    84
    ^ self
98
claus
parents: 97
diff changeset
    85
!
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    86
98
claus
parents: 97
diff changeset
    87
insertAndSelect:aString at:aCharacterPosition
claus
parents: 97
diff changeset
    88
    "ST-80 compatible error notification during fileIn."
claus
parents: 97
diff changeset
    89
claus
parents: 97
diff changeset
    90
    "
claus
parents: 97
diff changeset
    91
     will eventually open a TextBox here, showing the error ....
claus
parents: 97
diff changeset
    92
    "
claus
parents: 97
diff changeset
    93
    Transcript show:'===>  '; showCr:aString.
claus
parents: 97
diff changeset
    94
    ^ false
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    95
! !
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    96
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    97
!SourceFileLoader methodsFor:'private access'!
317a3bd63c65 Initial revision
claus
parents:
diff changeset
    98
84
claus
parents: 83
diff changeset
    99
reader:aStream wantChangeLog:aBoolean
claus
parents: 83
diff changeset
   100
    myStream := aStream.
claus
parents: 83
diff changeset
   101
    wantChangeLog := aBoolean
claus
parents: 83
diff changeset
   102
! !
claus
parents: 83
diff changeset
   103
claus
parents: 83
diff changeset
   104
!SourceFileLoader methodsFor:'compiler queries'!
claus
parents: 83
diff changeset
   105
claus
parents: 83
diff changeset
   106
wantChangeLog
claus
parents: 83
diff changeset
   107
    "sent by the compiler to ask if a changeLog entry should
claus
parents: 83
diff changeset
   108
     be written. Return false here, since SourceFileLaoders are
claus
parents: 83
diff changeset
   109
     used to read existing source files"
claus
parents: 83
diff changeset
   110
claus
parents: 83
diff changeset
   111
    ^ wantChangeLog
73
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   112
! !
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   113
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   114
!SourceFileLoader methodsFor:'directve processing'!
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   115
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   116
setPackage:packageName
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   117
    'code for package: ' print.
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   118
    packageName printNL
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   119
!
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   120
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   121
requirePackage:packageName
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   122
    'require package: ' print.
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   123
    packageName printNL
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   124
! !
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   125
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   126
!SourceFileLoader methodsFor:'accessing'!
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   127
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   128
source:aString
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   129
    currentSource := aString
317a3bd63c65 Initial revision
claus
parents:
diff changeset
   130
! !