--- 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
! !