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:'
|
4
|
21 |
COPYRIGHT (c) 1990 by Claus Gittinger
|
0
|
22 |
All Rights Reserved
|
20
|
23 |
'!
|
0
|
24 |
|
20
|
25 |
!PrimitiveNode class methodsFor:'documentation'!
|
|
26 |
|
|
27 |
copyright
|
|
28 |
"
|
|
29 |
COPYRIGHT (c) 1990 by Claus Gittinger
|
|
30 |
All Rights Reserved
|
0
|
31 |
|
20
|
32 |
This software is furnished under a license and may be used
|
|
33 |
only in accordance with the terms of that license and with the
|
|
34 |
inclusion of the above copyright notice. This software may not
|
|
35 |
be provided or otherwise made available to, or used by, any
|
|
36 |
other person. No title to or ownership of the software is
|
|
37 |
hereby transferred.
|
|
38 |
"
|
|
39 |
!
|
0
|
40 |
|
20
|
41 |
version
|
|
42 |
"
|
|
43 |
$Header: /cvs/stx/stx/libcomp/Attic/PrimNd.st,v 1.4 1994-06-02 20:26:11 claus Exp $
|
|
44 |
"
|
|
45 |
!
|
|
46 |
|
|
47 |
documentation
|
|
48 |
"
|
|
49 |
node for parse-trees, representing primitive code
|
0
|
50 |
|
20
|
51 |
Primitives are currently not supported by the compiler
|
|
52 |
- if you want a primitive, you must use the stc-compiler and
|
|
53 |
link a new smalltalk.
|
|
54 |
|
|
55 |
In the future, methods with primitives will be passed to stc and
|
|
56 |
the resulting binary be loaded into the image (also a limited set
|
|
57 |
of numeric primitives could be implemented for more ST-80
|
|
58 |
compatibility - if there is a need).
|
|
59 |
"
|
|
60 |
! !
|
0
|
61 |
|
|
62 |
!PrimitiveNode class methodsFor:'instance creation'!
|
|
63 |
|
|
64 |
code:aString
|
|
65 |
^ self basicNew code:aString
|
|
66 |
!
|
|
67 |
|
|
68 |
primitiveNumber:anInteger
|
|
69 |
^ self basicNew primitiveNumber:anInteger
|
|
70 |
! !
|
|
71 |
|
|
72 |
!PrimitiveNode methodsFor:'accessing'!
|
|
73 |
|
|
74 |
code:aString
|
|
75 |
code := aString
|
|
76 |
!
|
|
77 |
|
|
78 |
primitiveNumber:anInteger
|
|
79 |
primNumber := anInteger
|
|
80 |
! !
|
|
81 |
|
|
82 |
!PrimitiveNode methodsFor:'evaluating'!
|
|
83 |
|
|
84 |
evaluateExpression
|
|
85 |
"catch evaluation"
|
|
86 |
|
|
87 |
self error:'cannot evaluate primitives'
|
|
88 |
!
|
|
89 |
|
|
90 |
evaluate
|
|
91 |
"catch evaluation"
|
|
92 |
|
|
93 |
self error:'cannot evaluate primitives'
|
|
94 |
! !
|
|
95 |
|
|
96 |
!PrimitiveNode methodsFor:'code generation'!
|
|
97 |
|
|
98 |
codeForSideEffectOn:aStream inBlock:b
|
|
99 |
"catch code generation"
|
|
100 |
|
|
101 |
self error:'cannot compile primitives (as yet)'
|
|
102 |
!
|
|
103 |
|
|
104 |
codeOn:aStream inBlock:b
|
|
105 |
"catch code generation"
|
|
106 |
|
|
107 |
self error:'cannot compile primitives (as yet)'
|
|
108 |
! !
|