PPMemento.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 04 May 2012 23:58:48 +0200
changeset 10 cbaaa689fab2
parent 4 90de244a7fa2
child 19 4247b85d8584
permissions -rw-r--r--
Checkin from browser

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

Object subclass:#PPMemento
	instanceVariableNames:'result count position'
	classVariableNames:''
	poolDictionaries:''
	category:'PetitParser-Core'
!

PPMemento comment:'PPMemento is an internal class used by PPMemoizedParser to cache results and detect left-recursive calls.
Instance Variables:
	result  <Object>        The cached result.
	count   <Integer>       The number of recursive cycles followed.
	position        <Integer>       The position of the cached result in the input stream.'
!


!PPMemento class methodsFor:'instance creation'!

new
	^ self basicNew initialize
! !

!PPMemento methodsFor:'accessing'!

position
	^ position
!

position: anInteger
	position := anInteger
!

result
	^ result
!

result: anObject
	result := anObject
! !

!PPMemento methodsFor:'accessing-readonly'!

count
	^ count
! !

!PPMemento methodsFor:'actions'!

increment
	count := count + 1
! !

!PPMemento methodsFor:'initialization'!

initialize
	count := 0

! !

!PPMemento class methodsFor:'documentation'!

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