0
|
1 |
"{ Package: 'squeak:petitparser' }"
|
|
2 |
|
|
3 |
PPFlattenParser subclass:#PPTokenParser
|
|
4 |
instanceVariableNames:'tokenClass'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'PetitParser-Parsers'
|
|
8 |
!
|
|
9 |
|
|
10 |
PPTokenParser comment:'A parser that answers a token of the range my delegate parses.
|
|
11 |
Instance Variables:
|
|
12 |
tokenClass <PPToken class> The token sub-class to be used.'
|
|
13 |
!
|
|
14 |
|
|
15 |
|
|
16 |
!PPTokenParser methodsFor:'accessing'!
|
|
17 |
|
|
18 |
tokenClass
|
|
19 |
^ tokenClass
|
|
20 |
!
|
|
21 |
|
|
22 |
tokenClass: aTokenClass
|
|
23 |
tokenClass := aTokenClass
|
|
24 |
! !
|
|
25 |
|
|
26 |
!PPTokenParser methodsFor:'initialization'!
|
|
27 |
|
|
28 |
initialize
|
|
29 |
tokenClass := self defaultTokenClass
|
|
30 |
|
|
31 |
! !
|
|
32 |
|
|
33 |
!PPTokenParser methodsFor:'private'!
|
|
34 |
|
|
35 |
create: aCollection start: aStartInteger stop: aStopInteger
|
|
36 |
^ self tokenClass on: aCollection start: aStartInteger stop: aStopInteger
|
|
37 |
!
|
|
38 |
|
|
39 |
defaultTokenClass
|
|
40 |
^ PPToken
|
|
41 |
! !
|
|
42 |
|
|
43 |
!PPTokenParser class methodsFor:'documentation'!
|
|
44 |
|
|
45 |
version_SVN
|
|
46 |
^ '$Id: PPTokenParser.st,v 1.1 2011-08-18 18:56:17 cg Exp $'
|
|
47 |
! !
|