--- a/PrimitiveNode.st Tue Apr 19 16:23:56 2005 +0200
+++ b/PrimitiveNode.st Tue Apr 19 16:31:12 2005 +0200
@@ -114,6 +114,14 @@
self error:'cannot compile primitives (as yet)' mayProceed:true
! !
+!PrimitiveNode methodsFor:'enumerating'!
+
+nodeDo:anEnumerator
+ "helper for parse tree walking"
+
+ ^ anEnumerator doPrimitive:self code:code primitiveIndex:primNumber
+! !
+
!PrimitiveNode methodsFor:'evaluation'!
evaluateExpressionIn:anEnvironment
@@ -143,5 +151,5 @@
!PrimitiveNode class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libcomp/PrimitiveNode.st,v 1.20 2003-03-28 14:39:00 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/PrimitiveNode.st,v 1.21 2005-04-19 14:31:12 cg Exp $'
! !
--- a/ProgramNodeEnumerator.st Tue Apr 19 16:23:56 2005 +0200
+++ b/ProgramNodeEnumerator.st Tue Apr 19 16:31:12 2005 +0200
@@ -111,6 +111,10 @@
"Modified: 19.6.1997 / 16:53:01 / cg"
!
+doPrimitive:aNode code:code primitiveIndex:primNumber
+ ^ self subclassResponsibility
+!
+
doReturn:aNode value:value
^ self subclassResponsibility
@@ -163,5 +167,5 @@
!ProgramNodeEnumerator class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libcomp/ProgramNodeEnumerator.st,v 1.4 2005-02-02 11:02:40 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/ProgramNodeEnumerator.st,v 1.5 2005-04-19 14:30:56 cg Exp $'
! !
--- a/StatementNode.st Tue Apr 19 16:23:56 2005 +0200
+++ b/StatementNode.st Tue Apr 19 16:31:12 2005 +0200
@@ -172,14 +172,15 @@
nodeDo:anEnumerator
"helper for parse tree walking"
- |stats this|
+ |stats this expr|
"/ too stupid: ST/X statements are linked as a list ...
stats := OrderedCollection new.
this := self.
[this notNil] whileTrue:[
- stats add:this expression.
+ expr := this expression.
+ stats add:expr.
this := this nextStatement
].
^ anEnumerator doSequence:self temporaries:#() statements:stats
@@ -274,5 +275,5 @@
!StatementNode class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libcomp/StatementNode.st,v 1.29 2004-03-29 13:43:51 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/StatementNode.st,v 1.30 2005-04-19 14:31:05 cg Exp $'
! !