author | Patrik Svestka <patrik.svestka@gmail.com> |
Wed, 14 Nov 2018 13:01:14 +0100 | |
changeset 642 | 77d5fddb6462 |
parent 421 | 7e08b31e0dae |
permissions | -rw-r--r-- |
4 | 1 |
"{ Package: 'stx:goodies/petitparser' }" |
0 | 2 |
|
3 |
PPParser subclass:#PPListParser |
|
4 |
instanceVariableNames:'parsers' |
|
5 |
classVariableNames:'' |
|
6 |
poolDictionaries:'' |
|
7 |
category:'PetitParser-Parsers' |
|
8 |
! |
|
9 |
||
10 |
||
11 |
!PPListParser class methodsFor:'instance creation'! |
|
12 |
||
13 |
with: aParser |
|
14 |
^ self withAll: (Array with: aParser) |
|
15 |
! |
|
16 |
||
17 |
with: aFirstParser with: aSecondParser |
|
18 |
^ self withAll: (Array with: aFirstParser with: aSecondParser) |
|
19 |
! |
|
20 |
||
21 |
withAll: aCollection |
|
421
7e08b31e0dae
Merged JK's version from Monticello
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
22 |
^ self basicNew initialize; |
7e08b31e0dae
Merged JK's version from Monticello
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
169
diff
changeset
|
23 |
setParsers: aCollection |
0 | 24 |
! ! |
25 |
||
169 | 26 |
|
27 |
||
28 |
||
0 | 29 |
!PPListParser methodsFor:'accessing'! |
30 |
||
31 |
children |
|
32 |
^ parsers |
|
33 |
! ! |
|
34 |
||
35 |
!PPListParser methodsFor:'copying'! |
|
36 |
||
37 |
copyWith: aParser |
|
38 |
^ self species withAll: (parsers copyWith: aParser) |
|
39 |
! |
|
40 |
||
41 |
postCopy |
|
42 |
super postCopy. |
|
43 |
parsers := parsers copy |
|
44 |
! ! |
|
45 |
||
46 |
!PPListParser methodsFor:'initialization'! |
|
47 |
||
48 |
initialize |
|
49 |
super initialize. |
|
50 |
self setParsers: #() |
|
51 |
! |
|
52 |
||
53 |
setParsers: aCollection |
|
54 |
parsers := aCollection asArray |
|
55 |
! ! |
|
56 |
||
57 |
!PPListParser class methodsFor:'documentation'! |
|
58 |
||
56 | 59 |
version |
169 | 60 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/PPListParser.st,v 1.4 2014-03-04 14:32:58 cg Exp $' |
56 | 61 |
! |
62 |
||
63 |
version_CVS |
|
169 | 64 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/PPListParser.st,v 1.4 2014-03-04 14:32:58 cg Exp $' |
56 | 65 |
! |
66 |
||
0 | 67 |
version_SVN |
169 | 68 |
^ '$Id: PPListParser.st,v 1.4 2014-03-04 14:32:58 cg Exp $' |
0 | 69 |
! ! |
169 | 70 |