PPPredicateParser.st
changeset 0 739fe9b7253e
child 4 90de244a7fa2
equal deleted inserted replaced
-1:000000000000 0:739fe9b7253e
       
     1 "{ Package: 'squeak:petitparser' }"
       
     2 
       
     3 PPParser subclass:#PPPredicateParser
       
     4 	instanceVariableNames:'predicate predicateMessage negated negatedMessage'
       
     5 	classVariableNames:''
       
     6 	poolDictionaries:''
       
     7 	category:'PetitParser-Parsers'
       
     8 !
       
     9 
       
    10 PPPredicateParser comment:'An abstract parser that accepts if a given predicate holds.
       
    11 Instance Variables:
       
    12 	predicate	<BlockClosure>	The block testing for the predicate.
       
    13 	predicateMessage	<String>	The error message of the predicate.
       
    14 	negated	<BlockClosure>	The block testing for the negation of the predicate.
       
    15 	negatedMessage	<String>	The error message of the negated predicate.'
       
    16 !
       
    17 
       
    18 
       
    19 !PPPredicateParser methodsFor:'accessing'!
       
    20 
       
    21 block
       
    22 	"Answer the predicate block of the receiver."
       
    23 	
       
    24 	^ predicate
       
    25 !
       
    26 
       
    27 message
       
    28 	"Answer the failure message."
       
    29 	
       
    30 	^ predicateMessage
       
    31 ! !
       
    32 
       
    33 !PPPredicateParser methodsFor:'printing'!
       
    34 
       
    35 printNameOn: aStream
       
    36 	super printNameOn: aStream.
       
    37 	aStream nextPutAll: ', '; print: predicateMessage
       
    38 ! !
       
    39 
       
    40 !PPPredicateParser class methodsFor:'documentation'!
       
    41 
       
    42 version_SVN
       
    43     ^ '$Id: PPPredicateParser.st,v 1.1 2011-08-18 18:56:17 cg Exp $'
       
    44 ! !