PPMemento.st
changeset 0 739fe9b7253e
child 4 90de244a7fa2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PPMemento.st	Thu Aug 18 20:56:17 2011 +0200
@@ -0,0 +1,65 @@
+"{ 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 $'
+! !