compiler/PPCStarNode.st
changeset 438 20598d7ce9fa
parent 422 116d2b2af905
child 452 9f4558b3be66
--- a/compiler/PPCStarNode.st	Tue Apr 21 17:20:11 2015 +0100
+++ b/compiler/PPCStarNode.st	Thu Apr 30 23:43:14 2015 +0200
@@ -21,34 +21,6 @@
 
 prefix
 	^ #star
-!
-
-rewrite: changeStatus
-	(child isKindOf: PPCMessagePredicateNode) ifTrue: [ 
-		changeStatus change.
-		^ PPCStarMessagePredicateNode new
-			name: name;
-			child: child;
-			message: child message;
-			yourself
-	]. 
-
-	(child isKindOf: PPCAnyNode) ifTrue: [ 
-		changeStatus change.
-		^ PPCStarAnyNode new
-			name: name;
-			child: child;
-			yourself
-	]. 
-
-	(child isKindOf: PPCCharSetPredicateNode) ifTrue: [ 
-		changeStatus change.
-		^ PPCStarCharSetPredicateNode new
-			name: name;
-			predicate: child predicate;
-			child: child;
-			yourself
-	] 
 ! !
 
 !PPCStarNode methodsFor:'analyzing'!
@@ -57,28 +29,6 @@
 	^ true
 ! !
 
-!PPCStarNode methodsFor:'as yet unclassified'!
-
-compileWith: compiler effect: effect id: id
-	compiler startMethod: id.
-	compiler addVariable: 'retval'.
-	compiler addVariable: 'element'.
-
-	compiler add: 'retval := OrderedCollection new.'.
-	compiler add: 'element := '.
-	compiler callOnLine: (child compileWith: compiler).
-	compiler add: '[ error ] whileFalse: ['.
-	compiler indent.
-	compiler add: 'retval add: element.'.
-	compiler add: 'element := '.
-	compiler callOnLine: (child compileWith: compiler).
-	compiler dedent.
-	compiler add: '].'.
-	compiler add: 'self clearError.'.
-	compiler add: '^ retval asArray'.
- ^ compiler stopMethod.
-! !
-
 !PPCStarNode methodsFor:'first follow next'!
 
 followSets: aFollowDictionary firstSets: aFirstDictionary into: aSet suchThat: aBlock
@@ -86,6 +36,15 @@
 	super followSets: aFollowDictionary firstSets:  aFirstDictionary into: aSet suchThat: aBlock.
 	
 	first := aFirstDictionary at: self.
-	(aFollowDictionary at: child) addAll: (first reject: [:each | each isNullable])
+
+	self children do: [ :el | 
+		(aFollowDictionary at: el) addAll: (first reject: [:each | each isNullable])
+	]
 ! !
 
+!PPCStarNode methodsFor:'visiting'!
+
+accept: visitor
+	^ visitor visitStarNode: self
+! !
+