--- a/compiler/PPCActionNode.st Tue Apr 21 17:20:11 2015 +0100
+++ b/compiler/PPCActionNode.st Thu Apr 30 23:43:14 2015 +0200
@@ -9,47 +9,9 @@
category:'PetitCompiler-Nodes'
!
-!PPCActionNode methodsFor:'as yet unclassified'!
-
-asFast
- ^ PPCTokenActionNode new
- child: child;
- properties: properties;
- name: self name;
- yourself
-!
+!PPCActionNode methodsFor:'visiting'!
-compileWith: compiler effect: effect id: id
- | |
- compiler addConstant: block as: id.
-
- compiler startMethod: id.
- compiler addVariable: 'element'.
- compiler add: 'element := '.
- compiler callOnLine: (child compileWith: compiler).
- compiler add: 'error ifFalse: [ ^ ', id, ' value: element ].'.
- compiler add: '^ failure'.
- ^ compiler stopMethod.
-!
-
-rewrite: changeStatus
- (self hasProperty: #trimmingToken) ifTrue: [
- changeStatus change.
- ^ PPCTrimmingTokenNode new
- name: name;
- child: child children second child; "Oups, what a chain"
- tokenClass: child children second tokenClass;
- whitespace: child children first;
- yourself
- ].
-
- block isSymbol ifTrue: [
- changeStatus change.
- ^ PPCSymbolActionNode new
- block: block;
- name: name;
- child: child;
- yourself
- ]
+accept: visitor
+ ^ visitor visitActionNode: self
! !