- public void finish(Reduction r, Forest result, GSS.Phase target, Forest[] holder) {
- State state0 = state.gotoSetNonTerminals.get(r.position.owner());
+ public void reduce(Position r, int pos, Phase target, Node only) {
+ Forest[] holder = r.holder;
+ Forest old = holder[pos];
+
+ for(Forest result : results())
+ for(Node child : ((Forest.Ref<?>)result).parents) {
+ if (only != null && child!=only) continue;
+ holder[pos] = result;
+ if (pos==0) child.finish(r, r.rewrite(phase().getLocation()), target);
+ else child.reduce(r, pos-1, target, null);
+ }
+
+ holder[pos] = old;
+ }
+
+ public void finish(Position r, Forest result, Phase<Tok> target) {
+ Parser.Table<Tok>.State<Tok> state0 = state.gotoSetNonTerminals.get(r.owner());