PPMemento.st
author Claus Gittinger <cg@exept.de>
Fri, 13 Jan 2012 12:24:08 +0100
changeset 5 804a351a9415
parent 4 90de244a7fa2
child 19 4247b85d8584
permissions -rw-r--r--
*** empty log message ***

"{ 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 $'
! !