Portability fixes
* do not use Object>>asString. Not all Smalltalks implement it.
* do not use Object>>name. Not all Smalltalks implement it.
* do not use Dictionary keysAndValuesRemove:. Not all Smalltalks implement it.
* do not use Class>>methods The semantics is different among Smalltalks.
Use `Class methodDictionary values` instead.
* do not modify dictionary in #at:ifAbsentPut: block!
"{ Package: 'stx:goodies/petitparser/compiler' }"
"{ NameSpace: Smalltalk }"
PEGFsaTransition subclass:#PEGFsaPredicateTransition
instanceVariableNames:'predicate'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-FSA'
!
!PEGFsaPredicateTransition methodsFor:'accessing'!
predicate
^ predicate
!
predicate: anObject
predicate := anObject
! !
!PEGFsaPredicateTransition methodsFor:'comparing'!
equals: anotherTransition
(super equals: anotherTransition) ifFalse: [ ^ false ].
(predicate asString = anotherTransition predicate asString) ifFalse: [ ^ false ].
^ true
! !
!PEGFsaPredicateTransition methodsFor:'gt'!
gtName
| gtName |
gtName := self predicate asString.
priority < 0 ifTrue: [ gtName := gtName, ',', priority asString ].
^ gtName
! !
!PEGFsaPredicateTransition methodsFor:'set operations'!
intersection: transition
| intersection |
intersection := Array new: 255 withAll: false.
^ intersection
! !
!PEGFsaPredicateTransition methodsFor:'testing'!
accepts: character
self assert: character isCharacter.
^ self acceptsCodePoint: character codePoint
!
acceptsCodePoint: codePoint
self assert: codePoint isInteger.
^ predicate value: codePoint
!
isCharacterTransition
^ false
!
isEOF
^ false
!
isPredicateTransition
^ true
!
overlapsWith: transition
^ false
! !