0
|
1 |
"
|
4
|
2 |
COPYRIGHT (c) 1990 by Claus Gittinger
|
0
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
|
13 |
StatementNode subclass:#PrimitiveNode
|
|
14 |
instanceVariableNames:'code primNumber'
|
|
15 |
classVariableNames:''
|
|
16 |
poolDictionaries:''
|
|
17 |
category:'System-Compiler-Support'
|
|
18 |
!
|
|
19 |
|
|
20 |
PrimitiveNode comment:'
|
|
21 |
|
4
|
22 |
COPYRIGHT (c) 1990 by Claus Gittinger
|
0
|
23 |
All Rights Reserved
|
|
24 |
|
4
|
25 |
$Header: /cvs/stx/stx/libcomp/Attic/PrimNd.st,v 1.3 1993-10-13 02:41:39 claus Exp $
|
0
|
26 |
|
|
27 |
Primitives are currently not supported by the compiler - if you
|
|
28 |
want a primitive, you must use the stc-compiler and link a new smalltalk.
|
|
29 |
|
|
30 |
In the future, methods with primitives will be passed to stc and the resulting
|
|
31 |
binary be loaded into the image (also a limited set of numeric primitives
|
|
32 |
could be implemented for more ST-80 compatibility - if thats really needed).
|
|
33 |
|
|
34 |
written 90 by claus
|
|
35 |
'!
|
|
36 |
|
|
37 |
!PrimitiveNode class methodsFor:'instance creation'!
|
|
38 |
|
|
39 |
code:aString
|
|
40 |
^ self basicNew code:aString
|
|
41 |
!
|
|
42 |
|
|
43 |
primitiveNumber:anInteger
|
|
44 |
^ self basicNew primitiveNumber:anInteger
|
|
45 |
! !
|
|
46 |
|
|
47 |
!PrimitiveNode methodsFor:'accessing'!
|
|
48 |
|
|
49 |
code:aString
|
|
50 |
code := aString
|
|
51 |
!
|
|
52 |
|
|
53 |
primitiveNumber:anInteger
|
|
54 |
primNumber := anInteger
|
|
55 |
! !
|
|
56 |
|
|
57 |
!PrimitiveNode methodsFor:'evaluating'!
|
|
58 |
|
|
59 |
evaluateExpression
|
|
60 |
"catch evaluation"
|
|
61 |
|
|
62 |
self error:'cannot evaluate primitives'
|
|
63 |
!
|
|
64 |
|
|
65 |
evaluate
|
|
66 |
"catch evaluation"
|
|
67 |
|
|
68 |
self error:'cannot evaluate primitives'
|
|
69 |
! !
|
|
70 |
|
|
71 |
!PrimitiveNode methodsFor:'code generation'!
|
|
72 |
|
|
73 |
codeForSideEffectOn:aStream inBlock:b
|
|
74 |
"catch code generation"
|
|
75 |
|
|
76 |
self error:'cannot compile primitives (as yet)'
|
|
77 |
!
|
|
78 |
|
|
79 |
codeOn:aStream inBlock:b
|
|
80 |
"catch code generation"
|
|
81 |
|
|
82 |
self error:'cannot compile primitives (as yet)'
|
|
83 |
! !
|