PPFlattenParser.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 04 May 2012 23:59:52 +0200
changeset 15 421e0a6582d4
parent 4 90de244a7fa2
child 165 7df471ff9ea5
permissions -rw-r--r--
Checkin from browser

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

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


!PPFlattenParser methodsFor:'hooks'!

create: aCollection start: aStartInteger stop: aStopInteger
	^ aCollection copyFrom: aStartInteger to: aStopInteger
! !

!PPFlattenParser methodsFor:'parsing'!

parseOn: aStream
	| start element stop |
	start := aStream position.
	element := parser parseOn: aStream.
	element isPetitFailure ifTrue: [
		aStream position: start.
		^ element ].
	stop := aStream position.
	^ self create: aStream collection start: start + 1 stop: stop
! !

!PPFlattenParser class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPFlattenParser.st,v 1.3 2012-05-04 21:59:52 vrany Exp $'
!

version_CVS
    ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPFlattenParser.st,v 1.3 2012-05-04 21:59:52 vrany Exp $'
!

version_SVN
    ^ 'žId: PPFlattenParser.st 2 2010-12-17 18:44:23Z vranyj1 ž'
! !