private Phase prev;
private Input.Location location;
private Input.Location nextLocation;
- private Input.Location prevLocation;
private Forest forest;
newNode(primordealResult, startState, true);
}
public Phase(Phase prev, Forest forest) throws ParseFailed, IOException {
- this.prevLocation = input.getLocation();
- this.token = (Tok)input.next();
this.location = input.getLocation();
+ this.token = (Tok)input.next();
+ this.nextLocation = input.getLocation();
this.prev = prev;
this.forest = forest;
this.pos = prev==null ? 0 : prev.pos+1;
- this.nextLocation = input.getLocation();
if (prev != null) prev.shift(this, forest);
numReductions = 0;
return true;
}
- public Input.Location getPrevLocation() { return prevLocation; }
public Input.Location getLocation() { return location; }
- public Input.Region getRegion() { return prevLocation.createRegion(location); }
public Input.Location getNextLocation() { return nextLocation; }
public boolean isFrontier() { return hash!=null; }
IntPairMap<Node> h = prev.hash;
prev.hash = null;
prev.performed = null;
- for(Node n : h)
- n.check();
+ for(Node n : h) n.check();
}
numOldNodes = hash.size();
for(Node n : hash.values()) {
for(Node n : hash) n.check();
}
+ Input.Region getRegionFromThisToNext() {
+ return getLocation().createRegion(getNextLocation());
+ }
+
void newNodeFromReduction(Result result, State state, Position reduction) {
int pos = result.phase().pos;
Sequence owner = reduction.owner();