compiler/tests/extras/PPCLRPEpsilonTransition.st
changeset 511 527038bc8edf
equal deleted inserted replaced
510:869853decf31 511:527038bc8edf
       
     1 "{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }"
       
     2 
       
     3 "{ NameSpace: Smalltalk }"
       
     4 
       
     5 PPCLRPTransition subclass:#PPCLRPEpsilonTransition
       
     6 	instanceVariableNames:''
       
     7 	classVariableNames:''
       
     8 	poolDictionaries:''
       
     9 	category:'PetitCompiler-Extras-Tests-LRP'
       
    10 !
       
    11 
       
    12 !PPCLRPEpsilonTransition class methodsFor:'instance creation'!
       
    13 
       
    14 from: startState to: endState name: aString
       
    15     |retval|
       
    16     retval := self new.
       
    17     retval from: startState.
       
    18     retval to: endState.
       
    19     retval name: aString.
       
    20     ^ retval.
       
    21 !
       
    22 
       
    23 on: anEvent from: startState to: endState name: aString
       
    24 
       
    25     self error: 'Epsilon Transitions have no events. Use from:to:name: instead.'
       
    26 ! !
       
    27 
       
    28 !PPCLRPEpsilonTransition methodsFor:'printing'!
       
    29 
       
    30 printOn: aStream
       
    31 
       
    32     aStream nextPutAll: 'PPCLRPEpsilonTransition '.
       
    33     aStream nextPutAll: self name.
       
    34     aStream nextPutAll: ' : '.
       
    35     aStream nextPutAll: self from.
       
    36     aStream nextPutAll: '->'.
       
    37     aStream nextPutAll: self to.
       
    38 ! !
       
    39