PPNotParser.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sat, 05 May 2012 00:01:37 +0200
changeset 23 93f28e32de35
parent 4 90de244a7fa2
child 43 4bc103d5f559
permissions -rw-r--r--
Checkin from browser

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

PPDelegateParser subclass:#PPNotParser
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'PetitParser-Parsers'
!

PPNotParser comment:'The not-predicate, a parser that succeeds whenever its delegate does not, but consumes no input [Parr 1994, 1995].'
!


!PPNotParser methodsFor:'parsing'!

parseOn: aStream
	| element position |
	position := aStream position.
	element := parser parseOn: aStream.
	aStream position: position.
	^ element isPetitFailure
		ifFalse: [ PPFailure message: '' at: aStream position ]
! !

!PPNotParser class methodsFor:'documentation'!

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