equal
deleted
inserted
replaced
|
1 "{ Package: 'stx:goodies/petitparser/compiler' }" |
|
2 |
|
3 PPCNode subclass:#PPCPluggableNode |
|
4 instanceVariableNames:'block' |
|
5 classVariableNames:'' |
|
6 poolDictionaries:'' |
|
7 category:'PetitCompiler-Nodes' |
|
8 ! |
|
9 |
|
10 PPCPluggableNode comment:'' |
|
11 ! |
|
12 |
|
13 !PPCPluggableNode methodsFor:'accessing'! |
|
14 |
|
15 block |
|
16 |
|
17 ^ block |
|
18 ! |
|
19 |
|
20 block: anObject |
|
21 |
|
22 block := anObject |
|
23 ! ! |
|
24 |
|
25 !PPCPluggableNode methodsFor:'as yet unclassified'! |
|
26 |
|
27 acceptsEpsilon |
|
28 ^ true |
|
29 ! |
|
30 |
|
31 acceptsEpsilonOpenSet: set |
|
32 ^ true |
|
33 ! |
|
34 |
|
35 asInlined |
|
36 ^ PPCInlinePluggableNode new |
|
37 name: name; |
|
38 block: block; |
|
39 yourself |
|
40 ! |
|
41 |
|
42 compileWith: compiler effect: effect id: id |
|
43 | blockId | |
|
44 blockId := compiler idFor: block prefixed: #block. |
|
45 |
|
46 compiler startMethod: id. |
|
47 compiler addConstant: block as: blockId. |
|
48 compiler add: '^ ', blockId, ' value: context.'. |
|
49 ^ compiler stopMethod. |
|
50 ! |
|
51 |
|
52 firstCharParser |
|
53 ^ block asParser |
|
54 ! |
|
55 |
|
56 prefix |
|
57 ^ #plug |
|
58 ! ! |
|
59 |