compiler/PPCNode.st
changeset 422 116d2b2af905
parent 421 7e08b31e0dae
child 438 20598d7ce9fa
--- a/compiler/PPCNode.st	Mon Nov 24 00:09:23 2014 +0000
+++ b/compiler/PPCNode.st	Wed Apr 15 11:28:09 2015 +0100
@@ -1,5 +1,7 @@
 "{ Package: 'stx:goodies/petitparser/compiler' }"
 
+"{ NameSpace: Smalltalk }"
+
 Object subclass:#PPCNode
 	instanceVariableNames:'contextFree name firstFollowCache firstCharSet properties'
 	classVariableNames:''
@@ -369,30 +371,27 @@
 !
 
 doOptimizationLoop: params status: changeStatus
-        | mapping optimized root |
-        mapping := IdentityDictionary new.
-        self allNodes do: [ :node |
-                optimized := (node optimize: params status: changeStatus).
-                (optimized ~= node) ifTrue: [  
-                        mapping at: node put: optimized.
-                ].
-        ].
-        
-        root := mapping at: self ifAbsent: [ self ].
-        [  | changed |
-                changed := false.
-                root allNodes do: [ :node |
-                        node children do: [ :child | 
-                                mapping at: child ifPresent: [:newChild | 
-                                        node replace: child with: newChild.
-                                        changed := true.
-                                        changeStatus change]
-                ]].
-                changed 
-        ] whileTrue.
-        ^ root
-
-    "Modified: / 26-10-2014 / 01:14:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+	| mapping optimized root |
+	mapping := IdentityDictionary new.
+	self allNodes do: [ :node |
+		optimized := (node optimize: params status: changeStatus).
+		(optimized ~= node) ifTrue: [  
+			mapping at: node put: optimized.
+		].
+	].
+	
+	root := mapping at: self ifAbsent: [ self ].
+	[  | changed |
+		changed := false.
+		root allNodes do: [ :node |
+			node children do: [ :child | 
+				mapping at: child ifPresent: [:newChild | 
+					node replace: child with: newChild.
+					changed := true ]
+		]].
+		changed 
+	] whileTrue.
+	^ root
 !
 
 inline: changeStatus
@@ -477,10 +476,6 @@
 	aBlock value: self.
 	self children
 		do: [ :each | each allParsersDo: aBlock seen: aSet ]
-!
-
-firstSets: aFirstDictionary into: aSet
-	self children do: [ :child | aSet addAll: (aFirstDictionary at: child) ]
 ! !
 
 !PPCNode methodsFor:'transformation'!