compiler/PPCAbstractPredicateNode.st
changeset 452 9f4558b3be66
parent 438 20598d7ce9fa
child 515 b5316ef15274
--- a/compiler/PPCAbstractPredicateNode.st	Thu Apr 30 23:43:14 2015 +0200
+++ b/compiler/PPCAbstractPredicateNode.st	Sun May 10 06:28:36 2015 +0100
@@ -12,43 +12,56 @@
 !PPCAbstractPredicateNode methodsFor:'accessing'!
 
 predicate
-	
-	^ predicate
+    
+    ^ predicate
 !
 
 predicate: anObject
-	
-	predicate := anObject
+    
+    predicate := anObject
 !
 
 prefix
-	^ #predicate
+    ^ #predicate
 ! !
 
 !PPCAbstractPredicateNode methodsFor:'analysis'!
 
 acceptsEpsilon
-	^ false
+    ^ false
 !
 
 firstCharSet
-	^ PPCharSetPredicate on: predicate
+    ^ PPCharSetPredicate on: predicate
 ! !
 
 !PPCAbstractPredicateNode methodsFor:'comparing'!
 
 = anotherNode
-	super = anotherNode ifFalse: [ ^ false ].
-	^ predicate = anotherNode predicate.
+    super = anotherNode ifFalse: [ ^ false ].
+    ^ predicate = anotherNode predicate.
 !
 
 hash
-	^ super hash bitXor: predicate hash
+    ^ super hash bitXor: predicate hash
+!
+
+recognizedSentencesPrim
+    | retval |
+
+    retval := OrderedCollection new.
+    "TODO JK: Works only for ASCII :("
+    1 to: 255 do: [ :i |
+        (predicate value: (Character codePoint: i)) ifTrue: [ 
+            retval add: (Character codePoint: i) asString 
+        ]
+    ].
+    ^ retval
 ! !
 
 !PPCAbstractPredicateNode methodsFor:'compiling'!
 
 extendClassification: classification
-	^ (classification asOrderedCollection addLast: false; yourself) asArray
+    ^ (classification asOrderedCollection addLast: false; yourself) asArray
 ! !