equal
deleted
inserted
replaced
|
1 "{ Package: 'stx:goodies/petitparser/compiler' }" |
|
2 |
|
3 "{ NameSpace: Smalltalk }" |
|
4 |
|
5 PPActionParser subclass:#PPMappedActionParser |
|
6 instanceVariableNames:'' |
|
7 classVariableNames:'' |
|
8 poolDictionaries:'' |
|
9 category:'PetitCompiler-Parsers' |
|
10 ! |
|
11 |
|
12 !PPMappedActionParser methodsFor:'converting'! |
|
13 |
|
14 asCompilerNode |
|
15 ^ PPCMappedActionNode new |
|
16 name: self name; |
|
17 block: block; |
|
18 child: parser; |
|
19 properties: properties; |
|
20 parser: self; |
|
21 yourself |
|
22 |
|
23 "Created: / 02-06-2015 / 17:27:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
24 ! ! |
|
25 |
|
26 !PPMappedActionParser methodsFor:'parsing'! |
|
27 |
|
28 parseOn: aPPContext |
|
29 | element | |
|
30 ^ (element := parser parseOn: aPPContext) isPetitFailure |
|
31 ifFalse: [ block valueWithArguments: element ] |
|
32 ifTrue: [ element ] |
|
33 |
|
34 "Created: / 02-06-2015 / 17:15:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
35 ! ! |
|
36 |