SuperNode.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 28 Jul 2011 16:57:44 +0200
changeset 2617 160ca364f3d3
parent 2605 e40af6e65d7c
child 2897 b97e8a922cd2
permissions -rw-r--r--
More fixes for start/end position

"
 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.
"
"{ Package: 'stx:libcomp' }"

SelfNode subclass:#SuperNode
	instanceVariableNames:'class isHere'
	classVariableNames:''
	poolDictionaries:''
	category:'System-Compiler-Support'
!

!SuperNode 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 super
    This is a helper class for the compiler.

    [author:]
        Claus Gittinger
"
! !

!SuperNode class methodsFor:'instance creation'!

value:val inClass:cls 
    ^ (self basicNew) value:val inClass:cls here:false
!

value:val inClass:cls here:isHere
    ^ (self basicNew) value:val inClass:cls here:isHere
! !

!SuperNode methodsFor:'accessing'!

definingClass
    ^ class
!

value:val inClass:cls here:h
    type := #Super.
    value := val.
    class := cls.
    isHere := h
! !

!SuperNode methodsFor:'printing & storing'!

displayString
    "return a string for display in inspectors etc."
    isHere ifTrue:[
        ^ 'InterpreterVariable(here)'
    ] ifFalse:[
        ^ 'InterpreterVariable(super)'
    ]

    "Created: / 16.7.1998 / 19:57:59 / cg"
    "Modified: / 16.7.1998 / 19:58:45 / cg"
!

printOn:aStream indent:i
    isHere ifTrue:[
	aStream nextPutAll:'here'
    ] ifFalse:[
	aStream nextPutAll:'super'
    ]
! !

!SuperNode methodsFor:'testing'!

isHere
    ^ isHere
!

isSuper
    "return true, if this is a super-node"

    ^ true
! !

!SuperNode methodsFor:'visiting'!

acceptVisitor:aVisitor 
    "Double dispatch back to the visitor, passing my type encoded in
     the selector (visitor pattern)"

    "stub code automatically generated - please change if required"

    ^ aVisitor visitSuperNode:self
! !

!SuperNode class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libcomp/SuperNode.st,v 1.15 2011-07-25 22:36:12 vrany Exp $'
!

version_CVS
    ^ '$Header: /cvs/stx/stx/libcomp/SuperNode.st,v 1.15 2011-07-25 22:36:12 vrany Exp $'
! !