PPMemento.st
author Claus Gittinger <cg@exept.de>
Mon, 12 Sep 2011 19:47:59 +0200
changeset 2 acb3822c73db
parent 0 739fe9b7253e
child 4 90de244a7fa2
permissions -rw-r--r--
initial checkin

"{ Package: 'squeak: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.1 2011-08-18 18:56:17 cg Exp $'
! !