compiler/PEGFsaFailure.st
changeset 515 b5316ef15274
parent 502 1e45d3c96ec5
equal deleted inserted replaced
502:1e45d3c96ec5 515:b5316ef15274
     1 "{ Package: 'stx:goodies/petitparser/compiler' }"
     1 "{ Package: 'stx:goodies/petitparser/compiler' }"
     2 
     2 
     3 "{ NameSpace: Smalltalk }"
     3 "{ NameSpace: Smalltalk }"
     4 
     4 
     5 Object subclass:#PEGFsaFailure
     5 Object subclass:#PEGFsaFailure
     6 	instanceVariableNames:'message'
     6 	instanceVariableNames:'retval'
     7 	classVariableNames:''
     7 	classVariableNames:''
     8 	poolDictionaries:''
     8 	poolDictionaries:''
     9 	category:'PetitCompiler-FSA'
     9 	category:'PetitCompiler-FSA'
    10 !
    10 !
    11 
    11 
       
    12 PEGFsaFailure class instanceVariableNames:'Instance'
       
    13 
       
    14 "
       
    15  No other class instance variables are inherited by this class.
       
    16 "
       
    17 !
       
    18 
       
    19 !PEGFsaFailure class methodsFor:'as yet unclassified'!
       
    20 
       
    21 on: retval
       
    22     ^ (self new)
       
    23         retval: retval;
       
    24         yourself
       
    25 ! !
       
    26 
       
    27 !PEGFsaFailure methodsFor:'accessing'!
       
    28 
       
    29 retval
       
    30     ^ retval
       
    31 !
       
    32 
       
    33 retval: anObject
       
    34     retval := anObject
       
    35 !
       
    36 
       
    37 value
       
    38     ^ retval
       
    39 ! !
       
    40 
       
    41 !PEGFsaFailure methodsFor:'comparing'!
       
    42 
       
    43 = anotherFailure
       
    44     (self == anotherFailure) ifTrue: [ ^ true ].
       
    45     self class == anotherFailure class ifFalse: [ ^ false ].
       
    46     
       
    47     ^ (self retval == anotherFailure retval)
       
    48 !
       
    49 
       
    50 hash
       
    51     ^ self retval hash
       
    52 ! !
       
    53 
       
    54 !PEGFsaFailure methodsFor:'printing'!
       
    55 
       
    56 printOn: aStream
       
    57     super printOn: aStream.
       
    58     aStream nextPut: $(.
       
    59     retval printOn: aStream.
       
    60     aStream nextPut: $).
       
    61 ! !
       
    62 
       
    63 !PEGFsaFailure methodsFor:'testing'!
       
    64 
       
    65 isFsaFailure
       
    66     ^ true
       
    67 ! !
       
    68