compiler/PPCMessagePredicateNode.st
changeset 438 20598d7ce9fa
parent 422 116d2b2af905
child 452 9f4558b3be66
equal deleted inserted replaced
437:54b3bc9e3987 438:20598d7ce9fa
     9 	category:'PetitCompiler-Nodes'
     9 	category:'PetitCompiler-Nodes'
    10 !
    10 !
    11 
    11 
    12 !PPCMessagePredicateNode methodsFor:'accessing'!
    12 !PPCMessagePredicateNode methodsFor:'accessing'!
    13 
    13 
    14 asInlined
       
    15 	^ PPCInlineMessagePredicateNode new
       
    16 		message: message;
       
    17 		predicate: predicate;
       
    18 		name: name;
       
    19 		yourself
       
    20 !
       
    21 
       
    22 message
    14 message
    23 	
    15 	
    24 	^ message
    16 	^ message
    25 !
    17 !
    26 
    18 
    27 message: anObject
    19 message: anObject
    28 	
    20 	
    29 	message := anObject
    21 	message := anObject
    30 ! !
    22 ! !
    31 
    23 
    32 !PPCMessagePredicateNode methodsFor:'as yet unclassified'!
    24 !PPCMessagePredicateNode methodsFor:'analysis'!
    33 
    25 
    34 bodyOfPredicate: compiler
    26 firstCharSet
    35 	compiler addOnLine: '(context peek ', self message, ')'.
    27 	^ PPCharSetPredicate on: [:e | e perform: message ]
    36 	compiler indent.
    28 
    37 	compiler add: 'ifFalse: [ self error: ''predicate not found'' ]'.
    29     "Modified: / 23-04-2015 / 22:13:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    38 	compiler add: 'ifTrue: [ context next ].'.
       
    39 	compiler dedent.
       
    40 ! !
    30 ! !
    41 
    31 
    42 !PPCMessagePredicateNode methodsFor:'comparing'!
    32 !PPCMessagePredicateNode methodsFor:'comparing'!
    43 
    33 
    44 = anotherNode
    34 = anotherNode
    48 
    38 
    49 hash
    39 hash
    50 	^ super hash bitXor: message hash
    40 	^ super hash bitXor: message hash
    51 ! !
    41 ! !
    52 
    42 
       
    43 !PPCMessagePredicateNode methodsFor:'visiting'!
       
    44 
       
    45 accept: visitor
       
    46 	^ visitor visitMessagePredicateNode: self
       
    47 ! !
       
    48