"{ Package: 'stx:goodies/petitparser' }"
PPDelegateParser subclass:#PPEndOfInputParser
instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
category:'PetitParser-Parsers'
!
PPEndOfInputParser comment:'A parser that succeeds only at the end of the input stream.'
!
!PPEndOfInputParser methodsFor:'operations'!
end
^ self
! !
!PPEndOfInputParser methodsFor:'parsing'!
parseOn: aStream
| position result |
position := aStream position.
result := parser parseOn: aStream.
(result isPetitFailure or: [ aStream atEnd ])
ifTrue: [ ^ result ].
result := PPFailure
message: 'end of input expected'
at: aStream position.
aStream position: position.
^ result
! !
!PPEndOfInputParser class methodsFor:'documentation'!
version_SVN
^ '$Id: PPEndOfInputParser.st,v 1.2 2012-01-13 11:22:50 cg Exp $'
! !