SourceFileLoader.st
author Claus Gittinger <cg@exept.de>
Sat, 11 Nov 1995 16:31:47 +0100
changeset 135 aa4f7b8f121e
parent 103 f4a69d7dd387
child 141 d378d997aab0
permissions -rw-r--r--
uff - version methods changed to return stings

"
 COPYRIGHT (c) 1995 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

'From Smalltalk/X, Version:2.10.4 on 24-feb-1995 at 3:12:23 am'!

Object subclass:#SourceFileLoader
	 instanceVariableNames:'myStream currentSource package wantChangeLog'
	 classVariableNames:''
	 poolDictionaries:''
	 category:'System-Compiler'
!

!SourceFileLoader class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libcomp/SourceFileLoader.st,v 1.8 1995-11-11 15:31:38 cg Exp $'
!

documentation
"
    Instances of this class are created temporary during fileIn.
    They get notified about any errors. Currently, all we
    do here is to output the error on the Transcript;
    eventually, we will open a box showing the position of the error.
"
!

copyright
"
 COPYRIGHT (c) 1995 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
! !

!SourceFileLoader class methodsFor:'instance creation'!

on:aStream
    ^ self new reader:aStream wantChangeLog:false
! !

!SourceFileLoader methodsFor:'error handling'!

correctableError:aMessage position:position to:endPos from:aCompiler
    "error notification during fileIn.
     This is sent by the compiler/evaluator if it detects errors."

    Transcript show:'**  '; showCr:aMessage.
    ^ false
!

error:aMessage position:position to:endPos from:aCompiler
    "error notification during fileIn.
     This is sent by the compiler/evaluator if it detects errors."

    "
     will eventually open a TextBox here, showing the error ....
    "
    Transcript show:'===>  '; showCr:aMessage.
    ^ false
!

warning:aMessage position:position to:endPos from:aCompiler
    "warning notification during fileIn - ignore it.
     This is sent by the compiler/evaluator if it detects errors."

    ^ self
!

insertAndSelect:aString at:aCharacterPosition
    "ST-80 compatible error notification during fileIn."

    "
     will eventually open a TextBox here, showing the error ....
    "
    Transcript show:'===>  '; showCr:aString.
    ^ false
! !

!SourceFileLoader methodsFor:'private access'!

reader:aStream wantChangeLog:aBoolean
    myStream := aStream.
    wantChangeLog := aBoolean
! !

!SourceFileLoader methodsFor:'compiler queries'!

wantChangeLog
    "sent by the compiler to ask if a changeLog entry should
     be written. Return false here, since SourceFileLaoders are
     used to read existing source files"

    ^ wantChangeLog
! !

!SourceFileLoader methodsFor:'directve processing'!

setPackage:packageName
    'code for package: ' print.
    packageName printNL
!

requirePackage:packageName
    'require package: ' print.
    packageName printNL
! !

!SourceFileLoader methodsFor:'accessing'!

source:aString
    currentSource := aString
! !