- added acceptVisior:
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 26 Jul 2011 00:35:50 +0200
changeset 2603 342b2361b791
parent 2602 abf07802e67f
child 2604 d5a9c6f694df
- added acceptVisior: - nodes now keeps their parent
AssignmentNode.st
--- a/AssignmentNode.st	Tue Jul 26 00:35:40 2011 +0200
+++ b/AssignmentNode.st	Tue Jul 26 00:35:50 2011 +0200
@@ -74,7 +74,12 @@
 !
 
 expression:something
+
+    expression notNil ifTrue:[expression parent: nil].
     expression := something.
+    expression notNil ifTrue:[expression parent: self].
+
+    "Modified: / 20-07-2011 / 19:48:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 lineNr
@@ -108,13 +113,23 @@
 !
 
 variable:something
+
+    variable notNil ifTrue:[variable parent: nil].
     variable := something.
+    variable notNil ifTrue:[variable parent: self].
+
+    "Modified: / 20-07-2011 / 19:48:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 variable:v expression:e
 
+    variable notNil ifTrue:[variable parent: nil].
     variable := v.
+    variable notNil ifTrue:[variable parent: self].
+
+    expression notNil ifTrue:[expression parent: nil].
     expression := e.
+    expression notNil ifTrue:[expression parent: self].
 
     "/ any block, which gets assigned to something
     "/ cannot be inlined.
@@ -123,6 +138,7 @@
     ]
 
     "Modified: / 22-02-2011 / 12:52:56 / Jakub <zelenja7@fel.cvut.cz>"
+    "Modified: / 20-07-2011 / 19:49:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !AssignmentNode methodsFor:'code generation'!
@@ -310,12 +326,23 @@
     ^ true
 ! !
 
+!AssignmentNode methodsFor:'visiting'!
+
+acceptVisitor:aVisitor 
+    "Double dispatch back to the visitor, passing my type encoded in
+     the selector (visitor pattern)"
+
+    "stub code automatically generated - please change if required"
+
+    ^ aVisitor visitAssignmentNode:self
+! !
+
 !AssignmentNode class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libcomp/AssignmentNode.st,v 1.41 2011-06-28 20:17:34 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/AssignmentNode.st,v 1.42 2011-07-25 22:35:50 vrany Exp $'
 !
 
 version_SVN
-    ^ ' Id '
+    ^ '§ Id §'
 ! !