compiler/PPCNotMessagePredicateNode.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 !PPCNotMessagePredicateNode methodsFor:'accessing'!
    12 !PPCNotMessagePredicateNode methodsFor:'accessing'!
    13 
    13 
    14 asInlined
       
    15 	^ PPCInlineNotMessagePredicateNode new
       
    16 		predicate: predicate;
       
    17 		message: message;
       
    18 		name: name;
       
    19 		yourself
       
    20 !
       
    21 
       
    22 firstCharSet
       
    23 	PPCharSetPredicate on: [:e | (predicate value:e)  not ] 
       
    24 !
       
    25 
       
    26 message
    14 message
    27 	
    15 	
    28 	^ message
    16 	^ message
    29 !
    17 !
    30 
    18 
    31 message: anObject
    19 message: anObject
    32 	
    20 	
    33 	message := anObject
    21 	message := anObject
    34 ! !
    22 ! !
    35 
    23 
    36 !PPCNotMessagePredicateNode methodsFor:'as yet unclassified'!
    24 !PPCNotMessagePredicateNode methodsFor:'analysis'!
    37 
    25 
    38 bodyOfPredicate: compiler
    26 firstCharSet
    39 	compiler addOnLine: '(context peek ', message, ')'.
    27 	^ PPCharSetPredicate on: [:e | (predicate value:e)  not ]
    40 	compiler indent.
    28 
    41 	compiler add: ' ifTrue: [ self error: '' predicate not expected'' ]'.
    29     "Modified: / 23-04-2015 / 22:11:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    42 	compiler add: ' ifFalse: [ nil ].'.
       
    43 	compiler dedent.
       
    44 ! !
    30 ! !
    45 
    31 
    46 !PPCNotMessagePredicateNode methodsFor:'comparison'!
    32 !PPCNotMessagePredicateNode methodsFor:'comparison'!
    47 
    33 
    48 = anotherNode
    34 = anotherNode
    52 
    38 
    53 hash
    39 hash
    54 	^ super hash bitXor: message hash
    40 	^ super hash bitXor: message hash
    55 ! !
    41 ! !
    56 
    42 
       
    43 !PPCNotMessagePredicateNode methodsFor:'visiting'!
       
    44 
       
    45 accept: visitor
       
    46 	^ visitor visitNotMessagePredicateNode: self
       
    47 ! !
       
    48