0
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1993 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 |
Object subclass:#UndefinedVariable
|
|
14 |
instanceVariableNames:'name'
|
|
15 |
classVariableNames:''
|
|
16 |
poolDictionaries:''
|
|
17 |
category:'System-Compiler-Support'
|
|
18 |
!
|
|
19 |
|
|
20 |
UndefinedVariable comment:'
|
|
21 |
|
|
22 |
COPYRIGHT (c) 1993 by Claus Gittinger
|
|
23 |
All Rights Reserved
|
|
24 |
|
|
25 |
This class exists solely for the error message when accessing undefined
|
|
26 |
variables - instead of returning nil, the compiler returns an instance
|
|
27 |
of this class, which will not understand ANY message.
|
|
28 |
The error message will then be "UndefinedVariable ..." instead of
|
|
29 |
"UndefineObject ..."
|
|
30 |
|
3
|
31 |
$Header: /cvs/stx/stx/libcomp/UndefinedVariable.st,v 1.2 1993-10-13 00:26:22 claus Exp $
|
0
|
32 |
'!
|
|
33 |
|
|
34 |
!UndefinedVariable class methodsFor:'instance creation'!
|
|
35 |
|
|
36 |
name:aString
|
|
37 |
^ (self basicNew) setName:aString
|
|
38 |
! !
|
|
39 |
|
|
40 |
!UndefinedVariable methodsFor:'error reporting'!
|
|
41 |
|
|
42 |
methodError
|
|
43 |
self error:('trying to define methods for undefined class: ', name)
|
|
44 |
!
|
|
45 |
|
|
46 |
subclassingError
|
|
47 |
self error:('trying to create subclass of undefined class: ', name)
|
|
48 |
! !
|
|
49 |
|
|
50 |
!UndefinedVariable methodsFor:'catching messages'!
|
|
51 |
|
|
52 |
class
|
|
53 |
^ self
|
|
54 |
!
|
|
55 |
|
|
56 |
methods
|
|
57 |
self methodError
|
|
58 |
!
|
|
59 |
|
|
60 |
methodsFor:arg
|
|
61 |
self methodError
|
|
62 |
!
|
|
63 |
|
|
64 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s
|
|
65 |
self subclassingError
|
|
66 |
!
|
|
67 |
|
|
68 |
subclass:t instanceVariableNames:f classVariableNames:d poolDictionaries:s category:cat
|
|
69 |
self subclassingError
|
|
70 |
!
|
|
71 |
|
|
72 |
variableByteSubclass:t instanceVariableNames:f
|
|
73 |
classVariableNames:d poolDictionaries:s category:cat
|
|
74 |
self subclassingError
|
|
75 |
!
|
|
76 |
|
|
77 |
variableSubclass:t instanceVariableNames:f
|
|
78 |
classVariableNames:d poolDictionaries:s category:cat
|
|
79 |
self subclassingError
|
|
80 |
!
|
|
81 |
|
|
82 |
variableWordSubclass:t instanceVariableNames:f
|
|
83 |
classVariableNames:d poolDictionaries:s category:cat
|
|
84 |
self subclassingError
|
|
85 |
! !
|
|
86 |
|
|
87 |
!UndefinedVariable methodsFor:'private accessing'!
|
|
88 |
|
|
89 |
setName:aString
|
|
90 |
name := aString
|
|
91 |
! !
|
|
92 |
|
|
93 |
!UndefinedVariable methodsFor:'printing & storing'!
|
|
94 |
|
|
95 |
printString
|
|
96 |
"return a string for printing myself"
|
|
97 |
|
|
98 |
^ 'UndefinedVariable(' , name , ')'
|
|
99 |
! !
|