equal
deleted
inserted
replaced
|
1 "{ Package: 'squeak:petitparser' }" |
|
2 |
|
3 Object subclass:#PPMemento |
|
4 instanceVariableNames:'result count position' |
|
5 classVariableNames:'' |
|
6 poolDictionaries:'' |
|
7 category:'PetitParser-Core' |
|
8 ! |
|
9 |
|
10 PPMemento comment:'PPMemento is an internal class used by PPMemoizedParser to cache results and detect left-recursive calls. |
|
11 Instance Variables: |
|
12 result <Object> The cached result. |
|
13 count <Integer> The number of recursive cycles followed. |
|
14 position <Integer> The position of the cached result in the input stream.' |
|
15 ! |
|
16 |
|
17 |
|
18 !PPMemento class methodsFor:'instance creation'! |
|
19 |
|
20 new |
|
21 ^ self basicNew initialize |
|
22 ! ! |
|
23 |
|
24 !PPMemento methodsFor:'accessing'! |
|
25 |
|
26 position |
|
27 ^ position |
|
28 ! |
|
29 |
|
30 position: anInteger |
|
31 position := anInteger |
|
32 ! |
|
33 |
|
34 result |
|
35 ^ result |
|
36 ! |
|
37 |
|
38 result: anObject |
|
39 result := anObject |
|
40 ! ! |
|
41 |
|
42 !PPMemento methodsFor:'accessing-readonly'! |
|
43 |
|
44 count |
|
45 ^ count |
|
46 ! ! |
|
47 |
|
48 !PPMemento methodsFor:'actions'! |
|
49 |
|
50 increment |
|
51 count := count + 1 |
|
52 ! ! |
|
53 |
|
54 !PPMemento methodsFor:'initialization'! |
|
55 |
|
56 initialize |
|
57 count := 0 |
|
58 |
|
59 ! ! |
|
60 |
|
61 !PPMemento class methodsFor:'documentation'! |
|
62 |
|
63 version_SVN |
|
64 ^ '$Id: PPMemento.st,v 1.1 2011-08-18 18:56:17 cg Exp $' |
|
65 ! ! |