compiler/tests/extras/PPCLRPWildcardTransition.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 17 Aug 2015 23:11:56 +0100
changeset 518 a6d8b93441b0
parent 511 527038bc8edf
permissions -rw-r--r--
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/tests/extras' }"

"{ NameSpace: Smalltalk }"

PPCLRPTransition subclass:#PPCLRPWildcardTransition
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'PetitCompiler-Extras-Tests-LRP'
!


!PPCLRPWildcardTransition class methodsFor:'instance creation'!

on: anEvent from: startState to: endState name: aString

    self error: 'Wildcard transitions have no from state. Use on:to:name: instead.'
!

on: anEvent to: endState name: aString
    |retval|
    retval := self new.
    retval eventname: anEvent.
    retval from: '*'.
    retval to: endState.
    retval name: aString.
    ^ retval.
! !

!PPCLRPWildcardTransition methodsFor:'printing'!

printOn: aStream

    aStream nextPutAll: 'PPCLRPWildcardTransition '.
    aStream nextPutAll: self name.
    aStream nextPutAll: ' : *->'.
    aStream nextPutAll: self to.
    aStream nextPutAll: ' on '.
    aStream nextPutAll: self eventname.
    
! !

!PPCLRPWildcardTransition class methodsFor:'documentation'!

version_HG

    ^ '$Changeset: <not expanded> $'
! !