SelfNode.st
author Stefan Vogel <sv@exept.de>
Fri, 06 Mar 1998 16:38:37 +0100
changeset 657 0ecf1ff6f6bf
parent 612 2748896a66c8
child 711 25b9a501b97d
permissions -rw-r--r--
Fix #makeMethod:

"
 COPYRIGHT (c) 1994 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:3.1.10 on 20-sep-1997 at 11:48:04 pm'                !

PrimaryNode subclass:#SelfNode
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'System-Compiler-Support'
!

!SelfNode class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1994 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.
"
!

documentation
"
    node for parse-trees, representing self
    This is a helper class for the compiler.

    [author:]
        Claus Gittinger
"
! !

!SelfNode class methodsFor:'instance creation'!

value:val
    ^ (self basicNew) value:val
! !

!SelfNode methodsFor:'accessing'!

name
    ^ 'self'

    "Created: 19.6.1997 / 17:20:22 / cg"
!

value:val
    type := #Self.
    value := val.
! !

!SelfNode methodsFor:'code generation'!

codeOn:aStream inBlock:codeBlock for:aCompiler
    aStream nextPut:#pushSelf
!

codeStoreOn:aStream inBlock:codeBlock valueNeeded:valueNeeded for:aCompiler
    "not reached - parser has already checked this"

    ^ self error:'store into self - cannot happen'
! !

!SelfNode methodsFor:'enumeration'!

nodeDo:anEnumerator
    "helper for parse tree walking"

    ^ anEnumerator doVariable:self name:'self'

    "Created: 19.6.1997 / 17:20:02 / cg"
! !

!SelfNode methodsFor:'evaluating'!

evaluate
    ^ value
!

store:aValue
    "not reached - parser has already checked this"

    self error:'store into self - cannot happen'
! !

!SelfNode methodsFor:'printing'!

displayString
    "return a string for display in inspectors etc."

    ^ 'InterpreterVariable(self)'

    "Modified: 20.9.1997 / 11:41:41 / cg"
!

printOn:aStream indent:i
    aStream nextPutAll:'self'
! !

!SelfNode class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libcomp/SelfNode.st,v 1.13 1997-09-20 21:03:32 cg Exp $'
! !