SelfNode.st
author Claus Gittinger <cg@exept.de>
Thu, 25 Apr 1996 19:09:53 +0200
changeset 263 3b21d0991eff
parent 261 0372e948ca2d
child 542 728300bd8861
permissions -rw-r--r--
documentation

"
 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.
"

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'!

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:'evaluating'!

evaluate
    ^ value
!

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

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

!SelfNode methodsFor:'printing'!

displayString
    ^ 'InterpreterVariable(self)'
!

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

!SelfNode class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libcomp/SelfNode.st,v 1.11 1996-04-25 17:08:47 cg Exp $'
! !