MethodNode.st
author claus
Sun, 13 Aug 1995 22:52:47 +0200
changeset 106 2653f74569d1
parent 105 16fd75fcbd3b
child 111 c94471645c21
permissions -rw-r--r--
.

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

ParseNode subclass:#MethodNode
       instanceVariableNames:'selector arguments locals statements'
       classVariableNames:''
       poolDictionaries:''
       category:'System-Compiler ST-80- compatibility'
!

MethodNode comment:'
COPYRIGHT (c) 1995 by Claus Gittinger
	      All Rights Reserved

$Header: /cvs/stx/stx/libcomp/MethodNode.st,v 1.5 1995-08-13 20:52:22 claus Exp $
'!

!MethodNode class methodsFor:'documentation'!

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

version
"
$Header: /cvs/stx/stx/libcomp/MethodNode.st,v 1.5 1995-08-13 20:52:22 claus Exp $
"
!

documentation
"
    This is a pure mimicri class.
    It is not used by ST/X, but provided to support limited
    compatibility for applications which build up codetrees,
    knowing internals of ST-80's compiler class hierarchy.
    This classes protocol is not (not meant to be) fully covering
    the corresponding ST-80's classes protocol. It maps ST-80 messages
    to corresponding ST/X messages (as far as possible).

    NO WARRANTY and GUARANTEE; this class may be removed without notice.
"
! !

!MethodNode methodsFor:'accessing'!

selector:sel arguments:argVars locals:localVars statements:stats
    selector := sel. 
    arguments := argVars. 
    locals := localVars. 
    statements := stats.
!

selector
    ^ selector
! !

!MethodNode methodsFor:'code generation'!

emitEffect:aStream
    statements do:[:stat |
	stat codeForSideEffectOn:aStream inBlock:nil for:nil 
    ].
! !

!MethodNode methodsFor:'printing'!

printOn:aStream indent:i
    |n parts|

    n := selector numArgs.
    n == 0 ifTrue:[
	aStream nextPutAll:selector printString.
    ] ifFalse:[
	parts := selector partsIfSelector.
	parts with:arguments do:[:part :arg |
	    aStream nextPutAll:part.
	    aStream space.
	    aStream nextPutAll:arg name
	]
    ].
    aStream cr.

    statements do:[:stat |
	aStream spaces:i+4.
	stat printOn:aStream indent:i+4.
	aStream nextPut:$..
	aStream cr.
    ].
! !