4
|
1 |
"{ Package: 'stx:goodies/petitparser' }"
|
0
|
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:
|
4
|
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.'
|
0
|
16 |
!
|
|
17 |
|
|
18 |
|
|
19 |
!PPPredicateParser methodsFor:'accessing'!
|
|
20 |
|
|
21 |
block
|
|
22 |
"Answer the predicate block of the receiver."
|
4
|
23 |
|
0
|
24 |
^ predicate
|
|
25 |
!
|
|
26 |
|
|
27 |
message
|
|
28 |
"Answer the failure message."
|
4
|
29 |
|
0
|
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
|
4
|
43 |
^ '$Id: PPPredicateParser.st,v 1.2 2012-01-13 11:22:50 cg Exp $'
|
0
|
44 |
! !
|