PPPredicateParser.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sat, 05 May 2012 00:00:04 +0200
changeset 16 3b8de4bf5696
parent 4 90de244a7fa2
child 23 93f28e32de35
permissions -rw-r--r--
Checkin from browser

"{ Package: 'stx:goodies/petitparser' }"

PPParser subclass:#PPPredicateParser
	instanceVariableNames:'predicate predicateMessage negated negatedMessage'
	classVariableNames:''
	poolDictionaries:''
	category:'PetitParser-Parsers'
!

PPPredicateParser comment:'An abstract parser that accepts if a given predicate holds.
Instance Variables:
	predicate       <BlockClosure>  The block testing for the predicate.
	predicateMessage        <String>        The error message of the predicate.
	negated <BlockClosure>  The block testing for the negation of the predicate.
	negatedMessage  <String>        The error message of the negated predicate.'
!


!PPPredicateParser methodsFor:'accessing'!

block
	"Answer the predicate block of the receiver."

	^ predicate
!

message
	"Answer the failure message."

	^ predicateMessage
! !

!PPPredicateParser methodsFor:'printing'!

printNameOn: aStream
	super printNameOn: aStream.
	aStream nextPutAll: ', '; print: predicateMessage
! !

!PPPredicateParser class methodsFor:'documentation'!

version_SVN
    ^ '$Id: PPPredicateParser.st,v 1.2 2012-01-13 11:22:50 cg Exp $'
! !