UndefinedVariable.st
author claus
Sat, 11 Dec 1993 02:09:49 +0100
changeset 7 6c2bc76f0b8f
parent 3 b63b8a6b71fb
child 20 f8dd8ba75205
permissions -rw-r--r--
*** empty log message ***

"
 COPYRIGHT (c) 1993 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.
"

Object subclass:#UndefinedVariable
       instanceVariableNames:'name'
       classVariableNames:''
       poolDictionaries:''
       category:'System-Compiler-Support'
!

UndefinedVariable comment:'

COPYRIGHT (c) 1993 by Claus Gittinger
              All Rights Reserved

This class exists solely for the error message when accessing undefined
variables - instead of returning nil,  the compiler returns an instance
of this class,  which will not understand ANY message.
The error message will then be "UndefinedVariable ..." instead of
"UndefineObject ..."

$Header: /cvs/stx/stx/libcomp/UndefinedVariable.st,v 1.2 1993-10-13 00:26:22 claus Exp $
'!

!UndefinedVariable class methodsFor:'instance creation'!

name:aString
    ^ (self basicNew) setName:aString
! !

!UndefinedVariable methodsFor:'error reporting'!

methodError
    self error:('trying to define methods for undefined class: ', name)
!

subclassingError
    self error:('trying to create subclass of undefined class: ', name)
! !

!UndefinedVariable methodsFor:'catching messages'!

class
    ^ self
!

methods
    self methodError
!

methodsFor:arg
    self methodError
!

subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
    self subclassingError
!

subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
    self subclassingError
!

variableByteSubclass:t instanceVariableNames:f 
                          classVariableNames:d poolDictionaries:s category:cat
    self subclassingError
!

variableSubclass:t instanceVariableNames:f 
                          classVariableNames:d poolDictionaries:s category:cat
    self subclassingError
!

variableWordSubclass:t instanceVariableNames:f 
                          classVariableNames:d poolDictionaries:s category:cat
    self subclassingError
! !

!UndefinedVariable methodsFor:'private accessing'!

setName:aString
    name := aString
! !

!UndefinedVariable methodsFor:'printing & storing'!

printString
    "return a string for printing myself"

    ^ 'UndefinedVariable(' , name , ')'
! !