4
|
1 |
"{ Package: 'stx:goodies/petitparser' }"
|
0
|
2 |
|
|
3 |
PPFlattenParser subclass:#PPTokenParser
|
|
4 |
instanceVariableNames:'tokenClass'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'PetitParser-Parsers'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
181
|
11 |
!PPTokenParser methodsFor:'*petitanalyzer-matching'!
|
|
12 |
|
|
13 |
match: aParser inContext: aDictionary seen: anIdentitySet
|
|
14 |
^ (super match: aParser inContext: aDictionary seen: anIdentitySet) and: [ self tokenClass = aParser tokenClass ]
|
|
15 |
! !
|
|
16 |
|
0
|
17 |
!PPTokenParser methodsFor:'accessing'!
|
|
18 |
|
|
19 |
tokenClass
|
|
20 |
^ tokenClass
|
|
21 |
!
|
|
22 |
|
|
23 |
tokenClass: aTokenClass
|
|
24 |
tokenClass := aTokenClass
|
|
25 |
! !
|
|
26 |
|
|
27 |
!PPTokenParser methodsFor:'initialization'!
|
|
28 |
|
|
29 |
initialize
|
|
30 |
tokenClass := self defaultTokenClass
|
16
|
31 |
|
0
|
32 |
! !
|
|
33 |
|
|
34 |
!PPTokenParser methodsFor:'private'!
|
|
35 |
|
|
36 |
create: aCollection start: aStartInteger stop: aStopInteger
|
|
37 |
^ self tokenClass on: aCollection start: aStartInteger stop: aStopInteger
|
|
38 |
!
|
|
39 |
|
|
40 |
defaultTokenClass
|
|
41 |
^ PPToken
|
181
|
42 |
!
|
|
43 |
|
|
44 |
on: aCollection start: aStartInteger stop: aStopInteger value: anObject
|
|
45 |
^ self tokenClass on: aCollection start: aStartInteger stop: aStopInteger value: anObject
|
0
|
46 |
! !
|
|
47 |
|
|
48 |
!PPTokenParser class methodsFor:'documentation'!
|
|
49 |
|
16
|
50 |
version
|
181
|
51 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/PPTokenParser.st,v 1.4 2014-03-04 14:33:27 cg Exp $'
|
16
|
52 |
!
|
|
53 |
|
|
54 |
version_CVS
|
181
|
55 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/PPTokenParser.st,v 1.4 2014-03-04 14:33:27 cg Exp $'
|
16
|
56 |
!
|
|
57 |
|
0
|
58 |
version_SVN
|
181
|
59 |
^ '$Id: PPTokenParser.st,v 1.4 2014-03-04 14:33:27 cg Exp $'
|
0
|
60 |
! !
|
181
|
61 |
|