ParseNode.st
author claus
Thu, 02 Jun 1994 22:26:28 +0200
changeset 20 f8dd8ba75205
parent 19 84a1ddf215a5
child 33 8985ec2f9e82
permissions -rw-r--r--
*** empty log message ***

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

!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.6 1994-06-02 20:26:06 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
!

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
!

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
    "generate code for this statement - value not needed"

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