67 |
67 |
68 hash |
68 hash |
69 ^ super hash bitXor: parser hash |
69 ^ super hash bitXor: parser hash |
70 ! ! |
70 ! ! |
71 |
71 |
72 !PPCUnknownNode methodsFor:'compiling'! |
|
73 |
|
74 compileWith: compiler effect: effect id: id |
|
75 | compiledChild compiledParser | |
|
76 compiler startMethod: id. |
|
77 |
|
78 compiledParser := parser copy. |
|
79 "Compile all the children and call compiled version of them instead of the original one" |
|
80 compiledParser children do: [ :child | |
|
81 compiledChild := child compileWith: compiler. |
|
82 compiledParser replace: child with: compiledChild bridge. |
|
83 ]. |
|
84 |
|
85 compiler addConstant: compiledParser as: id. |
|
86 |
|
87 compiler addVariable: 'retval'. |
|
88 compiler add: 'self clearError.'. |
|
89 compiler add: '(retval := ', id, ' parseOn: context) isPetitFailure'. |
|
90 compiler indent. |
|
91 compiler add: ' ifTrue: [self error: retval message at: retval position ].'. |
|
92 compiler dedent. |
|
93 compiler add: 'error := retval isPetitFailure.'. |
|
94 compiler add: '^ retval'. |
|
95 ^ compiler stopMethod. |
|
96 ! ! |
|
97 |
|
98 !PPCUnknownNode methodsFor:'transformation'! |
72 !PPCUnknownNode methodsFor:'transformation'! |
99 |
73 |
100 replace: node with: anotherNode |
74 replace: node with: anotherNode |
101 parser replace: node with: anotherNode |
75 parser replace: node with: anotherNode |
|
76 ! ! |
|
77 |
|
78 !PPCUnknownNode methodsFor:'visiting'! |
|
79 |
|
80 accept: visitor |
|
81 ^ visitor visitUnknownNode: self |
102 ! ! |
82 ! ! |
103 |
83 |
104 !PPCUnknownNode class methodsFor:'documentation'! |
84 !PPCUnknownNode class methodsFor:'documentation'! |
105 |
85 |
106 version_HG |
86 version_HG |