ParseNode.st
author claus
Fri, 11 Aug 1995 22:28:40 +0200
changeset 104 2016bfa4cd45
parent 103 f4a69d7dd387
child 135 aa4f7b8f121e
permissions -rw-r--r--
.

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

Object subclass:#ParseNode
       instanceVariableNames:'type comments parenthized'
       classVariableNames:''
       poolDictionaries:''
       category:'System-Compiler-Support'
!

ParseNode comment:'
COPYRIGHT (c) 1989 by Claus Gittinger
	      All Rights Reserved

$Header: /cvs/stx/stx/libcomp/ParseNode.st,v 1.12 1995-08-11 20:28:09 claus Exp $
'!

!ParseNode class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1989 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/ParseNode.st,v 1.12 1995-08-11 20:28:09 claus Exp $
"
!

documentation
"
    node for parse-trees; abstract class
"
! !

!ParseNode class methodsFor:'instance creation'!

type:t
    ^ (self basicNew) type:t
! !

!ParseNode methodsFor:'queries'!

isConstant
    "return true, if this is a node for a constant"

    ^ false
!

isGlobal
    "return true, if this is a node for a global variable"

    ^ false
!

isPrimary
    "return true, if this is a node for a primary (i.e. non-send)"

    ^ false
!

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

    ^ false
!

isReturnNode
    "return true, if this is a node for a return expression"

    ^ false
!

isBlockNode
    "return true, if this is a node for a block"

    ^ false
!

isAssignment
    "return true, if this is a node for an assignment"

    ^ false
!

isMessage
    "return true, if this is a node for a message expression"

    ^ false
!

isBinaryMessage
    "return true, if this is a node for a binary send"

    ^ false
!

isUnaryMessage
    "return true, if this is a node for a unary send"

    ^ false
! !

!ParseNode methodsFor:'accessing'!

type
    "return the nodes type"

    ^ type
!

lineNumber:dummy
    "set linenumber - ignored here"

    ^ self
!

parenthized:aBoolean
    parenthized := aBoolean
!

parenthized
    ^ parenthized
! !

!ParseNode methodsFor:'private'!

type:t
    "set the nodes type"

    type := t
! !

!ParseNode methodsFor:'printing'!

printString
    |stream|

    stream := WriteStream on:String new.
    self printOn:stream indent:0.
    ^ stream contents
!

printOn:aStream
    self printOn:aStream indent:0
! !

!ParseNode methodsFor:'checks'!

plausibilityCheck
    ^ nil
! !

!ParseNode methodsFor:'evaluation'!

evaluateForCascade
    ^ self evaluate
! !

!ParseNode methodsFor:'code generation'!

codeForSideEffectOn:aStream inBlock:b for:aCompiler
    "generate code for this statement - value not needed"

    self codeOn:aStream inBlock:b for:aCompiler.
    aStream nextPut:#drop
! !