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

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

StatementNode subclass:#PrimitiveNode
       instanceVariableNames:'code primNumber'
       classVariableNames:''
       poolDictionaries:''
       category:'System-Compiler-Support'
!

PrimitiveNode comment:'
COPYRIGHT (c) 1990 by Claus Gittinger
	     All Rights Reserved

$Header: /cvs/stx/stx/libcomp/Attic/PrimNd.st,v 1.9 1995-08-11 20:28:14 claus Exp $
'!

!PrimitiveNode class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1990 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/Attic/PrimNd.st,v 1.9 1995-08-11 20:28:14 claus Exp $
"
!

documentation
"
    node for parse-trees, representing primitive code

    Primitives are currently not supported by the compiler 
    - if you want a primitive, you must use the stc-compiler and 
    link a new smalltalk.

    In the future, methods with primitives will be passed to stc and 
    the resulting binary be loaded into the image (also a limited set 
    of numeric primitives could be implemented for more ST-80 
    compatibility - if there is a need).
"
! !

!PrimitiveNode class methodsFor:'instance creation'!

code:aString
    ^ self basicNew code:aString
!

primitiveNumber:anInteger
    ^ self basicNew primitiveNumber:anInteger
! !

!PrimitiveNode methodsFor:'queries'!

isConstant
    ^ false
! !

!PrimitiveNode methodsFor:'accessing'!

code:aString
    code := aString
!

primitiveNumber:anInteger 
    primNumber := anInteger
! !

!PrimitiveNode methodsFor:'evaluating'!

evaluateExpression
    "catch evaluation"

    self error:'cannot evaluate primitives'
!

evaluate
    "catch evaluation"

    self error:'cannot evaluate primitives'
! !

!PrimitiveNode methodsFor:'code generation'!

codeForSideEffectOn:aStream inBlock:b for:aCompiler
    "catch code generation"

    self error:'cannot compile primitives (as yet)'
!

codeOn:aStream inBlock:b for:aCompiler
    "catch code generation"

    self error:'cannot compile primitives (as yet)'
! !